effective_datatables 4.17.4 → 4.19.0

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 (24) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -0
  3. data/app/assets/javascripts/dataTables/UPGRADE.md +17 -0
  4. data/app/assets/javascripts/dataTables/buttons/buttons.bootstrap4.js +73 -19
  5. data/app/assets/javascripts/dataTables/buttons/buttons.colVis.js +166 -120
  6. data/app/assets/javascripts/dataTables/buttons/buttons.html5.js +749 -667
  7. data/app/assets/javascripts/dataTables/buttons/buttons.print.js +96 -64
  8. data/app/assets/javascripts/dataTables/buttons/dataTables.buttons.js +1568 -909
  9. data/app/assets/javascripts/dataTables/dataTables.bootstrap4.js +172 -154
  10. data/app/assets/javascripts/dataTables/jquery.dataTables.js +3119 -2704
  11. data/app/assets/javascripts/dataTables/responsive/dataTables.responsive.js +707 -531
  12. data/app/assets/javascripts/dataTables/responsive/responsive.bootstrap4.js +61 -33
  13. data/app/assets/javascripts/dataTables/rowReorder/dataTables.rowReorder.js +961 -740
  14. data/app/assets/javascripts/dataTables/rowReorder/rowReorder.bootstrap4.js +50 -30
  15. data/app/assets/javascripts/effective_datatables/filters.js.coffee +88 -0
  16. data/app/assets/stylesheets/dataTables/buttons/buttons.bootstrap4.scss +178 -151
  17. data/app/assets/stylesheets/dataTables/dataTables.bootstrap4.scss +300 -81
  18. data/app/assets/stylesheets/dataTables/responsive/responsive.bootstrap4.scss +54 -71
  19. data/app/assets/stylesheets/dataTables/rowReorder/rowReorder.bootstrap4.scss +23 -4
  20. data/app/assets/stylesheets/effective_datatables/_overrides.bootstrap4.scss +81 -39
  21. data/app/views/effective/datatables/_filter_date_range.html.haml +37 -9
  22. data/app/views/effective/datatables/_filters.html.haml +1 -1
  23. data/lib/effective_datatables/version.rb +1 -1
  24. metadata +3 -2
@@ -1,35 +1,85 @@
1
1
  // Override dataTables.bootstrap4.css defaults
2
2
  table.dataTable { border-collapse: collapse !important; }
3
3
 
4
- // Override default padding
5
- table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc, table.dataTable thead > tr > th.sorting,
4
+ // Override default hover effect
5
+ table.dataTable.table-striped > tbody > tr.odd > *,
6
+ table.dataTable.table-striped > tbody > tr.odd.selected > *,
7
+ table.dataTable.table-hover > tbody > tr:hover > *,
8
+ table.dataTable.table-hover > tbody > tr.selected:hover > * {
9
+ box-shadow: unset;
10
+ }
11
+
12
+ // Override default sorting
13
+ table.dataTable thead > tr > th.sorting:before,
14
+ table.dataTable thead > tr > th.sorting_asc:before,
15
+ table.dataTable thead > tr > th.sorting_desc:before,
16
+ table.dataTable thead > tr > th.sorting_asc_disabled:before,
17
+ table.dataTable thead > tr > th.sorting_desc_disabled:before,
18
+ table.dataTable thead > tr > td.sorting:before,
19
+ table.dataTable thead > tr > td.sorting_asc:before,
20
+ table.dataTable thead > tr > td.sorting_desc:before,
21
+ table.dataTable thead > tr > td.sorting_asc_disabled:before,
22
+ table.dataTable thead > tr > td.sorting_desc_disabled:before {
23
+ content: '';
24
+ }
25
+
26
+ table.dataTable thead > tr > th.sorting:after,
27
+ table.dataTable thead > tr > th.sorting_asc:after,
28
+ table.dataTable thead > tr > th.sorting_desc:after,
29
+ table.dataTable thead > tr > th.sorting_asc_disabled:after,
30
+ table.dataTable thead > tr > th.sorting_desc_disabled:after,
31
+ table.dataTable thead > tr > td.sorting:after,
32
+ table.dataTable thead > tr > td.sorting_asc:after,
33
+ table.dataTable thead > tr > td.sorting_desc:after,
34
+ table.dataTable thead > tr > td.sorting_asc_disabled:after,
35
+ table.dataTable thead > tr > td.sorting_desc_disabled:after {
36
+ content: '';
37
+ }
38
+
39
+ table.dataTable thead > tr > th.sorting, table.dataTable thead > tr > th.sorting_asc, table.dataTable thead > tr > th.sorting_desc, table.dataTable thead > tr > th.sorting_asc_disabled, table.dataTable thead > tr > th.sorting_desc_disabled,
40
+ table.dataTable thead > tr > td.sorting,
6
41
  table.dataTable thead > tr > td.sorting_asc,
7
42
  table.dataTable thead > tr > td.sorting_desc,
8
- table.dataTable thead > tr > td.sorting { padding: 0.5em 0.5em 0.5em 0.5em; }
9
-
10
- // Override default sort icons
11
- table.dataTable thead .sorting:before,
12
- table.dataTable thead .sorting_asc:before,
13
- table.dataTable thead .sorting_desc:before,
14
- table.dataTable thead .sorting_asc_disabled:before,
15
- table.dataTable thead .sorting_desc_disabled:before,
16
- table.dataTable thead .sorting:after,
17
- table.dataTable thead .sorting_asc:after,
18
- table.dataTable thead .sorting_desc:after,
19
- table.dataTable thead .sorting_asc_disabled:after,
20
- table.dataTable thead .sorting_desc_disabled:after { content: ''; }
43
+ table.dataTable thead > tr > td.sorting_asc_disabled,
44
+ table.dataTable thead > tr > td.sorting_desc_disabled {
45
+ padding: 0.5em 0.5em 0.5em 0.5em;
46
+ }
21
47
 
22
- table.dataTable > thead {
48
+ table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) { padding-right: 0.5em; }
49
+ table.dataTable thead > tr > th.sorting_disabled { padding-bottom: 8px; }
50
+
51
+ table.dataTable > thead th {
52
+ background-repeat: no-repeat;
53
+ > span { padding-right: 1rem; }
54
+ }
55
+
56
+ table.dataTable > thead .sorting {
57
+ background-image: asset-data-url('dataTables/sort.svg');
58
+ background-position: right 0.25rem top 0.25rem;
59
+ }
60
+
61
+ table.dataTable > thead .sorting_asc {
62
+ background-image: asset-data-url('dataTables/sort-up.svg');
63
+ background-position: right 0.25rem top 0.25rem;
64
+ }
65
+
66
+ table.dataTable > thead .sorting_desc {
67
+ background-image: asset-data-url('dataTables/sort-down.svg');
68
+ background-position: right 0.25rem top 0.25rem;
69
+ }
70
+
71
+ // The New button
72
+ table.dataTable thead {
23
73
  th.col-actions {
24
74
  text-align: right;
25
-
26
75
  span { display: block; height: 1.25em; }
27
76
  }
28
77
  }
29
78
 
79
+ // Turbolinks destroy fix
30
80
  .dataTables_wrapper {
31
81
  table.dataTable {
32
- tr.effective-datatables-inline-row { visibility: collapse; } // Turbolinks destroy fix
82
+ tr.effective-datatables-inline-row { visibility: collapse; }
33
83
  }
34
84
  }
35
85
 
@@ -53,25 +103,17 @@ table.dataTable > thead {
53
103
  }
54
104
  }
55
105
 
56
- table.dataTable > thead th {
57
- background-repeat: no-repeat;
58
-
59
- > span { padding-right: 1rem; }
106
+ table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
107
+ table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
108
+ color: #0275d8;
60
109
  }
61
-
62
- table.dataTable > thead .sorting {
63
- background-image: asset-data-url('dataTables/sort.svg');
64
- background-position: right 0.25rem top 0.25rem;
110
+ table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control.arrow-right::before,
111
+ table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control.arrow-right::before {
112
+ color: #0275d8;
65
113
  }
66
-
67
- table.dataTable > thead .sorting_asc {
68
- background-image: asset-data-url('dataTables/sort-up.svg');
69
- background-position: right 0.25rem top 0.25rem;
70
- }
71
-
72
- table.dataTable > thead .sorting_desc {
73
- background-image: asset-data-url('dataTables/sort-down.svg');
74
- background-position: right 0.25rem top 0.25rem;
114
+ table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before,
115
+ table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control:before {
116
+ color: #0275d8;
75
117
  }
76
118
 
77
119
  // Collapsed Responsive View
@@ -90,6 +132,10 @@ table.dataTable > tbody > tr.child {
90
132
  }
91
133
  }
92
134
 
135
+ table.dataTable.collapsed {
136
+ th.col-bulk_actions:first-child { div { margin-left: 18px; } }
137
+ }
138
+
93
139
  // Buttons
94
140
  .dataTables_buttons {
95
141
  text-align: right;
@@ -124,10 +170,6 @@ table.dataTable > thead {
124
170
  }
125
171
  }
126
172
 
127
- table.dataTable.collapsed {
128
- th.col-bulk_actions:first-child { div { margin-left: 18px; } }
129
- }
130
-
131
173
  // Processing div
132
174
  div.dataTables_wrapper div.dataTables_processing {
133
175
  margin: -26px 25% 0px 25%;
@@ -31,17 +31,45 @@
31
31
  = f.static_field :year do
32
32
  #{now.beginning_of_year.strftime('%F')} to #{now.strftime('%F')} (today)
33
33
 
34
+ = f.show_if :date_range, :year do
35
+ = f.static_field :year, wrapper: { class: 'effective-datatables-filter' } do
36
+ - date = f.object.start_date.beginning_of_year
37
+
38
+ = link_to '#', 'data-effective-datatables-filter-prev-year': date.advance(years: -1).strftime('%F') do
39
+ = icon('arrow-left-circle')
40
+ %span.prev-year= date.advance(years: -1).strftime('%Y')
41
+
42
+ %span.start-date= f.object.start_date.strftime('%F')
43
+ to
44
+ %span.end-date= f.object.end_date.strftime('%F')
45
+
46
+ = link_to '#', 'data-effective-datatables-filter-next-year': date.advance(years: 1).strftime('%F') do
47
+ = icon('arrow-right-circle')
48
+ %span.next-year= date.advance(years: 1).strftime('%Y')
49
+
50
+ %div{style: 'display: none;'}
51
+ = f.date_field :start_date, name: name, autocomplete: 'off', feedback: false
52
+ = f.date_field :end_date, name: name, autocomplete: 'off', feedback: false
53
+
34
54
  = f.show_if :date_range, :month do
35
- = f.static_field :month do
36
- = link_to((prev_month.strftime('%b %Y') + ' ' + icon('arrow-left-circle')).html_safe, prev_month_path.sub(path, request.path))
37
- #{start_date.beginning_of_month.strftime('%F')} to #{start_date.end_of_month.strftime('%F')}
38
- = link_to((icon('arrow-right-circle') + ' ' + next_month.strftime('%b %Y')).html_safe, next_month_path.sub(path, request.path))
55
+ = f.static_field :month, wrapper: { class: 'effective-datatables-filter' } do
56
+ - date = f.object.start_date.beginning_of_month
39
57
 
40
- = f.show_if :date_range, :year do
41
- = f.static_field :year do
42
- = link_to((prev_year.strftime('%Y') + ' ' + icon('arrow-left-circle')).html_safe, prev_year_path.sub(path, request.path))
43
- #{start_date.beginning_of_year.strftime('%F')} to #{start_date.end_of_year.strftime('%F')}
44
- = link_to((icon('arrow-right-circle') + ' ' + next_year.strftime('%Y')).html_safe, next_year_path.sub(path, request.path))
58
+ = link_to '#', 'data-effective-datatables-filter-prev-month': date.advance(months: -1).strftime('%F') do
59
+ = icon('arrow-left-circle')
60
+ %span.prev-month= date.advance(months: -1).strftime('%b')
61
+
62
+ %span.start-date= f.object.start_date.strftime('%F')
63
+ to
64
+ %span.end-date= f.object.end_date.strftime('%F')
65
+
66
+ = link_to '#', 'data-effective-datatables-filter-next-month': date.advance(months: 1).strftime('%F') do
67
+ = icon('arrow-right-circle')
68
+ %span.next-month= date.advance(months: 1).strftime('%b')
69
+
70
+ %div{style: 'display: none;'}
71
+ = f.date_field :start_date, name: name, autocomplete: 'off', feedback: false
72
+ = f.date_field :end_date, name: name, autocomplete: 'off', feedback: false
45
73
 
46
74
  = f.show_if :date_range, :custom do
47
75
  .row
@@ -1,6 +1,6 @@
1
1
  .effective-datatables-filters{'aria-controls': datatable.to_param}
2
2
 
3
- = effective_form_with(model: datatable.filters_form, scope: :filters, url: (datatable._form[:url] || '#'), method: datatable._form[:verb], id: nil) do |form|
3
+ = effective_form_with(model: datatable.filters_form, scope: :filters, url: (datatable._form[:url] || '#'), method: datatable._form[:verb], id: nil, authenticity_token: datatable._filters_form_required?) do |form|
4
4
  .form-row.align-items-center
5
5
  - if datatable._scopes.present?
6
6
  = datatable_scope_tag(form, datatable)
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.17.4'.freeze
2
+ VERSION = '4.19.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_datatables
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.17.4
4
+ version: 4.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-03 00:00:00.000000000 Z
11
+ date: 2023-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -94,6 +94,7 @@ files:
94
94
  - app/assets/images/dataTables/sort-down.svg
95
95
  - app/assets/images/dataTables/sort-up.svg
96
96
  - app/assets/images/dataTables/sort.svg
97
+ - app/assets/javascripts/dataTables/UPGRADE.md
97
98
  - app/assets/javascripts/dataTables/buttons/buttons.bootstrap4.js
98
99
  - app/assets/javascripts/dataTables/buttons/buttons.colVis.js
99
100
  - app/assets/javascripts/dataTables/buttons/buttons.html5.js