fomantic-ui 2.10.0-beta.5 → 2.10.0-beta.7

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 (173) hide show
  1. package/dist/components/accordion.css +1 -1
  2. package/dist/components/accordion.js +1 -1
  3. package/dist/components/accordion.min.css +1 -1
  4. package/dist/components/accordion.min.js +1 -1
  5. package/dist/components/ad.css +1 -1
  6. package/dist/components/ad.min.css +1 -1
  7. package/dist/components/api.js +1 -1
  8. package/dist/components/api.min.js +1 -1
  9. package/dist/components/breadcrumb.css +1 -1
  10. package/dist/components/breadcrumb.min.css +1 -1
  11. package/dist/components/button.css +1 -1
  12. package/dist/components/button.min.css +1 -1
  13. package/dist/components/calendar.css +1 -1
  14. package/dist/components/calendar.js +1 -1
  15. package/dist/components/calendar.min.css +1 -1
  16. package/dist/components/calendar.min.js +1 -1
  17. package/dist/components/card.css +1 -1
  18. package/dist/components/card.min.css +1 -1
  19. package/dist/components/checkbox.css +1 -1
  20. package/dist/components/checkbox.js +1 -1
  21. package/dist/components/checkbox.min.css +1 -1
  22. package/dist/components/checkbox.min.js +1 -1
  23. package/dist/components/comment.css +1 -1
  24. package/dist/components/comment.min.css +1 -1
  25. package/dist/components/container.css +1 -1
  26. package/dist/components/container.min.css +1 -1
  27. package/dist/components/dimmer.css +1 -1
  28. package/dist/components/dimmer.js +1 -1
  29. package/dist/components/dimmer.min.css +1 -1
  30. package/dist/components/dimmer.min.js +1 -1
  31. package/dist/components/divider.css +1 -1
  32. package/dist/components/divider.min.css +1 -1
  33. package/dist/components/dropdown.css +1 -1
  34. package/dist/components/dropdown.js +46 -73
  35. package/dist/components/dropdown.min.css +1 -1
  36. package/dist/components/dropdown.min.js +2 -2
  37. package/dist/components/embed.css +1 -1
  38. package/dist/components/embed.js +17 -8
  39. package/dist/components/embed.min.css +1 -1
  40. package/dist/components/embed.min.js +2 -2
  41. package/dist/components/emoji.css +1 -1
  42. package/dist/components/emoji.min.css +1 -1
  43. package/dist/components/feed.css +1 -1
  44. package/dist/components/feed.min.css +1 -1
  45. package/dist/components/flag.css +1 -1
  46. package/dist/components/flag.min.css +1 -1
  47. package/dist/components/flyout.css +1 -1
  48. package/dist/components/flyout.js +18 -31
  49. package/dist/components/flyout.min.css +1 -1
  50. package/dist/components/flyout.min.js +2 -2
  51. package/dist/components/form.css +1 -1
  52. package/dist/components/form.js +1 -1
  53. package/dist/components/form.min.css +1 -1
  54. package/dist/components/form.min.js +1 -1
  55. package/dist/components/grid.css +1 -1
  56. package/dist/components/grid.min.css +1 -1
  57. package/dist/components/header.css +1 -1
  58. package/dist/components/header.min.css +1 -1
  59. package/dist/components/icon.css +1 -1
  60. package/dist/components/icon.min.css +1 -1
  61. package/dist/components/image.css +1 -1
  62. package/dist/components/image.min.css +1 -1
  63. package/dist/components/input.css +1 -1
  64. package/dist/components/input.min.css +1 -1
  65. package/dist/components/item.css +1 -1
  66. package/dist/components/item.min.css +1 -1
  67. package/dist/components/label.css +1 -1
  68. package/dist/components/label.min.css +1 -1
  69. package/dist/components/list.css +1 -1
  70. package/dist/components/list.min.css +1 -1
  71. package/dist/components/loader.css +1 -1
  72. package/dist/components/loader.min.css +1 -1
  73. package/dist/components/menu.css +1 -1
  74. package/dist/components/menu.min.css +1 -1
  75. package/dist/components/message.css +1 -1
  76. package/dist/components/message.min.css +1 -1
  77. package/dist/components/modal.css +1 -1
  78. package/dist/components/modal.js +18 -31
  79. package/dist/components/modal.min.css +1 -1
  80. package/dist/components/modal.min.js +2 -2
  81. package/dist/components/nag.css +1 -1
  82. package/dist/components/nag.js +1 -1
  83. package/dist/components/nag.min.css +1 -1
  84. package/dist/components/nag.min.js +1 -1
  85. package/dist/components/placeholder.css +1 -1
  86. package/dist/components/placeholder.min.css +1 -1
  87. package/dist/components/popup.css +1 -1
  88. package/dist/components/popup.js +11 -22
  89. package/dist/components/popup.min.css +1 -1
  90. package/dist/components/popup.min.js +2 -2
  91. package/dist/components/progress.css +1 -1
  92. package/dist/components/progress.js +1 -1
  93. package/dist/components/progress.min.css +1 -1
  94. package/dist/components/progress.min.js +1 -1
  95. package/dist/components/rail.css +1 -1
  96. package/dist/components/rail.min.css +1 -1
  97. package/dist/components/rating.css +1 -1
  98. package/dist/components/rating.js +14 -5
  99. package/dist/components/rating.min.css +1 -1
  100. package/dist/components/rating.min.js +2 -2
  101. package/dist/components/reset.css +1 -1
  102. package/dist/components/reset.min.css +1 -1
  103. package/dist/components/reveal.css +1 -1
  104. package/dist/components/reveal.min.css +1 -1
  105. package/dist/components/search.css +1 -1
  106. package/dist/components/search.js +18 -28
  107. package/dist/components/search.min.css +1 -1
  108. package/dist/components/search.min.js +2 -2
  109. package/dist/components/segment.css +1 -1
  110. package/dist/components/segment.min.css +1 -1
  111. package/dist/components/shape.css +1 -1
  112. package/dist/components/shape.js +1 -1
  113. package/dist/components/shape.min.css +1 -1
  114. package/dist/components/shape.min.js +1 -1
  115. package/dist/components/sidebar.css +1 -1
  116. package/dist/components/sidebar.js +1 -1
  117. package/dist/components/sidebar.min.css +1 -1
  118. package/dist/components/sidebar.min.js +1 -1
  119. package/dist/components/site.css +1 -1
  120. package/dist/components/site.js +1 -1
  121. package/dist/components/site.min.css +1 -1
  122. package/dist/components/site.min.js +1 -1
  123. package/dist/components/slider.css +1 -1
  124. package/dist/components/slider.js +1 -1
  125. package/dist/components/slider.min.css +1 -1
  126. package/dist/components/slider.min.js +1 -1
  127. package/dist/components/state.js +1 -1
  128. package/dist/components/state.min.js +1 -1
  129. package/dist/components/statistic.css +1 -1
  130. package/dist/components/statistic.min.css +1 -1
  131. package/dist/components/step.css +1 -1
  132. package/dist/components/step.min.css +1 -1
  133. package/dist/components/sticky.css +1 -1
  134. package/dist/components/sticky.js +1 -1
  135. package/dist/components/sticky.min.css +1 -1
  136. package/dist/components/sticky.min.js +1 -1
  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 +1 -1
  141. package/dist/components/table.css +1 -1
  142. package/dist/components/table.min.css +1 -1
  143. package/dist/components/text.css +1 -1
  144. package/dist/components/text.min.css +1 -1
  145. package/dist/components/toast.css +1 -1
  146. package/dist/components/toast.js +19 -32
  147. package/dist/components/toast.min.css +1 -1
  148. package/dist/components/toast.min.js +2 -2
  149. package/dist/components/transition.css +1 -1
  150. package/dist/components/transition.js +1 -1
  151. package/dist/components/transition.min.css +1 -1
  152. package/dist/components/transition.min.js +1 -1
  153. package/dist/components/visibility.js +1 -1
  154. package/dist/components/visibility.min.js +1 -1
  155. package/dist/semantic.css +53 -53
  156. package/dist/semantic.js +178 -247
  157. package/dist/semantic.min.css +1 -1
  158. package/dist/semantic.min.js +2 -2
  159. package/package.json +1 -2
  160. package/src/definitions/modules/dropdown.js +45 -72
  161. package/src/definitions/modules/embed.js +16 -7
  162. package/src/definitions/modules/flyout.js +17 -30
  163. package/src/definitions/modules/modal.js +17 -30
  164. package/src/definitions/modules/popup.js +10 -21
  165. package/src/definitions/modules/rating.js +13 -4
  166. package/src/definitions/modules/search.js +17 -27
  167. package/src/definitions/modules/toast.js +18 -31
  168. package/tasks/config/defaults.js +0 -1
  169. package/tasks/config/project/install.js +5 -8
  170. package/tasks/install.js +10 -11
  171. package/types/fomantic-ui-dropdown.d.ts +1 -6
  172. package/types/fomantic-ui-embed.d.ts +1 -1
  173. package/types/fomantic-ui-search.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Accordion
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Accordion
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Accordion
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Accordion
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Accordion
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Accordion
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.10.0-beta.5+789e0d0
2
+ * # Fomantic UI - 2.10.0-beta.7+13b1bae
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * https://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Ad
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Ad
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Ad
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Ad
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - API
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - API
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.10.0-beta.5+789e0d0
2
+ * # Fomantic UI - 2.10.0-beta.7+13b1bae
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * https://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Breadcrumb
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Breadcrumb
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Breadcrumb
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Breadcrumb
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Button
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Button
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Button
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Button
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Calendar
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Calendar
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Calendar
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Calendar
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Calendar
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Calendar
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.10.0-beta.5+789e0d0
2
+ * # Fomantic UI - 2.10.0-beta.7+13b1bae
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * https://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Card
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Card
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Card
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Card
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Checkbox
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Checkbox
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Checkbox
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Checkbox
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Checkbox
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Checkbox
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.10.0-beta.5+789e0d0
2
+ * # Fomantic UI - 2.10.0-beta.7+13b1bae
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * https://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Comment
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Comment
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Comment
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Comment
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Container
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Container
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Container
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Container
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Dimmer
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Dimmer
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Dimmer
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Dimmer
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Dimmer
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Dimmer
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.10.0-beta.5+789e0d0
2
+ * # Fomantic UI - 2.10.0-beta.7+13b1bae
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * https://fomantic-ui.com/
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Divider
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Divider
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Divider
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Divider
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Dropdown
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Dropdown
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Dropdown
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Dropdown
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -114,11 +114,6 @@
114
114
  if (module.is.alreadySetup()) {
115
115
  module.setup.reference();
116
116
  } else {
117
- if (settings.ignoreDiacritics && !String.prototype.normalize) {
118
- settings.ignoreDiacritics = false;
119
- module.error(error.noNormalize, element);
120
- }
121
-
122
117
  module.create.id();
123
118
  module.setup.layout();
124
119
 
@@ -1110,7 +1105,7 @@
1110
1105
  $input.append('<option disabled selected value></option>');
1111
1106
  $.each(values, function (index, item) {
1112
1107
  var
1113
- value = settings.templates.deQuote(item[fields.value]),
1108
+ value = settings.templates.escape(item[fields.value]),
1114
1109
  name = settings.templates.escape(
1115
1110
  item[fields.name] || '',
1116
1111
  settings
@@ -1762,6 +1757,7 @@
1762
1757
  }
1763
1758
  // down arrow (open menu)
1764
1759
  if (pressedKey === keys.downArrow && !module.is.visible()) {
1760
+ focused = true;
1765
1761
  module.verbose('Down key pressed, showing dropdown');
1766
1762
  module.show();
1767
1763
  event.preventDefault();
@@ -3840,26 +3836,19 @@
3840
3836
  },
3841
3837
  htmlEntities: function (string, forceAmpersand) {
3842
3838
  forceAmpersand = typeof forceAmpersand === 'number' ? false : forceAmpersand;
3843
- var
3844
- badChars = /["'<>`]/g,
3845
- shouldEscape = /["&'<>`]/,
3846
- escape = {
3847
- '<': '&lt;',
3848
- '>': '&gt;',
3849
- '"': '&quot;',
3850
- "'": '&#x27;',
3851
- '`': '&#x60;',
3852
- },
3853
- escapedChar = function (chr) {
3854
- return escape[chr];
3855
- }
3856
- ;
3857
- if (shouldEscape.test(string)) {
3858
- string = string.replace(forceAmpersand ? /&/g : /&(?![\d#a-z]{1,12};)/gi, '&amp;');
3859
- string = string.replace(badChars, escapedChar);
3860
- }
3861
3839
 
3862
- return string;
3840
+ const badChars = forceAmpersand
3841
+ ? /["&'<>]/g
3842
+ : /["'<>]|&(?![\d#A-Za-z]{1,12};)/g;
3843
+ const escape = {
3844
+ '"': '&quot;',
3845
+ '&': '&amp;',
3846
+ "'": '&apos;',
3847
+ '<': '&lt;',
3848
+ '>': '&gt;',
3849
+ };
3850
+
3851
+ return string.replace(badChars, (chr) => escape[chr]);
3863
3852
  },
3864
3853
  },
3865
3854
 
@@ -4152,7 +4141,6 @@
4152
4141
  noAPI: 'The API module is required to load resources remotely',
4153
4142
  noStorage: 'Saving remote data requires session storage',
4154
4143
  noElement: 'This module requires ui {element}',
4155
- noNormalize: '"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.',
4156
4144
  },
4157
4145
 
4158
4146
  regExp: {
@@ -4266,33 +4254,21 @@
4266
4254
 
4267
4255
  /* Templates */
4268
4256
  $.fn.dropdown.settings.templates = {
4269
- deQuote: function (string, encode) {
4270
- return String(string).replace(/"/g, encode ? '&quot;' : '');
4271
- },
4272
4257
  escape: function (string, settings) {
4273
- if (settings.preserveHTML) {
4258
+ if (settings !== undefined && settings.preserveHTML) {
4274
4259
  return string;
4275
4260
  }
4276
- var
4277
- badChars = /["'<>`]/g,
4278
- shouldEscape = /["&'<>`]/,
4279
- escape = {
4280
- '<': '&lt;',
4281
- '>': '&gt;',
4282
- '"': '&quot;',
4283
- "'": '&#x27;',
4284
- '`': '&#x60;',
4285
- },
4286
- escapedChar = function (chr) {
4287
- return escape[chr];
4288
- }
4289
- ;
4290
- if (shouldEscape.test(string)) {
4291
- string = string.replace(/&(?![\d#a-z]{1,12};)/gi, '&amp;');
4292
- string = string.replace(badChars, escapedChar);
4293
- }
4294
4261
 
4295
- return string;
4262
+ const badChars = /["'<>]|&(?![\d#A-Za-z]{1,12};)/g;
4263
+ const escape = {
4264
+ '"': '&quot;',
4265
+ '&': '&amp;',
4266
+ "'": '&apos;',
4267
+ '<': '&lt;',
4268
+ '>': '&gt;',
4269
+ };
4270
+
4271
+ return string.replace(badChars, (chr) => escape[chr]);
4296
4272
  },
4297
4273
  // generates dropdown from select values
4298
4274
  dropdown: function (select, settings) {
@@ -4300,14 +4276,13 @@
4300
4276
  placeholder = select.placeholder || false,
4301
4277
  html = '',
4302
4278
  className = settings.className,
4303
- escape = settings.templates.escape,
4304
- deQuote = settings.templates.deQuote
4279
+ escape = settings.templates.escape
4305
4280
  ;
4306
4281
  html += '<i class="dropdown icon"></i>';
4307
4282
  html += placeholder
4308
4283
  ? '<div class="default text">' + escape(placeholder, settings) + '</div>'
4309
4284
  : '<div class="text"></div>';
4310
- html += '<div class="' + deQuote(className.menu) + '">';
4285
+ html += '<div class="' + escape(className.menu) + '">';
4311
4286
  html += settings.templates.menu(select, settings);
4312
4287
  html += '</div>';
4313
4288
 
@@ -4321,8 +4296,7 @@
4321
4296
  values = response[fields.values] || [],
4322
4297
  html = '',
4323
4298
  className = settings.className,
4324
- escape = settings.templates.escape,
4325
- deQuote = settings.templates.deQuote
4299
+ escape = settings.templates.escape
4326
4300
  ;
4327
4301
  $.each(values, function (index, option) {
4328
4302
  var
@@ -4338,14 +4312,14 @@
4338
4312
  for (dataKey in dataObject) {
4339
4313
  dataKeyEscaped = String(dataKey).replace(/\W/g, '');
4340
4314
  if (Object.prototype.hasOwnProperty.call(dataObject, dataKey) && ['text', 'value'].indexOf(dataKeyEscaped.toLowerCase()) === -1) {
4341
- maybeData += ' data-' + dataKeyEscaped + '="' + deQuote(String(dataObject[dataKey])) + '"';
4315
+ maybeData += ' data-' + dataKeyEscaped + '="' + escape(String(dataObject[dataKey])) + '"';
4342
4316
  }
4343
4317
  }
4344
4318
  }
4345
4319
  if (itemType === 'item' || isMenu) {
4346
4320
  var
4347
4321
  maybeText = option[fields.text]
4348
- ? ' data-text="' + deQuote(option[fields.text], true) + '"'
4322
+ ? ' data-text="' + escape(option[fields.text]) + '"'
4349
4323
  : '',
4350
4324
  maybeActionable = option[fields.actionable]
4351
4325
  ? className.actionable + ' '
@@ -4358,27 +4332,27 @@
4358
4332
  : '',
4359
4333
  hasDescription = escape(option[fields.description] || '', settings) !== ''
4360
4334
  ;
4361
- html += '<div class="' + deQuote(maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] || className.item)) + '" data-value="' + deQuote(option[fields.value], true) + '"' + maybeText + maybeData + '>';
4335
+ html += '<div class="' + escape(maybeActionable + maybeDisabled + maybeDescriptionVertical + (option[fields.class] || className.item)) + '" data-value="' + escape(option[fields.value]) + '"' + maybeText + maybeData + '>';
4362
4336
  if (isMenu) {
4363
4337
  html += '<i class="' + (itemType.indexOf('left') !== -1 ? 'left' : '') + ' dropdown icon"></i>';
4364
4338
  }
4365
4339
  if (option[fields.image]) {
4366
- html += '<img class="' + deQuote(option[fields.imageClass] || className.image) + '" src="' + deQuote(option[fields.image]) + (option[fields.alt] ? '" alt="' + deQuote(option[fields.alt]) : '') + '">';
4340
+ html += '<img class="' + escape(option[fields.imageClass] || className.image) + '" src="' + escape(option[fields.image]) + '"' + (option[fields.alt] ? ' alt="' + escape(option[fields.alt]) + '"' : '') + '>';
4367
4341
  }
4368
4342
  if (option[fields.icon]) {
4369
- html += '<i class="' + deQuote(option[fields.icon] + ' ' + (option[fields.iconClass] || className.icon)) + '"></i>';
4343
+ html += '<i class="' + escape(option[fields.icon] + ' ' + (option[fields.iconClass] || className.icon)) + '"></i>';
4370
4344
  }
4371
4345
  if (hasDescription) {
4372
- html += '<span class="' + deQuote(className.description) + '">' + escape(option[fields.description] || '', settings) + '</span>';
4373
- html += !isMenu ? '<span class="' + deQuote(className.text) + '">' : '';
4346
+ html += '<span class="' + escape(className.description) + '">' + escape(option[fields.description] || '', settings) + '</span>';
4347
+ html += !isMenu ? '<span class="' + escape(className.text) + '">' : '';
4374
4348
  }
4375
4349
  if (isMenu) {
4376
- html += '<span class="' + deQuote(className.text) + '">';
4350
+ html += '<span class="' + escape(className.text) + '">';
4377
4351
  }
4378
4352
  html += escape(option[fields.name] || '', settings);
4379
4353
  if (isMenu) {
4380
4354
  html += '</span>';
4381
- html += '<div class="' + deQuote(itemType) + '">';
4355
+ html += '<div class="' + escape(itemType) + '">';
4382
4356
  html += settings.templates.menu(option, settings);
4383
4357
  html += '</div>';
4384
4358
  } else if (hasDescription) {
@@ -4387,19 +4361,19 @@
4387
4361
  html += '</div>';
4388
4362
  } else if (itemType === 'header') {
4389
4363
  var
4390
- groupName = escape(option[fields.name] || '', settings),
4391
- groupIcon = deQuote(option[fields.icon] || className.groupIcon)
4364
+ groupName = option[fields.name] || '',
4365
+ groupIcon = option[fields.icon] || className.groupIcon
4392
4366
  ;
4393
4367
  if (groupName !== '' || groupIcon !== '') {
4394
- html += '<div class="' + deQuote(option[fields.class] || className.header) + '">';
4368
+ html += '<div class="' + escape(option[fields.class] || className.header) + '">';
4395
4369
  if (groupIcon !== '') {
4396
- html += '<i class="' + deQuote(groupIcon + ' ' + (option[fields.iconClass] || className.icon)) + '"></i>';
4370
+ html += '<i class="' + escape(groupIcon + ' ' + (option[fields.iconClass] || className.icon)) + '"></i>';
4397
4371
  }
4398
- html += groupName;
4372
+ html += escape(groupName, settings);
4399
4373
  html += '</div>';
4400
4374
  }
4401
4375
  if (option[fields.divider]) {
4402
- html += '<div class="' + deQuote(className.divider) + '"></div>';
4376
+ html += '<div class="' + escape(className.divider) + '"></div>';
4403
4377
  }
4404
4378
  }
4405
4379
  });
@@ -4411,11 +4385,10 @@
4411
4385
  label: function (value, text, settings) {
4412
4386
  var
4413
4387
  className = settings.className,
4414
- escape = settings.templates.escape,
4415
- deQuote = settings.templates.deQuote
4388
+ escape = settings.templates.escape
4416
4389
  ;
4417
4390
 
4418
- return escape(text, settings) + '<i class="' + deQuote(className.delete) + ' icon"></i>';
4391
+ return escape(text, settings) + '<i class="' + escape(className.delete) + ' icon"></i>';
4419
4392
  },
4420
4393
 
4421
4394
  // generates messages like "No results"
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.5+789e0d0 - Dropdown
2
+ * # Fomantic-UI 2.10.0-beta.7+13b1bae - Dropdown
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *