fomantic-ui 2.9.0-beta.2 → 2.9.0-beta.202

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 (243) hide show
  1. package/.all-contributorsrc +197 -3
  2. package/CONTRIBUTING.md +1 -1
  3. package/CONTRIBUTORS.md +74 -37
  4. package/README.md +1 -1
  5. package/dist/components/accordion.css +162 -26
  6. package/dist/components/accordion.js +1 -1
  7. package/dist/components/accordion.min.css +2 -2
  8. package/dist/components/accordion.min.js +2 -2
  9. package/dist/components/ad.css +1 -1
  10. package/dist/components/ad.min.css +1 -1
  11. package/dist/components/api.js +30 -26
  12. package/dist/components/api.min.js +3 -3
  13. package/dist/components/breadcrumb.css +1 -1
  14. package/dist/components/breadcrumb.min.css +1 -1
  15. package/dist/components/button.css +81 -81
  16. package/dist/components/button.min.css +2 -2
  17. package/dist/components/calendar.css +1 -1
  18. package/dist/components/calendar.js +110 -11
  19. package/dist/components/calendar.min.css +1 -1
  20. package/dist/components/calendar.min.js +3 -3
  21. package/dist/components/card.css +26 -19
  22. package/dist/components/card.min.css +2 -2
  23. package/dist/components/checkbox.css +2 -1
  24. package/dist/components/checkbox.js +17 -11
  25. package/dist/components/checkbox.min.css +2 -2
  26. package/dist/components/checkbox.min.js +3 -3
  27. package/dist/components/comment.css +11 -11
  28. package/dist/components/comment.min.css +1 -1
  29. package/dist/components/container.css +77 -1
  30. package/dist/components/container.min.css +2 -2
  31. package/dist/components/dimmer.css +28 -14
  32. package/dist/components/dimmer.js +7 -1
  33. package/dist/components/dimmer.min.css +2 -2
  34. package/dist/components/dimmer.min.js +3 -3
  35. package/dist/components/divider.css +1 -1
  36. package/dist/components/divider.min.css +1 -1
  37. package/dist/components/dropdown.css +30 -7
  38. package/dist/components/dropdown.js +59 -34
  39. package/dist/components/dropdown.min.css +2 -2
  40. package/dist/components/dropdown.min.js +3 -3
  41. package/dist/components/embed.css +1 -1
  42. package/dist/components/embed.js +1 -1
  43. package/dist/components/embed.min.css +1 -1
  44. package/dist/components/embed.min.js +2 -2
  45. package/dist/components/emoji.css +2 -2
  46. package/dist/components/feed.css +28 -28
  47. package/dist/components/feed.min.css +2 -2
  48. package/dist/components/flag.css +731 -625
  49. package/dist/components/flag.min.css +2 -2
  50. package/dist/components/form.css +106 -55
  51. package/dist/components/form.js +25 -23
  52. package/dist/components/form.min.css +2 -2
  53. package/dist/components/form.min.js +3 -3
  54. package/dist/components/grid.css +11 -8
  55. package/dist/components/grid.min.css +2 -2
  56. package/dist/components/header.css +1 -1
  57. package/dist/components/header.min.css +1 -1
  58. package/dist/components/icon.css +6 -1
  59. package/dist/components/icon.min.css +2 -2
  60. package/dist/components/image.css +1 -1
  61. package/dist/components/image.min.css +1 -1
  62. package/dist/components/input.css +734 -17
  63. package/dist/components/input.min.css +2 -2
  64. package/dist/components/item.css +13 -13
  65. package/dist/components/item.min.css +1 -1
  66. package/dist/components/label.css +1 -1
  67. package/dist/components/label.min.css +1 -1
  68. package/dist/components/list.css +1 -1
  69. package/dist/components/list.min.css +1 -1
  70. package/dist/components/loader.css +1 -1
  71. package/dist/components/loader.min.css +1 -1
  72. package/dist/components/menu.css +31 -7
  73. package/dist/components/menu.min.css +1 -1
  74. package/dist/components/message.css +41 -41
  75. package/dist/components/message.min.css +2 -2
  76. package/dist/components/modal.css +13 -1
  77. package/dist/components/modal.js +121 -46
  78. package/dist/components/modal.min.css +2 -2
  79. package/dist/components/modal.min.js +3 -3
  80. package/dist/components/nag.css +1 -1
  81. package/dist/components/nag.js +1 -1
  82. package/dist/components/nag.min.css +1 -1
  83. package/dist/components/nag.min.js +2 -2
  84. package/dist/components/placeholder.css +1 -1
  85. package/dist/components/placeholder.min.css +1 -1
  86. package/dist/components/popup.css +5 -3
  87. package/dist/components/popup.js +1 -1
  88. package/dist/components/popup.min.css +2 -2
  89. package/dist/components/popup.min.js +2 -2
  90. package/dist/components/progress.css +1 -1
  91. package/dist/components/progress.js +6 -3
  92. package/dist/components/progress.min.css +1 -1
  93. package/dist/components/progress.min.js +3 -3
  94. package/dist/components/rail.css +1 -1
  95. package/dist/components/rail.min.css +1 -1
  96. package/dist/components/rating.css +7 -46
  97. package/dist/components/rating.js +1 -1
  98. package/dist/components/rating.min.css +2 -2
  99. package/dist/components/rating.min.js +2 -2
  100. package/dist/components/reset.css +1 -1
  101. package/dist/components/reset.min.css +1 -1
  102. package/dist/components/reveal.css +1 -1
  103. package/dist/components/reveal.min.css +1 -1
  104. package/dist/components/search.css +1 -1
  105. package/dist/components/search.js +1 -1
  106. package/dist/components/search.min.css +1 -1
  107. package/dist/components/search.min.js +2 -2
  108. package/dist/components/segment.css +90 -6
  109. package/dist/components/segment.min.css +2 -2
  110. package/dist/components/shape.css +1 -1
  111. package/dist/components/shape.js +1 -1
  112. package/dist/components/shape.min.css +1 -1
  113. package/dist/components/shape.min.js +2 -2
  114. package/dist/components/sidebar.css +4 -2
  115. package/dist/components/sidebar.js +1 -1
  116. package/dist/components/sidebar.min.css +2 -2
  117. package/dist/components/sidebar.min.js +2 -2
  118. package/dist/components/site.css +61 -39
  119. package/dist/components/site.js +1 -1
  120. package/dist/components/site.min.css +2 -2
  121. package/dist/components/site.min.js +2 -2
  122. package/dist/components/slider.js +1 -1
  123. package/dist/components/slider.min.js +2 -2
  124. package/dist/components/state.js +1 -1
  125. package/dist/components/state.min.js +2 -2
  126. package/dist/components/statistic.css +1 -1
  127. package/dist/components/statistic.min.css +1 -1
  128. package/dist/components/step.css +4 -4
  129. package/dist/components/step.min.css +2 -2
  130. package/dist/components/sticky.css +1 -1
  131. package/dist/components/sticky.js +2 -2
  132. package/dist/components/sticky.min.css +1 -1
  133. package/dist/components/sticky.min.js +3 -3
  134. package/dist/components/tab.css +1 -1
  135. package/dist/components/tab.js +23 -5
  136. package/dist/components/tab.min.css +1 -1
  137. package/dist/components/tab.min.js +3 -3
  138. package/dist/components/table.css +1168 -26
  139. package/dist/components/table.min.css +2 -2
  140. package/dist/components/text.css +1 -1
  141. package/dist/components/text.min.css +1 -1
  142. package/dist/components/toast.css +45 -1
  143. package/dist/components/toast.js +56 -28
  144. package/dist/components/toast.min.css +2 -2
  145. package/dist/components/toast.min.js +3 -3
  146. package/dist/components/transition.css +1 -1
  147. package/dist/components/transition.js +2 -2
  148. package/dist/components/transition.min.css +1 -1
  149. package/dist/components/transition.min.js +3 -3
  150. package/dist/components/visibility.js +2 -2
  151. package/dist/components/visibility.min.js +2 -2
  152. package/dist/semantic.css +4300 -1394
  153. package/dist/semantic.js +473 -207
  154. package/dist/semantic.min.css +3 -3
  155. package/dist/semantic.min.js +3 -3
  156. package/examples/assets/library/iframe-content.js +8 -8
  157. package/examples/assets/library/iframe.js +3 -3
  158. package/package.json +2 -2
  159. package/src/definitions/behaviors/api.js +29 -25
  160. package/src/definitions/behaviors/form.js +24 -22
  161. package/src/definitions/behaviors/visibility.js +1 -1
  162. package/src/definitions/collections/form.less +193 -140
  163. package/src/definitions/collections/grid.less +716 -680
  164. package/src/definitions/collections/menu.less +174 -127
  165. package/src/definitions/collections/message.less +48 -46
  166. package/src/definitions/collections/table.less +849 -262
  167. package/src/definitions/elements/button.less +360 -347
  168. package/src/definitions/elements/container.less +126 -8
  169. package/src/definitions/elements/emoji.less +15 -9
  170. package/src/definitions/elements/flag.less +7 -17
  171. package/src/definitions/elements/header.less +42 -35
  172. package/src/definitions/elements/icon.less +38 -31
  173. package/src/definitions/elements/input.less +256 -21
  174. package/src/definitions/elements/label.less +92 -91
  175. package/src/definitions/elements/list.less +55 -45
  176. package/src/definitions/elements/loader.less +30 -29
  177. package/src/definitions/elements/segment.less +146 -27
  178. package/src/definitions/elements/step.less +52 -48
  179. package/src/definitions/elements/text.less +17 -15
  180. package/src/definitions/globals/site.less +23 -2
  181. package/src/definitions/modules/accordion.less +175 -24
  182. package/src/definitions/modules/calendar.js +109 -10
  183. package/src/definitions/modules/checkbox.js +16 -10
  184. package/src/definitions/modules/checkbox.less +34 -178
  185. package/src/definitions/modules/dimmer.js +6 -0
  186. package/src/definitions/modules/dimmer.less +21 -8
  187. package/src/definitions/modules/dropdown.js +58 -33
  188. package/src/definitions/modules/dropdown.less +101 -69
  189. package/src/definitions/modules/modal.js +120 -45
  190. package/src/definitions/modules/modal.less +12 -0
  191. package/src/definitions/modules/nag.less +20 -19
  192. package/src/definitions/modules/popup.less +5 -1
  193. package/src/definitions/modules/progress.js +5 -2
  194. package/src/definitions/modules/progress.less +19 -18
  195. package/src/definitions/modules/rating.less +49 -42
  196. package/src/definitions/modules/search.less +32 -16
  197. package/src/definitions/modules/sidebar.less +33 -19
  198. package/src/definitions/modules/slider.less +39 -38
  199. package/src/definitions/modules/sticky.js +1 -1
  200. package/src/definitions/modules/tab.js +22 -4
  201. package/src/definitions/modules/toast.js +55 -27
  202. package/src/definitions/modules/toast.less +53 -16
  203. package/src/definitions/modules/transition.js +1 -1
  204. package/src/definitions/views/card.less +402 -361
  205. package/src/definitions/views/comment.less +92 -81
  206. package/src/definitions/views/feed.less +164 -144
  207. package/src/definitions/views/item.less +249 -196
  208. package/src/definitions/views/statistic.less +90 -88
  209. package/src/themes/bookish/elements/header.overrides +1 -1
  210. package/src/themes/chubby/elements/button.overrides +1 -1
  211. package/src/themes/chubby/elements/header.overrides +1 -1
  212. package/src/themes/default/collections/menu.variables +6 -0
  213. package/src/themes/default/collections/table.variables +52 -0
  214. package/src/themes/default/elements/button.variables +2 -1
  215. package/src/themes/default/elements/container.variables +8 -0
  216. package/src/themes/default/elements/flag.overrides +1635 -986
  217. package/src/themes/default/elements/flag.variables +7 -5
  218. package/src/themes/default/elements/icon.overrides +35 -28
  219. package/src/themes/default/elements/icon.variables +1 -0
  220. package/src/themes/default/elements/input.variables +15 -0
  221. package/src/themes/default/elements/segment.variables +8 -0
  222. package/src/themes/default/elements/step.overrides +1 -1
  223. package/src/themes/default/globals/site.variables +6 -0
  224. package/src/themes/default/globals/variation.variables +135 -6
  225. package/src/themes/default/modules/accordion.variables +49 -2
  226. package/src/themes/default/modules/checkbox.variables +5 -5
  227. package/src/themes/default/modules/dimmer.variables +1 -1
  228. package/src/themes/default/modules/dropdown.variables +1 -1
  229. package/src/themes/default/modules/modal.variables +13 -0
  230. package/src/themes/default/modules/toast.variables +3 -0
  231. package/src/themes/famfamfam/elements/flag.overrides +1026 -0
  232. package/src/themes/famfamfam/elements/flag.variables +13 -0
  233. package/src/themes/instagram/views/card.overrides +1 -1
  234. package/src/themes/material/collections/menu.overrides +1 -1
  235. package/src/themes/material/elements/button.overrides +1 -1
  236. package/src/themes/material/elements/header.overrides +1 -1
  237. package/src/themes/material/modules/dropdown.overrides +1 -1
  238. package/src/themes/material/modules/modal.overrides +1 -1
  239. package/src/themes/rtl/globals/site.overrides +1 -1
  240. package/tasks/admin/components/init.js +2 -2
  241. package/tasks/admin/distributions/init.js +2 -2
  242. package/tasks/build/css.js +6 -1
  243. package/test/helpers/sinon.js +1 -1
@@ -31,26 +31,25 @@
31
31
  }
32
32
 
33
33
  /* Title */
34
- .ui.accordion .title,
35
- .ui.accordion .accordion .title {
34
+ .ui.accordion.menu .item > .title,
35
+ .ui.accordion > .title,
36
+ .ui.accordion .accordion > .title {
36
37
  cursor: pointer;
37
- }
38
-
39
- /* Default Styling */
40
- .ui.accordion .title:not(.ui) {
41
38
  padding: @titlePadding;
42
39
  font-family: @titleFont;
43
40
  font-size: @titleFontSize;
44
41
  color: @titleColor;
42
+ list-style: none;
43
+ line-height: @titleLineHeight;
45
44
  }
46
45
 
47
46
  /* Default Styling */
48
- .ui.accordion:not(.styled) .title ~ .content:not(.ui),
49
- .ui.accordion:not(.styled) .accordion .title ~ .content:not(.ui) {
47
+ .ui.accordion:not(.styled) .title ~ .content,
48
+ .ui.accordion:not(.styled) .accordion .title ~ .content {
50
49
  margin: @contentMargin;
51
50
  padding: @contentPadding;
52
51
  }
53
- .ui.accordion:not(.styled) .title ~ .content:not(.ui):last-child {
52
+ .ui.accordion:not(.styled) .title ~ .content:last-child {
54
53
  padding-bottom: 0;
55
54
  }
56
55
 
@@ -68,6 +67,10 @@
68
67
  transition: @iconTransition;
69
68
  vertical-align: @iconVerticalAlign;
70
69
  transform: @iconTransform;
70
+ &.right when (@variationAccordionRightDropdown) {
71
+ float:right;
72
+ transform: @iconTransformRight;
73
+ }
71
74
  }
72
75
 
73
76
  /*--------------
@@ -95,6 +98,8 @@
95
98
  States
96
99
  *******************************/
97
100
 
101
+ .ui.accordion[open] > .title .dropdown.icon,
102
+ .ui.accordion .accordion[open] > .title .dropdown.icon,
98
103
  .ui.accordion .active.title .dropdown.icon,
99
104
  .ui.accordion .accordion .active.title .dropdown.icon {
100
105
  transform: @activeIconTransform;
@@ -123,8 +128,8 @@
123
128
  background: @styledBackground;
124
129
  box-shadow: @styledBoxShadow;
125
130
  }
126
- .ui.styled.accordion .title,
127
- .ui.styled.accordion .accordion .title {
131
+ .ui.styled.accordion > .title,
132
+ .ui.styled.accordion .accordion > .title {
128
133
  margin: @styledTitleMargin;
129
134
  padding: @styledTitlePadding;
130
135
  color: @styledTitleColor;
@@ -133,49 +138,101 @@
133
138
  transition: @styledTitleTransition;
134
139
  }
135
140
  .ui.styled.accordion > .title:first-child,
136
- .ui.styled.accordion .accordion .title:first-child {
141
+ .ui.styled.accordion .accordion > .title:first-child {
137
142
  border-top: none;
138
143
  }
139
144
 
140
145
 
141
146
  /* Content */
142
- .ui.styled.accordion .content,
143
- .ui.styled.accordion .accordion .content {
147
+ .ui.styled.accordion > .content {
144
148
  margin: @styledContentMargin;
145
149
  padding: @styledContentPadding;
146
150
  }
147
- .ui.styled.accordion .accordion .content {
151
+ .ui.styled.accordion .accordion > .content {
148
152
  margin: @styledChildContentMargin;
149
153
  padding: @styledChildContentPadding;
150
154
  }
151
155
 
152
156
 
153
157
  /* Hover */
154
- .ui.styled.accordion .title:hover,
155
- .ui.styled.accordion .active.title,
156
- .ui.styled.accordion .accordion .title:hover,
157
- .ui.styled.accordion .accordion .active.title {
158
+ .ui.styled.accordion > .title:hover {
158
159
  background: @styledTitleHoverBackground;
159
160
  color: @styledTitleHoverColor;
160
161
  }
161
- .ui.styled.accordion .accordion .title:hover,
162
- .ui.styled.accordion .accordion .active.title {
162
+ .ui.styled.accordion .accordion > .title:hover {
163
163
  background: @styledHoverChildTitleBackground;
164
164
  color: @styledHoverChildTitleColor;
165
165
  }
166
166
 
167
167
 
168
168
  /* Active */
169
+ .ui.styled.accordion[open] > .title,
169
170
  .ui.styled.accordion .active.title {
170
171
  background: @styledActiveTitleBackground;
171
172
  color: @styledActiveTitleColor;
172
173
  }
174
+ .ui.styled.accordion .accordion[open] > .title,
173
175
  .ui.styled.accordion .accordion .active.title {
174
176
  background: @styledActiveChildTitleBackground;
175
177
  color: @styledActiveChildTitleColor;
176
178
  }
177
179
  }
178
180
 
181
+ & when (@variationAccordionCompact) {
182
+ /*--------------
183
+ Compact
184
+ ---------------*/
185
+
186
+ /* Default Styling */
187
+
188
+ .ui.compact.accordion:not(.styled) > .title,
189
+ .ui.compact.accordion:not(.styled) .accordion > .title {
190
+ padding: @titlePaddingCompact;
191
+ }
192
+
193
+ .ui.compact.accordion:not(.styled) .title ~ .content,
194
+ .ui.compact.accordion:not(.styled) .accordion .title ~ .content {
195
+ padding: @contentPaddingCompact;
196
+ }
197
+
198
+ /* Styled */
199
+
200
+ .ui.compact.styled.accordion > .title,
201
+ .ui.compact.styled.accordion .accordion > .title {
202
+ padding: @styledTitlePaddingCompact;
203
+ }
204
+
205
+ .ui.compact.styled.accordion .title ~ .content,
206
+ .ui.compact.styled.accordion .accordion .title ~ .content {
207
+ padding: @styledContentPaddingCompact;
208
+ }
209
+ }
210
+ /*--------------
211
+ Very Compact
212
+ ---------------*/
213
+
214
+ & when (@variationAccordionVeryCompact) {
215
+ .ui[class*="very compact"].accordion:not(.styled) > .title,
216
+ .ui[class*="very compact"].accordion:not(.styled) .accordion > .title {
217
+ padding: @titlePaddingVeryCompact;
218
+ }
219
+
220
+ .ui[class*="very compact"].accordion:not(.styled) .title ~ .content,
221
+ .ui[class*="very compact"].accordion:not(.styled) .accordion .title ~ .content {
222
+ padding: @contentPaddingVeryCompact;
223
+ }
224
+
225
+ .ui[class*="very compact"].styled.accordion > .title,
226
+ .ui[class*="very compact"].styled.accordion .accordion > .title {
227
+ padding: @styledTitlePaddingVeryCompact;
228
+ }
229
+
230
+ .ui[class*="very compact"].styled.accordion .title ~ .content,
231
+ .ui[class*="very compact"].styled.accordion .accordion .title ~ .content {
232
+ padding: @styledContentPaddingVeryCompact;
233
+ }
234
+ }
235
+
179
236
 
180
237
  /*******************************
181
238
  States
@@ -185,8 +242,8 @@
185
242
  Not Active
186
243
  ---------------*/
187
244
 
188
- .ui.accordion .title ~ .content:not(.active),
189
- .ui.accordion .accordion .title ~ .content:not(.active) {
245
+ .ui.accordion:not(details) .title ~ .content:not(.active),
246
+ .ui.accordion .accordion:not(details) .title ~ .content:not(.active) {
190
247
  display: none;
191
248
  }
192
249
 
@@ -210,9 +267,103 @@
210
267
  Inverted
211
268
  ---------------*/
212
269
 
213
- .ui.inverted.accordion .title:not(.ui) {
270
+ .ui.inverted.accordion.menu .item > .title,
271
+ .ui.inverted.accordion > .title,
272
+ .ui.inverted.accordion .accordion > .title {
214
273
  color: @invertedTitleColor;
215
274
  }
275
+ & when (@variationAccordionStyled) {
276
+ .ui.inverted.styled.accordion,
277
+ .ui.inverted.styled.accordion .accordion {
278
+ background: @invertedStyledBackground;
279
+ box-shadow: @invertedStyledBoxShadow;
280
+ }
281
+ .ui.inverted.styled.accordion > .title,
282
+ .ui.inverted.styled.accordion .accordion > .title {
283
+ color: @invertedStyledTitleColor;
284
+ border-top: @invertedStyledTitleBorder;
285
+ }
286
+
287
+ /* Hover */
288
+ .ui.inverted.styled.accordion > .title:hover {
289
+ background: @invertedStyledTitleHoverBackground;
290
+ color: @invertedStyledTitleHoverColor;
291
+ }
292
+ .ui.inverted.styled.accordion .accordion > .title:hover {
293
+ background: @invertedStyledHoverChildTitleBackground;
294
+ color: @invertedStyledHoverChildTitleColor;
295
+ }
296
+
297
+ /* Active */
298
+ .ui.inverted.styled.accordion[open] > .title,
299
+ .ui.inverted.styled.accordion .active.title {
300
+ background: @invertedStyledActiveTitleBackground;
301
+ color: @invertedStyledActiveTitleColor;
302
+ }
303
+ .ui.inverted.styled.accordion .accordion[open] > .title,
304
+ .ui.inverted.styled.accordion .accordion .active.title {
305
+ background: @invertedStyledActiveChildTitleBackground;
306
+ color: @invertedStyledActiveChildTitleColor;
307
+ }
308
+ }
309
+ }
310
+
311
+ & when (@variationAccordionBasicStyled) {
312
+ .ui.basic.styled.accordion,
313
+ .ui.basic.styled.accordion .accordion {
314
+ background: transparent;
315
+ box-shadow: none;
316
+ }
317
+ .ui.basic.styled.accordion > .title,
318
+ .ui.basic.styled.accordion .accordion > .title {
319
+ border: none;
320
+ color: @basicStyledTitleColor;
321
+ }
322
+ .ui.basic.styled.accordion > .title:hover,
323
+ .ui.basic.styled.accordion .accordion > .title:hover {
324
+ background: transparent;
325
+ color: @basicStyledTitleHoverColor;
326
+ }
327
+ .ui.basic.styled.accordion[open] > .title,
328
+ .ui.basic.styled.accordion .active.title,
329
+ .ui.basic.styled.accordion .accordion[open] > .title,
330
+ .ui.basic.styled.accordion .accordion .active.title {
331
+ background: transparent;
332
+ color: @basicStyledActiveTitleColor;
333
+ }
334
+ & when (@variationAccordionInverted) {
335
+ .ui.inverted.basic.styled.accordion > .title,
336
+ .ui.inverted.basic.styled.accordion .accordion > .title {
337
+ background: transparent;
338
+ color: @invertedBasicStyledTitleColor;
339
+ }
340
+ .ui.inverted.basic.styled.accordion > .title:hover,
341
+ .ui.inverted.basic.styled.accordion .accordion > .title:hover {
342
+ background: transparent;
343
+ color: @invertedBasicStyledTitleHoverColor;
344
+ }
345
+ .ui.inverted.basic.styled.accordion[open] > .title,
346
+ .ui.inverted.basic.styled.accordion .active.title,
347
+ .ui.inverted.basic.styled.accordion .accordion[open] > .title,
348
+ .ui.inverted.basic.styled.accordion .accordion .active.title {
349
+ background: transparent;
350
+ color: @invertedBasicStyledActiveTitleColor;
351
+ }
352
+ }
353
+ }
354
+
355
+ & when (@variationAccordionTree) {
356
+ .ui.tree.accordion:not(.styled) .title ~ .content,
357
+ .ui.tree.accordion:not(.styled) .accordion .title ~ .content {
358
+ padding:@treeContentPadding;
359
+ }
360
+ .ui.tree.accordion > .content,
361
+ .ui.tree.accordion .accordion > .content {
362
+ margin-left: @treeContentLeftMargin;
363
+ }
364
+ .ui.tree.accordion .accordion {
365
+ margin-top: @treeContentTopMargin;
366
+ }
216
367
  }
217
368
 
218
369
  .loadUIOverrides();
@@ -122,7 +122,7 @@ $.fn.calendar = function(parameters) {
122
122
  module.set.maxDate($module.data(metadata.maxDate));
123
123
  }
124
124
  module.setting('type', module.get.type());
125
- module.setting('on', settings.on || ($input.length ? 'focus' : 'click'));
125
+ module.setting('on', settings.on || 'click');
126
126
  },
127
127
  popup: function () {
128
128
  if (settings.inline) {
@@ -153,7 +153,10 @@ $.fn.calendar = function(parameters) {
153
153
  module.refreshTooltips();
154
154
  return settings.onVisible.apply($container, arguments);
155
155
  };
156
- var onHidden = settings.onHidden;
156
+ var onHidden = function () {
157
+ module.blur();
158
+ return settings.onHidden.apply($container, arguments)
159
+ }
157
160
  if (!$input.length) {
158
161
  //no input, $container has to handle focus/blur
159
162
  $container.attr('tabindex', '0');
@@ -162,10 +165,6 @@ $.fn.calendar = function(parameters) {
162
165
  module.focus();
163
166
  return settings.onVisible.apply($container, arguments);
164
167
  };
165
- onHidden = function () {
166
- module.blur();
167
- return settings.onHidden.apply($container, arguments);
168
- };
169
168
  }
170
169
  var onShow = function () {
171
170
  //reset the focus date onShow
@@ -390,6 +389,19 @@ $.fn.calendar = function(parameters) {
390
389
  cell.attr("data-variation", disabledDate[metadata.variation]);
391
390
  }
392
391
  }
392
+ if (mode === 'hour') {
393
+ var disabledHour = module.helper.findHourAsObject(cellDate, mode, settings.disabledHours);
394
+ if (disabledHour !== null && disabledHour[metadata.message]) {
395
+ cell.attr("data-tooltip", disabledHour[metadata.message]);
396
+ cell.attr("data-position", disabledHour[metadata.position] || tooltipPosition);
397
+ if(disabledHour[metadata.inverted] || (isInverted && disabledHour[metadata.inverted] === undefined)) {
398
+ cell.attr("data-inverted", '');
399
+ }
400
+ if(disabledHour[metadata.variation]) {
401
+ cell.attr("data-variation", disabledHour[metadata.variation]);
402
+ }
403
+ }
404
+ }
393
405
  } else {
394
406
  eventDate = module.helper.findDayAsObject(cellDate, mode, settings.eventDates);
395
407
  if (eventDate !== null) {
@@ -611,7 +623,9 @@ $.fn.calendar = function(parameters) {
611
623
  var mode = module.get.mode();
612
624
  var date = module.get.focusDate();
613
625
  if (date && !settings.isDisabled(date, mode) && !module.helper.isDisabled(date, mode) && module.helper.isEnabled(date, mode)) {
614
- module.selectDate(date);
626
+ if (settings.onSelect.call(element, date, module.get.mode()) !== false) {
627
+ module.selectDate(date);
628
+ }
615
629
  }
616
630
  //disable form submission:
617
631
  event.preventDefault();
@@ -923,6 +937,7 @@ $.fn.calendar = function(parameters) {
923
937
  //if this is a range calendar, focus the container or input. This will open the popup from its event listeners.
924
938
  var endModule = module.get.calendarModule(settings.endCalendar);
925
939
  if (endModule) {
940
+ endModule.refresh();
926
941
  if (endModule.setting('on') !== 'focus') {
927
942
  endModule.popup('show');
928
943
  }
@@ -972,7 +987,7 @@ $.fn.calendar = function(parameters) {
972
987
 
973
988
  helper: {
974
989
  isDisabled: function(date, mode) {
975
- return (mode === 'day' || mode === 'month' || mode === 'year') && ((mode === 'day' && settings.disabledDaysOfWeek.indexOf(date.getDay()) !== -1) || settings.disabledDates.some(function(d){
990
+ return (mode === 'day' || mode === 'month' || mode === 'year' || mode === 'hour') && (((mode === 'day' && settings.disabledDaysOfWeek.indexOf(date.getDay()) !== -1) || settings.disabledDates.some(function(d){
976
991
  if(typeof d === 'string') {
977
992
  d = module.helper.sanitiseDate(d);
978
993
  }
@@ -1005,7 +1020,45 @@ $.fn.calendar = function(parameters) {
1005
1020
  }
1006
1021
  }
1007
1022
  }
1008
- }));
1023
+ })) || (mode === 'hour' && settings.disabledHours.some(function(d){
1024
+ if (typeof d === 'string') {
1025
+ d = module.helper.sanitiseDate(d);
1026
+ }
1027
+ if (d instanceof Date) {
1028
+ return module.helper.dateEqual(date, d, mode);
1029
+ } else if (typeof d === 'number') {
1030
+ return date.getHours() === d;
1031
+ }
1032
+ if (d !== null && typeof d === 'object') {
1033
+ var blocked = true;
1034
+
1035
+ if (d[metadata.date]) {
1036
+ if (d[metadata.date] instanceof Date) {
1037
+ blocked = module.helper.dateEqual(date, module.helper.sanitiseDate(d[metadata.date]));
1038
+ } else if (Array.isArray(d[metadata.date])) {
1039
+ return d[metadata.date].some(function(idate) {
1040
+ blocked = module.helper.dateEqual(date, idate, mode);
1041
+ });
1042
+ }
1043
+ }
1044
+
1045
+ if (d[metadata.days]) {
1046
+ if (typeof d[metadata.days] === 'number') {
1047
+ blocked = date.getDay() == d[metadata.days];
1048
+ } else if (Array.isArray(d[metadata.days])) {
1049
+ blocked = d[metadata.days].indexOf(date.getDay()) > -1;
1050
+ }
1051
+ }
1052
+
1053
+ if (d[metadata.hours]) {
1054
+ if (typeof d[metadata.hours] === 'number') {
1055
+ return blocked && date.getHours() == d[metadata.hours];
1056
+ } else if (Array.isArray(d[metadata.hours])) {
1057
+ return blocked && d[metadata.hours].indexOf(date.getHours()) > -1;
1058
+ }
1059
+ }
1060
+ }
1061
+ })));
1009
1062
  },
1010
1063
  isEnabled: function(date, mode) {
1011
1064
  if (mode === 'day') {
@@ -1073,6 +1126,49 @@ $.fn.calendar = function(parameters) {
1073
1126
  }
1074
1127
  return null;
1075
1128
  },
1129
+ findHourAsObject: function(date, mode, hours) {
1130
+ if (mode === 'hour') {
1131
+ var d;
1132
+ var hourCheck = function(date, d) {
1133
+ if (d[metadata.hours]) {
1134
+ if (typeof d[metadata.hours] === 'number' && date.getHours() == d[metadata.hours]) {
1135
+ return d;
1136
+ } else if (Array.isArray(d[metadata.hours])) {
1137
+ if (d[metadata.hours].indexOf(date.getHours()) > -1) {
1138
+ return d;
1139
+ }
1140
+ }
1141
+ }
1142
+ }
1143
+ for (var i = 0; i < hours.length; i++) {
1144
+ d = hours[i];
1145
+ if (typeof d === 'number' && date.getHours() == d) {
1146
+ return null;
1147
+ } else if (d !== null && typeof d === 'object') {
1148
+ if (d[metadata.days] && hourCheck(date,d)) {
1149
+ if (typeof d[metadata.days] === 'number' && date.getDay() == d[metadata.days]) {
1150
+ return d;
1151
+ } else if (Array.isArray(d[metadata.days])) {
1152
+ if (d[metadata.days].indexOf(date.getDay()) > -1) {
1153
+ return d;
1154
+ }
1155
+ }
1156
+ } else if (d[metadata.date] && hourCheck(date,d)) {
1157
+ if (d[metadata.date] instanceof Date && module.helper.dateEqual(date, module.helper.sanitiseDate(d[metadata.date]))) {
1158
+ return d;
1159
+ } else if (Array.isArray(d[metadata.date])) {
1160
+ if (d[metadata.date].some(function(idate) { return module.helper.dateEqual(date, idate, mode); })) {
1161
+ return d;
1162
+ }
1163
+ }
1164
+ } else if (hourCheck(date,d)) {
1165
+ return d;
1166
+ }
1167
+ }
1168
+ }
1169
+ }
1170
+ return null;
1171
+ },
1076
1172
  sanitiseDate: function (date) {
1077
1173
  if (!(date instanceof Date)) {
1078
1174
  date = parser.date('' + date, settings);
@@ -1358,6 +1454,7 @@ $.fn.calendar.settings = {
1358
1454
  multiMonth : 1, // show multiple months when in 'day' mode
1359
1455
  minTimeGap : 5,
1360
1456
  showWeekNumbers : null, // show Number of Week at the very first column of a dayView
1457
+ disabledHours : [], // specific hour(s) which won't be selectable and contain additional information.
1361
1458
  disabledDates : [], // specific day(s) which won't be selectable and contain additional information.
1362
1459
  disabledDaysOfWeek : [], // day(s) which won't be selectable(s) (0 = Sunday)
1363
1460
  enabledDates : [], // specific day(s) which will be selectable, all other days will be disabled
@@ -1763,7 +1860,9 @@ $.fn.calendar.settings = {
1763
1860
  variation: 'variation',
1764
1861
  position: 'position',
1765
1862
  month: 'month',
1766
- year: 'year'
1863
+ year: 'year',
1864
+ hours: 'hours',
1865
+ days: 'days'
1767
1866
  },
1768
1867
 
1769
1868
  eventClass: 'blue'
@@ -239,18 +239,26 @@ $.fn.checkbox = function(parameters) {
239
239
  }
240
240
  }
241
241
 
242
+ shortcutPressed = false;
242
243
  if(key == keyCode.escape) {
243
244
  module.verbose('Escape key pressed blurring field');
244
245
  $input.blur();
245
246
  shortcutPressed = true;
246
247
  }
247
- else if(!event.ctrlKey && ( key == keyCode.space || (key == keyCode.enter && settings.enableEnterKey)) ) {
248
- module.verbose('Enter/space key pressed, toggling checkbox');
249
- module.toggle();
250
- shortcutPressed = true;
251
- }
252
- else {
253
- shortcutPressed = false;
248
+ else if(!event.ctrlKey && module.can.change()) {
249
+ if( key == keyCode.space || (key == keyCode.enter && settings.enableEnterKey) ) {
250
+ module.verbose('Enter/space key pressed, toggling checkbox');
251
+ module.toggle();
252
+ shortcutPressed = true;
253
+ } else if($module.is('.toggle, .slider') && !module.is.radio()) {
254
+ if(key == keyCode.left && module.is.checked()) {
255
+ module.uncheck();
256
+ shortcutPressed = true;
257
+ } else if(key == keyCode.right && module.is.unchecked()) {
258
+ module.check();
259
+ shortcutPressed = true;
260
+ }
261
+ }
254
262
  }
255
263
  },
256
264
  keyup: function(event) {
@@ -323,7 +331,6 @@ $.fn.checkbox = function(parameters) {
323
331
  settings.onEnable.call(input);
324
332
  // preserve legacy callbacks
325
333
  settings.onEnabled.call(input);
326
- module.trigger.change();
327
334
  }
328
335
  },
329
336
 
@@ -338,7 +345,6 @@ $.fn.checkbox = function(parameters) {
338
345
  settings.onDisable.call(input);
339
346
  // preserve legacy callbacks
340
347
  settings.onDisabled.call(input);
341
- module.trigger.change();
342
348
  }
343
349
  },
344
350
 
@@ -866,7 +872,7 @@ $.fn.checkbox.settings = {
866
872
 
867
873
  selector : {
868
874
  checkbox : '.ui.checkbox',
869
- label : 'label, .box',
875
+ label : 'label',
870
876
  input : 'input[type="checkbox"], input[type="radio"]',
871
877
  link : 'a[href]'
872
878
  }