effective_datatables 4.35.0 → 4.35.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce86a4ccf56b39946b075599ac4c146cab3b95f420d0f1a4eb2bca95b9b15594
4
- data.tar.gz: 7b98dfd5a1996035256c8c7ee7047541b461ffce0268672b2d9327996988b252
3
+ metadata.gz: 58ba852489ca6c3a824b03443eaeadde149e051212055e2bd62a1d8b59972f26
4
+ data.tar.gz: a112f67a6cc67a2d082f9f19ebd70b8dc8ef6b8537851cb1508782159d7598c4
5
5
  SHA512:
6
- metadata.gz: c780a6949308cfd9f560ddc52be61f3822b85ddf6ca904b2b238a33a6507f59fc6cfccf4a3676c5429219950a996b3ca0f87b16d6d7b253657f00b3a7f2cd7e1
7
- data.tar.gz: 0da2df1d7a30190a6211c2dec883309e041ef46ec3c8536fab3ea11bc11ebcf9738debb79bcb3ca421c320b04afd2f9251f29dc31dbccd8cbea27d8538613fdd
6
+ metadata.gz: d46724dd25b495e4ccb796e688ddb9e0ea2c341d00755486419b1fa37efd2700b96a0becc6e0725e49354cec4eedae86295d13ffa168fa2ec7b806b92b05f4dd
7
+ data.tar.gz: a75f57a5ce59fd95997b5a550787e330019c286ff5ce9bb8782e2120b3312568c0f3eff47e0629df011a4a273f4cfb7006d059a1678be452f4c4d18ee1e72779
@@ -9,7 +9,7 @@ $(document).on 'ajax:before', '.dataTables_wrapper .col-actions', (event) ->
9
9
  $table = $(event.target).closest('table')
10
10
 
11
11
  return true if ('' + $action.data('inline')) == 'false'
12
- return true if ('' + $action.data('nested-datatable-action')) == 'true'
12
+ return true if ('' + $action.data('nested-datatable')) == 'true'
13
13
 
14
14
  $params = $.param(
15
15
  {
@@ -157,7 +157,12 @@ afterEdit = ($action) ->
157
157
  $tr = $action.closest('tr')
158
158
  $table = $tr.closest('table')
159
159
 
160
- html = buildRow($tr.children('td').length, EffectiveForm.remote_form_payload)
160
+ nestedDatatableAction = $tr.find('a[data-nested-datatable]')
161
+
162
+ html = if nestedDatatableAction.length > 0
163
+ buildNestedDatatableRow($tr.children('td').length, EffectiveForm.remote_form_payload, nestedDatatableAction.attr('title'))
164
+ else
165
+ buildRow($tr.children('td').length, EffectiveForm.remote_form_payload)
161
166
 
162
167
  $tr.data('inline-form-original-html', $tr.children().detach())
163
168
  $tr.html(html)
@@ -201,6 +206,12 @@ buildRow = (length, payload) ->
201
206
  "<a href='#' class='btn btn-sm btn-outline-primary' title='Cancel' data-role='inline-form-cancel'>Cancel</a>" +
202
207
  "</td>"
203
208
 
209
+ buildNestedDatatableRow = (length, payload, title) ->
210
+ "<td class='col-inline-form' colspan='#{length-1}'><div class='nested-datatable-container-parent'><div class='nested-datatable-container'><div class='nested-datatable-title'>#{title || ''}</div>#{payload}</div></div></td>" +
211
+ "<td class='col-actions col-actions-inline-form'>" +
212
+ "<a href='#' class='btn btn-sm btn-outline-primary' title='Cancel' data-role='inline-form-cancel'>Cancel</a>" +
213
+ "</td>"
214
+
204
215
  expand = ($table) ->
205
216
  $wrapper = $table.closest('.dataTables_wrapper').addClass('effective-datatables-inline-expanded')
206
217
  $table.on 'draw.dt', (event) ->
@@ -72,7 +72,7 @@ table.dataTable > thead .sorting_desc {
72
72
  table.dataTable thead {
73
73
  th.col-actions {
74
74
  text-align: right;
75
- span { display: block; height: 1.25em; }
75
+ span { display: block; }
76
76
  }
77
77
  }
78
78
 
@@ -184,6 +184,10 @@ table.dataTable > thead {
184
184
  p { margin-bottom: 0; }
185
185
  }
186
186
 
187
+ .form-group.datatables-filters-present {
188
+ margin-top: 1.75em;
189
+ }
190
+
187
191
  // Processing div
188
192
  div.dataTables_wrapper div.dataTables_processing {
189
193
  margin: -26px 25% 0px 25%;
@@ -321,3 +325,14 @@ div.dt-button-collection .dt-button-active:after {
321
325
  right: auto;
322
326
  left: 0.5rem;
323
327
  }
328
+
329
+ // Nested Datatables
330
+ .nested-datatable-container-parent {
331
+ padding-left: 0.25em;
332
+ padding-right: 0.25em;
333
+ container-type: inline-size;
334
+ }
335
+
336
+ .nested-datatable-container {
337
+ width: 100%;
338
+ }
@@ -138,7 +138,7 @@ module EffectiveDatatablesHelper
138
138
  def nested_datatable_link_to(title, path, options = {})
139
139
  options[:class] ||= 'btn btn-sm btn-link'
140
140
  options['data-remote'] = true
141
- options['data-nested-datatable-action'] = true
141
+ options['data-nested-datatable'] = true
142
142
 
143
143
  link_to(title, path, options)
144
144
  end
@@ -11,7 +11,7 @@
11
11
  - else
12
12
  = datatable_filter_tag(form, datatable, name, opts)
13
13
 
14
- .form-group.col-auto
14
+ .form-group.col-auto{class: (datatable._filters.present? ? 'datatables-filters-present' : 'datatables-filters-blank')}
15
15
  - if datatable._filters_form_required?
16
16
  = form.save t('effective_datatables.apply'), 'data-disable-with': t('effective_datatables.applying'), class: 'btn btn-sm btn-secondary'
17
17
  - else
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.35.0'.freeze
2
+ VERSION = '4.35.1'.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.35.0
4
+ version: 4.35.1
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: 2025-05-06 00:00:00.000000000 Z
11
+ date: 2025-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails