activeadmin 2.6.1 → 3.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (326) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +438 -9
  3. data/CONTRIBUTING.md +12 -36
  4. data/README.md +8 -8
  5. data/app/assets/javascripts/active_admin/base.js +27 -25
  6. data/app/assets/stylesheets/active_admin/_base.scss +53 -37
  7. data/app/assets/stylesheets/active_admin/_forms.scss +2 -13
  8. data/app/assets/stylesheets/active_admin/_header.scss +37 -3
  9. data/app/assets/stylesheets/active_admin/_normalize.scss +25 -123
  10. data/app/assets/stylesheets/active_admin/components/_comments.scss +2 -2
  11. data/app/assets/stylesheets/active_admin/components/_date_picker.scss +1 -2
  12. data/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss +7 -5
  13. data/app/assets/stylesheets/active_admin/components/_pagination.scss +5 -2
  14. data/app/assets/stylesheets/active_admin/components/_table_tools.scss +9 -6
  15. data/app/assets/stylesheets/active_admin/components/_tabs.scss +10 -7
  16. data/app/assets/stylesheets/active_admin/mixins/_buttons.scss +2 -2
  17. data/app/assets/stylesheets/active_admin/mixins/_variables.scss +12 -0
  18. data/app/assets/stylesheets/active_admin/pages/_logged_out.scss +1 -1
  19. data/app/assets/stylesheets/active_admin/structure/_footer.scss +6 -1
  20. data/app/assets/stylesheets/active_admin/structure/_title_bar.scss +6 -4
  21. data/app/javascript/active_admin/initializers/has-many.js +4 -1
  22. data/app/javascript/active_admin/initializers/per-page.js +1 -1
  23. data/app/javascript/active_admin/lib/checkbox-toggler.js +3 -3
  24. data/app/javascript/active_admin/lib/dropdown-menu.js +1 -1
  25. data/app/javascript/active_admin/lib/modal-dialog.js +7 -7
  26. data/app/javascript/active_admin/lib/per-page.js +1 -1
  27. data/app/javascript/active_admin/lib/table-checkbox-toggler.js +1 -1
  28. data/app/views/active_admin/devise/mailer/reset_password_instructions.html.erb +1 -1
  29. data/app/views/active_admin/devise/mailer/unlock_instructions.html.erb +2 -2
  30. data/app/views/active_admin/devise/shared/_links.erb +1 -1
  31. data/app/views/active_admin/page/index.html.arb +1 -0
  32. data/app/views/active_admin/resource/edit.html.arb +1 -0
  33. data/app/views/active_admin/resource/index.html.arb +1 -0
  34. data/app/views/active_admin/resource/new.html.arb +1 -0
  35. data/app/views/active_admin/resource/show.html.arb +1 -0
  36. data/app/views/layouts/active_admin.html.arb +1 -0
  37. data/app/views/layouts/active_admin_logged_out.html.erb +18 -7
  38. data/config/locales/ar.yml +6 -13
  39. data/config/locales/az.yml +0 -7
  40. data/config/locales/bg.yml +0 -7
  41. data/config/locales/bs.yml +0 -7
  42. data/config/locales/ca.yml +0 -7
  43. data/config/locales/cs.yml +0 -7
  44. data/config/locales/da.yml +0 -7
  45. data/config/locales/de-CH.yml +0 -7
  46. data/config/locales/de.yml +0 -8
  47. data/config/locales/el.yml +0 -7
  48. data/config/locales/en-CA.yml +0 -7
  49. data/config/locales/en-GB.yml +0 -7
  50. data/config/locales/en.yml +0 -8
  51. data/config/locales/eo.yml +0 -8
  52. data/config/locales/es-MX.yml +2 -8
  53. data/config/locales/es.yml +2 -10
  54. data/config/locales/fa.yml +0 -7
  55. data/config/locales/fi.yml +0 -7
  56. data/config/locales/fr.yml +3 -11
  57. data/config/locales/he.yml +0 -9
  58. data/config/locales/hr.yml +0 -7
  59. data/config/locales/hu.yml +0 -8
  60. data/config/locales/id.yml +0 -7
  61. data/config/locales/it.yml +18 -8
  62. data/config/locales/ja.yml +2 -10
  63. data/config/locales/ko.yml +1 -8
  64. data/config/locales/lt.yml +0 -8
  65. data/config/locales/lv.yml +0 -7
  66. data/config/locales/mk.yml +0 -8
  67. data/config/locales/nb.yml +0 -8
  68. data/config/locales/nl.yml +1 -9
  69. data/config/locales/pl.yml +0 -8
  70. data/config/locales/pt-BR.yml +0 -8
  71. data/config/locales/pt-PT.yml +0 -7
  72. data/config/locales/ro.yml +3 -9
  73. data/config/locales/ru.yml +0 -6
  74. data/config/locales/sk.yml +0 -8
  75. data/config/locales/sv-SE.yml +58 -39
  76. data/config/locales/tr.yml +0 -11
  77. data/config/locales/uk.yml +0 -6
  78. data/config/locales/vi.yml +38 -19
  79. data/config/locales/zh-CN.yml +34 -23
  80. data/config/locales/zh-TW.yml +0 -7
  81. data/lib/active_admin/abstract_view_factory.rb +1 -0
  82. data/lib/active_admin/application.rb +19 -19
  83. data/lib/active_admin/application_settings.rb +4 -3
  84. data/lib/active_admin/asset_registration.rb +4 -3
  85. data/lib/active_admin/authorization_adapter.rb +6 -3
  86. data/lib/active_admin/base_controller/authorization.rb +15 -13
  87. data/lib/active_admin/base_controller/menu.rb +1 -0
  88. data/lib/active_admin/base_controller.rb +6 -5
  89. data/lib/active_admin/batch_actions/controller.rb +4 -3
  90. data/lib/active_admin/batch_actions/resource_extension.rb +10 -8
  91. data/lib/active_admin/batch_actions/views/batch_action_form.rb +4 -3
  92. data/lib/active_admin/batch_actions/views/batch_action_selector.rb +7 -6
  93. data/lib/active_admin/batch_actions/views/selection_cells.rb +4 -3
  94. data/lib/active_admin/batch_actions.rb +1 -0
  95. data/lib/active_admin/callbacks.rb +1 -0
  96. data/lib/active_admin/cancan_adapter.rb +2 -1
  97. data/lib/active_admin/collection_decorator.rb +32 -0
  98. data/lib/active_admin/component.rb +1 -0
  99. data/lib/active_admin/controller_action.rb +1 -0
  100. data/lib/active_admin/csv_builder.rb +25 -17
  101. data/lib/active_admin/dependency.rb +12 -15
  102. data/lib/active_admin/devise.rb +16 -5
  103. data/lib/active_admin/dsl.rb +2 -1
  104. data/lib/active_admin/dynamic_setting.rb +1 -0
  105. data/lib/active_admin/dynamic_settings_node.rb +3 -2
  106. data/lib/active_admin/engine.rb +17 -9
  107. data/lib/active_admin/error.rb +1 -2
  108. data/lib/active_admin/filters/active.rb +2 -1
  109. data/lib/active_admin/filters/active_filter.rb +6 -6
  110. data/lib/active_admin/filters/active_sidebar.rb +4 -30
  111. data/lib/active_admin/filters/dsl.rb +1 -0
  112. data/lib/active_admin/filters/forms.rb +9 -8
  113. data/lib/active_admin/filters/formtastic_addons.rb +3 -7
  114. data/lib/active_admin/filters/resource_extension.rb +6 -5
  115. data/lib/active_admin/filters.rb +8 -7
  116. data/lib/active_admin/form_builder.rb +25 -20
  117. data/lib/active_admin/generators/boilerplate.rb +2 -1
  118. data/lib/active_admin/helpers/collection.rb +2 -0
  119. data/lib/active_admin/helpers/i18n.rb +1 -0
  120. data/lib/active_admin/helpers/optional_display.rb +3 -2
  121. data/lib/active_admin/helpers/routes/url_helpers.rb +1 -0
  122. data/lib/active_admin/helpers/scope_chain.rb +1 -0
  123. data/lib/active_admin/inputs/datepicker_input.rb +2 -1
  124. data/lib/active_admin/inputs/filters/base/search_method_select.rb +7 -6
  125. data/lib/active_admin/inputs/filters/base.rb +2 -1
  126. data/lib/active_admin/inputs/filters/boolean_input.rb +2 -1
  127. data/lib/active_admin/inputs/filters/check_boxes_input.rb +2 -1
  128. data/lib/active_admin/inputs/filters/date_picker_input.rb +1 -0
  129. data/lib/active_admin/inputs/filters/date_range_input.rb +3 -2
  130. data/lib/active_admin/inputs/filters/numeric_input.rb +2 -1
  131. data/lib/active_admin/inputs/filters/select_input.rb +5 -2
  132. data/lib/active_admin/inputs/filters/string_input.rb +2 -1
  133. data/lib/active_admin/inputs/filters/text_input.rb +1 -0
  134. data/lib/active_admin/inputs.rb +1 -0
  135. data/lib/active_admin/localizers/resource_localizer.rb +4 -3
  136. data/lib/active_admin/localizers.rb +2 -1
  137. data/lib/active_admin/menu.rb +8 -3
  138. data/lib/active_admin/menu_collection.rb +1 -0
  139. data/lib/active_admin/menu_item.rb +8 -7
  140. data/lib/active_admin/namespace.rb +16 -15
  141. data/lib/active_admin/namespace_settings.rb +9 -5
  142. data/lib/active_admin/order_clause.rb +2 -1
  143. data/lib/active_admin/orm/active_record/comments/comment.rb +12 -3
  144. data/lib/active_admin/orm/active_record/comments/namespace_helper.rb +1 -0
  145. data/lib/active_admin/orm/active_record/comments/resource_helper.rb +1 -0
  146. data/lib/active_admin/orm/active_record/comments/show_page_helper.rb +1 -0
  147. data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +21 -20
  148. data/lib/active_admin/orm/active_record/comments/views.rb +3 -2
  149. data/lib/active_admin/orm/active_record/comments.rb +28 -27
  150. data/lib/active_admin/orm/active_record.rb +2 -1
  151. data/lib/active_admin/orm/mongoid.rb +1 -0
  152. data/lib/active_admin/page.rb +2 -1
  153. data/lib/active_admin/page_controller.rb +1 -0
  154. data/lib/active_admin/page_dsl.rb +1 -0
  155. data/lib/active_admin/page_presenter.rb +1 -0
  156. data/lib/active_admin/pundit_adapter.rb +58 -16
  157. data/lib/active_admin/resource/action_items.rb +6 -5
  158. data/lib/active_admin/resource/attributes.rb +9 -1
  159. data/lib/active_admin/resource/belongs_to.rb +3 -2
  160. data/lib/active_admin/resource/controllers.rb +2 -1
  161. data/lib/active_admin/resource/includes.rb +1 -0
  162. data/lib/active_admin/resource/menu.rb +5 -4
  163. data/lib/active_admin/resource/model.rb +1 -0
  164. data/lib/active_admin/resource/naming.rb +5 -4
  165. data/lib/active_admin/resource/ordering.rb +1 -0
  166. data/lib/active_admin/resource/page_presenters.rb +1 -0
  167. data/lib/active_admin/resource/pagination.rb +1 -0
  168. data/lib/active_admin/resource/routes.rb +6 -7
  169. data/lib/active_admin/resource/scope_to.rb +8 -7
  170. data/lib/active_admin/resource/scopes.rb +1 -0
  171. data/lib/active_admin/resource/sidebars.rb +2 -1
  172. data/lib/active_admin/resource.rb +20 -19
  173. data/lib/active_admin/resource_collection.rb +1 -0
  174. data/lib/active_admin/resource_controller/action_builder.rb +1 -0
  175. data/lib/active_admin/resource_controller/data_access.rb +31 -5
  176. data/lib/active_admin/resource_controller/decorators.rb +7 -28
  177. data/lib/active_admin/resource_controller/polymorphic_routes.rb +1 -0
  178. data/lib/active_admin/resource_controller/resource_class_methods.rb +1 -0
  179. data/lib/active_admin/resource_controller/scoping.rb +1 -0
  180. data/lib/active_admin/resource_controller/sidebars.rb +1 -0
  181. data/lib/active_admin/resource_controller/streaming.rb +9 -7
  182. data/lib/active_admin/resource_controller.rb +13 -11
  183. data/lib/active_admin/resource_dsl.rb +11 -25
  184. data/lib/active_admin/router.rb +1 -0
  185. data/lib/active_admin/scope.rb +7 -6
  186. data/lib/active_admin/settings_node.rb +1 -0
  187. data/lib/active_admin/sidebar_section.rb +1 -0
  188. data/lib/active_admin/version.rb +2 -1
  189. data/lib/active_admin/view_factory.rb +18 -17
  190. data/lib/active_admin/view_helpers/active_admin_application_helper.rb +1 -0
  191. data/lib/active_admin/view_helpers/auto_link_helper.rb +2 -1
  192. data/lib/active_admin/view_helpers/breadcrumb_helper.rb +4 -3
  193. data/lib/active_admin/view_helpers/display_helper.rb +23 -8
  194. data/lib/active_admin/view_helpers/download_format_links_helper.rb +2 -1
  195. data/lib/active_admin/view_helpers/fields_for.rb +3 -2
  196. data/lib/active_admin/view_helpers/flash_helper.rb +1 -0
  197. data/lib/active_admin/view_helpers/form_helper.rb +1 -0
  198. data/lib/active_admin/view_helpers/method_or_proc_helper.rb +1 -0
  199. data/lib/active_admin/view_helpers/scope_name_helper.rb +1 -0
  200. data/lib/active_admin/view_helpers/sidebar_helper.rb +1 -0
  201. data/lib/active_admin/view_helpers/title_helper.rb +1 -0
  202. data/lib/active_admin/view_helpers/view_factory_helper.rb +1 -0
  203. data/lib/active_admin/view_helpers.rb +2 -1
  204. data/lib/active_admin/views/action_items.rb +1 -0
  205. data/lib/active_admin/views/components/active_admin_form.rb +8 -11
  206. data/lib/active_admin/views/components/active_filters_sidebar_content.rb +59 -0
  207. data/lib/active_admin/views/components/attributes_table.rb +6 -5
  208. data/lib/active_admin/views/components/blank_slate.rb +2 -1
  209. data/lib/active_admin/views/components/columns.rb +1 -0
  210. data/lib/active_admin/views/components/dropdown_menu.rb +7 -9
  211. data/lib/active_admin/views/components/index_list.rb +4 -3
  212. data/lib/active_admin/views/components/menu.rb +2 -1
  213. data/lib/active_admin/views/components/menu_item.rb +5 -4
  214. data/lib/active_admin/views/components/paginated_collection.rb +19 -18
  215. data/lib/active_admin/views/components/panel.rb +2 -1
  216. data/lib/active_admin/views/components/scopes.rb +8 -5
  217. data/lib/active_admin/views/components/sidebar.rb +1 -0
  218. data/lib/active_admin/views/components/sidebar_section.rb +1 -0
  219. data/lib/active_admin/views/components/site_title.rb +2 -1
  220. data/lib/active_admin/views/components/status_tag.rb +12 -11
  221. data/lib/active_admin/views/components/table_for.rb +18 -17
  222. data/lib/active_admin/views/components/tabs.rb +4 -3
  223. data/lib/active_admin/views/components/unsupported_browser.rb +1 -0
  224. data/lib/active_admin/views/footer.rb +3 -1
  225. data/lib/active_admin/views/header.rb +3 -2
  226. data/lib/active_admin/views/index_as_block.rb +1 -0
  227. data/lib/active_admin/views/index_as_blog.rb +2 -1
  228. data/lib/active_admin/views/index_as_grid.rb +2 -1
  229. data/lib/active_admin/views/index_as_table.rb +16 -19
  230. data/lib/active_admin/views/pages/base.rb +17 -11
  231. data/lib/active_admin/views/pages/form.rb +1 -0
  232. data/lib/active_admin/views/pages/index.rb +15 -13
  233. data/lib/active_admin/views/pages/layout.rb +1 -0
  234. data/lib/active_admin/views/pages/page.rb +1 -0
  235. data/lib/active_admin/views/pages/show.rb +2 -7
  236. data/lib/active_admin/views/tabbed_navigation.rb +3 -2
  237. data/lib/active_admin/views/title_bar.rb +2 -1
  238. data/lib/active_admin/views.rb +2 -1
  239. data/lib/active_admin.rb +63 -61
  240. data/lib/activeadmin.rb +2 -1
  241. data/lib/generators/active_admin/assets/assets_generator.rb +3 -2
  242. data/lib/generators/active_admin/assets/templates/active_admin.scss +2 -2
  243. data/lib/generators/active_admin/devise/devise_generator.rb +6 -5
  244. data/lib/generators/active_admin/install/install_generator.rb +15 -8
  245. data/lib/generators/active_admin/install/templates/active_admin.rb.erb +27 -3
  246. data/lib/generators/active_admin/install/templates/dashboard.rb +1 -0
  247. data/lib/generators/active_admin/page/page_generator.rb +2 -1
  248. data/lib/generators/active_admin/page/templates/page.rb +1 -0
  249. data/lib/generators/active_admin/resource/resource_generator.rb +4 -3
  250. data/lib/generators/active_admin/webpacker/plugins/jquery.js +7 -0
  251. data/lib/generators/active_admin/webpacker/templates/active_admin.js +5 -0
  252. data/lib/generators/active_admin/webpacker/templates/active_admin.scss +17 -0
  253. data/lib/generators/active_admin/webpacker/templates/print.scss +2 -0
  254. data/lib/generators/active_admin/webpacker/webpacker_generator.rb +27 -0
  255. data/vendor/assets/javascripts/jquery-ui/data.js +12 -8
  256. data/vendor/assets/javascripts/jquery-ui/disable-selection.js +10 -7
  257. data/vendor/assets/javascripts/jquery-ui/focusable.js +12 -9
  258. data/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js +60 -57
  259. data/vendor/assets/javascripts/jquery-ui/form.js +15 -12
  260. data/vendor/assets/javascripts/jquery-ui/ie.js +5 -2
  261. data/vendor/assets/javascripts/jquery-ui/keycode.js +11 -7
  262. data/vendor/assets/javascripts/jquery-ui/labels.js +46 -40
  263. data/vendor/assets/javascripts/jquery-ui/plugin.js +5 -2
  264. data/vendor/assets/javascripts/jquery-ui/position.js +30 -17
  265. data/vendor/assets/javascripts/jquery-ui/safe-active-element.js +6 -2
  266. data/vendor/assets/javascripts/jquery-ui/safe-blur.js +6 -2
  267. data/vendor/assets/javascripts/jquery-ui/scroll-parent.js +10 -7
  268. data/vendor/assets/javascripts/jquery-ui/tabbable.js +11 -8
  269. data/vendor/assets/javascripts/jquery-ui/unique-id.js +10 -7
  270. data/vendor/assets/javascripts/jquery-ui/version.js +6 -3
  271. data/vendor/assets/javascripts/jquery-ui/widget.js +53 -30
  272. data/vendor/assets/javascripts/jquery-ui/widgets/button.js +87 -24
  273. data/vendor/assets/javascripts/jquery-ui/widgets/checkboxradio.js +276 -273
  274. data/vendor/assets/javascripts/jquery-ui/widgets/controlgroup.js +15 -11
  275. data/vendor/assets/javascripts/jquery-ui/widgets/datepicker.js +182 -62
  276. data/vendor/assets/javascripts/jquery-ui/widgets/dialog.js +53 -36
  277. data/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +28 -19
  278. data/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +22 -11
  279. data/vendor/assets/javascripts/jquery-ui/widgets/resizable.js +47 -26
  280. data/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +186 -125
  281. data/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +20 -20
  282. metadata +48 -114
  283. data/docs/.gitignore +0 -1
  284. data/docs/0-installation.md +0 -118
  285. data/docs/1-general-configuration.md +0 -224
  286. data/docs/10-custom-pages.md +0 -150
  287. data/docs/11-decorators.md +0 -59
  288. data/docs/12-arbre-components.md +0 -214
  289. data/docs/13-authorization-adapter.md +0 -285
  290. data/docs/14-gotchas.md +0 -138
  291. data/docs/2-resource-customization.md +0 -466
  292. data/docs/3-index-pages/custom-index.md +0 -35
  293. data/docs/3-index-pages/index-as-block.md +0 -19
  294. data/docs/3-index-pages/index-as-blog.md +0 -69
  295. data/docs/3-index-pages/index-as-grid.md +0 -27
  296. data/docs/3-index-pages/index-as-table.md +0 -234
  297. data/docs/3-index-pages.md +0 -328
  298. data/docs/4-csv-format.md +0 -74
  299. data/docs/5-forms.md +0 -232
  300. data/docs/6-show-pages.md +0 -81
  301. data/docs/7-sidebars.md +0 -75
  302. data/docs/8-custom-actions.md +0 -177
  303. data/docs/9-batch-actions.md +0 -237
  304. data/docs/CNAME +0 -1
  305. data/docs/Gemfile +0 -3
  306. data/docs/Gemfile.lock +0 -248
  307. data/docs/README.md +0 -24
  308. data/docs/_config.yml +0 -4
  309. data/docs/_includes/footer.html +0 -8
  310. data/docs/_includes/google-analytics.html +0 -16
  311. data/docs/_includes/head.html +0 -7
  312. data/docs/_includes/toc.html +0 -98
  313. data/docs/_includes/top-menu.html +0 -17
  314. data/docs/_layouts/default.html +0 -21
  315. data/docs/documentation.md +0 -60
  316. data/docs/images/activeadmin.png +0 -0
  317. data/docs/images/code-header.png +0 -0
  318. data/docs/images/divider.png +0 -0
  319. data/docs/images/features.png +0 -0
  320. data/docs/images/tidelift.svg +0 -14
  321. data/docs/index.html +0 -226
  322. data/docs/stylesheets/main.css +0 -1205
  323. data/lib/active_admin/deprecation.rb +0 -10
  324. data/lib/ransack_ext.rb +0 -20
  325. data/vendor/assets/javascripts/jquery-ui/escape-selector.js +0 -23
  326. /data/app/assets/stylesheets/active_admin/{print.scss → _print.scss} +0 -0
@@ -1,27 +1,28 @@
1
1
  //= require jquery-ui/version
2
2
  //= require jquery-ui/keycode
3
3
 
4
- // jscs:disable maximumLineLength
5
- /* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
4
+ /* eslint-disable max-len, camelcase */
6
5
  /*!
7
- * jQuery UI Datepicker 1.12.1
8
- * http://jqueryui.com
6
+ * jQuery UI Datepicker 1.13.3
7
+ * https://jqueryui.com
9
8
  *
10
- * Copyright jQuery Foundation and other contributors
9
+ * Copyright OpenJS Foundation and other contributors
11
10
  * Released under the MIT license.
12
- * http://jquery.org/license
11
+ * https://jquery.org/license
13
12
  */
14
13
 
15
14
  //>>label: Datepicker
16
15
  //>>group: Widgets
17
16
  //>>description: Displays a calendar from an input or inline for selecting dates.
18
- //>>docs: http://api.jqueryui.com/datepicker/
19
- //>>demos: http://jqueryui.com/datepicker/
17
+ //>>docs: https://api.jqueryui.com/datepicker/
18
+ //>>demos: https://jqueryui.com/datepicker/
20
19
  //>>css.structure: ../../themes/base/core.css
21
20
  //>>css.structure: ../../themes/base/datepicker.css
22
21
  //>>css.theme: ../../themes/base/theme.css
23
22
 
24
23
  ( function( factory ) {
24
+ "use strict";
25
+
25
26
  if ( typeof define === "function" && define.amd ) {
26
27
 
27
28
  // AMD. Register as an anonymous module.
@@ -35,9 +36,10 @@
35
36
  // Browser globals
36
37
  factory( jQuery );
37
38
  }
38
- }( function( $ ) {
39
+ } )( function( $ ) {
40
+ "use strict";
39
41
 
40
- $.extend( $.ui, { datepicker: { version: "1.12.1" } } );
42
+ $.extend( $.ui, { datepicker: { version: "1.13.3" } } );
41
43
 
42
44
  var datepicker_instActive;
43
45
 
@@ -65,6 +67,7 @@ function datepicker_getZindex( elem ) {
65
67
 
66
68
  return 0;
67
69
  }
70
+
68
71
  /* Date picker manager.
69
72
  Use the singleton instance of this class, $.datepicker, to interact with the date picker.
70
73
  Settings for (groups of) date pickers are maintained in an instance object,
@@ -91,18 +94,20 @@ function Datepicker() {
91
94
  prevText: "Prev", // Display text for previous month link
92
95
  nextText: "Next", // Display text for next month link
93
96
  currentText: "Today", // Display text for current month link
94
- monthNames: [ "January","February","March","April","May","June",
95
- "July","August","September","October","November","December" ], // Names of months for drop-down and formatting
97
+ monthNames: [ "January", "February", "March", "April", "May", "June",
98
+ "July", "August", "September", "October", "November", "December" ], // Names of months for drop-down and formatting
96
99
  monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], // For formatting
97
100
  dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], // For formatting
98
101
  dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], // For formatting
99
- dayNamesMin: [ "Su","Mo","Tu","We","Th","Fr","Sa" ], // Column headings for days starting at Sunday
102
+ dayNamesMin: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ], // Column headings for days starting at Sunday
100
103
  weekHeader: "Wk", // Column header for week of the year
101
104
  dateFormat: "mm/dd/yy", // See format options on parseDate
102
105
  firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
103
106
  isRTL: false, // True if right-to-left language, false if left-to-right
104
107
  showMonthAfterYear: false, // True if the year select precedes month, false for month then year
105
- yearSuffix: "" // Additional text to append to the year in the month headers
108
+ yearSuffix: "", // Additional text to append to the year in the month headers,
109
+ selectMonthLabel: "Select month", // Invisible label for month selector
110
+ selectYearLabel: "Select year" // Invisible label for year selector
106
111
  };
107
112
  this._defaults = { // Global defaults for all the date picker instances
108
113
  showOn: "focus", // "focus" for popup on focus,
@@ -143,6 +148,7 @@ function Datepicker() {
143
148
  onSelect: null, // Define a callback function when a date is selected
144
149
  onChangeMonthYear: null, // Define a callback function when the month or year is changed
145
150
  onClose: null, // Define a callback function when the datepicker is closed
151
+ onUpdateDatepicker: null, // Define a callback function when the datepicker is updated
146
152
  numberOfMonths: 1, // Number of months to show at a time
147
153
  showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
148
154
  stepMonths: 1, // Number of months to step back/forward
@@ -161,6 +167,7 @@ function Datepicker() {
161
167
  }
162
168
 
163
169
  $.extend( Datepicker.prototype, {
170
+
164
171
  /* Class name added to elements to indicate already configured with a date picker. */
165
172
  markerClassName: "hasDatepicker",
166
173
 
@@ -243,7 +250,9 @@ $.extend( Datepicker.prototype, {
243
250
  inst.append.remove();
244
251
  }
245
252
  if ( appendText ) {
246
- inst.append = $( "<span class='" + this._appendClass + "'>" + appendText + "</span>" );
253
+ inst.append = $( "<span>" )
254
+ .addClass( this._appendClass )
255
+ .text( appendText );
247
256
  input[ isRTL ? "before" : "after" ]( inst.append );
248
257
  }
249
258
 
@@ -260,12 +269,32 @@ $.extend( Datepicker.prototype, {
260
269
  if ( showOn === "button" || showOn === "both" ) { // pop-up date picker when button clicked
261
270
  buttonText = this._get( inst, "buttonText" );
262
271
  buttonImage = this._get( inst, "buttonImage" );
263
- inst.trigger = $( this._get( inst, "buttonImageOnly" ) ?
264
- $( "<img/>" ).addClass( this._triggerClass ).
265
- attr( { src: buttonImage, alt: buttonText, title: buttonText } ) :
266
- $( "<button type='button'></button>" ).addClass( this._triggerClass ).
267
- html( !buttonImage ? buttonText : $( "<img/>" ).attr(
268
- { src:buttonImage, alt:buttonText, title:buttonText } ) ) );
272
+
273
+ if ( this._get( inst, "buttonImageOnly" ) ) {
274
+ inst.trigger = $( "<img>" )
275
+ .addClass( this._triggerClass )
276
+ .attr( {
277
+ src: buttonImage,
278
+ alt: buttonText,
279
+ title: buttonText
280
+ } );
281
+ } else {
282
+ inst.trigger = $( "<button type='button'>" )
283
+ .addClass( this._triggerClass );
284
+ if ( buttonImage ) {
285
+ inst.trigger.html(
286
+ $( "<img>" )
287
+ .attr( {
288
+ src: buttonImage,
289
+ alt: buttonText,
290
+ title: buttonText
291
+ } )
292
+ );
293
+ } else {
294
+ inst.trigger.text( buttonText );
295
+ }
296
+ }
297
+
269
298
  input[ isRTL ? "before" : "after" ]( inst.trigger );
270
299
  inst.trigger.on( "click", function() {
271
300
  if ( $.datepicker._datepickerShowing && $.datepicker._lastInput === input[ 0 ] ) {
@@ -327,7 +356,7 @@ $.extend( Datepicker.prototype, {
327
356
  }
328
357
 
329
358
  // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
330
- // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
359
+ // https://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
331
360
  inst.dpDiv.css( "display", "block" );
332
361
  },
333
362
 
@@ -411,6 +440,7 @@ $.extend( Datepicker.prototype, {
411
440
 
412
441
  if ( datepicker_instActive === inst ) {
413
442
  datepicker_instActive = null;
443
+ this._curInst = null;
414
444
  }
415
445
  },
416
446
 
@@ -430,7 +460,9 @@ $.extend( Datepicker.prototype, {
430
460
  if ( nodeName === "input" ) {
431
461
  target.disabled = false;
432
462
  inst.trigger.filter( "button" ).
433
- each( function() { this.disabled = false; } ).end().
463
+ each( function() {
464
+ this.disabled = false;
465
+ } ).end().
434
466
  filter( "img" ).css( { opacity: "1.0", cursor: "" } );
435
467
  } else if ( nodeName === "div" || nodeName === "span" ) {
436
468
  inline = $target.children( "." + this._inlineClass );
@@ -439,7 +471,11 @@ $.extend( Datepicker.prototype, {
439
471
  prop( "disabled", false );
440
472
  }
441
473
  this._disabledInputs = $.map( this._disabledInputs,
442
- function( value ) { return ( value === target ? null : value ); } ); // delete entry
474
+
475
+ // Delete entry
476
+ function( value ) {
477
+ return ( value === target ? null : value );
478
+ } );
443
479
  },
444
480
 
445
481
  /* Disable the date picker to a jQuery selection.
@@ -458,7 +494,9 @@ $.extend( Datepicker.prototype, {
458
494
  if ( nodeName === "input" ) {
459
495
  target.disabled = true;
460
496
  inst.trigger.filter( "button" ).
461
- each( function() { this.disabled = true; } ).end().
497
+ each( function() {
498
+ this.disabled = true;
499
+ } ).end().
462
500
  filter( "img" ).css( { opacity: "0.5", cursor: "default" } );
463
501
  } else if ( nodeName === "div" || nodeName === "span" ) {
464
502
  inline = $target.children( "." + this._inlineClass );
@@ -467,7 +505,11 @@ $.extend( Datepicker.prototype, {
467
505
  prop( "disabled", true );
468
506
  }
469
507
  this._disabledInputs = $.map( this._disabledInputs,
470
- function( value ) { return ( value === target ? null : value ); } ); // delete entry
508
+
509
+ // Delete entry
510
+ function( value ) {
511
+ return ( value === target ? null : value );
512
+ } );
471
513
  this._disabledInputs[ this._disabledInputs.length ] = target;
472
514
  },
473
515
 
@@ -495,8 +537,7 @@ $.extend( Datepicker.prototype, {
495
537
  _getInst: function( target ) {
496
538
  try {
497
539
  return $.data( target, "datepicker" );
498
- }
499
- catch ( err ) {
540
+ } catch ( err ) {
500
541
  throw "Missing instance data for this datepicker";
501
542
  }
502
543
  },
@@ -729,8 +770,7 @@ $.extend( Datepicker.prototype, {
729
770
  $.datepicker._updateAlternate( inst );
730
771
  $.datepicker._updateDatepicker( inst );
731
772
  }
732
- }
733
- catch ( err ) {
773
+ } catch ( err ) {
734
774
  }
735
775
  }
736
776
  return true;
@@ -835,7 +875,8 @@ $.extend( Datepicker.prototype, {
835
875
  numMonths = this._getNumberOfMonths( inst ),
836
876
  cols = numMonths[ 1 ],
837
877
  width = 17,
838
- activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
878
+ activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" ),
879
+ onUpdateDatepicker = $.datepicker._get( inst, "onUpdateDatepicker" );
839
880
 
840
881
  if ( activeCell.length > 0 ) {
841
882
  datepicker_handleMouseover.apply( activeCell.get( 0 ) );
@@ -861,11 +902,15 @@ $.extend( Datepicker.prototype, {
861
902
 
862
903
  //assure that inst.yearshtml didn't change.
863
904
  if ( origyearshtml === inst.yearshtml && inst.yearshtml ) {
864
- inst.dpDiv.find( "select.ui-datepicker-year:first" ).replaceWith( inst.yearshtml );
905
+ inst.dpDiv.find( "select.ui-datepicker-year" ).first().replaceWith( inst.yearshtml );
865
906
  }
866
907
  origyearshtml = inst.yearshtml = null;
867
908
  }, 0 );
868
909
  }
910
+
911
+ if ( onUpdateDatepicker ) {
912
+ onUpdateDatepicker.apply( ( inst.input ? inst.input[ 0 ] : null ), [ inst ] );
913
+ }
869
914
  },
870
915
 
871
916
  // #6694 - don't focus the input if it's already focused
@@ -903,7 +948,7 @@ $.extend( Datepicker.prototype, {
903
948
  inst = this._getInst( obj ),
904
949
  isRTL = this._get( inst, "isRTL" );
905
950
 
906
- while ( obj && ( obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden( obj ) ) ) {
951
+ while ( obj && ( obj.type === "hidden" || obj.nodeType !== 1 || $.expr.pseudos.hidden( obj ) ) ) {
907
952
  obj = obj[ isRTL ? "previousSibling" : "nextSibling" ];
908
953
  }
909
954
 
@@ -991,9 +1036,7 @@ $.extend( Datepicker.prototype, {
991
1036
  if ( this._isDisabledDatepicker( target[ 0 ] ) ) {
992
1037
  return;
993
1038
  }
994
- this._adjustInstDate( inst, offset +
995
- ( period === "M" ? this._get( inst, "showCurrentAtPos" ) : 0 ), // undo positioning
996
- period );
1039
+ this._adjustInstDate( inst, offset, period );
997
1040
  this._updateDatepicker( inst );
998
1041
  },
999
1042
 
@@ -1040,7 +1083,7 @@ $.extend( Datepicker.prototype, {
1040
1083
  }
1041
1084
 
1042
1085
  inst = this._getInst( target[ 0 ] );
1043
- inst.selectedDay = inst.currentDay = $( "a", td ).html();
1086
+ inst.selectedDay = inst.currentDay = parseInt( $( "a", td ).attr( "data-date" ) );
1044
1087
  inst.selectedMonth = inst.currentMonth = month;
1045
1088
  inst.selectedYear = inst.currentYear = year;
1046
1089
  this._selectDate( id, this._formatDate( inst,
@@ -1093,7 +1136,7 @@ $.extend( Datepicker.prototype, {
1093
1136
  altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" );
1094
1137
  date = this._getDate( inst );
1095
1138
  dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) );
1096
- $( altField ).val( dateStr );
1139
+ $( document ).find( altField ).val( dateStr );
1097
1140
  }
1098
1141
  },
1099
1142
 
@@ -1532,8 +1575,7 @@ $.extend( Datepicker.prototype, {
1532
1575
  try {
1533
1576
  return $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
1534
1577
  offset, $.datepicker._getFormatConfig( inst ) );
1535
- }
1536
- catch ( e ) {
1578
+ } catch ( e ) {
1537
1579
 
1538
1580
  // Ignore
1539
1581
  }
@@ -1707,32 +1749,104 @@ $.extend( Datepicker.prototype, {
1707
1749
  this._daylightSavingAdjust( new Date( drawYear, drawMonth - stepMonths, 1 ) ),
1708
1750
  this._getFormatConfig( inst ) ) );
1709
1751
 
1710
- prev = ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ?
1711
- "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
1712
- " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w" ) + "'>" + prevText + "</span></a>" :
1713
- ( hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w" ) + "'>" + prevText + "</span></a>" ) );
1752
+ if ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ) {
1753
+ prev = $( "<a>" )
1754
+ .attr( {
1755
+ "class": "ui-datepicker-prev ui-corner-all",
1756
+ "data-handler": "prev",
1757
+ "data-event": "click",
1758
+ title: prevText
1759
+ } )
1760
+ .append(
1761
+ $( "<span>" )
1762
+ .addClass( "ui-icon ui-icon-circle-triangle-" +
1763
+ ( isRTL ? "e" : "w" ) )
1764
+ .text( prevText )
1765
+ )[ 0 ].outerHTML;
1766
+ } else if ( hideIfNoPrevNext ) {
1767
+ prev = "";
1768
+ } else {
1769
+ prev = $( "<a>" )
1770
+ .attr( {
1771
+ "class": "ui-datepicker-prev ui-corner-all ui-state-disabled",
1772
+ title: prevText
1773
+ } )
1774
+ .append(
1775
+ $( "<span>" )
1776
+ .addClass( "ui-icon ui-icon-circle-triangle-" +
1777
+ ( isRTL ? "e" : "w" ) )
1778
+ .text( prevText )
1779
+ )[ 0 ].outerHTML;
1780
+ }
1714
1781
 
1715
1782
  nextText = this._get( inst, "nextText" );
1716
1783
  nextText = ( !navigationAsDateFormat ? nextText : this.formatDate( nextText,
1717
1784
  this._daylightSavingAdjust( new Date( drawYear, drawMonth + stepMonths, 1 ) ),
1718
1785
  this._getFormatConfig( inst ) ) );
1719
1786
 
1720
- next = ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ?
1721
- "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
1722
- " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e" ) + "'>" + nextText + "</span></a>" :
1723
- ( hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e" ) + "'>" + nextText + "</span></a>" ) );
1787
+ if ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ) {
1788
+ next = $( "<a>" )
1789
+ .attr( {
1790
+ "class": "ui-datepicker-next ui-corner-all",
1791
+ "data-handler": "next",
1792
+ "data-event": "click",
1793
+ title: nextText
1794
+ } )
1795
+ .append(
1796
+ $( "<span>" )
1797
+ .addClass( "ui-icon ui-icon-circle-triangle-" +
1798
+ ( isRTL ? "w" : "e" ) )
1799
+ .text( nextText )
1800
+ )[ 0 ].outerHTML;
1801
+ } else if ( hideIfNoPrevNext ) {
1802
+ next = "";
1803
+ } else {
1804
+ next = $( "<a>" )
1805
+ .attr( {
1806
+ "class": "ui-datepicker-next ui-corner-all ui-state-disabled",
1807
+ title: nextText
1808
+ } )
1809
+ .append(
1810
+ $( "<span>" )
1811
+ .attr( "class", "ui-icon ui-icon-circle-triangle-" +
1812
+ ( isRTL ? "w" : "e" ) )
1813
+ .text( nextText )
1814
+ )[ 0 ].outerHTML;
1815
+ }
1724
1816
 
1725
1817
  currentText = this._get( inst, "currentText" );
1726
1818
  gotoDate = ( this._get( inst, "gotoCurrent" ) && inst.currentDay ? currentDate : today );
1727
1819
  currentText = ( !navigationAsDateFormat ? currentText :
1728
1820
  this.formatDate( currentText, gotoDate, this._getFormatConfig( inst ) ) );
1729
1821
 
1730
- controls = ( !inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
1731
- this._get( inst, "closeText" ) + "</button>" : "" );
1732
-
1733
- buttonPanel = ( showButtonPanel ) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + ( isRTL ? controls : "" ) +
1734
- ( this._isInRange( inst, gotoDate ) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
1735
- ">" + currentText + "</button>" : "" ) + ( isRTL ? "" : controls ) + "</div>" : "";
1822
+ controls = "";
1823
+ if ( !inst.inline ) {
1824
+ controls = $( "<button>" )
1825
+ .attr( {
1826
+ type: "button",
1827
+ "class": "ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all",
1828
+ "data-handler": "hide",
1829
+ "data-event": "click"
1830
+ } )
1831
+ .text( this._get( inst, "closeText" ) )[ 0 ].outerHTML;
1832
+ }
1833
+
1834
+ buttonPanel = "";
1835
+ if ( showButtonPanel ) {
1836
+ buttonPanel = $( "<div class='ui-datepicker-buttonpane ui-widget-content'>" )
1837
+ .append( isRTL ? controls : "" )
1838
+ .append( this._isInRange( inst, gotoDate ) ?
1839
+ $( "<button>" )
1840
+ .attr( {
1841
+ type: "button",
1842
+ "class": "ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all",
1843
+ "data-handler": "today",
1844
+ "data-event": "click"
1845
+ } )
1846
+ .text( currentText ) :
1847
+ "" )
1848
+ .append( isRTL ? "" : controls )[ 0 ].outerHTML;
1849
+ }
1736
1850
 
1737
1851
  firstDay = parseInt( this._get( inst, "firstDay" ), 10 );
1738
1852
  firstDay = ( isNaN( firstDay ) ? 0 : firstDay );
@@ -1820,7 +1934,9 @@ $.extend( Datepicker.prototype, {
1820
1934
  ( printDate.getTime() === today.getTime() ? " ui-state-highlight" : "" ) +
1821
1935
  ( printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "" ) + // highlight selected day
1822
1936
  ( otherMonth ? " ui-priority-secondary" : "" ) + // distinguish dates from other months
1823
- "' href='#'>" + printDate.getDate() + "</a>" ) ) + "</td>"; // display selectable date
1937
+ "' href='#' aria-current='" + ( printDate.getTime() === currentDate.getTime() ? "true" : "false" ) + // mark date as selected for screen reader
1938
+ "' data-date='" + printDate.getDate() + // store date as data
1939
+ "'>" + printDate.getDate() + "</a>" ) ) + "</td>"; // display selectable date
1824
1940
  printDate.setDate( printDate.getDate() + 1 );
1825
1941
  printDate = this._daylightSavingAdjust( printDate );
1826
1942
  }
@@ -1850,6 +1966,8 @@ $.extend( Datepicker.prototype, {
1850
1966
  changeMonth = this._get( inst, "changeMonth" ),
1851
1967
  changeYear = this._get( inst, "changeYear" ),
1852
1968
  showMonthAfterYear = this._get( inst, "showMonthAfterYear" ),
1969
+ selectMonthLabel = this._get( inst, "selectMonthLabel" ),
1970
+ selectYearLabel = this._get( inst, "selectYearLabel" ),
1853
1971
  html = "<div class='ui-datepicker-title'>",
1854
1972
  monthHtml = "";
1855
1973
 
@@ -1859,7 +1977,7 @@ $.extend( Datepicker.prototype, {
1859
1977
  } else {
1860
1978
  inMinYear = ( minDate && minDate.getFullYear() === drawYear );
1861
1979
  inMaxYear = ( maxDate && maxDate.getFullYear() === drawYear );
1862
- monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
1980
+ monthHtml += "<select class='ui-datepicker-month' aria-label='" + selectMonthLabel + "' data-handler='selectMonth' data-event='change'>";
1863
1981
  for ( month = 0; month < 12; month++ ) {
1864
1982
  if ( ( !inMinYear || month >= minDate.getMonth() ) && ( !inMaxYear || month <= maxDate.getMonth() ) ) {
1865
1983
  monthHtml += "<option value='" + month + "'" +
@@ -1894,7 +2012,7 @@ $.extend( Datepicker.prototype, {
1894
2012
  endYear = Math.max( year, determineYear( years[ 1 ] || "" ) );
1895
2013
  year = ( minDate ? Math.max( year, minDate.getFullYear() ) : year );
1896
2014
  endYear = ( maxDate ? Math.min( endYear, maxDate.getFullYear() ) : endYear );
1897
- inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
2015
+ inst.yearshtml += "<select class='ui-datepicker-year' aria-label='" + selectYearLabel + "' data-handler='selectYear' data-event='change'>";
1898
2016
  for ( ; year <= endYear; year++ ) {
1899
2017
  inst.yearshtml += "<option value='" + year + "'" +
1900
2018
  ( year === drawYear ? " selected='selected'" : "" ) +
@@ -2106,18 +2224,20 @@ $.fn.datepicker = function( options ) {
2106
2224
  apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );
2107
2225
  }
2108
2226
  return this.each( function() {
2109
- typeof options === "string" ?
2110
- $.datepicker[ "_" + options + "Datepicker" ].
2111
- apply( $.datepicker, [ this ].concat( otherArgs ) ) :
2227
+ if ( typeof options === "string" ) {
2228
+ $.datepicker[ "_" + options + "Datepicker" ]
2229
+ .apply( $.datepicker, [ this ].concat( otherArgs ) );
2230
+ } else {
2112
2231
  $.datepicker._attachDatepicker( this, options );
2232
+ }
2113
2233
  } );
2114
2234
  };
2115
2235
 
2116
2236
  $.datepicker = new Datepicker(); // singleton instance
2117
2237
  $.datepicker.initialized = false;
2118
2238
  $.datepicker.uuid = new Date().getTime();
2119
- $.datepicker.version = "1.12.1";
2239
+ $.datepicker.version = "1.13.3";
2120
2240
 
2121
2241
  return $.datepicker;
2122
2242
 
2123
- } ) );
2243
+ } );
@@ -13,24 +13,26 @@
13
13
  //= require jquery-ui/widget
14
14
 
15
15
  /*!
16
- * jQuery UI Dialog 1.12.1
17
- * http://jqueryui.com
16
+ * jQuery UI Dialog 1.13.3
17
+ * https://jqueryui.com
18
18
  *
19
- * Copyright jQuery Foundation and other contributors
19
+ * Copyright OpenJS Foundation and other contributors
20
20
  * Released under the MIT license.
21
- * http://jquery.org/license
21
+ * https://jquery.org/license
22
22
  */
23
23
 
24
24
  //>>label: Dialog
25
25
  //>>group: Widgets
26
26
  //>>description: Displays customizable dialog windows.
27
- //>>docs: http://api.jqueryui.com/dialog/
28
- //>>demos: http://jqueryui.com/dialog/
27
+ //>>docs: https://api.jqueryui.com/dialog/
28
+ //>>demos: https://jqueryui.com/dialog/
29
29
  //>>css.structure: ../../themes/base/core.css
30
30
  //>>css.structure: ../../themes/base/dialog.css
31
31
  //>>css.theme: ../../themes/base/theme.css
32
32
 
33
33
  ( function( factory ) {
34
+ "use strict";
35
+
34
36
  if ( typeof define === "function" && define.amd ) {
35
37
 
36
38
  // AMD. Register as an anonymous module.
@@ -55,10 +57,11 @@
55
57
  // Browser globals
56
58
  factory( jQuery );
57
59
  }
58
- }( function( $ ) {
60
+ } )( function( $ ) {
61
+ "use strict";
59
62
 
60
63
  $.widget( "ui.dialog", {
61
- version: "1.12.1",
64
+ version: "1.13.3",
62
65
  options: {
63
66
  appendTo: "body",
64
67
  autoOpen: true,
@@ -303,7 +306,7 @@ $.widget( "ui.dialog", {
303
306
  that._trigger( "focus" );
304
307
  } );
305
308
 
306
- // Track the dialog immediately upon openening in case a focus event
309
+ // Track the dialog immediately upon opening in case a focus event
307
310
  // somehow occurs outside of the dialog before an element inside the
308
311
  // dialog is focused (#10152)
309
312
  this._makeFocusTarget();
@@ -339,22 +342,23 @@ $.widget( "ui.dialog", {
339
342
  hasFocus.eq( 0 ).trigger( "focus" );
340
343
  },
341
344
 
342
- _keepFocus: function( event ) {
343
- function checkFocus() {
344
- var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
345
- isActive = this.uiDialog[ 0 ] === activeElement ||
346
- $.contains( this.uiDialog[ 0 ], activeElement );
347
- if ( !isActive ) {
348
- this._focusTabbable();
349
- }
345
+ _restoreTabbableFocus: function() {
346
+ var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
347
+ isActive = this.uiDialog[ 0 ] === activeElement ||
348
+ $.contains( this.uiDialog[ 0 ], activeElement );
349
+ if ( !isActive ) {
350
+ this._focusTabbable();
350
351
  }
352
+ },
353
+
354
+ _keepFocus: function( event ) {
351
355
  event.preventDefault();
352
- checkFocus.call( this );
356
+ this._restoreTabbableFocus();
353
357
 
354
358
  // support: IE
355
359
  // IE <= 8 doesn't prevent moving focus even with event.preventDefault()
356
360
  // so we check again later
357
- this._delay( checkFocus );
361
+ this._delay( this._restoreTabbableFocus );
358
362
  },
359
363
 
360
364
  _createWrapper: function() {
@@ -383,8 +387,8 @@ $.widget( "ui.dialog", {
383
387
  return;
384
388
  }
385
389
  var tabbables = this.uiDialog.find( ":tabbable" ),
386
- first = tabbables.filter( ":first" ),
387
- last = tabbables.filter( ":last" );
390
+ first = tabbables.first(),
391
+ last = tabbables.last();
388
392
 
389
393
  if ( ( event.target === last[ 0 ] || event.target === this.uiDialog[ 0 ] ) &&
390
394
  !event.shiftKey ) {
@@ -495,14 +499,14 @@ $.widget( "ui.dialog", {
495
499
  this.uiDialogButtonPane.remove();
496
500
  this.uiButtonSet.empty();
497
501
 
498
- if ( $.isEmptyObject( buttons ) || ( $.isArray( buttons ) && !buttons.length ) ) {
502
+ if ( $.isEmptyObject( buttons ) || ( Array.isArray( buttons ) && !buttons.length ) ) {
499
503
  this._removeClass( this.uiDialog, "ui-dialog-buttons" );
500
504
  return;
501
505
  }
502
506
 
503
507
  $.each( buttons, function( name, props ) {
504
508
  var click, buttonOptions;
505
- props = $.isFunction( props ) ?
509
+ props = typeof props === "function" ?
506
510
  { click: props, text: name } :
507
511
  props;
508
512
 
@@ -867,6 +871,8 @@ $.widget( "ui.dialog", {
867
871
  return;
868
872
  }
869
873
 
874
+ var jqMinor = $.fn.jquery.substring( 0, 4 );
875
+
870
876
  // We use a delay in case the overlay is created from an
871
877
  // event that we're going to be cancelling (#2804)
872
878
  var isOpening = true;
@@ -877,20 +883,31 @@ $.widget( "ui.dialog", {
877
883
  if ( !this.document.data( "ui-dialog-overlays" ) ) {
878
884
 
879
885
  // Prevent use of anchors and inputs
880
- // Using _on() for an event handler shared across many instances is
881
- // safe because the dialogs stack and must be closed in reverse order
882
- this._on( this.document, {
883
- focusin: function( event ) {
884
- if ( isOpening ) {
885
- return;
886
- }
886
+ // This doesn't use `_on()` because it is a shared event handler
887
+ // across all open modal dialogs.
888
+ this.document.on( "focusin.ui-dialog", function( event ) {
889
+ if ( isOpening ) {
890
+ return;
891
+ }
887
892
 
888
- if ( !this._allowInteraction( event ) ) {
889
- event.preventDefault();
890
- this._trackingInstances()[ 0 ]._focusTabbable();
893
+ var instance = this._trackingInstances()[ 0 ];
894
+ if ( !instance._allowInteraction( event ) ) {
895
+ event.preventDefault();
896
+ instance._focusTabbable();
897
+
898
+ // Support: jQuery >=3.4 <3.7 only
899
+ // In jQuery 3.4-3.6, there are multiple issues with focus/blur
900
+ // trigger chains or when triggering is done on a hidden element
901
+ // at least once.
902
+ // Trigger focus in a delay in addition if needed to avoid the issues.
903
+ // See https://github.com/jquery/jquery/issues/4382
904
+ // See https://github.com/jquery/jquery/issues/4856
905
+ // See https://github.com/jquery/jquery/issues/4950
906
+ if ( jqMinor === "3.4." || jqMinor === "3.5." || jqMinor === "3.6." ) {
907
+ instance._delay( instance._restoreTabbableFocus );
891
908
  }
892
909
  }
893
- } );
910
+ }.bind( this ) );
894
911
  }
895
912
 
896
913
  this.overlay = $( "<div>" )
@@ -913,7 +930,7 @@ $.widget( "ui.dialog", {
913
930
  var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
914
931
 
915
932
  if ( !overlays ) {
916
- this._off( this.document, "focusin" );
933
+ this.document.off( "focusin.ui-dialog" );
917
934
  this.document.removeData( "ui-dialog-overlays" );
918
935
  } else {
919
936
  this.document.data( "ui-dialog-overlays", overlays );
@@ -951,4 +968,4 @@ if ( $.uiBackCompat !== false ) {
951
968
 
952
969
  return $.ui.dialog;
953
970
 
954
- } ) );
971
+ } );