fomantic-ui 2.9.3-beta.9 → 2.9.3

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 +5 -4
  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,1183 @@
1
+ declare namespace FomanticUI {
2
+ interface Dropdown {
3
+ settings: DropdownSettings;
4
+
5
+ /**
6
+ * Recreates dropdown menu from passed values.
7
+ * values should be an object with the following structure: { values: [ {value, text, name} ] }.
8
+ */
9
+ (behavior: 'setup menu', values: object): void;
10
+
11
+ /**
12
+ * Changes dropdown to use new values.
13
+ * values structure: [ {value, text, name} ].
14
+ */
15
+ (behavior: 'change values', values: object): void;
16
+
17
+ /**
18
+ * Refreshes all cached selectors and data
19
+ */
20
+ (behavior: 'refresh'): void;
21
+
22
+ /**
23
+ * Toggles current visibility of dropdown
24
+ */
25
+ (behavior: 'toggle'): void;
26
+
27
+ /**
28
+ * Shows dropdown.
29
+ * If a function is provided to callback, it's called after the dropdown-menu is shown.
30
+ * Set preventFocus to true if you don't want the dropdown field to focus after the menu is shown
31
+ */
32
+ (behavior: 'show', callback: Function, preventFocus: boolean): void;
33
+
34
+ /**
35
+ * Hides dropdown.
36
+ * If a function is provided to callback, it's called after the dropdown-menu is hidden.
37
+ * Set preventBlur to true if you don't want the dropdown field to blur after the menu is hidden
38
+ */
39
+ (behavior: 'hide', callback:Function, preventBlur: boolean): void;
40
+
41
+ /**
42
+ * Clears dropdown of selection.
43
+ * Set preventChangeTrigger to true to omit the change event (default: false).
44
+ */
45
+ (behavior: 'clear', preventChangeTrigger: boolean): void;
46
+
47
+ /**
48
+ * Hides all other dropdowns that is not current dropdown
49
+ */
50
+ (behavior: 'hide others'): void;
51
+
52
+ /**
53
+ * Restores dropdown text and value to its value on page load.
54
+ * Set preventChangeTrigger to true to omit the change event (default: false).
55
+ */
56
+ (behavior: 'restore defaults', preventChangeTrigger: boolean): void;
57
+
58
+ /**
59
+ * Restores dropdown text to its value on page load
60
+ */
61
+ (behavior: 'restore default text'): void;
62
+
63
+ /**
64
+ * Restores dropdown text to its prompt, placeholder text
65
+ */
66
+ (behavior: 'restore placeholder text'): void;
67
+
68
+ /**
69
+ * Restores dropdown value to its value on page load
70
+ */
71
+ (behavior: 'restore default value'): void;
72
+
73
+ /**
74
+ * Saves current text and value as new defaults (for use with restore)
75
+ */
76
+ (behavior: 'save defaults'): void;
77
+
78
+ /**
79
+ * Sets value as selected.
80
+ * Set preventChangeTrigger to true to omit the change event (default: false).
81
+ */
82
+ (behavior: 'set selected', value: string, preventChangeTrigger: boolean): void;
83
+
84
+ /**
85
+ * Remove value from selected
86
+ */
87
+ (behavior: 'remove selected', value: string): void;
88
+
89
+ /**
90
+ * Adds a group of values as selected
91
+ */
92
+ (behavior: 'set selected', values: string[]): void;
93
+
94
+ /**
95
+ * Sets selected values to exactly specified values, removing current selection
96
+ */
97
+ (behavior: 'set exactly', values: string[]): void;
98
+
99
+ /**
100
+ * Sets dropdown text to a value
101
+ */
102
+ (behavior: 'text', text: string): void;
103
+
104
+ /**
105
+ * Sets dropdown input to value (does not update display state).
106
+ * Set preventChangeTrigger to true to omit the change event (default: false).
107
+ */
108
+ (behavior: 'set value', value: string, preventChangeTrigger: boolean): void;
109
+
110
+ /**
111
+ * Returns current dropdown text
112
+ */
113
+ (behavior: 'get text'): string;
114
+
115
+ /**
116
+ * Returns current dropdown input value.
117
+ * When the dropdown was created out of a select tag, the value will always be an array, otherwise a string (delimited when multiple)
118
+ */
119
+ (behavior: 'get value'): string | string[];
120
+
121
+ /**
122
+ * Returns current dropdown input values as array.
123
+ * Useful for multiple selection dropdowns regardless if made out of a div or select
124
+ */
125
+ (behavior: 'get values'): string[];
126
+
127
+ /**
128
+ * Returns DOM element that matches a given input value
129
+ */
130
+ (behavior: 'get item', value: string): HTMLElement;
131
+
132
+ /**
133
+ * Returns current search term entered
134
+ */
135
+ (behavior: 'get query'): string;
136
+
137
+ /**
138
+ * Adds touch events to element
139
+ */
140
+ (behavior: 'bind touch events'): void;
141
+
142
+ /**
143
+ * Adds mouse events to element
144
+ */
145
+ (behavior: 'bind mouse events'): void;
146
+
147
+ /**
148
+ * Binds a click to document to determine if you click away from a dropdown
149
+ */
150
+ (behavior: 'bind intent'): void;
151
+
152
+ /**
153
+ * Unbinds document intent click
154
+ */
155
+ (behavior: 'unbind intent'): void;
156
+
157
+ /**
158
+ * Returns whether event occurred inside dropdown
159
+ */
160
+ (behavior: 'determine eventInModule'): boolean;
161
+
162
+ /**
163
+ * Triggers preset item selection action based on settings passing text/value
164
+ */
165
+ (behavior: 'determine select action', text: string, value: string): void;
166
+
167
+ /**
168
+ * Sets dropdown to active state
169
+ */
170
+ (behavior: 'set active'): void;
171
+
172
+ /**
173
+ * Sets dropdown to visible state
174
+ */
175
+ (behavior: 'set visible'): void;
176
+
177
+ /**
178
+ * Removes dropdown active state
179
+ */
180
+ (behavior: 'remove active'): void;
181
+
182
+ /**
183
+ * Removes dropdown visible state
184
+ */
185
+ (behavior: 'remove visible'): void;
186
+
187
+ /**
188
+ * Returns whether dropdown is a selection dropdown
189
+ */
190
+ (behavior: 'is selection'): boolean;
191
+
192
+ /**
193
+ * Returns whether dropdown is animated
194
+ */
195
+ (behavior: 'is animated'): boolean;
196
+
197
+ /**
198
+ * Returns whether dropdown is visible
199
+ */
200
+ (behavior: 'is visible'): boolean;
201
+
202
+ /**
203
+ * Returns whether dropdown is hidden
204
+ */
205
+ (behavior: 'is hidden'): boolean;
206
+
207
+ /**
208
+ * Returns dropdown value as set on page load
209
+ */
210
+ (behavior: 'get default text'): string;
211
+
212
+ /**
213
+ * Returns placeholder text
214
+ */
215
+ (behavior: 'get placeholder text'): string;
216
+
217
+ (behavior: 'destroy'): JQuery;
218
+ <K extends keyof DropdownSettings>(behavior: 'setting', name: K, value?: undefined, ): Partial<Pick<DropdownSettings, keyof DropdownSettings>>;
219
+ <K extends keyof DropdownSettings>(behavior: 'setting', name: K, value: DropdownSettings[K]): JQuery;
220
+ (behavior: 'setting', value: Partial<Pick<DropdownSettings, keyof DropdownSettings>>): JQuery;
221
+ (settings?: Partial<Pick<DropdownSettings, keyof DropdownSettings>>): JQuery;
222
+ }
223
+
224
+ /**
225
+ * @see {@link http://fomantic-ui.com/modules/dropdown.html#/settings}
226
+ */
227
+ interface DropdownSettings {
228
+ // region Dropdown Settings
229
+
230
+ /**
231
+ * Event used to trigger dropdown (can be 'hover', 'click' or a custom event).
232
+ * @default 'click'
233
+ */
234
+ on: string;
235
+
236
+ /**
237
+ * Sets a default action to occur.
238
+ * @see {@link https://fomantic-ui.com/modules/dropdown.html#/usage}
239
+ * @default 'auto'
240
+ */
241
+ action:
242
+ | 'auto'
243
+ | 'activate'
244
+ | 'select'
245
+ | 'combo'
246
+ | 'nothing'
247
+ | 'hide'
248
+ | ((this: JQuery, text: string, value: string | false, element: JQuery) => void);
249
+
250
+ /**
251
+ * When specified allows you to initialize dropdown with specific values.
252
+ * @see {@link https://fomantic-ui.com/modules/dropdown.html#/usage}
253
+ * @default false
254
+ */
255
+ values: any;
256
+
257
+ /**
258
+ * Whether the dropdown value can be cleared by the user after being selected.
259
+ * @default false
260
+ */
261
+ clearable: boolean;
262
+
263
+ /**
264
+ * Can be set to an object to specify API settings for retrieving remote selection menu content from an API endpoint.
265
+ * @see {@link https://fomantic-ui.com/behaviors/api.html#/settings}
266
+ * @default false
267
+ */
268
+ apiSettings: false | APISettings | JQueryAjaxSettings;
269
+
270
+ /**
271
+ * Whether dropdown should select new option when using keyboard shortcuts.
272
+ * Setting to 'false' will require 'enter' or left click to confirm a choice.
273
+ * @default true
274
+ */
275
+ selectOnKeydown: boolean;
276
+
277
+ /**
278
+ * The minimum characters for a search to begin showing results.
279
+ * @default 0
280
+ */
281
+ minCharacters: number;
282
+
283
+ /**
284
+ * Whether results returned from API should be filtered by query before being displayed.
285
+ * @default false
286
+ */
287
+ filterRemoteData: boolean;
288
+
289
+ /**
290
+ * When enabled, will automatically store selected name/value pairs in 'sessionStorage' to preserve user selection on page refresh.
291
+ * Disabling will clear remote dropdown values on refresh.
292
+ * @default true
293
+ */
294
+ saveRemoteData: boolean;
295
+
296
+ /**
297
+ * How long to wait after last user input to search remotely.
298
+ * @default 200
299
+ */
300
+ throttle: number;
301
+
302
+ /**
303
+ * Element context to use when checking whether can show when 'keepOnScreen: true'.
304
+ * @default 'window'
305
+ */
306
+ context: string | JQuery;
307
+
308
+ /**
309
+ * When set to 'auto' determines direction based on whether dropdown can fit on screen.
310
+ * Set to 'upward' or 'downward' to always force a direction.
311
+ * @default 'auto'
312
+ */
313
+ direction: 'auto' | 'upward' | 'downward';
314
+
315
+ /**
316
+ * Whether dropdown should try to keep itself on screen by checking whether menus display position in its 'context' (Default context is page).
317
+ * @default true
318
+ */
319
+ keepOnScreen: boolean;
320
+
321
+ /**
322
+ * When using 'search selection' specifies how to match values.
323
+ * @default 'both'
324
+ */
325
+ match: 'both' | 'value' | 'text';
326
+
327
+ /**
328
+ * Specifying to "true" will use a fuzzy full text search, setting to "exact" will force the exact search to be matched somewhere in the string, setting to "false" will only match start of string.
329
+ * @default 'exact'
330
+ */
331
+ fullTextSearch: boolean | 'exact';
332
+
333
+ /**
334
+ * When activated, searches will also match results for base diacritic letters.
335
+ * For example when searching for 'a', it will also match 'á' or 'â' or 'å' and so on...
336
+ * It will also ignore diacritics for the searchterm, so if searching for 'ó', it will match 'ó', but also 'o', 'ô' or 'õ' and so on...
337
+ * @default false
338
+ */
339
+ ignoreDiacritics: boolean;
340
+
341
+ /**
342
+ * How to handle dividers in the dropdown while searching.
343
+ * Dividers are defined as all siblings of items that match the 'divider selector'.
344
+ * @see {@link https://fomantic-ui.com/modules/dropdown.html#dom-settings}
345
+ * @default false
346
+ */
347
+ hideDividers: boolean | 'empty';
348
+
349
+ /**
350
+ *
351
+ * @default 'auto'
352
+ */
353
+ placeholder: 'auto' | String | false;
354
+
355
+ /**
356
+ * Whether HTML included in dropdown values should be preserved.
357
+ * Allows icons to show up in selected value.
358
+ * @default true
359
+ */
360
+ preserveHTML: boolean;
361
+
362
+ /**
363
+ * Whether to sort values when creating a dropdown automatically from a select element.
364
+ * @default false
365
+ */
366
+ sortSelect: boolean | 'natural' | Function;
367
+
368
+ /**
369
+ * Whether search selection will force currently selected choice when element is blurred.
370
+ * If a 'select' tag with a required attribute was used, the 'forceSelection' setting will be set to 'true' automatically.
371
+ * @default false
372
+ */
373
+ forceSelection: boolean;
374
+
375
+ /**
376
+ * Whether search selection should allow users to add their own selections, works for single or multiselect.
377
+ * @default false
378
+ */
379
+ allowAdditions: boolean;
380
+
381
+ /**
382
+ * Whether values with non matching cases should be treated as identical when adding them to a dropdown.
383
+ * @default false
384
+ */
385
+ ignoreCase: boolean;
386
+
387
+ /**
388
+ * Whether values with non matching cases should be treated as identical when filtering the items.
389
+ * @default true
390
+ */
391
+ ignoreSearchCase: boolean;
392
+
393
+ /**
394
+ * If disabled user additions will appear in the dropdown's menu using a specially formatted selection item formatted by 'templates.addition'.
395
+ * @default true
396
+ */
397
+ hideAdditions: boolean;
398
+
399
+ /**
400
+ * When set to a number, sets the maximum number of selections.
401
+ * @default false
402
+ */
403
+ maxSelections: false | number;
404
+
405
+ /**
406
+ * Whether multiselect should use labels. Must be set to 'true' when 'allowAdditions' is 'true'.
407
+ * @default true
408
+ */
409
+ useLabels: boolean;
410
+
411
+ /**
412
+ * When multiselect uses normal input tag, the values will be delimited with this character.
413
+ * Also used as the keyboard shortcut while entering multiple values.
414
+ * @default ','
415
+ */
416
+ delimiter: string;
417
+
418
+ /**
419
+ * Whether to show dropdown menu automatically on element focus.
420
+ * @default false
421
+ */
422
+ showOnFocus: boolean;
423
+
424
+ /**
425
+ * When set to 'true' will fire 'onChange' even when the value a user select matches the currently selected value.
426
+ * @default false
427
+ */
428
+ allowReselection: boolean;
429
+
430
+ /**
431
+ * Whether to allow the element to be navigable by keyboard, by automatically creating a 'tabindex'.
432
+ * @default true
433
+ */
434
+ allowTab: boolean;
435
+
436
+ /**
437
+ * Whether menu items with sub-menus (categories) should be selectable.
438
+ * @default false
439
+ */
440
+ allowCategorySelection: boolean;
441
+
442
+ /**
443
+ * Whether callbacks should fire when initializing dropdown values.
444
+ * @default false
445
+ */
446
+ fireOnInit: boolean;
447
+
448
+ /**
449
+ * Named transition to use when animating menu in and out.
450
+ * Defaults to 'slide down' or 'slide up' depending on dropdown direction. Fade and slide down are available without including 'ui transitions'.
451
+ *
452
+ * Alternatively you can provide an 'object' to set individual values for hide/show transitions as well as hide/show duration.
453
+ * @default 'auto'
454
+ */
455
+ transition: boolean | object;
456
+
457
+ /**
458
+ * Duration of animation events.
459
+ * The value will be ignored when individual hide/show duration values are provided via the 'transition' setting.
460
+ * @default 200
461
+ */
462
+ duration: number;
463
+
464
+ /**
465
+ * Specify the final transition display type ('block', 'inline-block' etc) so that it doesn't have to be calculated.
466
+ * @default false
467
+ */
468
+ displayType: false | string;
469
+
470
+ /**
471
+ * Maximum glyph width, used to calculate search size.
472
+ * This is usually size of a "W" in your font in 'em'.
473
+ * @default 1.037
474
+ */
475
+ glyphWidth: number;
476
+
477
+ /**
478
+ * Whether option headers should have an additional divider line underneath when converted from '<select><optgroup>'.
479
+ * @default true
480
+ */
481
+ headerDivider: boolean;
482
+
483
+ /**
484
+ * Whether the dropdown should collapse upon selection of an actionable item.
485
+ * @default true
486
+ */
487
+ collapseOnActionable: boolean;
488
+
489
+ /**
490
+ * Allows customization of multi-select labels.
491
+ * @default true
492
+ */
493
+ label: object;
494
+
495
+ /**
496
+ * Time in milliseconds to debounce show or hide behavior when 'on: hover' is used, or when 'touch' is used..
497
+ * @default true
498
+ */
499
+ delay: object;
500
+
501
+ // endregion
502
+
503
+ // region Callbacks
504
+
505
+ /**
506
+ * Is called after a dropdown value changes.
507
+ * Receives the name and value of selection and the active menu element.
508
+ */
509
+ onChange(value: string, text: string, $choice: JQuery): void;
510
+
511
+ /**
512
+ * Is called after a dropdown selection is added using a multiple select dropdown, only receives the added value.
513
+ */
514
+ onAdd(addedValue: string, addedText: string, $addedChoice: JQuery): void;
515
+
516
+ /**
517
+ * Is called after a dropdown selection is removed using a multiple select dropdown, only receives the removed value.
518
+ */
519
+ onRemove(removedValue: string, removedText: string, $removedChoice: JQuery): void;
520
+
521
+ /**
522
+ * Is called after an actionable item has been selected.
523
+ */
524
+ onActionable(value: string, text: string, $choice: JQuery): void;
525
+
526
+ /**
527
+ * Is called before a search takes place to filter the items list.
528
+ * If 'false' is returned, the search and item filtering is cancelled.
529
+ */
530
+ onSearch(): void;
531
+
532
+ /**
533
+ * Is called after a label is selected by a user.
534
+ */
535
+ onLabelSelect($selectedLabels: JQuery): void;
536
+
537
+ /**
538
+ * Allows you to modify a label before it is added.
539
+ * Expects the jQ DOM element for a label to be returned.
540
+ */
541
+ onLabelCreate(value: string, text: string): void;
542
+
543
+ /**
544
+ * Called when a label is remove, 'return false;' will prevent the label from being removed.
545
+ */
546
+ onLabelRemove(value: string): void;
547
+
548
+ /**
549
+ * Is called after a dropdown is searched with no matching values.
550
+ */
551
+ onNoResults(searchValue: string): void;
552
+
553
+ /**
554
+ * Is called before a dropdown is shown.
555
+ * If 'false' is returned, dropdown will not be shown.
556
+ */
557
+ onShow(searchValue: string): void;
558
+
559
+ /**
560
+ * Is called before a dropdown is hidden.
561
+ * If 'false' is returned, dropdown will not be hidden.
562
+ */
563
+ onHide(): void;
564
+
565
+ // endregion
566
+
567
+ // region DOM Settings
568
+
569
+ /**
570
+ * Selectors used to find parts of a module.
571
+ */
572
+ selector: Dropdown.SelectorSettings;
573
+
574
+ /**
575
+ * Class names used to determine element state.
576
+ */
577
+ className: Dropdown.ClassNameSettings;
578
+
579
+ /**
580
+ * Class names used to determine element messages.
581
+ */
582
+ message: Dropdown.MessageSettings;
583
+
584
+ /**
585
+ *
586
+ */
587
+ regExp: Dropdown.RegExpSettings;
588
+
589
+ /**
590
+ *
591
+ */
592
+ metadata: Dropdown.MetadataSettings;
593
+
594
+ /**
595
+ *
596
+ */
597
+ fields: Dropdown.FieldsSettings;
598
+
599
+ /**
600
+ *
601
+ */
602
+ keys: Dropdown.KeysSettings;
603
+
604
+ // endregion
605
+
606
+ // region Debug Settings
607
+
608
+ /**
609
+ * Name used in log statements
610
+ * @default 'Dropdown'
611
+ */
612
+ name: string;
613
+
614
+ /**
615
+ * Event namespace. Makes sure module teardown does not effect other events attached to an element.
616
+ * @default 'dropdown'
617
+ */
618
+ namespace: string;
619
+
620
+ /**
621
+ * Silences all console output including error messages, regardless of other debug settings.
622
+ * @default false
623
+ */
624
+ silent: boolean;
625
+
626
+ /**
627
+ * Debug output to console
628
+ * @default false
629
+ */
630
+ debug: boolean;
631
+
632
+ /**
633
+ * Show console.table output with performance metrics
634
+ * @default true
635
+ */
636
+ performance: boolean;
637
+
638
+ /**
639
+ * Debug output includes all internal behaviors
640
+ * @default false
641
+ */
642
+ verbose: boolean;
643
+
644
+ error: Dropdown.ErrorSettings;
645
+
646
+ // endregion
647
+ }
648
+
649
+ namespace Dropdown {
650
+ type SelectorSettings = Partial<Pick<Settings.Selectors, keyof Settings.Selectors>>;
651
+ type ClassNameSettings = Partial<Pick<Settings.ClassNames, keyof Settings.ClassNames>>;
652
+ type MessageSettings = Partial<Pick<Settings.Messages, keyof Settings.Messages>>;
653
+ type RegExpSettings = Partial<Pick<Settings.RegExps, keyof Settings.RegExps>>;
654
+ type MetadataSettings = Partial<Pick<Settings.Metadatas, keyof Settings.Metadatas>>;
655
+ type FieldsSettings = Partial<Pick<Settings.Fields, keyof Settings.Fields>>;
656
+ type KeysSettings = Partial<Pick<Settings.Keys, keyof Settings.Keys>>;
657
+ type ErrorSettings = Partial<Pick<Settings.Errors, keyof Settings.Errors>>;
658
+
659
+ namespace Settings {
660
+ interface Selectors {
661
+ /**
662
+ * @default '.addition'
663
+ */
664
+ addition: string;
665
+
666
+ /**
667
+ * @default '.divider, .header'
668
+ */
669
+ divider: string;
670
+
671
+ /**
672
+ * @default '.ui.dropdown'
673
+ */
674
+ dropdown: string;
675
+
676
+ /**
677
+ * @default '> .dropdown.icon'
678
+ */
679
+ icon: string;
680
+
681
+ /**
682
+ * @default '> input[type="hidden"], > select'
683
+ */
684
+ input: string;
685
+
686
+ /**
687
+ * @default '.item'
688
+ */
689
+ item: string;
690
+
691
+ /**
692
+ * @default '> .label'
693
+ */
694
+ label: string;
695
+
696
+ /**
697
+ * @default '> .label > .delete.icon'
698
+ */
699
+ remove: string;
700
+
701
+ /**
702
+ * @default '.label'
703
+ */
704
+ siblingLabel: string;
705
+
706
+ /**
707
+ * @default '.menu'
708
+ */
709
+ menu: string;
710
+
711
+ /**
712
+ * @default '.message'
713
+ */
714
+ message: string;
715
+
716
+ /**
717
+ * @default '.dropdown.icon'
718
+ */
719
+ menuIcon: string;
720
+
721
+ /**
722
+ * @default 'input.search, .menu > .search > input'
723
+ */
724
+ search: string;
725
+
726
+ /**
727
+ * @default '> span.sizer'
728
+ */
729
+ sizer: string;
730
+
731
+ /**
732
+ * @default '> .text:not(.icon)'
733
+ */
734
+ text: string;
735
+
736
+ /**
737
+ * @default '.disabled, .filtered'
738
+ */
739
+ unselectable: string;
740
+
741
+ /**
742
+ * @default '> .remove.icon'
743
+ */
744
+ clearIcon: string;
745
+ }
746
+
747
+ interface ClassNames {
748
+ /**
749
+ * @default 'active'
750
+ */
751
+ active: string;
752
+
753
+ /**
754
+ * @default 'addition'
755
+ */
756
+ addition: string;
757
+
758
+ /**
759
+ * @default 'animating'
760
+ */
761
+ animating: string;
762
+
763
+ /**
764
+ * @default 'description'
765
+ */
766
+ description: string;
767
+
768
+ /**
769
+ * @default 'vertical'
770
+ */
771
+ descriptionVertical: string;
772
+
773
+ /**
774
+ * @default 'disabled'
775
+ */
776
+ disabled: string;
777
+
778
+ /**
779
+ * @default 'empty'
780
+ */
781
+ empty: string;
782
+
783
+ /**
784
+ * @default 'ui dropdown'
785
+ */
786
+ dropdown: string;
787
+
788
+ /**
789
+ * @default 'filtered'
790
+ */
791
+ filtered: string;
792
+
793
+ /**
794
+ * @default 'hidden transition'
795
+ */
796
+ hidden: string;
797
+
798
+ /**
799
+ * @default 'icon'
800
+ */
801
+ icon: string;
802
+
803
+ /**
804
+ * @default 'image'
805
+ */
806
+ image: string;
807
+
808
+ /**
809
+ * @default 'item'
810
+ */
811
+ item: string;
812
+
813
+ /**
814
+ * @default 'ui label'
815
+ */
816
+ label: string;
817
+
818
+ /**
819
+ * @default 'loading'
820
+ */
821
+ loading: string;
822
+
823
+ /**
824
+ * @default 'menu'
825
+ */
826
+ menu: string;
827
+
828
+ /**
829
+ * @default 'message'
830
+ */
831
+ message: string;
832
+
833
+ /**
834
+ * @default 'multiple'
835
+ */
836
+ multiple: string;
837
+
838
+ /**
839
+ * @default 'default'
840
+ */
841
+ placeholder: string;
842
+
843
+ /**
844
+ * @default 'sizer'
845
+ */
846
+ sizer: string;
847
+
848
+ /**
849
+ * @default 'search'
850
+ */
851
+ search: string;
852
+
853
+ /**
854
+ * @default 'selected'
855
+ */
856
+ selected: string;
857
+
858
+ /**
859
+ * @default 'selection'
860
+ */
861
+ selection: string;
862
+
863
+ /**
864
+ * @default 'text'
865
+ */
866
+ text: string;
867
+
868
+ /**
869
+ * @default 'upward'
870
+ */
871
+ upward: string;
872
+
873
+ /**
874
+ * @default 'left'
875
+ */
876
+ leftward: string;
877
+
878
+ /**
879
+ * @default 'visible'
880
+ */
881
+ visible: string;
882
+
883
+ /**
884
+ * @default 'clearable'
885
+ */
886
+ clearable: string;
887
+
888
+ /**
889
+ * @default 'noselection'
890
+ */
891
+ noselection: string;
892
+
893
+ /**
894
+ * @default 'delete'
895
+ */
896
+ delete: string;
897
+
898
+ /**
899
+ * @default 'header'
900
+ */
901
+ header: string;
902
+
903
+ /**
904
+ * @default 'divider'
905
+ */
906
+ divider: string;
907
+
908
+ /**
909
+ * @default ''
910
+ */
911
+ groupIcon: string;
912
+
913
+ /**
914
+ * @default 'unfilterable'
915
+ */
916
+ unfilterable: string;
917
+
918
+ /**
919
+ * @default 'actionable'
920
+ */
921
+ actionable: string;
922
+ }
923
+
924
+ interface Messages {
925
+ /**
926
+ * @default 'Add <b>{term}</b>'
927
+ */
928
+ addResult: string;
929
+
930
+ /**
931
+ * @default '{count} selected'
932
+ */
933
+ count: string;
934
+
935
+ /**
936
+ * @default 'Max {maxCount} selections'
937
+ */
938
+ maxSelections: string;
939
+
940
+ /**
941
+ * @default 'No results found.'
942
+ */
943
+ noResults: string;
944
+
945
+ /**
946
+ * @default 'There was an error contacting the server'
947
+ */
948
+ serverError: string;
949
+ }
950
+
951
+ interface RegExps {
952
+ /**
953
+ * @default '/[-[\]{}()*+?.,\\^$|#\s]/g'
954
+ */
955
+ escape: string;
956
+ }
957
+
958
+ interface Metadatas {
959
+ /**
960
+ * @default 'defaultText'
961
+ */
962
+ defaultText: string;
963
+
964
+ /**
965
+ * @default 'defaultValue'
966
+ */
967
+ defaultValue: string;
968
+
969
+ /**
970
+ * @default 'placeholderText'
971
+ */
972
+ placeholderText: string;
973
+
974
+ /**
975
+ * @default 'text'
976
+ */
977
+ text: string;
978
+
979
+ /**
980
+ * @default 'value'
981
+ */
982
+ value: string;
983
+ }
984
+
985
+ interface Fields {
986
+ /**
987
+ * Grouping for api results
988
+ * @default 'results'
989
+ */
990
+ remoteValues: string;
991
+
992
+ /**
993
+ * Grouping for all dropdown values
994
+ * @default 'values'
995
+ */
996
+ values: string;
997
+
998
+ /**
999
+ * Whether value should be disabled
1000
+ * @default 'disabled'
1001
+ */
1002
+ disabled: string;
1003
+
1004
+ /**
1005
+ * Displayed dropdown text
1006
+ * @default 'name'
1007
+ */
1008
+ name: string;
1009
+
1010
+ /**
1011
+ * Displayed dropdown description
1012
+ * @default 'description'
1013
+ */
1014
+ description: string;
1015
+
1016
+ /**
1017
+ * Whether description should be vertical
1018
+ * @default 'descriptionVertical'
1019
+ */
1020
+ descriptionVertical: string;
1021
+
1022
+ /**
1023
+ * Actual dropdown value
1024
+ * @default 'value'
1025
+ */
1026
+ value: string;
1027
+
1028
+ /**
1029
+ * Displayed text when selected
1030
+ * @default 'text'
1031
+ */
1032
+ text: string;
1033
+
1034
+ /**
1035
+ * Type of dropdown element
1036
+ * @default 'type'
1037
+ */
1038
+ type: string;
1039
+
1040
+ /**
1041
+ * Optional image path
1042
+ * @default 'image'
1043
+ */
1044
+ image: string;
1045
+
1046
+ /**
1047
+ * Optional individual class for image
1048
+ * @default 'imageClass'
1049
+ */
1050
+ imageClass: string;
1051
+
1052
+ /**
1053
+ * Optional icon name
1054
+ * @default 'icon'
1055
+ */
1056
+ icon: string;
1057
+
1058
+ /**
1059
+ * Optional individual class for icon (for example to use flag instead)
1060
+ * @default 'iconClass'
1061
+ */
1062
+ iconClass: string;
1063
+
1064
+ /**
1065
+ * Optional individual class for item/header
1066
+ * @default 'class'
1067
+ */
1068
+ class: string;
1069
+
1070
+ /**
1071
+ * Optional divider append for group headers
1072
+ * @default 'divider'
1073
+ */
1074
+ divider: string;
1075
+
1076
+ /**
1077
+ * Optional actionable item
1078
+ * @default 'actionable'
1079
+ */
1080
+ actionable: string;
1081
+ }
1082
+
1083
+ interface Keys {
1084
+ /**
1085
+ * @default 8
1086
+ */
1087
+ backspace: number;
1088
+
1089
+ /**
1090
+ * @default 46
1091
+ */
1092
+ deleteKey: number;
1093
+
1094
+ /**
1095
+ * @default 13
1096
+ */
1097
+ enter: number;
1098
+
1099
+ /**
1100
+ * @default 27
1101
+ */
1102
+ escape: number;
1103
+
1104
+ /**
1105
+ * @default 33
1106
+ */
1107
+ pageUp: number;
1108
+
1109
+ /**
1110
+ * @default 34
1111
+ */
1112
+ pageDown: number;
1113
+
1114
+ /**
1115
+ * @default 37
1116
+ */
1117
+ leftArrow: number;
1118
+
1119
+ /**
1120
+ * @default 38
1121
+ */
1122
+ upArrow: number;
1123
+
1124
+ /**
1125
+ * @default 39
1126
+ */
1127
+ rightArrow: number;
1128
+
1129
+ /**
1130
+ * @default 40
1131
+ */
1132
+ downArrow: number;
1133
+ }
1134
+
1135
+ interface Errors {
1136
+ /**
1137
+ * @default 'You called a dropdown action that was not defined'
1138
+ */
1139
+ action: string;
1140
+
1141
+ /**
1142
+ * @default 'Once a select has been initialized behaviors must be called on the created ui dropdown'
1143
+ */
1144
+ alreadySetup: string;
1145
+
1146
+ /**
1147
+ * @default 'Allowing user additions currently requires the use of labels.'
1148
+ */
1149
+ labels: string;
1150
+
1151
+ /**
1152
+ * @default '<select> requires multiple property to be set to correctly preserve multiple values'
1153
+ */
1154
+ missingMultiple: string;
1155
+
1156
+ /**
1157
+ * @default 'The method you called is not defined.'
1158
+ */
1159
+ method: string;
1160
+
1161
+ /**
1162
+ * @default 'The API module is required to load resources remotely'
1163
+ */
1164
+ noAPI: string;
1165
+
1166
+ /**
1167
+ * @default 'Saving remote data requires session storage'
1168
+ */
1169
+ noStorage: string;
1170
+
1171
+ /**
1172
+ * @default 'This module requires ui transitions'
1173
+ */
1174
+ noTransition: string;
1175
+
1176
+ /**
1177
+ * @default '"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including as a polyfill.'
1178
+ */
1179
+ noNormalize: string;
1180
+ }
1181
+ }
1182
+ }
1183
+ }