fomantic-ui 2.9.4-beta.10 → 2.9.4-beta.101

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 (295) hide show
  1. package/.all-contributorsrc +29 -1
  2. package/.eslintrc.js +17 -0
  3. package/.github/FUNDING.yml +1 -1
  4. package/.github/workflows/ci.yml +8 -8
  5. package/.github/workflows/depsreview.yml +14 -0
  6. package/.github/workflows/nightly.yml +1 -1
  7. package/.github/workflows/release.yml +1 -1
  8. package/CONTRIBUTORS.md +5 -0
  9. package/README.md +2 -12
  10. package/dist/components/accordion.css +1 -1
  11. package/dist/components/accordion.js +4 -2
  12. package/dist/components/accordion.min.css +1 -1
  13. package/dist/components/accordion.min.js +2 -2
  14. package/dist/components/ad.css +1 -1
  15. package/dist/components/ad.min.css +1 -1
  16. package/dist/components/api.js +7 -3
  17. package/dist/components/api.min.js +2 -2
  18. package/dist/components/breadcrumb.css +1 -1
  19. package/dist/components/breadcrumb.min.css +1 -1
  20. package/dist/components/button.css +21 -3
  21. package/dist/components/button.min.css +2 -2
  22. package/dist/components/calendar.css +1 -1
  23. package/dist/components/calendar.js +47 -12
  24. package/dist/components/calendar.min.css +1 -1
  25. package/dist/components/calendar.min.js +3 -3
  26. package/dist/components/card.css +1 -1
  27. package/dist/components/card.min.css +1 -1
  28. package/dist/components/checkbox.css +1 -1
  29. package/dist/components/checkbox.js +10 -4
  30. package/dist/components/checkbox.min.css +1 -1
  31. package/dist/components/checkbox.min.js +3 -3
  32. package/dist/components/comment.css +1 -1
  33. package/dist/components/comment.min.css +1 -1
  34. package/dist/components/container.css +1 -1
  35. package/dist/components/container.min.css +1 -1
  36. package/dist/components/dimmer.css +7 -3
  37. package/dist/components/dimmer.js +4 -2
  38. package/dist/components/dimmer.min.css +2 -2
  39. package/dist/components/dimmer.min.js +2 -2
  40. package/dist/components/divider.css +1 -1
  41. package/dist/components/divider.min.css +1 -1
  42. package/dist/components/dropdown.css +48 -40
  43. package/dist/components/dropdown.js +110 -35
  44. package/dist/components/dropdown.min.css +2 -2
  45. package/dist/components/dropdown.min.js +3 -3
  46. package/dist/components/embed.css +1 -1
  47. package/dist/components/embed.js +17 -7
  48. package/dist/components/embed.min.css +1 -1
  49. package/dist/components/embed.min.js +3 -3
  50. package/dist/components/emoji.css +4309 -3713
  51. package/dist/components/emoji.min.css +2 -2
  52. package/dist/components/feed.css +12 -1
  53. package/dist/components/feed.min.css +2 -2
  54. package/dist/components/flag.css +267 -265
  55. package/dist/components/flag.min.css +2 -2
  56. package/dist/components/flyout.css +3 -3
  57. package/dist/components/flyout.js +4 -2
  58. package/dist/components/flyout.min.css +1 -1
  59. package/dist/components/flyout.min.js +2 -2
  60. package/dist/components/form.css +15 -3
  61. package/dist/components/form.js +66 -23
  62. package/dist/components/form.min.css +2 -2
  63. package/dist/components/form.min.js +3 -3
  64. package/dist/components/grid.css +5 -5
  65. package/dist/components/grid.min.css +2 -2
  66. package/dist/components/header.css +1 -1
  67. package/dist/components/header.min.css +1 -1
  68. package/dist/components/icon.css +1 -1
  69. package/dist/components/icon.min.css +1 -1
  70. package/dist/components/image.css +1 -1
  71. package/dist/components/image.min.css +1 -1
  72. package/dist/components/input.css +1 -1
  73. package/dist/components/input.min.css +1 -1
  74. package/dist/components/item.css +1 -1
  75. package/dist/components/item.min.css +1 -1
  76. package/dist/components/label.css +7 -1
  77. package/dist/components/label.min.css +2 -2
  78. package/dist/components/list.css +1 -1
  79. package/dist/components/list.min.css +1 -1
  80. package/dist/components/loader.css +1 -1
  81. package/dist/components/loader.min.css +1 -1
  82. package/dist/components/menu.css +1 -1
  83. package/dist/components/menu.min.css +1 -1
  84. package/dist/components/message.css +2 -1
  85. package/dist/components/message.min.css +2 -2
  86. package/dist/components/modal.css +3 -3
  87. package/dist/components/modal.js +7 -3
  88. package/dist/components/modal.min.css +1 -1
  89. package/dist/components/modal.min.js +2 -2
  90. package/dist/components/nag.css +1 -1
  91. package/dist/components/nag.js +11 -5
  92. package/dist/components/nag.min.css +1 -1
  93. package/dist/components/nag.min.js +3 -3
  94. package/dist/components/placeholder.css +1 -1
  95. package/dist/components/placeholder.min.css +1 -1
  96. package/dist/components/popup.css +1 -1
  97. package/dist/components/popup.js +10 -4
  98. package/dist/components/popup.min.css +1 -1
  99. package/dist/components/popup.min.js +2 -2
  100. package/dist/components/progress.css +15 -6
  101. package/dist/components/progress.js +4 -2
  102. package/dist/components/progress.min.css +2 -2
  103. package/dist/components/progress.min.js +2 -2
  104. package/dist/components/rail.css +1 -1
  105. package/dist/components/rail.min.css +1 -1
  106. package/dist/components/rating.css +1 -1
  107. package/dist/components/rating.js +4 -2
  108. package/dist/components/rating.min.css +1 -1
  109. package/dist/components/rating.min.js +2 -2
  110. package/dist/components/reset.css +1 -1
  111. package/dist/components/reset.min.css +1 -1
  112. package/dist/components/reveal.css +1 -1
  113. package/dist/components/reveal.min.css +1 -1
  114. package/dist/components/search.css +34 -23
  115. package/dist/components/search.js +78 -14
  116. package/dist/components/search.min.css +2 -2
  117. package/dist/components/search.min.js +3 -3
  118. package/dist/components/segment.css +1 -1
  119. package/dist/components/segment.min.css +1 -1
  120. package/dist/components/shape.css +1 -1
  121. package/dist/components/shape.js +7 -5
  122. package/dist/components/shape.min.css +1 -1
  123. package/dist/components/shape.min.js +3 -3
  124. package/dist/components/sidebar.css +1 -1
  125. package/dist/components/sidebar.js +4 -2
  126. package/dist/components/sidebar.min.css +1 -1
  127. package/dist/components/sidebar.min.js +2 -2
  128. package/dist/components/site.css +14 -6
  129. package/dist/components/site.js +4 -2
  130. package/dist/components/site.min.css +2 -2
  131. package/dist/components/site.min.js +2 -2
  132. package/dist/components/slider.css +152 -2
  133. package/dist/components/slider.js +142 -44
  134. package/dist/components/slider.min.css +2 -2
  135. package/dist/components/slider.min.js +3 -3
  136. package/dist/components/state.js +4 -2
  137. package/dist/components/state.min.js +2 -2
  138. package/dist/components/statistic.css +1 -1
  139. package/dist/components/statistic.min.css +1 -1
  140. package/dist/components/step.css +992 -86
  141. package/dist/components/step.min.css +2 -2
  142. package/dist/components/sticky.css +1 -1
  143. package/dist/components/sticky.js +4 -2
  144. package/dist/components/sticky.min.css +1 -1
  145. package/dist/components/sticky.min.js +2 -2
  146. package/dist/components/tab.css +1 -1
  147. package/dist/components/tab.js +4 -2
  148. package/dist/components/tab.min.css +1 -1
  149. package/dist/components/tab.min.js +2 -2
  150. package/dist/components/table.css +32 -21
  151. package/dist/components/table.min.css +2 -2
  152. package/dist/components/text.css +1 -1
  153. package/dist/components/text.min.css +1 -1
  154. package/dist/components/toast.css +1 -1
  155. package/dist/components/toast.js +7 -3
  156. package/dist/components/toast.min.css +1 -1
  157. package/dist/components/toast.min.js +3 -3
  158. package/dist/components/transition.css +1 -1
  159. package/dist/components/transition.js +7 -3
  160. package/dist/components/transition.min.css +1 -1
  161. package/dist/components/transition.min.js +2 -2
  162. package/dist/components/visibility.js +4 -2
  163. package/dist/components/visibility.min.js +2 -2
  164. package/dist/semantic.css +6445 -4234
  165. package/dist/semantic.js +572 -189
  166. package/dist/semantic.min.css +3 -3
  167. package/dist/semantic.min.js +3 -3
  168. package/dist/themes/basic/assets/fonts/LICENSE.txt +91 -0
  169. package/dist/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
  170. package/dist/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
  171. package/dist/themes/github/assets/fonts/LICENSE.txt +94 -0
  172. package/dist/themes/material/assets/fonts/LICENSE.txt +202 -0
  173. package/package.json +14 -14
  174. package/semantic.json.example +1 -1
  175. package/src/definitions/behaviors/api.js +6 -2
  176. package/src/definitions/behaviors/form.js +65 -22
  177. package/src/definitions/behaviors/state.js +3 -1
  178. package/src/definitions/behaviors/visibility.js +3 -1
  179. package/src/definitions/collections/form.less +43 -23
  180. package/src/definitions/collections/grid.less +85 -70
  181. package/src/definitions/collections/menu.less +38 -27
  182. package/src/definitions/collections/message.less +1 -0
  183. package/src/definitions/collections/table.less +183 -157
  184. package/src/definitions/elements/button.less +61 -25
  185. package/src/definitions/elements/container.less +6 -4
  186. package/src/definitions/elements/divider.less +4 -1
  187. package/src/definitions/elements/emoji.less +3 -1
  188. package/src/definitions/elements/header.less +7 -4
  189. package/src/definitions/elements/icon.less +35 -28
  190. package/src/definitions/elements/input.less +21 -13
  191. package/src/definitions/elements/label.less +19 -8
  192. package/src/definitions/elements/list.less +28 -21
  193. package/src/definitions/elements/loader.less +17 -12
  194. package/src/definitions/elements/segment.less +12 -7
  195. package/src/definitions/elements/step.less +405 -87
  196. package/src/definitions/globals/site.js +3 -1
  197. package/src/definitions/globals/site.less +17 -12
  198. package/src/definitions/modules/accordion.js +3 -1
  199. package/src/definitions/modules/accordion.less +15 -13
  200. package/src/definitions/modules/calendar.js +46 -11
  201. package/src/definitions/modules/calendar.less +6 -4
  202. package/src/definitions/modules/checkbox.js +9 -3
  203. package/src/definitions/modules/checkbox.less +12 -6
  204. package/src/definitions/modules/dimmer.js +3 -1
  205. package/src/definitions/modules/dimmer.less +16 -10
  206. package/src/definitions/modules/dropdown.js +109 -34
  207. package/src/definitions/modules/dropdown.less +109 -78
  208. package/src/definitions/modules/embed.js +16 -6
  209. package/src/definitions/modules/flyout.js +3 -1
  210. package/src/definitions/modules/flyout.less +51 -45
  211. package/src/definitions/modules/modal.js +6 -2
  212. package/src/definitions/modules/modal.less +109 -82
  213. package/src/definitions/modules/nag.js +10 -4
  214. package/src/definitions/modules/nag.less +8 -4
  215. package/src/definitions/modules/popup.js +9 -3
  216. package/src/definitions/modules/popup.less +3 -1
  217. package/src/definitions/modules/progress.js +3 -1
  218. package/src/definitions/modules/progress.less +24 -6
  219. package/src/definitions/modules/rating.js +3 -1
  220. package/src/definitions/modules/search.js +77 -13
  221. package/src/definitions/modules/search.less +41 -25
  222. package/src/definitions/modules/shape.js +6 -4
  223. package/src/definitions/modules/sidebar.js +3 -1
  224. package/src/definitions/modules/slider.js +141 -43
  225. package/src/definitions/modules/slider.less +129 -27
  226. package/src/definitions/modules/sticky.js +3 -1
  227. package/src/definitions/modules/tab.js +3 -1
  228. package/src/definitions/modules/toast.js +6 -2
  229. package/src/definitions/modules/toast.less +35 -24
  230. package/src/definitions/modules/transition.js +6 -2
  231. package/src/definitions/views/card.less +7 -5
  232. package/src/definitions/views/feed.less +14 -1
  233. package/src/definitions/views/item.less +7 -5
  234. package/src/themes/basic/assets/fonts/LICENSE.txt +91 -0
  235. package/src/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
  236. package/src/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
  237. package/src/themes/default/elements/button.variables +3 -0
  238. package/src/themes/default/elements/emoji.variables +172 -23
  239. package/src/themes/default/elements/flag.variables +4 -4
  240. package/src/themes/default/elements/step.variables +33 -0
  241. package/src/themes/default/globals/site.variables +3 -0
  242. package/src/themes/default/globals/variation.variables +23 -2
  243. package/src/themes/default/modules/dropdown.variables +3 -0
  244. package/src/themes/default/modules/progress.variables +1 -1
  245. package/src/themes/default/modules/search.variables +15 -12
  246. package/src/themes/default/modules/slider.variables +10 -0
  247. package/src/themes/default/views/feed.variables +3 -0
  248. package/src/themes/github/assets/fonts/LICENSE.txt +94 -0
  249. package/src/themes/joypixels/elements/emoji.variables +183 -22
  250. package/src/themes/material/assets/fonts/LICENSE.txt +202 -0
  251. package/tasks/admin/components/create.js +4 -4
  252. package/tasks/admin/components/init.js +2 -2
  253. package/tasks/admin/components/update.js +3 -3
  254. package/tasks/admin/distributions/create.js +3 -3
  255. package/tasks/admin/distributions/init.js +2 -2
  256. package/tasks/admin/distributions/update.js +4 -4
  257. package/tasks/build/assets.js +1 -1
  258. package/tasks/build/css.js +19 -10
  259. package/tasks/build/javascript.js +12 -5
  260. package/tasks/check-install.js +1 -1
  261. package/tasks/config/defaults.js +4 -0
  262. package/tasks/config/project/release.js +19 -1
  263. package/tasks/config/tasks.js +7 -7
  264. package/tasks/docs/build.js +3 -3
  265. package/tasks/docs/metadata.js +1 -1
  266. package/tasks/docs/serve.js +3 -1
  267. package/tasks/install.js +2 -2
  268. package/tasks/watch.js +1 -1
  269. package/types/fomantic-ui-accordion.d.ts +1 -1
  270. package/types/fomantic-ui-api.d.ts +9 -3
  271. package/types/fomantic-ui-calendar.d.ts +114 -13
  272. package/types/fomantic-ui-checkbox.d.ts +14 -4
  273. package/types/fomantic-ui-dimmer.d.ts +1 -1
  274. package/types/fomantic-ui-dropdown.d.ts +82 -44
  275. package/types/fomantic-ui-embed.d.ts +19 -2
  276. package/types/fomantic-ui-flyout.d.ts +25 -11
  277. package/types/fomantic-ui-form.d.ts +123 -15
  278. package/types/fomantic-ui-modal.d.ts +101 -5
  279. package/types/fomantic-ui-nag.d.ts +4 -4
  280. package/types/fomantic-ui-popup.d.ts +38 -12
  281. package/types/fomantic-ui-progress.d.ts +12 -6
  282. package/types/fomantic-ui-rating.d.ts +1 -1
  283. package/types/fomantic-ui-search.d.ts +138 -22
  284. package/types/fomantic-ui-shape.d.ts +2 -2
  285. package/types/fomantic-ui-sidebar.d.ts +4 -4
  286. package/types/fomantic-ui-slider.d.ts +56 -4
  287. package/types/fomantic-ui-sticky.d.ts +1 -1
  288. package/types/fomantic-ui-tab.d.ts +6 -6
  289. package/types/fomantic-ui-toast.d.ts +14 -2
  290. package/types/fomantic-ui-transition.d.ts +41 -7
  291. package/types/fomantic-ui-visibility.d.ts +3 -3
  292. package/types/index.d.ts +25 -25
  293. package/types/tests.ts +188 -0
  294. package/types/tsconfig.json +1 -1
  295. package/types/fomantic-ui-tests.ts +0 -25
@@ -48,7 +48,7 @@ declare namespace FomanticUI {
48
48
  */
49
49
  (behavior: 'destroy'): JQuery;
50
50
 
51
- <K extends keyof TabSettings>(behavior: 'setting', name: K, value?: undefined, ): Partial<Pick<TabSettings, keyof TabSettings>>;
51
+ <K extends keyof TabSettings>(behavior: 'setting', name: K, value?: undefined,): Partial<Pick<TabSettings, keyof TabSettings>>;
52
52
  <K extends keyof TabSettings>(behavior: 'setting', name: K, value: TabSettings[K]): JQuery;
53
53
  (behavior: 'setting', value: Partial<Pick<TabSettings, keyof TabSettings>>): JQuery;
54
54
  (settings?: Partial<Pick<TabSettings, keyof TabSettings>>): JQuery;
@@ -149,7 +149,7 @@ declare namespace FomanticUI {
149
149
  * Tabs are limited to those found inside this context.
150
150
  * @default false
151
151
  */
152
- context: false | string;
152
+ context: JQuery | string | false;
153
153
 
154
154
  /**
155
155
  * If enabled limits tabs to children of passed context.
@@ -276,9 +276,9 @@ declare namespace FomanticUI {
276
276
  * Returns page title
277
277
  * @default Function
278
278
  */
279
- determineTitle: Function;
279
+ determineTitle: (tabPath: string) => string | void;
280
280
  }
281
-
281
+
282
282
  interface Selectors {
283
283
  /**
284
284
  * @default '.ui.tab'
@@ -290,7 +290,7 @@ declare namespace FomanticUI {
290
290
  */
291
291
  parent: string;
292
292
  }
293
-
293
+
294
294
  interface Metadatas {
295
295
  /**
296
296
  * @default 'tab'
@@ -319,7 +319,7 @@ declare namespace FomanticUI {
319
319
  */
320
320
  active: string;
321
321
  }
322
-
322
+
323
323
  interface Errors {
324
324
  /**
325
325
  * @default 'You attempted to load content without API module'
@@ -12,6 +12,11 @@ declare namespace FomanticUI {
12
12
  */
13
13
  (behavior: 'animate continue'): JQuery;
14
14
 
15
+ /**
16
+ * Show the toast
17
+ */
18
+ (behavior: 'show'): JQuery;
19
+
15
20
  /**
16
21
  * Closes the toast
17
22
  */
@@ -28,7 +33,7 @@ declare namespace FomanticUI {
28
33
  (behavior: 'get remainingTime'): number;
29
34
 
30
35
  (behavior: 'refresh' | 'destroy'): JQuery;
31
- <K extends keyof ToastSettings>(behavior: 'setting', name: K, value?: undefined, ): Partial<Pick<ToastSettings, keyof ToastSettings>>;
36
+ <K extends keyof ToastSettings>(behavior: 'setting', name: K, value?: undefined,): Partial<Pick<ToastSettings, keyof ToastSettings>>;
32
37
  <K extends keyof ToastSettings>(behavior: 'setting', name: K, value: ToastSettings[K]): JQuery;
33
38
  (behavior: 'setting', value: Partial<Pick<ToastSettings, keyof ToastSettings>>): JQuery;
34
39
  (settings?: Partial<Pick<ToastSettings, keyof ToastSettings>>): JQuery;
@@ -120,6 +125,13 @@ declare namespace FomanticUI {
120
125
  */
121
126
  showImage: false | string;
122
127
 
128
+ /**
129
+ * Alt text for a given showImage.
130
+ *
131
+ * @default false
132
+ */
133
+ alt: false | string;
134
+
123
135
  /**
124
136
  * Define if the toast should display an icon which matches to a given class.
125
137
  * If a string is given, this will be used as icon classname.
@@ -273,7 +285,7 @@ declare namespace FomanticUI {
273
285
  /**
274
286
  * An array of objects. Each object defines an action with 'properties' 'text', 'class', 'icon' and 'click'.
275
287
  */
276
- actions: Toast.ActionsSettings;
288
+ actions: Toast.ActionsSettings[];
277
289
 
278
290
  // endregion
279
291
 
@@ -50,7 +50,7 @@ declare namespace FomanticUI {
50
50
  /**
51
51
  * Enables animation looping.
52
52
  */
53
- (behavior: 'looping'): JQuery;
53
+ (behavior: 'set looping'): JQuery;
54
54
 
55
55
  /**
56
56
  * Removes looping state from element.
@@ -112,11 +112,39 @@ declare namespace FomanticUI {
112
112
  */
113
113
  (behavior: 'is supported'): boolean;
114
114
 
115
+ (behavior: 'scale', duration?: any, onComplete?: () => any): JQuery;
116
+
117
+ (behavior: 'zoom', duration?: any, onComplete?: () => any): JQuery;
118
+
119
+ (behavior: 'fade' | 'fade up' | 'fade down' | 'fade left' | 'fade right', duration?: any, onComplete?: () => any): JQuery;
120
+
121
+ (behavior: 'horizontal flip' | 'vertical flip', duration?: any, onComplete?: () => any): JQuery;
122
+
123
+ (behavior: 'drop', duration?: any, onComplete?: () => any): JQuery;
124
+
125
+ (behavior: 'fly up' | 'fly down' | 'fly left' | 'fly right', duration?: any, onComplete?: () => any): JQuery;
126
+
127
+ (behavior: 'swing up' | 'swing down' | 'swing left' | 'swing right', duration?: any, onComplete?: () => any): JQuery;
128
+
129
+ (behavior: 'browse' | 'browse up' | 'browse down' | 'browse left' | 'browse right', duration?: any, onComplete?: () => any): JQuery;
130
+
131
+ (behavior: 'slide up' | 'slide down' | 'slide left' | 'slide right', duration?: any, onComplete?: () => any): JQuery;
132
+
133
+ // Static animations
134
+ (behavior: 'pulsating', duration?: any, onComplete?: () => any): JQuery;
135
+ (behavior: 'jiggle', duration?: any, onComplete?: () => any): JQuery;
136
+ (behavior: 'flash', duration?: any, onComplete?: () => any): JQuery;
137
+ (behavior: 'shake', duration?: any, onComplete?: () => any): JQuery;
138
+ (behavior: 'pulse', duration?: any, onComplete?: () => any): JQuery;
139
+ (behavior: 'tada', duration?: any, onComplete?: () => any): JQuery;
140
+ (behavior: 'bounce', duration?: any, onComplete?: () => any): JQuery;
141
+ (behavior: 'glow', duration?: any, onComplete?: () => any): JQuery;
142
+
115
143
  /**
116
144
  * Destroys instance and removes all events.
117
145
  */
118
146
  (behavior: 'destroy'): JQuery;
119
- <K extends keyof TransitionSettings>(behavior: 'setting', name: K, value?: undefined, ): Partial<Pick<TransitionSettings, keyof TransitionSettings>>;
147
+ <K extends keyof TransitionSettings>(behavior: 'setting', name: K, value?: undefined,): Partial<Pick<TransitionSettings, keyof TransitionSettings>>;
120
148
  <K extends keyof TransitionSettings>(behavior: 'setting', name: K, value: TransitionSettings[K]): JQuery;
121
149
  (behavior: 'setting', value: Partial<Pick<TransitionSettings, keyof TransitionSettings>>): JQuery;
122
150
  (settings?: Partial<Pick<TransitionSettings, keyof TransitionSettings>>): JQuery;
@@ -154,10 +182,10 @@ declare namespace FomanticUI {
154
182
  displayType: false | string;
155
183
 
156
184
  /**
157
- * Specify the final display type (block, inline-block etc) so that it doesn't have to be calculated.
158
- * @default '500ms'
185
+ * Duration of the CSS transition animation
186
+ * @default false
159
187
  */
160
- duration: string;
188
+ duration: string | number | false;
161
189
 
162
190
  /**
163
191
  * If enabled a 'timeout' will be added to ensure 'animationend' callback occurs even if element is hidden.
@@ -165,6 +193,12 @@ declare namespace FomanticUI {
165
193
  */
166
194
  useFailSafe: boolean;
167
195
 
196
+ /**
197
+ * Delay in ms for fail safe
198
+ * @default 100
199
+ */
200
+ failSafeDelay: number;
201
+
168
202
  /**
169
203
  * If enabled will allow same animation to be queued while it is already occurring.
170
204
  * @default false
@@ -199,7 +233,7 @@ declare namespace FomanticUI {
199
233
  * Callback right before the show transition should start.
200
234
  * The 'showFunction' parameter has to be called inside the callback to trigger the transition show
201
235
  */
202
- onBeforeShow(this: JQuery, showFunction: Function): void;
236
+ onBeforeShow(this: JQuery, showFunction: () => void): void;
203
237
 
204
238
  /**
205
239
  * Callback once the show transition has finished.
@@ -216,7 +250,7 @@ declare namespace FomanticUI {
216
250
  * Callback right before the hide transition should start.
217
251
  * The 'hideFunction' parameter has to be called inside the callback to trigger the transition hide.
218
252
  */
219
- onBeforeHide(this: JQuery, hideFunction: Function): void;
253
+ onBeforeHide(this: JQuery, hideFunction: () => void): void;
220
254
 
221
255
  /**
222
256
  * Callback once the transition hide has finished.
@@ -44,10 +44,10 @@ declare namespace FomanticUI {
44
44
  (behavior: 'get screen size'): object;
45
45
 
46
46
  (behavior: 'destroy'): JQuery;
47
- <K extends keyof VisibilitySettings>(behavior: 'setting', name: K, value?: undefined, ): Partial<Pick<VisibilitySettings, keyof VisibilitySettings>>;
47
+ <K extends keyof VisibilitySettings>(behavior: 'setting', name: K, value?: undefined,): Partial<Pick<VisibilitySettings, keyof VisibilitySettings>>;
48
48
  <K extends keyof VisibilitySettings>(behavior: 'setting', name: K, value: VisibilitySettings[K]): JQuery;
49
- (behavior: 'setting', value: VisibilitySettings): JQuery;
50
- (settings?: VisibilitySettings): JQuery;
49
+ (behavior: 'setting', value: Partial<Pick<VisibilitySettings, keyof VisibilitySettings>>): JQuery;
50
+ (settings?: Partial<Pick<VisibilitySettings, keyof VisibilitySettings>>): JQuery;
51
51
  }
52
52
 
53
53
  /**
package/types/index.d.ts CHANGED
@@ -30,34 +30,34 @@
30
30
  /// <reference path="fomantic-ui-visibility.d.ts" />
31
31
 
32
32
  interface JQuery {
33
- accordion: FomanticUI.Accordion;
34
- api: FomanticUI.API;
35
- calendar: FomanticUI.Calendar;
36
- checkbox: FomanticUI.Checkbox;
37
- dimmer: FomanticUI.Dimmer;
38
- dropdown: FomanticUI.Dropdown;
39
- embed: FomanticUI.Embed;
40
- flyout: FomanticUI.Flyout;
41
- form: FomanticUI.Form;
42
- modal: FomanticUI.Modal;
43
- nag: FomanticUI.Nag;
44
- popup: FomanticUI.Popup;
45
- progress: FomanticUI.Progress;
46
- rating: FomanticUI.Rating;
47
- search: FomanticUI.Search;
48
- shape: FomanticUI.Shape;
49
- sidebar: FomanticUI.Sidebar;
50
- slider: FomanticUI.Slider;
51
- sticky: FomanticUI.Sticky;
52
- tab: FomanticUI.Tab;
53
- toast: FomanticUI.Toast;
33
+ accordion: FomanticUI.Accordion;
34
+ api: FomanticUI.API;
35
+ calendar: FomanticUI.Calendar;
36
+ checkbox: FomanticUI.Checkbox;
37
+ dimmer: FomanticUI.Dimmer;
38
+ dropdown: FomanticUI.Dropdown;
39
+ embed: FomanticUI.Embed;
40
+ flyout: FomanticUI.Flyout;
41
+ form: FomanticUI.Form;
42
+ modal: FomanticUI.Modal;
43
+ nag: FomanticUI.Nag;
44
+ popup: FomanticUI.Popup;
45
+ progress: FomanticUI.Progress;
46
+ rating: FomanticUI.Rating;
47
+ search: FomanticUI.Search;
48
+ shape: FomanticUI.Shape;
49
+ sidebar: FomanticUI.Sidebar;
50
+ slider: FomanticUI.Slider;
51
+ sticky: FomanticUI.Sticky;
52
+ tab: FomanticUI.Tab;
53
+ toast: FomanticUI.Toast;
54
54
  transition: FomanticUI.Transition;
55
55
  visibility: FomanticUI.Visibility;
56
56
  }
57
57
 
58
58
  interface JQueryStatic {
59
- api: FomanticUI.API;
60
- flyout: FomanticUI.Flyout;
61
- modal: FomanticUI.Modal;
62
- toast: FomanticUI.Toast;
59
+ api: FomanticUI.API;
60
+ flyout: FomanticUI.Flyout;
61
+ modal: FomanticUI.Modal;
62
+ toast: FomanticUI.Toast;
63
63
  }
package/types/tests.ts ADDED
@@ -0,0 +1,188 @@
1
+ /// <reference path="index.d.ts" />
2
+
3
+ $().accordion(); // $ExpectType JQuery<HTMLElement>
4
+ $().api();// $ExpectType JQuery
5
+ $().calendar(); // $ExpectType JQuery<HTMLElement>
6
+ $().checkbox(); // $ExpectType JQuery<HTMLElement>
7
+ $('body').dimmer(); // $ExpectType JQuery<HTMLElement>
8
+ $().dropdown(); // $ExpectType JQuery<HTMLElement>
9
+ $().embed(); // $ExpectType JQuery<HTMLElement>
10
+ $().flyout(); // $ExpectType JQuery<HTMLElement>
11
+ $().form(); // $ExpectType JQuery<HTMLElement>
12
+ $().modal(); // $ExpectType JQuery<HTMLElement>
13
+ $().nag(); // $ExpectType JQuery<HTMLElement>
14
+ $().popup(); // $ExpectType JQuery<HTMLElement>
15
+ $().progress(); // $ExpectType JQuery<HTMLElement>
16
+ $().rating(); // $ExpectType JQuery<HTMLElement>
17
+ $().search(); // $ExpectType JQuery<HTMLElement>
18
+ $().shape(); // $ExpectType JQuery<HTMLElement>
19
+ $().sidebar(); // $ExpectType JQuery<HTMLElement>
20
+ $().slider(); // $ExpectType JQuery<HTMLElement>
21
+ $().sticky(); // $ExpectType JQuery<HTMLElement>
22
+ $().tab(); // $ExpectType JQuery<HTMLElement>
23
+ $('body').toast(); // $ExpectType JQuery<HTMLElement>
24
+ $().transition(); // $ExpectType JQuery<HTMLElement>
25
+ $().visibility(); // $ExpectType JQuery<HTMLElement>
26
+
27
+ /* Define API endpoints once globally */
28
+ $.fn.api.settings.api = {
29
+ 'get followers': '/followers/{id}?results={count}',
30
+ 'create user': '/create',
31
+ 'add user': '/add/{id}',
32
+ 'follow user': '/follow/{id}',
33
+ search: '/search/?query={value}',
34
+ };
35
+
36
+ $().calendar({
37
+ today: true,
38
+ initialDate: null,
39
+ endCalendar: $(),
40
+ }); // $ExpectType JQuery<HTMLElement>
41
+
42
+ $.flyout('alert', 'hello'); // $ExpectType JQuery<HTMLElement>
43
+ $.flyout('confirm', 'Are you sure?', function () { /* make eslint happy */ }); // $ExpectType JQuery<HTMLElement>
44
+ $.flyout('prompt', 'Enter Code', function () { /* make eslint happy */ }); // $ExpectType JQuery<HTMLElement>
45
+
46
+ $.fn.flyout.settings.templates.greet = function (username) {
47
+ return {
48
+ title: 'Greetings to ' + username + '!',
49
+ content: '' + username.toUpperCase() + 'is the best!',
50
+ closeIcon: true,
51
+ class: 'inverted',
52
+ classContent: 'centered',
53
+ };
54
+ };
55
+
56
+ $().form({
57
+ fields: {
58
+ field1: {
59
+ rules: [
60
+ {
61
+ type: 'notEmpty',
62
+ },
63
+ ],
64
+ },
65
+ field2: {
66
+ rules: [
67
+ {
68
+ type: 'isExactly[dog]',
69
+ prompt: '{name} is set to "{value}" that is totally wrong. It should be {ruleValue}',
70
+ },
71
+ ],
72
+ },
73
+ field3: {
74
+ rules: [
75
+ {
76
+ type: 'isExactly[cat]',
77
+ prompt: function (value) {
78
+ if (value === 'dog') {
79
+ return 'I told you to put cat, not dog!';
80
+ }
81
+
82
+ return 'That is not cat';
83
+ },
84
+ },
85
+ ],
86
+ },
87
+ color: {
88
+ identifier: 'color',
89
+ rules: [{
90
+ type: 'regExp',
91
+ value: /rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/i,
92
+ }],
93
+ },
94
+ yearsPracticed: {
95
+ identifier: 'yearsPracticed',
96
+ depends: 'isDoctor',
97
+ rules: [
98
+ {
99
+ type: 'notEmpty',
100
+ prompt: 'Please enter the number of years you have been a doctor',
101
+ },
102
+ ],
103
+ },
104
+ ccEmail: {
105
+ identifier: 'cc-email',
106
+ optional: true,
107
+ rules: [
108
+ {
109
+ type: 'email',
110
+ prompt: 'Please enter a valid second e-mail',
111
+ },
112
+ ],
113
+ },
114
+ },
115
+ }); // $ExpectType JQuery<HTMLElement>
116
+
117
+ $().form({
118
+ fields: {
119
+ gender: 'notEmpty',
120
+ name: 'notEmpty',
121
+ password: ['minLength[6]', 'notEmpty'],
122
+ },
123
+ }); // $ExpectType JQuery<HTMLElement>
124
+
125
+ $.fn.form.settings.rules.date = function (dateStr: string) {
126
+ return dateStr !== '';
127
+ };
128
+
129
+ $.modal('alert', {
130
+ title: 'Listen to me',
131
+ content: 'I love Fomantic-UI',
132
+ handler: function () {
133
+ $.toast({ message: 'Great!' });
134
+ },
135
+ });
136
+
137
+ $.fn.modal.settings.templates.greet = function (username: string) {
138
+ // do something according to modals settings and/or given parameters
139
+ return {
140
+ title: 'Greetings to ' + username + '!',
141
+ content: '' + username.toUpperCase() + 'is the best!',
142
+ class: 'inverted',
143
+ classContent: 'centered',
144
+ dimmerSettings: {
145
+ variation: 'inverted',
146
+ },
147
+ };
148
+ };
149
+
150
+ $.modal('greet', 'mom');
151
+
152
+ $().nag({
153
+ persist: true,
154
+ }); // $ExpectType JQuery<HTMLElement>
155
+
156
+ $().search('display message', 'Hello, world !'); // $ExpectType JQuery<HTMLElement>
157
+
158
+ // To change the defaults for all toast at once override the module as follows
159
+ $.fn.toast.settings.progressUp = true;
160
+ $.fn.toast.settings.class = 'info';
161
+ $.fn.toast.settings.showIcon = true;
162
+ $.fn.toast.settings.className.box = 'toast-box'; // removes shadow
163
+ $.fn.toast.settings.className.title = 'header'; // smaller font size
164
+ $.fn.toast.settings.className.icon = 'icon'; // top position again
165
+ $.fn.toast.settings.transition.closeEasing = 'easeOutBounce';
166
+
167
+ // Or apply the old defaults directly to the toast
168
+ $.toast({
169
+ title: 'LOOK',
170
+ message: 'Turned back time to 2.7.0 defaults',
171
+ showProgress: 'bottom',
172
+ // make it look like 2.7.0
173
+ showIcon: true,
174
+ progressUp: true,
175
+ class: 'info',
176
+ className: {
177
+ box: 'toast-box',
178
+ title: 'header',
179
+ icon: 'icon',
180
+ },
181
+ transition: {
182
+ closeEasing: 'easeOutBounce',
183
+ },
184
+ });
185
+
186
+ $().transition('shake', '200ms');
187
+ $().transition('horizontal flip', 500, function () { /* make eslint happy */ });
188
+ $().transition('fade up');
@@ -18,6 +18,6 @@
18
18
  },
19
19
  "files": [
20
20
  "index.d.ts",
21
- "fomantic-ui-tests.ts"
21
+ "tests.ts"
22
22
  ]
23
23
  }
@@ -1,25 +0,0 @@
1
- /// <reference path="index.d.ts" />
2
-
3
- $().accordion(); // $ExpectType JQuery<HTMLElement>
4
- $().api();// $ExpectType JQuery
5
- $().calendar(); // $ExpectType JQuery<HTMLElement>
6
- $().checkbox(); // $ExpectType JQuery<HTMLElement>
7
- $('body').dimmer(); // $ExpectType JQuery<HTMLElement>
8
- $().dropdown(); // $ExpectType JQuery<HTMLElement>
9
- $().embed(); // $ExpectType JQuery<HTMLElement>
10
- $().flyout(); // $ExpectType JQuery<HTMLElement>
11
- $().form(); // $ExpectType JQuery<HTMLElement>
12
- $().modal(); // $ExpectType JQuery<HTMLElement>
13
- $().nag(); // $ExpectType JQuery<HTMLElement>
14
- $().popup(); // $ExpectType JQuery<HTMLElement>
15
- $().progress(); // $ExpectType JQuery<HTMLElement>
16
- $().rating(); // $ExpectType JQuery<HTMLElement>
17
- $().search(); // $ExpectType JQuery<HTMLElement>
18
- $().shape(); // $ExpectType JQuery<HTMLElement>
19
- $().sidebar(); // $ExpectType JQuery<HTMLElement>
20
- $().slider(); // $ExpectType JQuery<HTMLElement>
21
- $().sticky(); // $ExpectType JQuery<HTMLElement>
22
- $().tab(); // $ExpectType JQuery<HTMLElement>
23
- $('body').toast(); // $ExpectType JQuery<HTMLElement>
24
- $().transition(); // $ExpectType JQuery<HTMLElement>
25
- $().visibility(); // $ExpectType JQuery<HTMLElement>