govuk_publishing_components 29.14.0 → 29.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/table.js +52 -0
  3. data/app/views/govuk_publishing_components/components/_table.html.erb +60 -30
  4. data/app/views/govuk_publishing_components/components/docs/table.yml +30 -0
  5. data/config/locales/ar.yml +4 -0
  6. data/config/locales/az.yml +4 -0
  7. data/config/locales/be.yml +4 -0
  8. data/config/locales/bg.yml +4 -0
  9. data/config/locales/bn.yml +4 -0
  10. data/config/locales/cs.yml +4 -0
  11. data/config/locales/cy.yml +4 -0
  12. data/config/locales/da.yml +4 -0
  13. data/config/locales/de.yml +4 -0
  14. data/config/locales/dr.yml +4 -0
  15. data/config/locales/el.yml +4 -0
  16. data/config/locales/en.yml +4 -0
  17. data/config/locales/es-419.yml +4 -0
  18. data/config/locales/es.yml +4 -0
  19. data/config/locales/et.yml +4 -0
  20. data/config/locales/fa.yml +4 -0
  21. data/config/locales/fi.yml +4 -0
  22. data/config/locales/fr.yml +4 -0
  23. data/config/locales/gd.yml +4 -0
  24. data/config/locales/gu.yml +4 -0
  25. data/config/locales/he.yml +4 -0
  26. data/config/locales/hi.yml +4 -0
  27. data/config/locales/hr.yml +4 -0
  28. data/config/locales/hu.yml +4 -0
  29. data/config/locales/hy.yml +4 -0
  30. data/config/locales/id.yml +4 -0
  31. data/config/locales/is.yml +4 -0
  32. data/config/locales/it.yml +4 -0
  33. data/config/locales/ja.yml +4 -0
  34. data/config/locales/ka.yml +4 -0
  35. data/config/locales/kk.yml +4 -0
  36. data/config/locales/ko.yml +4 -0
  37. data/config/locales/lt.yml +4 -0
  38. data/config/locales/lv.yml +4 -0
  39. data/config/locales/ms.yml +4 -0
  40. data/config/locales/mt.yml +4 -0
  41. data/config/locales/nl.yml +4 -0
  42. data/config/locales/no.yml +4 -0
  43. data/config/locales/pa-pk.yml +4 -0
  44. data/config/locales/pa.yml +4 -0
  45. data/config/locales/pl.yml +4 -0
  46. data/config/locales/ps.yml +4 -0
  47. data/config/locales/pt.yml +4 -0
  48. data/config/locales/ro.yml +4 -0
  49. data/config/locales/ru.yml +4 -0
  50. data/config/locales/si.yml +4 -0
  51. data/config/locales/sk.yml +4 -0
  52. data/config/locales/sl.yml +4 -0
  53. data/config/locales/so.yml +4 -0
  54. data/config/locales/sq.yml +4 -0
  55. data/config/locales/sr.yml +4 -0
  56. data/config/locales/sv.yml +4 -0
  57. data/config/locales/sw.yml +4 -0
  58. data/config/locales/ta.yml +4 -0
  59. data/config/locales/th.yml +4 -0
  60. data/config/locales/tk.yml +4 -0
  61. data/config/locales/tr.yml +4 -0
  62. data/config/locales/uk.yml +4 -0
  63. data/config/locales/ur.yml +4 -0
  64. data/config/locales/uz.yml +4 -0
  65. data/config/locales/vi.yml +4 -0
  66. data/config/locales/zh-hk.yml +4 -0
  67. data/config/locales/zh-tw.yml +4 -0
  68. data/config/locales/zh.yml +4 -0
  69. data/lib/govuk_publishing_components/app_helpers/table_helper.rb +3 -3
  70. data/lib/govuk_publishing_components/version.rb +1 -1
  71. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea69ac62517f1d199c528b86f901ea00cf09b7d09b9c4b7c6550af866ad67cea
4
- data.tar.gz: f92c94a1bad3f1516e4cdc4e415202c72e027b42990ed3e1c9c5eacebe389d14
3
+ metadata.gz: f53467f684078c59a2e499d0697b47183adacc1b30b9c19839ab8a8983715ff2
4
+ data.tar.gz: edddfebbcd07e825aa735e3bbe59fe000ebf5b2007272522ef94e92506cae352
5
5
  SHA512:
6
- metadata.gz: e4a5fa8f083422f90461f0473ebe979d1240a5b0a0f4a0a56f19a24936eb33c70f18216b4e29bb43140f945c9985e5da738299563b0ceab1a40932c2cb85b138
7
- data.tar.gz: 3ab97ddb79f5ed2a1494c9fa63868573b4bc18d8ba067343d4acc035b5602f90ab6a47b089a36b8590f77b5d45e9cc70084001b355cc458dbe2326346ec63073
6
+ metadata.gz: 25eed8d95465c897c95ab654b97e2bfc15fbf956fd7535c361354da8326cc23795160413abdca24bb80757f4c6ea4c1033f3ca96474caf705ae92059896bf8c8
7
+ data.tar.gz: a7c01b6e8fa79cde09ef1a04c596a97a2dde847341c7e50fece0997cd78472b8a6f30741f228feb6c29b969c3374664f46d9262827027fc42ec4a67bb0c59bd4
@@ -0,0 +1,52 @@
1
+ window.GOVUK = window.GOVUK || {}
2
+ window.GOVUK.Modules = window.GOVUK.Modules || {};
3
+
4
+ (function (Modules) {
5
+ function Table ($module) {
6
+ this.$module = $module
7
+ this.searchInput = $module.querySelector('input[name="filter"]')
8
+ this.tableRows = $module.querySelectorAll('.js-govuk-table__row')
9
+ this.filter = $module.querySelector('.js-gem-c-table__filter')
10
+ this.filterCount = this.filter.querySelector('.js-filter-count')
11
+ this.message = $module.querySelector('.js-gem-c-table__message')
12
+ this.hiddenClass = 'govuk-!-display-none'
13
+ this.filterCountText = this.filterCount.getAttribute('data-count-text')
14
+ this.tableRowsContent = []
15
+
16
+ for (var i = 0; i < this.tableRows.length; i++) {
17
+ this.tableRowsContent.push(this.tableRows[i].textContent.toUpperCase())
18
+ }
19
+ }
20
+
21
+ Table.prototype.init = function () {
22
+ this.$module.updateRows = this.updateRows.bind(this)
23
+ this.filter.classList.remove(this.hiddenClass)
24
+ this.searchInput.addEventListener('input', this.$module.updateRows)
25
+ }
26
+
27
+ // Reads value of input and filters content
28
+ Table.prototype.updateRows = function () {
29
+ var value = this.searchInput.value
30
+ var hiddenRows = 0
31
+ var length = this.tableRows.length
32
+
33
+ for (var i = 0; i < length; i++) {
34
+ if (this.tableRowsContent[i].includes(value.toUpperCase())) {
35
+ this.tableRows[i].classList.remove(this.hiddenClass)
36
+ } else {
37
+ this.tableRows[i].classList.add(this.hiddenClass)
38
+ hiddenRows++
39
+ }
40
+ }
41
+
42
+ this.filterCount.textContent = (length - hiddenRows) + ' ' + this.filterCountText
43
+
44
+ if (length === hiddenRows) {
45
+ this.message.classList.remove(this.hiddenClass)
46
+ } else {
47
+ this.message.classList.add(this.hiddenClass)
48
+ }
49
+ }
50
+
51
+ Modules.Table = Table
52
+ })(window.GOVUK.Modules)
@@ -2,46 +2,76 @@
2
2
  caption ||= nil
3
3
  head ||= []
4
4
  rows ||= []
5
- first_cell_is_header ||=false
5
+ first_cell_is_header ||= false
6
6
  caption_classes ||= nil
7
- sortable ||=false
7
+ sortable ||= false
8
+ filterable ||= false
9
+ label ||= t("components.table.filter_label")
10
+
11
+ table_id = "table-id-#{SecureRandom.hex(4)}"
12
+ filter_count_id = "filter-count-id-#{SecureRandom.hex(4)}"
8
13
  %>
9
14
 
10
- <%= GovukPublishingComponents::AppHelpers::TableHelper.helper(self, caption, {
11
- sortable: sortable,
12
- caption_classes: caption_classes
13
- }) do |t| %>
14
-
15
- <% if head.any? %>
16
- <%= t.head do %>
17
- <% head.each_with_index do |item, cellindex| %>
18
- <%= t.header item[:text], {
19
- format: item[:format],
20
- href: item[:href],
21
- data_attributes: item[:data_attributes],
22
- sort_direction: item[:sort_direction]
23
- } %>
15
+ <% @table = capture do %>
16
+ <%= GovukPublishingComponents::AppHelpers::TableHelper.helper(self, caption, table_id, {
17
+ sortable: sortable,
18
+ filterable: filterable,
19
+ caption_classes: caption_classes
20
+ }) do |t| %>
21
+
22
+ <% if head.any? %>
23
+ <%= t.head do %>
24
+ <% head.each_with_index do |item, cellindex| %>
25
+ <%= t.header item[:text], {
26
+ format: item[:format],
27
+ href: item[:href],
28
+ data_attributes: item[:data_attributes],
29
+ sort_direction: item[:sort_direction]
30
+ } %>
31
+ <% end %>
24
32
  <% end %>
25
33
  <% end %>
26
- <% end %>
27
34
 
28
- <%= t.body do %>
29
- <% rows.each_with_index do |row, rowindex| %>
30
- <%= t.row do %>
31
- <% row.each_with_index do |cell, cellindex| %>
32
- <% if cellindex == 0 && first_cell_is_header %>
33
- <%= t.header cell[:text], {
34
- scope: "row",
35
- format: cell[:format]
36
- } %>
37
- <% else %>
38
- <%= t.cell cell[:text], {
39
- format: cell[:format]
40
- } %>
35
+ <%= t.body do %>
36
+ <% rows.each_with_index do |row, rowindex| %>
37
+ <%= t.row do %>
38
+ <% row.each_with_index do |cell, cellindex| %>
39
+ <% if cellindex == 0 && first_cell_is_header %>
40
+ <%= t.header cell[:text], {
41
+ scope: "row",
42
+ format: cell[:format]
43
+ } %>
44
+ <% else %>
45
+ <%= t.cell cell[:text], {
46
+ format: cell[:format]
47
+ } %>
48
+ <% end %>
41
49
  <% end %>
42
50
  <% end %>
43
51
  <% end %>
44
52
  <% end %>
45
53
  <% end %>
54
+ <% end %>
55
+
56
+ <% if filterable %>
57
+ <div data-module="table">
58
+ <div class="js-gem-c-table__filter govuk-!-display-none">
59
+ <%= render "govuk_publishing_components/components/input", {
60
+ label: {
61
+ text: label
62
+ },
63
+ name: "filter",
64
+ controls: table_id,
65
+ aria_described_by: filter_count_id,
66
+ } %>
67
+
68
+ <p id="<%= filter_count_id %>" aria-live="polite" class="js-filter-count govuk-visually-hidden" data-count-text="<%= t("components.table.filter_count") %>"></p>
69
+ </div>
70
+
71
+ <%= @table %>
46
72
 
73
+ <p class="govuk-body govuk-!-display-none js-gem-c-table__message"><%= t("components.table.filter_message") %></p>
74
+ </div>
75
+ <% else %>
76
+ <%= @table %>
47
77
  <% end %>
@@ -134,3 +134,33 @@ examples:
134
134
  format: numeric
135
135
  - text: £80
136
136
  format: numeric
137
+ with_filter:
138
+ description: This option allows table rows to be filtered by user input. Since this filtering is implemented client-side the filter section is not displayed by default but displays only when JavaScript is enabled. The label for the input field can be set when the coponent is rendered via the `label` key. if this is not set a fallback value will display.
139
+ data:
140
+ filterable: true
141
+ label: Filter months
142
+ head:
143
+ - text: Month you apply
144
+ - text: Rate for bicycles
145
+ format: numeric
146
+ - text: Rate for vehicles
147
+ format: numeric
148
+ rows:
149
+ -
150
+ - text: January
151
+ - text: £85
152
+ format: numeric
153
+ - text: £95
154
+ format: numeric
155
+ -
156
+ - text: February
157
+ - text: £75
158
+ format: numeric
159
+ - text: £55
160
+ format: numeric
161
+ -
162
+ - text: March
163
+ - text: £165
164
+ format: numeric
165
+ - text: £125
166
+ format: numeric
@@ -203,5 +203,9 @@ ar:
203
203
  summary_list:
204
204
  delete: حذف
205
205
  edit: تغيير
206
+ table:
207
+ filter_count:
208
+ filter_label:
209
+ filter_message:
206
210
  tabs:
207
211
  contents: المحتويات
@@ -199,5 +199,9 @@ az:
199
199
  summary_list:
200
200
  delete: Sil
201
201
  edit: Dəyiş
202
+ table:
203
+ filter_count:
204
+ filter_label:
205
+ filter_message:
202
206
  tabs:
203
207
  contents: Məzmunlar
@@ -206,5 +206,9 @@ be:
206
206
  summary_list:
207
207
  delete: Выдаліць
208
208
  edit: Змянiць
209
+ table:
210
+ filter_count:
211
+ filter_label:
212
+ filter_message:
209
213
  tabs:
210
214
  contents: Змест
@@ -204,5 +204,9 @@ bg:
204
204
  summary_list:
205
205
  delete: Изтриване
206
206
  edit: Промяна
207
+ table:
208
+ filter_count:
209
+ filter_label:
210
+ filter_message:
207
211
  tabs:
208
212
  contents: Съдържание
@@ -201,5 +201,9 @@ bn:
201
201
  summary_list:
202
202
  delete: মুছে ফেলুন
203
203
  edit: পরিবর্তন
204
+ table:
205
+ filter_count:
206
+ filter_label:
207
+ filter_message:
204
208
  tabs:
205
209
  contents: বিষয়সূচী
@@ -205,5 +205,9 @@ cs:
205
205
  summary_list:
206
206
  delete: Odstranit
207
207
  edit: Změna
208
+ table:
209
+ filter_count:
210
+ filter_label:
211
+ filter_message:
208
212
  tabs:
209
213
  contents: Obsah
@@ -204,5 +204,9 @@ cy:
204
204
  summary_list:
205
205
  delete: Dileu
206
206
  edit: Newid
207
+ table:
208
+ filter_count:
209
+ filter_label:
210
+ filter_message:
207
211
  tabs:
208
212
  contents: Cynnwys
@@ -201,5 +201,9 @@ da:
201
201
  summary_list:
202
202
  delete: Slet
203
203
  edit: Ændre
204
+ table:
205
+ filter_count:
206
+ filter_label:
207
+ filter_message:
204
208
  tabs:
205
209
  contents: Indhold
@@ -204,5 +204,9 @@ de:
204
204
  summary_list:
205
205
  delete: Löschen
206
206
  edit: Ändern
207
+ table:
208
+ filter_count:
209
+ filter_label:
210
+ filter_message:
207
211
  tabs:
208
212
  contents: Inhalte
@@ -202,5 +202,9 @@ dr:
202
202
  summary_list:
203
203
  delete: حذف کردن
204
204
  edit: تغییر دادن
205
+ table:
206
+ filter_count:
207
+ filter_label:
208
+ filter_message:
205
209
  tabs:
206
210
  contents: محتویات
@@ -200,5 +200,9 @@ el:
200
200
  summary_list:
201
201
  delete: Διαγραφή
202
202
  edit: Αλλαγή
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Περιεχόμενα
@@ -332,5 +332,9 @@ en:
332
332
  summary_list:
333
333
  delete: Delete
334
334
  edit: Change
335
+ table:
336
+ filter_count: results for the term entered
337
+ filter_label: Filter
338
+ filter_message: There are no matching results
335
339
  tabs:
336
340
  contents: Contents
@@ -200,5 +200,9 @@ es-419:
200
200
  summary_list:
201
201
  delete: Borrar
202
202
  edit: Cambiar
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Contenido
@@ -200,5 +200,9 @@ es:
200
200
  summary_list:
201
201
  delete: Eliminar
202
202
  edit: Cambiar
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Contenido
@@ -203,5 +203,9 @@ et:
203
203
  summary_list:
204
204
  delete: Kustuta
205
205
  edit: Muuda
206
+ table:
207
+ filter_count:
208
+ filter_label:
209
+ filter_message:
206
210
  tabs:
207
211
  contents: Sisu
@@ -198,5 +198,9 @@ fa:
198
198
  summary_list:
199
199
  delete: حذف
200
200
  edit: تغییر
201
+ table:
202
+ filter_count:
203
+ filter_label:
204
+ filter_message:
201
205
  tabs:
202
206
  contents: محتوا
@@ -202,5 +202,9 @@ fi:
202
202
  summary_list:
203
203
  delete: Poistaa
204
204
  edit: Muuttaa
205
+ table:
206
+ filter_count:
207
+ filter_label:
208
+ filter_message:
205
209
  tabs:
206
210
  contents: Sisällys
@@ -200,5 +200,9 @@ fr:
200
200
  summary_list:
201
201
  delete: Supprimer
202
202
  edit: Modifier
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Contenu
@@ -202,5 +202,9 @@ gd:
202
202
  summary_list:
203
203
  delete: Scriosadh
204
204
  edit: A mhodhnú
205
+ table:
206
+ filter_count:
207
+ filter_label:
208
+ filter_message:
205
209
  tabs:
206
210
  contents: Clár ábhair
@@ -200,5 +200,9 @@ gu:
200
200
  summary_list:
201
201
  delete: ડિલીટ કરો
202
202
  edit: બદલો
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: સામગ્રી
@@ -200,5 +200,9 @@ he:
200
200
  summary_list:
201
201
  delete: מחק
202
202
  edit: שנה
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: תוכן
@@ -200,5 +200,9 @@ hi:
200
200
  summary_list:
201
201
  delete: हटाएं
202
202
  edit: बदलें
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: विषय-वस्तु
@@ -202,5 +202,9 @@ hr:
202
202
  summary_list:
203
203
  delete: Obriši
204
204
  edit: Promijeniti
205
+ table:
206
+ filter_count:
207
+ filter_label:
208
+ filter_message:
205
209
  tabs:
206
210
  contents: Sadržaj
@@ -203,5 +203,9 @@ hu:
203
203
  summary_list:
204
204
  delete: Törlés
205
205
  edit: Megváltoztatás
206
+ table:
207
+ filter_count:
208
+ filter_label:
209
+ filter_message:
206
210
  tabs:
207
211
  contents: Tartalomjegyzék
@@ -204,5 +204,9 @@ hy:
204
204
  summary_list:
205
205
  delete: Ջնջել
206
206
  edit: Փոխել
207
+ table:
208
+ filter_count:
209
+ filter_label:
210
+ filter_message:
207
211
  tabs:
208
212
  contents: Բովանդակություն
@@ -200,5 +200,9 @@ id:
200
200
  summary_list:
201
201
  delete: Hapus
202
202
  edit: Ubah
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Konten
@@ -200,5 +200,9 @@ is:
200
200
  summary_list:
201
201
  delete: Eyða
202
202
  edit: Breyta
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Efni
@@ -200,5 +200,9 @@ it:
200
200
  summary_list:
201
201
  delete: Cancella
202
202
  edit: Modifica
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Contenuti
@@ -196,5 +196,9 @@ ja:
196
196
  summary_list:
197
197
  delete: 削除
198
198
  edit: 変更
199
+ table:
200
+ filter_count:
201
+ filter_label:
202
+ filter_message:
199
203
  tabs:
200
204
  contents: コンテンツ
@@ -203,5 +203,9 @@ ka:
203
203
  summary_list:
204
204
  delete: წაშლა
205
205
  edit: შეცვლა
206
+ table:
207
+ filter_count:
208
+ filter_label:
209
+ filter_message:
206
210
  tabs:
207
211
  contents: შინაარსი
@@ -200,5 +200,9 @@ kk:
200
200
  summary_list:
201
201
  delete: Жою
202
202
  edit: Өзгерту
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Мазмұны
@@ -195,5 +195,9 @@ ko:
195
195
  summary_list:
196
196
  delete:
197
197
  edit:
198
+ table:
199
+ filter_count:
200
+ filter_label:
201
+ filter_message:
198
202
  tabs:
199
203
  contents:
@@ -205,5 +205,9 @@ lt:
205
205
  summary_list:
206
206
  delete: Ištrinti
207
207
  edit: Keisti
208
+ table:
209
+ filter_count:
210
+ filter_label:
211
+ filter_message:
208
212
  tabs:
209
213
  contents: Turinys
@@ -204,5 +204,9 @@ lv:
204
204
  summary_list:
205
205
  delete: Dzēst
206
206
  edit: Mainīt
207
+ table:
208
+ filter_count:
209
+ filter_label:
210
+ filter_message:
207
211
  tabs:
208
212
  contents: Saturs
@@ -199,5 +199,9 @@ ms:
199
199
  summary_list:
200
200
  delete: Padam
201
201
  edit: Ubah
202
+ table:
203
+ filter_count:
204
+ filter_label:
205
+ filter_message:
202
206
  tabs:
203
207
  contents: Kandungan
@@ -202,5 +202,9 @@ mt:
202
202
  summary_list:
203
203
  delete: Ħassar
204
204
  edit: Biddel
205
+ table:
206
+ filter_count:
207
+ filter_label:
208
+ filter_message:
205
209
  tabs:
206
210
  contents: Werrej
@@ -200,5 +200,9 @@ nl:
200
200
  summary_list:
201
201
  delete: Verwijderen
202
202
  edit: Wijzig
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Inhoud
@@ -200,5 +200,9 @@
200
200
  summary_list:
201
201
  delete: Slett
202
202
  edit: Endring
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Innhold
@@ -196,5 +196,9 @@ pa-pk:
196
196
  summary_list:
197
197
  delete: مٹا دیو
198
198
  edit: بدل دیو
199
+ table:
200
+ filter_count:
201
+ filter_label:
202
+ filter_message:
199
203
  tabs:
200
204
  contents: ایہ سارا مواد
@@ -200,5 +200,9 @@ pa:
200
200
  summary_list:
201
201
  delete: ਮਿਟਾਓ
202
202
  edit: ਬਦਲੋ
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: ਸਮਗਰੀ
@@ -204,5 +204,9 @@ pl:
204
204
  summary_list:
205
205
  delete: Usuń
206
206
  edit: Zmień
207
+ table:
208
+ filter_count:
209
+ filter_label:
210
+ filter_message:
207
211
  tabs:
208
212
  contents: Zawartość
@@ -197,5 +197,9 @@ ps:
197
197
  summary_list:
198
198
  delete: ړنګول
199
199
  edit: بدلون
200
+ table:
201
+ filter_count:
202
+ filter_label:
203
+ filter_message:
200
204
  tabs:
201
205
  contents: منځپانګې
@@ -200,5 +200,9 @@ pt:
200
200
  summary_list:
201
201
  delete: Apagar
202
202
  edit: Alterar
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Conteúdos
@@ -201,5 +201,9 @@ ro:
201
201
  summary_list:
202
202
  delete: Ștergeți
203
203
  edit: Modificați
204
+ table:
205
+ filter_count:
206
+ filter_label:
207
+ filter_message:
204
208
  tabs:
205
209
  contents: Conținut
@@ -204,5 +204,9 @@ ru:
204
204
  summary_list:
205
205
  delete: Удалить
206
206
  edit: Изменить
207
+ table:
208
+ filter_count:
209
+ filter_label:
210
+ filter_message:
207
211
  tabs:
208
212
  contents: Содержание
@@ -200,5 +200,9 @@ si:
200
200
  summary_list:
201
201
  delete: මකන්න
202
202
  edit: වෙනස් කරන්න
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: අන්තර්ගත
@@ -205,5 +205,9 @@ sk:
205
205
  summary_list:
206
206
  delete: Odstrániť
207
207
  edit: Zmeniť
208
+ table:
209
+ filter_count:
210
+ filter_label:
211
+ filter_message:
208
212
  tabs:
209
213
  contents: Obsah
@@ -207,5 +207,9 @@ sl:
207
207
  summary_list:
208
208
  delete: Izbriši
209
209
  edit: Spremeni
210
+ table:
211
+ filter_count:
212
+ filter_label:
213
+ filter_message:
210
214
  tabs:
211
215
  contents: Vsebina
@@ -200,5 +200,9 @@ so:
200
200
  summary_list:
201
201
  delete: Masax
202
202
  edit: Badal
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Waxyaabaha uu ka koobanyahay
@@ -200,5 +200,9 @@ sq:
200
200
  summary_list:
201
201
  delete: Fshij
202
202
  edit: Ndrysho
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Përmbajtje
@@ -201,5 +201,9 @@ sr:
201
201
  summary_list:
202
202
  delete: Izbriši
203
203
  edit: Promena
204
+ table:
205
+ filter_count:
206
+ filter_label:
207
+ filter_message:
204
208
  tabs:
205
209
  contents: Sadržaj
@@ -200,5 +200,9 @@ sv:
200
200
  summary_list:
201
201
  delete: Ta bort
202
202
  edit: Ändra
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Innehåll
@@ -200,5 +200,9 @@ sw:
200
200
  summary_list:
201
201
  delete: Futa
202
202
  edit: Badilisha
203
+ table:
204
+ filter_count:
205
+ filter_label:
206
+ filter_message:
203
207
  tabs:
204
208
  contents: Maudhui
@@ -201,5 +201,9 @@ ta:
201
201
  summary_list:
202
202
  delete: நீக்கு
203
203
  edit: மாற்று
204
+ table:
205
+ filter_count:
206
+ filter_label:
207
+ filter_message:
204
208
  tabs:
205
209
  contents: உள்ளடக்கம்
@@ -198,5 +198,9 @@ th:
198
198
  summary_list:
199
199
  delete: ลบ
200
200
  edit: เปลี่ยน
201
+ table:
202
+ filter_count:
203
+ filter_label:
204
+ filter_message:
201
205
  tabs:
202
206
  contents: เนื้อหา
@@ -201,5 +201,9 @@ tk:
201
201
  summary_list:
202
202
  delete: Öçürmek
203
203
  edit: Çalyşmak
204
+ table:
205
+ filter_count:
206
+ filter_label:
207
+ filter_message:
204
208
  tabs:
205
209
  contents: Mazmuny
@@ -201,5 +201,9 @@ tr:
201
201
  summary_list:
202
202
  delete: Sil
203
203
  edit: Değiştir
204
+ table:
205
+ filter_count:
206
+ filter_label:
207
+ filter_message:
204
208
  tabs:
205
209
  contents: İçerikler
@@ -207,5 +207,9 @@ uk:
207
207
  summary_list:
208
208
  delete: Видалити
209
209
  edit: Змінити
210
+ table:
211
+ filter_count:
212
+ filter_label:
213
+ filter_message:
210
214
  tabs:
211
215
  contents: Зміст
@@ -197,5 +197,9 @@ ur:
197
197
  summary_list:
198
198
  delete: حذف کریں
199
199
  edit: تبدیل کریں
200
+ table:
201
+ filter_count:
202
+ filter_label:
203
+ filter_message:
200
204
  tabs:
201
205
  contents: مشمولات
@@ -202,5 +202,9 @@ uz:
202
202
  summary_list:
203
203
  delete: Ўчириб юбориш
204
204
  edit: Ўзгартириш
205
+ table:
206
+ filter_count:
207
+ filter_label:
208
+ filter_message:
205
209
  tabs:
206
210
  contents: Мундарижа
@@ -199,5 +199,9 @@ vi:
199
199
  summary_list:
200
200
  delete: Xóa
201
201
  edit: Thay đổi
202
+ table:
203
+ filter_count:
204
+ filter_label:
205
+ filter_message:
202
206
  tabs:
203
207
  contents: Mục lục
@@ -198,5 +198,9 @@ zh-hk:
198
198
  summary_list:
199
199
  delete: 刪除
200
200
  edit: 變更
201
+ table:
202
+ filter_count:
203
+ filter_label:
204
+ filter_message:
201
205
  tabs:
202
206
  contents: 內容
@@ -198,5 +198,9 @@ zh-tw:
198
198
  summary_list:
199
199
  delete: 刪除
200
200
  edit: 變更
201
+ table:
202
+ filter_count:
203
+ filter_label:
204
+ filter_message:
201
205
  tabs:
202
206
  contents: 內容
@@ -198,5 +198,9 @@ zh:
198
198
  summary_list:
199
199
  delete: 删除
200
200
  edit: 更改
201
+ table:
202
+ filter_count:
203
+ filter_label:
204
+ filter_message:
201
205
  tabs:
202
206
  contents: 目录
@@ -1,7 +1,7 @@
1
1
  module GovukPublishingComponents
2
2
  module AppHelpers
3
3
  class TableHelper
4
- def self.helper(context, caption = nil, opt = {})
4
+ def self.helper(context, caption = nil, id = nil, opt = {})
5
5
  builder = TableBuilder.new(context.tag)
6
6
 
7
7
  classes = %w[gem-c-table govuk-table]
@@ -10,7 +10,7 @@ module GovukPublishingComponents
10
10
  caption_classes = %w[govuk-table__caption]
11
11
  caption_classes << opt[:caption_classes] if opt[:caption_classes]
12
12
 
13
- context.tag.table class: classes do
13
+ context.tag.table class: classes, id: id do
14
14
  context.concat context.tag.caption caption, class: caption_classes
15
15
  yield(builder)
16
16
  end
@@ -41,7 +41,7 @@ module GovukPublishingComponents
41
41
  end
42
42
 
43
43
  def row
44
- tag.tr class: "govuk-table__row" do
44
+ tag.tr class: "govuk-table__row js-govuk-table__row" do
45
45
  yield(self)
46
46
  end
47
47
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "29.14.0".freeze
2
+ VERSION = "29.15.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 29.14.0
4
+ version: 29.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-08 00:00:00.000000000 Z
11
+ date: 2022-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -481,6 +481,7 @@ files:
481
481
  - app/assets/javascripts/govuk_publishing_components/components/single-page-notification-button.js
482
482
  - app/assets/javascripts/govuk_publishing_components/components/skip-link.js
483
483
  - app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js
484
+ - app/assets/javascripts/govuk_publishing_components/components/table.js
484
485
  - app/assets/javascripts/govuk_publishing_components/components/tabs.js
485
486
  - app/assets/javascripts/govuk_publishing_components/dependencies.js
486
487
  - app/assets/javascripts/govuk_publishing_components/ie.js