fomantic-ui 2.8.8-beta.99 → 2.9.0-beta.100

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 (244) hide show
  1. package/.all-contributorsrc +188 -3
  2. package/.github/dependabot.yml +17 -0
  3. package/.github/workflows/ci.yml +1 -1
  4. package/CHANGELOG.md +139 -0
  5. package/CONTRIBUTING.md +1 -1
  6. package/CONTRIBUTORS.md +71 -37
  7. package/README.md +3 -3
  8. package/dist/components/accordion.css +50 -6
  9. package/dist/components/accordion.js +1 -1
  10. package/dist/components/accordion.min.css +2 -2
  11. package/dist/components/accordion.min.js +3 -3
  12. package/dist/components/ad.css +1 -1
  13. package/dist/components/ad.min.css +1 -1
  14. package/dist/components/api.js +26 -24
  15. package/dist/components/api.min.js +4 -4
  16. package/dist/components/breadcrumb.css +1 -1
  17. package/dist/components/breadcrumb.min.css +1 -1
  18. package/dist/components/button.css +81 -81
  19. package/dist/components/button.min.css +2 -2
  20. package/dist/components/calendar.css +1 -1
  21. package/dist/components/calendar.js +110 -11
  22. package/dist/components/calendar.min.css +1 -1
  23. package/dist/components/calendar.min.js +4 -4
  24. package/dist/components/card.css +26 -19
  25. package/dist/components/card.min.css +2 -2
  26. package/dist/components/checkbox.css +6 -4
  27. package/dist/components/checkbox.js +17 -11
  28. package/dist/components/checkbox.min.css +2 -2
  29. package/dist/components/checkbox.min.js +4 -4
  30. package/dist/components/comment.css +11 -11
  31. package/dist/components/comment.min.css +1 -1
  32. package/dist/components/container.css +3 -4
  33. package/dist/components/container.min.css +2 -2
  34. package/dist/components/dimmer.css +28 -14
  35. package/dist/components/dimmer.js +15 -12
  36. package/dist/components/dimmer.min.css +2 -2
  37. package/dist/components/dimmer.min.js +4 -4
  38. package/dist/components/divider.css +1 -1
  39. package/dist/components/divider.min.css +1 -1
  40. package/dist/components/dropdown.css +54 -7
  41. package/dist/components/dropdown.js +107 -77
  42. package/dist/components/dropdown.min.css +2 -2
  43. package/dist/components/dropdown.min.js +4 -4
  44. package/dist/components/embed.css +1 -1
  45. package/dist/components/embed.js +1 -1
  46. package/dist/components/embed.min.css +1 -1
  47. package/dist/components/embed.min.js +3 -3
  48. package/dist/components/emoji.css +2 -2
  49. package/dist/components/feed.css +28 -28
  50. package/dist/components/feed.min.css +2 -2
  51. package/dist/components/flag.css +731 -625
  52. package/dist/components/flag.min.css +2 -2
  53. package/dist/components/form.css +119 -54
  54. package/dist/components/form.js +51 -70
  55. package/dist/components/form.min.css +2 -2
  56. package/dist/components/form.min.js +4 -4
  57. package/dist/components/grid.css +13 -11
  58. package/dist/components/grid.min.css +2 -2
  59. package/dist/components/header.css +3 -3
  60. package/dist/components/header.min.css +2 -2
  61. package/dist/components/icon.css +86 -5
  62. package/dist/components/icon.min.css +2 -2
  63. package/dist/components/image.css +1 -1
  64. package/dist/components/image.min.css +1 -1
  65. package/dist/components/input.css +17 -2
  66. package/dist/components/input.min.css +2 -2
  67. package/dist/components/item.css +13 -13
  68. package/dist/components/item.min.css +1 -1
  69. package/dist/components/label.css +1 -1
  70. package/dist/components/label.min.css +1 -1
  71. package/dist/components/list.css +1 -1
  72. package/dist/components/list.min.css +1 -1
  73. package/dist/components/loader.css +39 -37
  74. package/dist/components/loader.min.css +2 -2
  75. package/dist/components/menu.css +37 -11
  76. package/dist/components/menu.min.css +1 -1
  77. package/dist/components/message.css +78 -34
  78. package/dist/components/message.min.css +2 -2
  79. package/dist/components/modal.css +7 -5
  80. package/dist/components/modal.js +237 -41
  81. package/dist/components/modal.min.css +2 -2
  82. package/dist/components/modal.min.js +4 -4
  83. package/dist/components/nag.css +168 -16
  84. package/dist/components/nag.js +131 -65
  85. package/dist/components/nag.min.css +2 -2
  86. package/dist/components/nag.min.js +4 -4
  87. package/dist/components/placeholder.css +1 -1
  88. package/dist/components/placeholder.min.css +1 -1
  89. package/dist/components/popup.css +5 -3
  90. package/dist/components/popup.js +5 -5
  91. package/dist/components/popup.min.css +2 -2
  92. package/dist/components/popup.min.js +4 -4
  93. package/dist/components/progress.css +2 -1
  94. package/dist/components/progress.js +3 -3
  95. package/dist/components/progress.min.css +2 -2
  96. package/dist/components/progress.min.js +4 -4
  97. package/dist/components/rail.css +1 -1
  98. package/dist/components/rail.min.css +1 -1
  99. package/dist/components/rating.css +8 -62
  100. package/dist/components/rating.js +1 -1
  101. package/dist/components/rating.min.css +2 -2
  102. package/dist/components/rating.min.js +3 -3
  103. package/dist/components/reset.css +2 -3
  104. package/dist/components/reset.min.css +2 -2
  105. package/dist/components/reveal.css +1 -1
  106. package/dist/components/reveal.min.css +1 -1
  107. package/dist/components/search.css +1 -1
  108. package/dist/components/search.js +15 -13
  109. package/dist/components/search.min.css +1 -1
  110. package/dist/components/search.min.js +4 -4
  111. package/dist/components/segment.css +36 -6
  112. package/dist/components/segment.min.css +2 -2
  113. package/dist/components/shape.css +1 -1
  114. package/dist/components/shape.js +1 -1
  115. package/dist/components/shape.min.css +1 -1
  116. package/dist/components/shape.min.js +3 -3
  117. package/dist/components/sidebar.css +4 -2
  118. package/dist/components/sidebar.js +1 -1
  119. package/dist/components/sidebar.min.css +2 -2
  120. package/dist/components/sidebar.min.js +3 -3
  121. package/dist/components/site.css +61 -39
  122. package/dist/components/site.js +1 -1
  123. package/dist/components/site.min.css +2 -2
  124. package/dist/components/site.min.js +3 -3
  125. package/dist/components/slider.js +1 -1
  126. package/dist/components/slider.min.js +3 -3
  127. package/dist/components/state.js +1 -1
  128. package/dist/components/state.min.js +3 -3
  129. package/dist/components/statistic.css +1 -1
  130. package/dist/components/statistic.min.css +1 -1
  131. package/dist/components/step.css +4 -4
  132. package/dist/components/step.min.css +2 -2
  133. package/dist/components/sticky.css +1 -2
  134. package/dist/components/sticky.js +2 -2
  135. package/dist/components/sticky.min.css +2 -2
  136. package/dist/components/sticky.min.js +4 -4
  137. package/dist/components/tab.css +1 -1
  138. package/dist/components/tab.js +1 -1
  139. package/dist/components/tab.min.css +1 -1
  140. package/dist/components/tab.min.js +3 -3
  141. package/dist/components/table.css +5 -3
  142. package/dist/components/table.min.css +2 -2
  143. package/dist/components/text.css +1 -1
  144. package/dist/components/text.min.css +1 -1
  145. package/dist/components/toast.css +123 -10
  146. package/dist/components/toast.js +54 -27
  147. package/dist/components/toast.min.css +2 -2
  148. package/dist/components/toast.min.js +4 -4
  149. package/dist/components/transition.css +1 -1
  150. package/dist/components/transition.js +2 -2
  151. package/dist/components/transition.min.css +1 -1
  152. package/dist/components/transition.min.js +4 -4
  153. package/dist/components/visibility.js +2 -2
  154. package/dist/components/visibility.min.js +3 -3
  155. package/dist/semantic.css +2004 -1124
  156. package/dist/semantic.js +789 -377
  157. package/dist/semantic.min.css +4 -397
  158. package/dist/semantic.min.js +4 -4
  159. package/examples/assets/library/iframe-content.js +8 -8
  160. package/examples/assets/library/iframe.js +3 -3
  161. package/package.json +5 -5
  162. package/scripts/nightly-version.js +23 -8
  163. package/src/definitions/behaviors/api.js +25 -23
  164. package/src/definitions/behaviors/form.js +50 -69
  165. package/src/definitions/behaviors/visibility.js +1 -1
  166. package/src/definitions/collections/form.less +200 -142
  167. package/src/definitions/collections/grid.less +717 -681
  168. package/src/definitions/collections/menu.less +177 -128
  169. package/src/definitions/collections/message.less +77 -44
  170. package/src/definitions/collections/table.less +255 -242
  171. package/src/definitions/elements/button.less +360 -347
  172. package/src/definitions/elements/container.less +16 -8
  173. package/src/definitions/elements/emoji.less +15 -9
  174. package/src/definitions/elements/flag.less +7 -17
  175. package/src/definitions/elements/header.less +44 -37
  176. package/src/definitions/elements/icon.less +121 -43
  177. package/src/definitions/elements/input.less +23 -7
  178. package/src/definitions/elements/label.less +92 -91
  179. package/src/definitions/elements/list.less +55 -45
  180. package/src/definitions/elements/loader.less +38 -35
  181. package/src/definitions/elements/segment.less +51 -23
  182. package/src/definitions/elements/step.less +52 -48
  183. package/src/definitions/elements/text.less +17 -15
  184. package/src/definitions/globals/site.less +23 -2
  185. package/src/definitions/modules/accordion.less +55 -5
  186. package/src/definitions/modules/calendar.js +109 -10
  187. package/src/definitions/modules/checkbox.js +16 -10
  188. package/src/definitions/modules/checkbox.less +44 -186
  189. package/src/definitions/modules/dimmer.js +14 -11
  190. package/src/definitions/modules/dimmer.less +21 -8
  191. package/src/definitions/modules/dropdown.js +106 -76
  192. package/src/definitions/modules/dropdown.less +148 -89
  193. package/src/definitions/modules/modal.js +236 -40
  194. package/src/definitions/modules/modal.less +6 -4
  195. package/src/definitions/modules/nag.js +130 -64
  196. package/src/definitions/modules/nag.less +105 -40
  197. package/src/definitions/modules/popup.js +4 -4
  198. package/src/definitions/modules/popup.less +5 -1
  199. package/src/definitions/modules/progress.js +2 -2
  200. package/src/definitions/modules/progress.less +20 -18
  201. package/src/definitions/modules/rating.less +50 -42
  202. package/src/definitions/modules/search.js +14 -12
  203. package/src/definitions/modules/search.less +32 -16
  204. package/src/definitions/modules/sidebar.less +33 -19
  205. package/src/definitions/modules/slider.less +43 -42
  206. package/src/definitions/modules/sticky.js +1 -1
  207. package/src/definitions/modules/toast.js +53 -26
  208. package/src/definitions/modules/toast.less +139 -25
  209. package/src/definitions/modules/transition.js +1 -1
  210. package/src/definitions/views/card.less +402 -361
  211. package/src/definitions/views/comment.less +92 -81
  212. package/src/definitions/views/feed.less +164 -144
  213. package/src/definitions/views/item.less +249 -196
  214. package/src/definitions/views/statistic.less +90 -88
  215. package/src/themes/default/collections/grid.variables +8 -8
  216. package/src/themes/default/collections/menu.variables +6 -0
  217. package/src/themes/default/collections/table.variables +1 -1
  218. package/src/themes/default/elements/button.variables +2 -1
  219. package/src/themes/default/elements/flag.overrides +1635 -986
  220. package/src/themes/default/elements/flag.variables +7 -5
  221. package/src/themes/default/elements/header.variables +2 -2
  222. package/src/themes/default/elements/icon.overrides +35 -28
  223. package/src/themes/default/elements/icon.variables +4 -0
  224. package/src/themes/default/elements/list.variables +1 -1
  225. package/src/themes/default/elements/step.overrides +1 -1
  226. package/src/themes/default/globals/colors.less +7 -7
  227. package/src/themes/default/globals/site.variables +19 -9
  228. package/src/themes/default/globals/variation.variables +119 -6
  229. package/src/themes/default/modules/accordion.variables +15 -0
  230. package/src/themes/default/modules/checkbox.variables +16 -16
  231. package/src/themes/default/modules/dimmer.variables +1 -1
  232. package/src/themes/default/modules/dropdown.variables +12 -5
  233. package/src/themes/default/modules/modal.variables +2 -2
  234. package/src/themes/default/modules/nag.variables +3 -1
  235. package/src/themes/default/modules/toast.variables +5 -1
  236. package/src/themes/default/views/card.variables +1 -1
  237. package/src/themes/famfamfam/elements/flag.overrides +1026 -0
  238. package/src/themes/famfamfam/elements/flag.variables +13 -0
  239. package/tasks/admin/components/init.js +2 -2
  240. package/tasks/admin/distributions/init.js +2 -2
  241. package/tasks/build/css.js +6 -1
  242. package/tasks/config/project/release.js +2 -2
  243. package/tasks/config/tasks.js +13 -9
  244. package/test/helpers/sinon.js +1 -1
@@ -746,12 +746,12 @@
746
746
  return maxVal;
747
747
  }
748
748
 
749
- function getAllMeasurements(dimention) {
749
+ function getAllMeasurements(dimension) {
750
750
  return [
751
- dimention.bodyOffset(),
752
- dimention.bodyScroll(),
753
- dimention.documentElementOffset(),
754
- dimention.documentElementScroll()
751
+ dimension.bodyOffset(),
752
+ dimension.bodyScroll(),
753
+ dimension.documentElementOffset(),
754
+ dimension.documentElementScroll()
755
755
  ];
756
756
  }
757
757
 
@@ -779,7 +779,7 @@
779
779
  },
780
780
 
781
781
  offset: function() {
782
- return getHeight.bodyOffset(); //Backwards compatability
782
+ return getHeight.bodyOffset(); //Backwards compatibility
783
783
  },
784
784
 
785
785
  bodyScroll: function getBodyScrollHeight() {
@@ -1029,7 +1029,7 @@
1029
1029
  moveToAnchor: function moveToAnchorF() {
1030
1030
  inPageLinks.findTarget(getData());
1031
1031
  },
1032
- inPageLink: function inPageLinkF() {this.moveToAnchor();}, //Backward compatability
1032
+ inPageLink: function inPageLinkF() {this.moveToAnchor();}, //Backward compatibility
1033
1033
 
1034
1034
  pageInfo: function pageInfoFromParent() {
1035
1035
  var msgBody = getData();
@@ -1065,7 +1065,7 @@
1065
1065
 
1066
1066
  function isInitMsg() {
1067
1067
  //Test if this message is from a child below us. This is an ugly test, however, updating
1068
- //the message format would break backwards compatibity.
1068
+ //the message format would break backwards compatibility.
1069
1069
  return event.data.split(':')[2] in {'true':1,'false':1};
1070
1070
  }
1071
1071
 
@@ -231,7 +231,7 @@
231
231
 
232
232
  function isMessageFromMetaParent() {
233
233
  //Test if this message is from a parent above us. This is an ugly test, however, updating
234
- //the message format would break backwards compatibity.
234
+ //the message format would break backwards compatibility.
235
235
  var retCode = messageData.type in {'true':1,'false':1,'undefined':1};
236
236
 
237
237
  if (retCode) {
@@ -659,7 +659,7 @@
659
659
  function warning() {
660
660
  if (settings[id] && !settings[id].loaded && !errorShown) {
661
661
  errorShown = true;
662
- warn(id, 'IFrame has not responded within '+ settings[id].warningTimeout/1000 +' seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ingored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.');
662
+ warn(id, 'IFrame has not responded within '+ settings[id].warningTimeout/1000 +' seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.');
663
663
  }
664
664
  }
665
665
 
@@ -941,7 +941,7 @@
941
941
  }
942
942
 
943
943
  if('hidden' !== document.visibilityState) {
944
- log('document','Trigger event: Visiblity change');
944
+ log('document','Trigger event: Visibility change');
945
945
  debouce(resize,16);
946
946
  }
947
947
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fomantic-ui",
3
- "version": "2.8.8-beta.99",
3
+ "version": "2.9.0-beta.100",
4
4
  "description": "Fomantic empowers designers and developers by creating a shared vocabulary for UI.",
5
5
  "keywords": [
6
6
  "fomantic-ui",
@@ -35,7 +35,7 @@
35
35
  "gulp-debug": "^4.0.0",
36
36
  "gulp-git": "^2.9.0",
37
37
  "gulp-tap": "^1.0.1",
38
- "less": "^3.7.0",
38
+ "less": "^3.7.1 || ^4.0.0",
39
39
  "merge-stream": "^2.0.0",
40
40
  "better-console": "1.0.1",
41
41
  "del": "^3.0.0",
@@ -43,7 +43,7 @@
43
43
  "gulp": "^4.0.0",
44
44
  "gulp-autoprefixer": "^6.0.0",
45
45
  "gulp-chmod": "^2.0.0",
46
- "gulp-clean-css": "^3.10.0",
46
+ "gulp-clean-css": "^4.3.0",
47
47
  "gulp-clone": "^2.0.1",
48
48
  "gulp-concat": "^2.6.1",
49
49
  "gulp-concat-css": "^3.1.0",
@@ -53,7 +53,7 @@
53
53
  "gulp-header": "^2.0.5",
54
54
  "gulp-if": "^2.0.2",
55
55
  "gulp-json-editor": "^2.4.3",
56
- "gulp-less": "^4.0.1",
56
+ "gulp-less": "^5.0.0",
57
57
  "gulp-notify": "^3.0.0",
58
58
  "gulp-plumber": "^1.1.0",
59
59
  "gulp-print": "^5.0.0",
@@ -61,7 +61,7 @@
61
61
  "gulp-replace": "^1.0.0",
62
62
  "gulp-rtlcss": "^1.3.0",
63
63
  "gulp-uglify": "^3.0.1",
64
- "inquirer": "^6.2.1",
64
+ "inquirer": "^7.0.5",
65
65
  "map-stream": "^0.1.0",
66
66
  "mkdirp": "^0.5.1",
67
67
  "normalize-path": "^3.0.0",
@@ -35,23 +35,38 @@ const getNpmPreRelease = async function () {
35
35
  .then(pr => pr === null ? ['beta', 0] : pr)
36
36
  }
37
37
 
38
+ const getAllNpmVersions = async function () {
39
+ // The versions property sometimes does not include versions which are in "time"!
40
+ // That's why "time" is used here
41
+ return fetch(`${npmBase}/${npmPackage}`)
42
+ .then(r => r.json())
43
+ .then(p => Object.keys(p['time']))
44
+ }
45
+
38
46
  const getNightlyVersion = async function () {
39
47
  const nextVersion = await getGitHubVersion()
40
48
  const currentNightlyWithPre = semver.parse(await getCurrentNpmVersion())
41
49
  const currentNightly = `${currentNightlyWithPre.major}.${currentNightlyWithPre.minor}.${currentNightlyWithPre.patch}`
50
+ const allNpmVersions = await getAllNpmVersions()
51
+ let nightlyVersion = `${nextVersion}-beta.0`
42
52
 
43
- if (!semver.gt(nextVersion, currentNightly)) {
44
- if (semver.minor(nextVersion) === semver.minor(currentNightly)) {
45
- const preRelease = await getNpmPreRelease()
53
+ if (semver.eq(nextVersion, currentNightly)) {
54
+ const preRelease = await getNpmPreRelease()
46
55
 
47
- return semver.inc(
48
- `${nextVersion}-${preRelease[0]}.${preRelease[1]}`,
56
+ nightlyVersion = semver.inc(
57
+ `${nextVersion}-${preRelease[0]}.${preRelease[1]}`,
58
+ 'prerelease'
59
+ )
60
+ }
61
+ //check if version was already uploaded to npm previously
62
+ while (allNpmVersions.indexOf(nightlyVersion) !== -1) {
63
+ nightlyVersion = semver.inc(
64
+ nightlyVersion,
49
65
  'prerelease'
50
- )
51
- }
66
+ )
52
67
  }
53
68
 
54
- return `${nextVersion}-beta.0`
69
+ return nightlyVersion
55
70
  }
56
71
 
57
72
  getNightlyVersion()
@@ -132,7 +132,7 @@ $.api = $.fn.api = function(parameters) {
132
132
  response = JSON.parse(response);
133
133
  }
134
134
  catch(e) {
135
- // isnt json string
135
+ // isn't json string
136
136
  }
137
137
  }
138
138
  return response;
@@ -148,8 +148,8 @@ $.api = $.fn.api = function(parameters) {
148
148
  module.error(error.noStorage);
149
149
  return;
150
150
  }
151
- response = sessionStorage.getItem(url);
152
- module.debug('Using cached response', url, response);
151
+ response = sessionStorage.getItem(url + module.get.normalizedData());
152
+ module.debug('Using cached response', url, settings.data, response);
153
153
  response = module.decode.json(response);
154
154
  return response;
155
155
  }
@@ -167,8 +167,8 @@ $.api = $.fn.api = function(parameters) {
167
167
  if( $.isPlainObject(response) ) {
168
168
  response = JSON.stringify(response);
169
169
  }
170
- sessionStorage.setItem(url, response);
171
- module.verbose('Storing cached response for url', url, response);
170
+ sessionStorage.setItem(url + module.get.normalizedData(), response);
171
+ module.verbose('Storing cached response for url', url, settings.data, response);
172
172
  }
173
173
  },
174
174
 
@@ -334,10 +334,6 @@ $.api = $.fn.api = function(parameters) {
334
334
  cancelled: function() {
335
335
  return (module.cancelled || false);
336
336
  },
337
- succesful: function() {
338
- module.verbose('This behavior will be deleted due to typo. Use "was successful" instead.');
339
- return module.was.successful();
340
- },
341
337
  successful: function() {
342
338
  return (module.request && module.request.state() == 'resolved');
343
339
  },
@@ -429,25 +425,29 @@ $.api = $.fn.api = function(parameters) {
429
425
  },
430
426
  formData: function(data) {
431
427
  var
432
- canSerialize = ($.fn.serializeObject !== undefined),
433
- formData = (canSerialize)
434
- ? $form.serializeObject()
435
- : $form.serialize(),
428
+ formData = {},
436
429
  hasOtherData
437
430
  ;
438
431
  data = data || settings.data;
439
432
  hasOtherData = $.isPlainObject(data);
440
433
 
441
- if(hasOtherData) {
442
- if(canSerialize) {
443
- module.debug('Extending existing data with form data', data, formData);
444
- data = $.extend(true, {}, data, formData);
445
- }
446
- else {
447
- module.error(error.missingSerialize);
448
- module.debug('Cant extend data. Replacing data with form data', data, formData);
449
- data = formData;
434
+ $.each($form.serializeArray(), function (i, element) {
435
+ var node = formData[element.name];
436
+
437
+ if ('undefined' !== typeof node && node !== null) {
438
+ if (Array.isArray(node)) {
439
+ node.push(element.value);
440
+ } else {
441
+ formData[element.name] = [node, element.value];
442
+ }
443
+ } else {
444
+ formData[element.name] = element.value;
450
445
  }
446
+ });
447
+
448
+ if(hasOtherData) {
449
+ module.debug('Extending existing data with form data', data, formData);
450
+ data = $.extend(true, {}, data, formData);
451
451
  }
452
452
  else {
453
453
  module.debug('Adding form data', formData);
@@ -698,6 +698,9 @@ $.api = $.fn.api = function(parameters) {
698
698
  },
699
699
 
700
700
  get: {
701
+ normalizedData: function(){
702
+ return typeof settings.data === "string" ? settings.data : JSON.stringify(settings.data, Object.keys(settings.data).sort());
703
+ },
701
704
  responseFromXHR: function(xhr) {
702
705
  return $.isPlainObject(xhr)
703
706
  ? (module.is.expectingJSON())
@@ -1141,7 +1144,6 @@ $.api.settings = {
1141
1144
  legacyParameters : 'You are using legacy API success callback names',
1142
1145
  method : 'The method you called is not defined',
1143
1146
  missingAction : 'API action used but no url was defined',
1144
- missingSerialize : 'jquery-serialize-object is required to add form data to an existing data object',
1145
1147
  missingURL : 'No URL specified for api event',
1146
1148
  noReturnedValue : 'The beforeSend callback must return a settings object, beforeSend ignored.',
1147
1149
  noStorage : 'Caching responses locally requires session storage',
@@ -91,6 +91,7 @@ $.fn.form = function(parameters) {
91
91
  else {
92
92
  if(instance !== undefined) {
93
93
  instance.invoke('destroy');
94
+ module.refresh();
94
95
  }
95
96
  module.verbose('Initializing form validation', $module, settings);
96
97
  module.bindEvents();
@@ -171,11 +172,9 @@ $.fn.form = function(parameters) {
171
172
  }
172
173
 
173
174
  $field.on('change click keyup keydown blur', function(e) {
174
- $(this).triggerHandler(e.type + ".dirty");
175
+ module.determine.isDirty();
175
176
  });
176
177
 
177
- $field.on('change.dirty click.dirty keyup.dirty keydown.dirty blur.dirty', module.determine.isDirty);
178
-
179
178
  $module.on('dirty' + eventNamespace, function(e) {
180
179
  settings.onDirty.call();
181
180
  });
@@ -302,10 +301,6 @@ $.fn.form = function(parameters) {
302
301
  module.set.clean();
303
302
  }
304
303
 
305
- if (e && e.namespace === 'dirty') {
306
- e.stopImmediatePropagation();
307
- e.preventDefault();
308
- }
309
304
  }
310
305
  },
311
306
 
@@ -313,13 +308,6 @@ $.fn.form = function(parameters) {
313
308
  bracketedRule: function(rule) {
314
309
  return (rule.type && rule.type.match(settings.regExp.bracket));
315
310
  },
316
- shorthandFields: function(fields) {
317
- var
318
- fieldKeys = Object.keys(fields),
319
- firstRule = fields[fieldKeys[0]]
320
- ;
321
- return module.is.shorthandRules(firstRule);
322
- },
323
311
  // duck type rule test
324
312
  shorthandRules: function(rules) {
325
313
  return (typeof rules == 'string' || Array.isArray(rules));
@@ -422,7 +410,7 @@ $.fn.form = function(parameters) {
422
410
  ;
423
411
  if( key == keyCode.escape) {
424
412
  module.verbose('Escape key pressed blurring field');
425
- $field
413
+ $field[0]
426
414
  .blur()
427
415
  ;
428
416
  }
@@ -431,6 +419,7 @@ $.fn.form = function(parameters) {
431
419
  $field.one('keyup' + eventNamespace, module.event.field.keyup);
432
420
  module.submit();
433
421
  module.debug('Enter pressed on input submitting form');
422
+ event.preventDefault();
434
423
  }
435
424
  keyHeldDown = true;
436
425
  }
@@ -444,15 +433,11 @@ $.fn.form = function(parameters) {
444
433
  $fieldGroup = $field.closest($group),
445
434
  validationRules = module.get.validation($field)
446
435
  ;
447
- if( $fieldGroup.hasClass(className.error) ) {
436
+ if(validationRules && (settings.on == 'blur' || ( $fieldGroup.hasClass(className.error) && settings.revalidate) )) {
448
437
  module.debug('Revalidating field', $field, validationRules);
449
- if(validationRules) {
450
- module.validate.field( validationRules );
451
- }
452
- }
453
- else if(settings.on == 'blur') {
454
- if(validationRules) {
455
- module.validate.field( validationRules );
438
+ module.validate.field( validationRules );
439
+ if(!settings.inline) {
440
+ module.validate.form(false,true);
456
441
  }
457
442
  }
458
443
  },
@@ -465,7 +450,7 @@ $.fn.form = function(parameters) {
465
450
  if(validationRules && (settings.on == 'change' || ( $fieldGroup.hasClass(className.error) && settings.revalidate) )) {
466
451
  clearTimeout(module.timer);
467
452
  module.timer = setTimeout(function() {
468
- module.debug('Revalidating field', $field, module.get.validation($field));
453
+ module.debug('Revalidating field', $field, validationRules);
469
454
  module.validate.field( validationRules );
470
455
  if(!settings.inline) {
471
456
  module.validate.form(false,true);
@@ -527,15 +512,19 @@ $.fn.form = function(parameters) {
527
512
  fullFields = {}
528
513
  ;
529
514
  $.each(fields, function(name, rules) {
530
- if(typeof rules == 'string') {
531
- rules = [rules];
515
+ if (!Array.isArray(rules) && typeof rules === 'object') {
516
+ fullFields[name] = rules;
517
+ } else {
518
+ if (typeof rules == 'string') {
519
+ rules = [rules];
520
+ }
521
+ fullFields[name] = {
522
+ rules: []
523
+ };
524
+ $.each(rules, function (index, rule) {
525
+ fullFields[name].rules.push({type: rule});
526
+ });
532
527
  }
533
- fullFields[name] = {
534
- rules: []
535
- };
536
- $.each(rules, function(index, rule) {
537
- fullFields[name].rules.push({ type: rule });
538
- });
539
528
  });
540
529
  return fullFields;
541
530
  },
@@ -603,7 +592,7 @@ $.fn.form = function(parameters) {
603
592
  }
604
593
  else {
605
594
  // 2.x
606
- if(parameters.fields && module.is.shorthandFields(parameters.fields)) {
595
+ if(parameters.fields) {
607
596
  parameters.fields = module.get.fieldsFromShorthand(parameters.fields);
608
597
  }
609
598
  settings = $.extend(true, {}, $.fn.form.settings, parameters);
@@ -631,7 +620,7 @@ $.fn.form = function(parameters) {
631
620
  instance = $module.data(moduleNamespace);
632
621
 
633
622
  // refresh selector cache
634
- module.refresh();
623
+ (instance || module).refresh();
635
624
  },
636
625
  field: function(identifier) {
637
626
  module.verbose('Finding field with identifier', identifier);
@@ -877,16 +866,7 @@ $.fn.form = function(parameters) {
877
866
  module.debug('Adding rules', newValidation.rules, validation);
878
867
  },
879
868
  fields: function(fields) {
880
- var
881
- newValidation
882
- ;
883
- if(fields && module.is.shorthandFields(fields)) {
884
- newValidation = module.get.fieldsFromShorthand(fields);
885
- }
886
- else {
887
- newValidation = fields;
888
- }
889
- validation = $.extend({}, validation, newValidation);
869
+ validation = $.extend({}, validation, module.get.fieldsFromShorthand(fields));
890
870
  },
891
871
  prompt: function(identifier, errors, internal) {
892
872
  var
@@ -907,13 +887,13 @@ $.fn.form = function(parameters) {
907
887
  }
908
888
  if(settings.inline) {
909
889
  if(!promptExists) {
910
- $prompt = settings.templates.prompt(errors, className.label);
890
+ $prompt = $('<div/>').addClass(className.label);
911
891
  $prompt
912
892
  .appendTo($fieldGroup)
913
893
  ;
914
894
  }
915
895
  $prompt
916
- .html(errors[0])
896
+ .html(settings.templates.prompt(errors))
917
897
  ;
918
898
  if(!promptExists) {
919
899
  if(settings.transition && module.can.useElement('transition') && $module.transition('is supported')) {
@@ -1106,12 +1086,15 @@ $.fn.form = function(parameters) {
1106
1086
  }
1107
1087
  else if(isCheckbox) {
1108
1088
  module.verbose('Setting checkbox value', value, $element);
1109
- if(value === true || value === 1) {
1089
+ if(value === true || value === 1 || value === 'on') {
1110
1090
  $element.checkbox('check');
1111
1091
  }
1112
1092
  else {
1113
1093
  $element.checkbox('uncheck');
1114
1094
  }
1095
+ if(typeof value === 'string') {
1096
+ $field.val(value);
1097
+ }
1115
1098
  }
1116
1099
  else if(isDropdown) {
1117
1100
  module.verbose('Setting dropdown value', value, $element);
@@ -1224,7 +1207,7 @@ $.fn.form = function(parameters) {
1224
1207
  if(event && $module.data('moduleApi') !== undefined) {
1225
1208
  event.stopImmediatePropagation();
1226
1209
  }
1227
- if(settings.errorFocus) {
1210
+ if(settings.errorFocus && ignoreCallbacks !== true) {
1228
1211
  var focusElement, hasTabIndex = true;
1229
1212
  if (typeof settings.errorFocus === 'string') {
1230
1213
  focusElement = $(settings.errorFocus);
@@ -1331,7 +1314,7 @@ $.fn.form = function(parameters) {
1331
1314
  // cast to string avoiding encoding special values
1332
1315
  value = (value === undefined || value === '' || value === null)
1333
1316
  ? ''
1334
- : (settings.shouldTrim) ? String(value + '').trim() : String(value + '')
1317
+ : (settings.shouldTrim && rule.shouldTrim !== false) || rule.shouldTrim ? String(value + '').trim() : String(value + '')
1335
1318
  ;
1336
1319
  return ruleFunction.call(field, value, ancillary, $module);
1337
1320
  }
@@ -1547,7 +1530,7 @@ $.fn.form.settings = {
1547
1530
 
1548
1531
  autoCheckRequired : false,
1549
1532
  preventLeaving : false,
1550
- errorFocus : false,
1533
+ errorFocus : true,
1551
1534
  dateHandling : 'date', // 'date', 'input', 'formatter'
1552
1535
 
1553
1536
  onValid : function() {},
@@ -1603,7 +1586,6 @@ $.fn.form.settings = {
1603
1586
  doesntContain : '{name} cannot contain "{ruleValue}"',
1604
1587
  doesntContainExactly : '{name} cannot contain exactly "{ruleValue}"',
1605
1588
  minLength : '{name} must be at least {ruleValue} characters',
1606
- length : '{name} must be at least {ruleValue} characters',
1607
1589
  exactLength : '{name} must be exactly {ruleValue} characters',
1608
1590
  maxLength : '{name} cannot be longer than {ruleValue} characters',
1609
1591
  match : '{name} must match {ruleValue} field',
@@ -1617,9 +1599,9 @@ $.fn.form.settings = {
1617
1599
  selector : {
1618
1600
  checkbox : 'input[type="checkbox"], input[type="radio"]',
1619
1601
  clear : '.clear',
1620
- field : 'input:not(.search), textarea, select',
1602
+ field : 'input:not(.search):not([type="file"]):not([type="reset"]):not([type="button"]):not([type="submit"]), textarea, select',
1621
1603
  group : '.field',
1622
- input : 'input',
1604
+ input : 'input:not([type="file"])',
1623
1605
  message : '.error.message',
1624
1606
  prompt : '.prompt.label',
1625
1607
  radio : 'input[type="radio"]',
@@ -1658,15 +1640,22 @@ $.fn.form.settings = {
1658
1640
  html += '<li>' + value + '</li>';
1659
1641
  });
1660
1642
  html += '</ul>';
1661
- return $(html);
1643
+ return html;
1662
1644
  },
1663
1645
 
1664
- // template that produces label
1665
- prompt: function(errors, labelClasses) {
1666
- return $('<div/>')
1667
- .addClass(labelClasses)
1668
- .html(errors[0])
1646
+ // template that produces label content
1647
+ prompt: function(errors) {
1648
+ if(errors.length === 1){
1649
+ return errors[0];
1650
+ }
1651
+ var
1652
+ html = '<ul class="ui list">'
1669
1653
  ;
1654
+ $.each(errors, function(index, value) {
1655
+ html += '<li>' + value + '</li>';
1656
+ });
1657
+ html += '</ul>';
1658
+ return html;
1670
1659
  }
1671
1660
  },
1672
1661
 
@@ -1876,14 +1865,6 @@ $.fn.form.settings = {
1876
1865
  ;
1877
1866
  },
1878
1867
 
1879
- // see rls notes for 2.0.6 (this is a duplicate of minLength)
1880
- length: function(value, requiredLength) {
1881
- return (value !== undefined)
1882
- ? (value.length >= requiredLength)
1883
- : false
1884
- ;
1885
- },
1886
-
1887
1868
  // is exactly length
1888
1869
  exactLength: function(value, requiredLength) {
1889
1870
  return (value !== undefined)
@@ -2006,8 +1987,8 @@ $.fn.form.settings = {
2006
1987
  return;
2007
1988
  }
2008
1989
 
2009
- // allow dashes in card
2010
- cardNumber = cardNumber.replace(/[\-]/g, '');
1990
+ // allow dashes and spaces in card
1991
+ cardNumber = cardNumber.replace(/[\s\-]/g, '');
2011
1992
 
2012
1993
  // verify card types
2013
1994
  if(requiredTypes) {
@@ -1237,7 +1237,7 @@ $.fn.visibility.settings = {
1237
1237
  // callback should only occur one time
1238
1238
  once : true,
1239
1239
 
1240
- // callback should fire continuously whe evaluates to true
1240
+ // callback should fire continuously when evaluates to true
1241
1241
  continuous : false,
1242
1242
 
1243
1243
  // offset to use with scroll top