effective_datatables 3.7.10 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +5 -5
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +32 -32
  4. data/app/assets/images/dataTables/sort-down.svg +1 -0
  5. data/app/assets/images/dataTables/sort-up.svg +1 -0
  6. data/app/assets/images/dataTables/sort.svg +1 -0
  7. data/app/assets/javascripts/dataTables/buttons/{buttons.bootstrap.js → buttons.bootstrap4.js} +7 -15
  8. data/app/assets/javascripts/dataTables/dataTables.bootstrap4.js +184 -0
  9. data/app/assets/javascripts/dataTables/responsive/dataTables.responsive.js +30 -11
  10. data/app/assets/javascripts/dataTables/responsive/{responsive.bootstrap.js → responsive.bootstrap4.js} +6 -6
  11. data/app/assets/javascripts/effective_datatables/bulk_actions.js.coffee +43 -43
  12. data/app/assets/javascripts/effective_datatables/events.js.coffee +7 -4
  13. data/app/assets/javascripts/effective_datatables/filters.js.coffee +0 -1
  14. data/app/assets/javascripts/effective_datatables/initialize.js.coffee +45 -49
  15. data/app/assets/javascripts/effective_datatables/overrides.js +12 -0
  16. data/app/assets/javascripts/effective_datatables/reset.js.coffee +1 -1
  17. data/app/assets/javascripts/effective_datatables.js +4 -4
  18. data/app/assets/stylesheets/dataTables/buttons/{buttons.bootstrap.scss → buttons.bootstrap4.css} +68 -1
  19. data/app/assets/stylesheets/dataTables/{dataTables.bootstrap.scss → dataTables.bootstrap4.css} +44 -29
  20. data/app/assets/stylesheets/dataTables/responsive/{responsive.bootstrap.scss → responsive.bootstrap4.css} +3 -3
  21. data/app/assets/stylesheets/effective_datatables/_overrides.scss +72 -152
  22. data/app/assets/stylesheets/effective_datatables.scss +3 -4
  23. data/app/controllers/effective/datatables_controller.rb +6 -39
  24. data/app/helpers/effective_datatables_helper.rb +55 -50
  25. data/app/helpers/effective_datatables_private_helper.rb +47 -179
  26. data/app/models/effective/datatable.rb +16 -44
  27. data/app/models/effective/datatable_column.rb +0 -1
  28. data/app/models/effective/datatable_column_tool.rb +2 -4
  29. data/app/models/effective/datatable_dsl_tool.rb +3 -11
  30. data/app/models/effective/datatable_value_tool.rb +23 -23
  31. data/app/models/effective/effective_datatable/attributes.rb +13 -5
  32. data/app/models/effective/effective_datatable/collection.rb +3 -18
  33. data/app/models/effective/effective_datatable/compute.rb +6 -17
  34. data/app/models/effective/effective_datatable/cookie.rb +20 -19
  35. data/app/models/effective/effective_datatable/dsl/bulk_actions.rb +25 -14
  36. data/app/models/effective/effective_datatable/dsl/datatable.rb +28 -70
  37. data/app/models/effective/effective_datatable/dsl/filters.rb +5 -5
  38. data/app/models/effective/effective_datatable/dsl.rb +3 -8
  39. data/app/models/effective/effective_datatable/format.rb +50 -95
  40. data/app/models/effective/effective_datatable/params.rb +3 -8
  41. data/app/models/effective/effective_datatable/resource.rb +76 -137
  42. data/app/models/effective/effective_datatable/state.rb +15 -30
  43. data/app/views/effective/datatables/_actions_column.html.haml +8 -1
  44. data/app/views/effective/datatables/_bulk_actions_column.html.haml +1 -1
  45. data/app/views/effective/datatables/_filters.html.haml +11 -12
  46. data/app/views/effective/datatables/_resource_column.html.haml +8 -11
  47. data/config/effective_datatables.rb +14 -12
  48. data/config/routes.rb +0 -1
  49. data/lib/effective_datatables/engine.rb +4 -14
  50. data/lib/effective_datatables/version.rb +1 -1
  51. data/lib/effective_datatables.rb +4 -57
  52. metadata +20 -31
  53. data/app/assets/config/effective_datatables_manifest.js +0 -3
  54. data/app/assets/images/dataTables/sort_asc.png +0 -0
  55. data/app/assets/images/dataTables/sort_both.png +0 -0
  56. data/app/assets/images/dataTables/sort_desc.png +0 -0
  57. data/app/assets/javascripts/dataTables/dataTables.bootstrap.js +0 -182
  58. data/app/assets/javascripts/dataTables/locales/en.lang +0 -33
  59. data/app/assets/javascripts/dataTables/locales/es.lang +0 -36
  60. data/app/assets/javascripts/dataTables/locales/nl.lang +0 -30
  61. data/app/assets/javascripts/effective_datatables/flash.js.coffee +0 -31
  62. data/app/assets/javascripts/effective_datatables/inline_crud.js.coffee +0 -217
  63. data/app/assets/javascripts/effective_datatables/overrides.js.coffee +0 -7
  64. data/app/assets/javascripts/effective_datatables/reorder.js.coffee +0 -43
  65. data/app/assets/stylesheets/effective_datatables/_filters.scss +0 -7
  66. data/app/views/effective/datatables/_reorder_column.html.haml +0 -5
  67. data/config/locales/en.yml +0 -12
  68. data/config/locales/es.yml +0 -12
  69. data/config/locales/nl.yml +0 -12
@@ -1,66 +1,50 @@
1
1
  #### Checkbox toggling and Bulk Actions dropdown disabling
2
2
 
3
- $(document).on 'change', ".dataTables_wrapper input[data-role='bulk-action']", (event) ->
3
+ $(document).on 'change', "input[data-role='bulk-actions-resource']", (event) ->
4
4
  $wrapper = $(event.currentTarget).closest('.dataTables_wrapper')
5
5
 
6
- $wrapper.find("input[data-role='bulk-actions']").prop('checked', false)
7
- toggleDropdown($wrapper)
6
+ $wrapper.find("input[data-role='bulk-actions-all']").prop('checked', false)
7
+ toggleClosestBulkActionsButton($wrapper)
8
8
 
9
- $(document).on 'change', ".dataTables_wrapper input[data-role='bulk-actions']", (event) ->
9
+ $(document).on 'change', "input[data-role='bulk-actions-all']", (event) ->
10
10
  $wrapper = $(event.currentTarget).closest('.dataTables_wrapper')
11
- $resources = $wrapper.find("input[data-role='bulk-action']")
11
+ $resources = $wrapper.find("input[data-role='bulk-actions-resource']")
12
12
 
13
13
  if $(event.currentTarget).is(':checked')
14
14
  $resources.prop('checked', true)
15
15
  else
16
16
  $resources.prop('checked', false)
17
17
 
18
- toggleDropdown($wrapper)
18
+ toggleClosestBulkActionsButton($wrapper)
19
19
 
20
- toggleDropdown = ($wrapper) ->
20
+ toggleClosestBulkActionsButton = ($wrapper) ->
21
21
  $bulkActions = $wrapper.children().first().find('.buttons-bulk-actions').children('button')
22
22
 
23
- if $wrapper.find("input[data-role='bulk-action']:checked").length > 0
23
+ if $wrapper.find("input[data-role='bulk-actions-resource']:checked").length > 0
24
24
  $bulkActions.removeAttr('disabled')
25
25
  else
26
26
  $bulkActions.attr('disabled', 'disabled')
27
27
 
28
- restoreSelected = ($table, selected) ->
29
- $bulkActions = $table.closest('.dataTables_wrapper').children().first().find('.buttons-bulk-actions').children('button')
30
- present = false
31
-
32
- if selected && selected.length > 0
33
- $table.find("input[data-role='bulk-action']").each (_, input) ->
34
- $input = $(input)
35
-
36
- if selected.indexOf($input.val()) > -1
37
- $input.prop('checked', true)
38
- present = true
39
- else
40
- $input.prop('checked', false)
41
-
42
- if present then $bulkActions.removeAttr('disabled') else $bulkActions.attr('disabled', 'disabled')
43
28
 
44
29
  #### Bulk Action link behaviour
45
- $(document).on 'click', '.dataTables_wrapper .buttons-bulk-actions a', (event) ->
30
+ $(document).on 'click', '.buttons-bulk-actions a', (event) ->
46
31
  event.preventDefault() # prevent the click
47
32
 
48
33
  $bulkAction = $(event.currentTarget) # This is a regular <a href=...> tag
49
34
  $wrapper = $bulkAction.closest('.dataTables_wrapper')
50
35
  $table = $wrapper.find('table.dataTable').first()
51
36
  $processing = $table.siblings('.dataTables_processing').first()
52
- $selected = $table.find("input[data-role='bulk-action']:checked")
37
+ $selected = $table.find("input[data-role='bulk-actions-resource']:checked")
53
38
 
54
39
  url = $bulkAction.attr('href')
55
40
  title = $bulkAction.text()
56
- download = $bulkAction.data('bulk-download')
57
- token = $table.data('authenticity-token')
41
+ token = $bulkAction.parent('li').data('authenticity-token')
58
42
  values = $.map($selected, (input) -> input.getAttribute('value'))
59
- method = $bulkAction.data('ajax-method')
43
+ get_link = $bulkAction.data('bulk-actions-get')
60
44
 
61
45
  return unless url && values
62
46
 
63
- if method == 'GET'
47
+ if get_link
64
48
  if url.includes('?')
65
49
  window.location.assign(url + '&' + $.param({ids: values}))
66
50
  else
@@ -71,36 +55,52 @@ $(document).on 'click', '.dataTables_wrapper .buttons-bulk-actions a', (event) -
71
55
  # Disable the Bulk Actions dropdown, so only one can be run at a time
72
56
  $bulkAction.closest('button').attr('disabled', 'disabled')
73
57
 
74
- $table.dataTable().data('bulk-actions-restore-selected-values', values)
58
+ # Show Processing...
59
+ $processing.show().data('bulk-actions-processing', true)
75
60
 
76
- if download # This is a file download
61
+ if token # This is a file download
77
62
  $.fileDownload(url,
78
63
  httpMethod: 'POST',
79
64
  data: { ids: values, authenticity_token: token }
80
65
  successCallback: ->
81
66
  success = "Successfully completed #{title} bulk action"
82
- $table.one 'draw.dt', (e) -> $(e.target).DataTable().flash(success, 'success') and restoreSelected($(e.target), values)
67
+ $processing.html(success)
68
+ $table.dataTable().data('bulk-actions-restore-selected-values', values)
83
69
  $table.DataTable().draw()
84
70
  failCallback: ->
85
71
  error = "An error occured while attempting #{title} bulk action"
86
- $table.one 'draw.dt', (e) -> $(e.target).DataTable().flash(error, 'danger') and restoreSelected($(e.target), values)
72
+ $processing.html(error)
73
+ alert(error)
74
+ $table.dataTable().data('bulk-actions-restore-selected-values', values)
87
75
  $table.DataTable().draw()
88
76
  )
89
77
  else # Normal AJAX post
90
- $table.dataTable().data('bulk-actions-restore-selected-values', values)
91
-
92
- $.ajax(
93
- method: method,
94
- url: url,
95
- data: { ids: values, authenticity_token: token }
78
+ $.post(
79
+ url, { ids: values }
96
80
  ).done((response) ->
97
81
  success = response['message'] || "Successfully completed #{title} bulk action"
98
- $table.one 'draw.dt', (e) -> $(e.target).DataTable().flash(success, 'success') and restoreSelected($(e.target), values)
99
-
82
+ $processing.html(success)
100
83
  ).fail((response) ->
101
84
  error = response['message'] || "An error occured while attempting #{title} bulk action: #{response.statusText}"
102
- $table.one 'draw.dt', (e) -> $(e.target).DataTable().flash(error, 'danger') and restoreSelected($(e.target), values)
103
-
85
+ $processing.html(error)
86
+ alert(error)
104
87
  ).always((response) ->
88
+ $table.dataTable().data('bulk-actions-restore-selected-values', values)
105
89
  $table.DataTable().draw()
106
90
  )
91
+
92
+ # We borrow the Processing div for our bulk action success/error messages
93
+ # This makes sure that the message is displayed for 1500ms
94
+ $(document).on 'processing.dt', (event, settings, visible) ->
95
+ return if settings.bDestroying
96
+
97
+ $processing = $(event.target).siblings('.dataTables_processing').first()
98
+ return unless $processing.data('bulk-actions-processing')
99
+
100
+ timeout = $processing.show().data('timeout')
101
+ clearTimeout(timeout) if timeout
102
+ $processing.data('timeout', setTimeout( =>
103
+ $processing.html('Processing...').hide()
104
+ $processing.data('bulk-actions-processing', null)
105
+ , 1500)
106
+ )
@@ -8,13 +8,16 @@ $(document).on 'column-visibility.dt', (event, settings, index, state) ->
8
8
  clearTimeout(timeout) if timeout
9
9
  $table.data('timeout', setTimeout( =>
10
10
  $table.DataTable().draw()
11
- $.event.trigger('page:change')
11
+ $table.trigger('effective-bootstrap:initialize')
12
12
  , 700)
13
13
  )
14
+ true
14
15
 
15
16
  # Remove empty label (bulk actions) from ColVis dropdown
16
- $(document).on 'click.dtb-collection', (event) ->
17
- $colvis = $('.dt-button-collection:not(.initialized)')
17
+ $(document).on 'click', 'a.buttons-colvis:not(.initialized)', (event) ->
18
+ $colvis = $('.dt-button-collection')
18
19
  return if $colvis.length == 0
19
20
 
20
- $colvis.addClass('initialized').find('li > a:empty').each -> $(this).parent().remove()
21
+ $colvis.find('a > span:empty').each -> $(this).parent().remove()
22
+ $colvis.find('a.buttons-colvisGroup').first().before("<div class='dropdown-divider'></div>")
23
+ $(event.currentTarget).addClass('initialized')
@@ -1,4 +1,3 @@
1
- # Don't scope by .datatables_wrapper here, because it's out of the wrapper!
2
1
  $(document).on 'click', 'a[data-apply-effective-datatables-filters]', (event) ->
3
2
  event.preventDefault()
4
3
  $form = $(event.currentTarget).closest('.effective-datatables-filters')
@@ -1,9 +1,11 @@
1
- initializeDataTables = (target) ->
2
- $(target || document).find('table.effective-datatable:not(.initialized)').each ->
1
+ initializeDataTables = ->
2
+ $('table.effective-datatable').each ->
3
+ return if $.fn.DataTable.fnIsDataTable(this)
4
+
3
5
  datatable = $(this)
4
6
  options = datatable.data('options') || {}
5
7
  buttons_export_columns = options['buttons_export_columns'] || ':not(.col-actions)'
6
- reorder = datatable.data('reorder')
8
+ simple = ('' + datatable.data('simple') == 'true')
7
9
 
8
10
  if options['buttons'] == false
9
11
  options['buttons'] = []
@@ -14,10 +16,10 @@ initializeDataTables = (target) ->
14
16
  buttons: [
15
17
  {
16
18
  extend: 'colvis',
19
+ text: 'Show / Hide',
17
20
  postfixButtons: [
18
- { extend: 'colvisGroup', text: 'Show all', show: ':hidden', className: 'buttons-colvisGroup-first'},
19
- { extend: 'colvisGroup', text: 'Show none', hide: ':visible' },
20
- { extend: 'colvisGroup', text: 'Show default', hide: ':not(.colvis-default)', show: '.colvis-default' }
21
+ { extend: 'colvisGroup', text: 'Show all', show: ':hidden'},
22
+ { extend: 'colvisRestore', text: 'Show default'}
21
23
  ]
22
24
  },
23
25
  {
@@ -47,8 +49,9 @@ initializeDataTables = (target) ->
47
49
  deferLoading: [datatable.data('display-records'), datatable.data('total-records')]
48
50
  deferRender: true
49
51
  displayStart: datatable.data('display-start')
52
+ dom: "<'row'<'col-sm-12 dataTables_buttons'B>><'row'<'col-sm-12'tr>><'row'<'col-sm-6 dataTables_entries'il><'col-sm-6'p>>"
50
53
  iDisplayLength: datatable.data('display-length')
51
- language: datatable.data('language')
54
+ language: { 'lengthMenu': '&nbsp;with _MENU_ per page'}
52
55
  lengthMenu: [[5, 10, 25, 50, 100, 250, 500, 9999999], ['5', '10', '25', '50', '100', '250', '500', 'All']]
53
56
  order: datatable.data('display-order')
54
57
  processing: true
@@ -60,33 +63,23 @@ initializeDataTables = (target) ->
60
63
  $table = $(api.table().node())
61
64
  $form = $(".effective-datatables-filters[aria-controls='#{$table.attr('id')}']").first()
62
65
 
63
- params['attributes'] = $table.data('attributes')
64
- params['authenticity_token'] = $table.data('authenticity-token')
66
+ params['cookie'] = $table.data('cookie')
65
67
 
66
68
  if $form.length > 0
67
69
  params['scope'] = $form.find("input[name='filters[scope]']:checked").val() || ''
68
70
  params['filter'] = {}
69
71
 
70
- $form.find("select,textarea,input:not([type=submit])").each ->
72
+ $form.find("select,textarea,input:not([type=submit]):not([name='filters[scope]'])").each ->
71
73
  $input = $(this)
72
-
73
- if ['utf8', 'authenticity_token', 'filters[scope]'].includes($input.attr('name'))
74
- # Skipped
75
- else if $input.attr('type') == 'radio'
76
- name = $input.attr('name')
77
- filter_name = name.replace('filters[', '').substring(0, name.length-9)
78
-
79
- params['filter'][filter_name] = $form.find("input[name='#{name}']:checked").val()
80
-
81
- else if $input.attr('id')
82
- filter_name = $input.attr('id').replace('filters_', '')
83
- params['filter'][filter_name] = $input.val()
74
+ if $input.attr('id')
75
+ params['filter'][$input.attr('id').substring(8, $input.attr('id').length)] = $input.val()
84
76
 
85
77
  serverSide: true
86
78
  scrollCollapse: true
87
79
  pagingType: 'simple_numbers'
88
80
  initComplete: (settings) ->
89
- initializeButtons(this.api())
81
+ initializeReset(this.api())
82
+ initializeBulkActions(this.api())
90
83
  initializeSearch(this.api())
91
84
  drawCallback: (settings) ->
92
85
  $table = $(this.api().table().node())
@@ -102,21 +95,36 @@ initializeDataTables = (target) ->
102
95
  if settings['json']['charts']
103
96
  drawCharts($table, settings['json']['charts'])
104
97
 
105
- $table.children('tbody').trigger('effective-bootstrap:initialize')
98
+ drawBulkActions($table)
106
99
 
107
100
  # Copies the bulk actions html, stored in a data attribute on the table, into the buttons area
108
- initializeButtons = (api) ->
101
+ initializeBulkActions = (api) ->
102
+ $table = $(api.table().node())
103
+
104
+ if $table.data('bulk-actions')
105
+ $table.closest('.dataTables_wrapper').children().first().find('.dt-buttons').prepend($table.data('bulk-actions'))
106
+
107
+ initializeReset = (api) ->
109
108
  $table = $(api.table().node())
110
- $buttons = $table.closest('.dataTables_wrapper').children().first().find('.dt-buttons')
111
109
 
112
110
  if $table.data('reset')
113
- $buttons.prepend($table.data('reset'))
111
+ $table.closest('.dataTables_wrapper').children().first().find('.dt-buttons').prepend($table.data('reset'))
114
112
 
115
- if $table.data('reorder')
116
- $buttons.prepend($table.data('reorder'))
113
+ # After we perform a bulk action, we have to re-select the checkboxes manually and do a bit of house keeping
114
+ drawBulkActions = ($table) ->
115
+ selected = $table.data('bulk-actions-restore-selected-values')
117
116
 
118
- if $table.data('bulk-actions')
119
- $buttons.prepend($table.data('bulk-actions'))
117
+ $bulkActions = $table.closest('.dataTables_wrapper').children().first().find('.buttons-bulk-actions').children('button')
118
+
119
+ if selected && selected.length > 0
120
+ $table.find("input[data-role='bulk-actions-resource']").each (_, input) ->
121
+ $input = $(input)
122
+ $input.prop('checked', selected.indexOf($input.val()) > -1)
123
+
124
+ $bulkActions.removeAttr('disabled')
125
+ $table.data('bulk-actions-restore-selected-values', [])
126
+ else
127
+ $bulkActions.attr('disabled', 'disabled')
120
128
 
121
129
  drawAggregates = ($table, aggregates) ->
122
130
  $tfoot = $table.find('tfoot').first()
@@ -156,13 +164,11 @@ initializeDataTables = (target) ->
156
164
 
157
165
  $input.parent().on 'click', (event) -> false # Dont order columns when you click inside the input
158
166
  $input.parent().on 'mousedown', (event) -> event.stopPropagation() # Dont order columns when you click inside the input
159
- $input.parent().on 'keypress', (event) -> event.stopPropagation() # Don't order columns when you type inside the input
160
167
 
161
168
  if $input.is('select')
162
169
  $input.on 'change', (event) -> dataTableSearch($(event.currentTarget))
163
170
  else if $input.is('input')
164
171
  $input.delayedChange ($input) -> dataTableSearch($input)
165
- $input.on('paste', -> dataTableSearch($input))
166
172
 
167
173
  # Do the actual search
168
174
  dataTableSearch = ($input) -> # This is the function called by a select or input to run the search
@@ -171,32 +177,22 @@ initializeDataTables = (target) ->
171
177
  table = $input.closest('table.dataTable')
172
178
  table.DataTable().column("#{$input.data('column-name')}:name").search($input.val()).draw()
173
179
 
174
- if reorder
175
- init_options['rowReorder'] = { selector: 'td.col-_reorder', snapX: true, dataSrc: datatable.data('reorder-index') }
180
+ if simple
181
+ init_options['dom'] = "<'row'<'col-sm-12'tr>>" # Just show the table
182
+ datatable.addClass('simple')
176
183
 
177
184
  # Let's actually initialize the table now
178
185
  table = datatable.dataTable(jQuery.extend(init_options, options))
179
186
 
180
- # Fix a tabindex issue
181
- table.children('tbody').children('tr').children('td[tabindex]').removeAttr('tabindex')
182
-
183
187
  # Apply EffectiveFormInputs to the Show x per page dropdown
184
188
  try table.closest('.dataTables_wrapper').find('.dataTables_length select').removeAttr('name').select2(minimumResultsForSearch: 100)
185
189
 
186
- if reorder
187
- table.DataTable().on('row-reorder', (event, diff, edit) -> $(event.target).DataTable().reorder(event, diff, edit))
188
-
189
- table.addClass('initialized')
190
- table.children('thead').trigger('effective-bootstrap:initialize')
191
- true
192
-
193
190
  destroyDataTables = ->
194
- $('.effective-datatables-inline-expanded').removeClass('effective-datatables-inline-expanded')
195
- $('table.effective-datatable').each -> try $(this).removeClass('initialized').DataTable().destroy()
191
+ $('table.effective-datatable').each ->
192
+ if $.fn.DataTable.fnIsDataTable(this)
193
+ $(this).DataTable().destroy()
196
194
 
197
195
  $ -> initializeDataTables()
198
- $(document).on 'effective-datatables:initialize', (event) -> initializeDataTables(event.currentTarget)
199
-
200
196
  $(document).on 'page:change', -> initializeDataTables()
201
197
  $(document).on 'turbolinks:load', -> initializeDataTables()
202
198
  $(document).on 'turbolinks:render', -> initializeDataTables()
@@ -0,0 +1,12 @@
1
+ $.extend(true, $.fn.dataTable.Buttons.defaults, {
2
+ dom: {
3
+ button: {
4
+ className: 'btn btn-link btn-sm'
5
+ }
6
+ }
7
+ });
8
+
9
+ /* Default class modification */
10
+ $.extend($.fn.dataTable.ext.classes, {
11
+ sWrapper: 'dataTables_wrapper dt-bootstrap4', // Remove container-fluid
12
+ });
@@ -1,4 +1,4 @@
1
- $(document).on 'click', '.dataTables_wrapper a.buttons-reset-search', (event) ->
1
+ $(document).on 'click', 'a.buttons-reset-search', (event) ->
2
2
  event.preventDefault() # prevent the click
3
3
 
4
4
  $table = $(event.currentTarget).closest('.dataTables_wrapper').find('table.dataTable').first()
@@ -2,22 +2,22 @@
2
2
  //= require vendor/jquery.fileDownload
3
3
 
4
4
  //= require dataTables/jquery.dataTables
5
- //= require dataTables/dataTables.bootstrap
5
+ //= require dataTables/dataTables.bootstrap4
6
6
 
7
7
  //= require dataTables/buttons/dataTables.buttons
8
- //= require dataTables/buttons/buttons.bootstrap
8
+ //= require dataTables/buttons/buttons.bootstrap4
9
9
  //= require dataTables/buttons/buttons.colVis
10
10
  //= require dataTables/buttons/buttons.html5
11
11
  //= require dataTables/buttons/buttons.print
12
12
  //= require dataTables/responsive/dataTables.responsive
13
- //= require dataTables/responsive/responsive.bootstrap
13
+ //= require dataTables/responsive/responsive.bootstrap4
14
14
 
15
15
  //= require effective_datatables/bulk_actions
16
16
  //= require effective_datatables/events
17
17
  //= require effective_datatables/filters
18
- //= require effective_datatables/flash
19
18
  //= require effective_datatables/reset
20
19
  //= require effective_datatables/responsive
20
+ //= require effective_datatables/overrides
21
21
 
22
22
  //= require effective_datatables/charts
23
23
  //= require effective_datatables/initialize
@@ -108,6 +108,73 @@ ul.dt-button-collection.dropdown-menu.four-column {
108
108
  -o-column-count: 4;
109
109
  column-count: 4;
110
110
  }
111
+ ul.dt-button-collection.dropdown-menu .dt-button {
112
+ border-radius: 0;
113
+ }
114
+
115
+ ul.dt-button-collection {
116
+ -webkit-column-gap: 8px;
117
+ -moz-column-gap: 8px;
118
+ -ms-column-gap: 8px;
119
+ -o-column-gap: 8px;
120
+ column-gap: 8px;
121
+ }
122
+ ul.dt-button-collection.fixed {
123
+ position: fixed;
124
+ top: 50%;
125
+ left: 50%;
126
+ margin-left: -75px;
127
+ border-radius: 0;
128
+ }
129
+ ul.dt-button-collection.fixed.two-column {
130
+ margin-left: -150px;
131
+ }
132
+ ul.dt-button-collection.fixed.three-column {
133
+ margin-left: -225px;
134
+ }
135
+ ul.dt-button-collection.fixed.four-column {
136
+ margin-left: -300px;
137
+ }
138
+ ul.dt-button-collection > * {
139
+ -webkit-column-break-inside: avoid;
140
+ break-inside: avoid;
141
+ }
142
+ ul.dt-button-collection.two-column {
143
+ width: 300px;
144
+ padding-bottom: 1px;
145
+ -webkit-column-count: 2;
146
+ -moz-column-count: 2;
147
+ -ms-column-count: 2;
148
+ -o-column-count: 2;
149
+ column-count: 2;
150
+ }
151
+ ul.dt-button-collection.three-column {
152
+ width: 450px;
153
+ padding-bottom: 1px;
154
+ -webkit-column-count: 3;
155
+ -moz-column-count: 3;
156
+ -ms-column-count: 3;
157
+ -o-column-count: 3;
158
+ column-count: 3;
159
+ }
160
+ ul.dt-button-collection.four-column {
161
+ width: 600px;
162
+ padding-bottom: 1px;
163
+ -webkit-column-count: 4;
164
+ -moz-column-count: 4;
165
+ -ms-column-count: 4;
166
+ -o-column-count: 4;
167
+ column-count: 4;
168
+ }
169
+ ul.dt-button-collection .dt-button {
170
+ border-radius: 0;
171
+ }
172
+ ul.dt-button-collection.fixed {
173
+ max-width: none;
174
+ }
175
+ ul.dt-button-collection.fixed:before, ul.dt-button-collection.fixed:after {
176
+ display: none;
177
+ }
111
178
 
112
179
  div.dt-button-background {
113
180
  position: fixed;
@@ -115,7 +182,7 @@ div.dt-button-background {
115
182
  left: 0;
116
183
  width: 100%;
117
184
  height: 100%;
118
- z-index: 2001;
185
+ z-index: 999;
119
186
  }
120
187
 
121
188
  @media screen and (max-width: 767px) {
@@ -42,7 +42,7 @@ div.dataTables_wrapper div.dataTables_filter input {
42
42
  width: auto;
43
43
  }
44
44
  div.dataTables_wrapper div.dataTables_info {
45
- padding-top: 8px;
45
+ padding-top: 0.85em;
46
46
  white-space: nowrap;
47
47
  }
48
48
  div.dataTables_wrapper div.dataTables_paginate {
@@ -53,6 +53,7 @@ div.dataTables_wrapper div.dataTables_paginate {
53
53
  div.dataTables_wrapper div.dataTables_paginate ul.pagination {
54
54
  margin: 2px 0;
55
55
  white-space: nowrap;
56
+ justify-content: flex-end;
56
57
  }
57
58
  div.dataTables_wrapper div.dataTables_processing {
58
59
  position: absolute;
@@ -83,52 +84,61 @@ table.dataTable thead .sorting_desc_disabled {
83
84
  cursor: pointer;
84
85
  position: relative;
85
86
  }
86
- table.dataTable thead .sorting:after,
87
+ table.dataTable thead .sorting:before, table.dataTable thead .sorting:after,
88
+ table.dataTable thead .sorting_asc:before,
87
89
  table.dataTable thead .sorting_asc:after,
90
+ table.dataTable thead .sorting_desc:before,
88
91
  table.dataTable thead .sorting_desc:after,
92
+ table.dataTable thead .sorting_asc_disabled:before,
89
93
  table.dataTable thead .sorting_asc_disabled:after,
94
+ table.dataTable thead .sorting_desc_disabled:before,
90
95
  table.dataTable thead .sorting_desc_disabled:after {
91
96
  position: absolute;
92
- bottom: 8px;
93
- right: 8px;
97
+ bottom: 0.9em;
94
98
  display: block;
95
- font-family: 'Glyphicons Halflings';
96
- opacity: 0.5;
99
+ opacity: 0.3;
97
100
  }
98
- table.dataTable thead .sorting:after {
99
- opacity: 0.2;
100
- content: "\e150";
101
- /* sort */
101
+ table.dataTable thead .sorting:before,
102
+ table.dataTable thead .sorting_asc:before,
103
+ table.dataTable thead .sorting_desc:before,
104
+ table.dataTable thead .sorting_asc_disabled:before,
105
+ table.dataTable thead .sorting_desc_disabled:before {
106
+ right: 1em;
107
+ content: "\2191";
102
108
  }
103
- table.dataTable thead .sorting_asc:after {
104
- content: "\e155";
105
- /* sort-by-attributes */
109
+ table.dataTable thead .sorting:after,
110
+ table.dataTable thead .sorting_asc:after,
111
+ table.dataTable thead .sorting_desc:after,
112
+ table.dataTable thead .sorting_asc_disabled:after,
113
+ table.dataTable thead .sorting_desc_disabled:after {
114
+ right: 0.5em;
115
+ content: "\2193";
106
116
  }
117
+ table.dataTable thead .sorting_asc:before,
107
118
  table.dataTable thead .sorting_desc:after {
108
- content: "\e156";
109
- /* sort-by-attributes-alt */
119
+ opacity: 1;
110
120
  }
111
- table.dataTable thead .sorting_asc_disabled:after,
121
+ table.dataTable thead .sorting_asc_disabled:before,
112
122
  table.dataTable thead .sorting_desc_disabled:after {
113
- color: #eee;
123
+ opacity: 0;
114
124
  }
115
125
 
116
126
  div.dataTables_scrollHead table.dataTable {
117
127
  margin-bottom: 0 !important;
118
128
  }
119
129
 
120
- div.dataTables_scrollBody > table {
130
+ div.dataTables_scrollBody table {
121
131
  border-top: none;
122
132
  margin-top: 0 !important;
123
133
  margin-bottom: 0 !important;
124
134
  }
125
- div.dataTables_scrollBody > table > thead .sorting:after,
126
- div.dataTables_scrollBody > table > thead .sorting_asc:after,
127
- div.dataTables_scrollBody > table > thead .sorting_desc:after {
135
+ div.dataTables_scrollBody table thead .sorting:after,
136
+ div.dataTables_scrollBody table thead .sorting_asc:after,
137
+ div.dataTables_scrollBody table thead .sorting_desc:after {
128
138
  display: none;
129
139
  }
130
- div.dataTables_scrollBody > table > tbody > tr:first-child > th,
131
- div.dataTables_scrollBody > table > tbody > tr:first-child > td {
140
+ div.dataTables_scrollBody table tbody tr:first-child th,
141
+ div.dataTables_scrollBody table tbody tr:first-child td {
132
142
  border-top: none;
133
143
  }
134
144
 
@@ -148,14 +158,19 @@ div.dataTables_scrollFoot > .dataTables_scrollFootInner > table {
148
158
  text-align: center;
149
159
  }
150
160
  }
151
- table.dataTable.table-condensed > thead > tr > th {
161
+ table.dataTable.table-sm > thead > tr > th {
152
162
  padding-right: 20px;
153
163
  }
154
- table.dataTable.table-condensed .sorting:after,
155
- table.dataTable.table-condensed .sorting_asc:after,
156
- table.dataTable.table-condensed .sorting_desc:after {
157
- top: 6px;
158
- right: 6px;
164
+ table.dataTable.table-sm .sorting:before,
165
+ table.dataTable.table-sm .sorting_asc:before,
166
+ table.dataTable.table-sm .sorting_desc:before {
167
+ top: 5px;
168
+ right: 0.85em;
169
+ }
170
+ table.dataTable.table-sm .sorting:after,
171
+ table.dataTable.table-sm .sorting_asc:after,
172
+ table.dataTable.table-sm .sorting_desc:after {
173
+ top: 5px;
159
174
  }
160
175
 
161
176
  table.table-bordered.dataTable th,
@@ -16,7 +16,7 @@ table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > th:first-child {
16
16
  }
17
17
  table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > td:first-child:before,
18
18
  table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > th:first-child:before {
19
- top: 9px;
19
+ top: 12px;
20
20
  left: 4px;
21
21
  height: 14px;
22
22
  width: 14px;
@@ -32,7 +32,7 @@ table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > th:first-child:b
32
32
  font-family: 'Courier New', Courier, monospace;
33
33
  line-height: 14px;
34
34
  content: '+';
35
- background-color: #337ab7;
35
+ background-color: #0275d8;
36
36
  }
37
37
  table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before,
38
38
  table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th:first-child:before {
@@ -78,7 +78,7 @@ table.dataTable.dtr-column > tbody > tr > th.control:before {
78
78
  font-family: 'Courier New', Courier, monospace;
79
79
  line-height: 14px;
80
80
  content: '+';
81
- background-color: #337ab7;
81
+ background-color: #0275d8;
82
82
  }
83
83
  table.dataTable.dtr-column > tbody > tr.parent td.control:before,
84
84
  table.dataTable.dtr-column > tbody > tr.parent th.control:before {