govuk_publishing_components 64.0.0 → 64.1.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.
Files changed (23) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-change-tracker.js +8 -2
  3. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +12 -3
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +4 -0
  5. data/app/controllers/govuk_publishing_components/applications_page_controller.rb +1 -0
  6. data/app/models/govuk_publishing_components/applications_page.rb +12 -7
  7. data/app/views/govuk_publishing_components/applications_page/_table-content.html.erb +7 -0
  8. data/app/views/govuk_publishing_components/applications_page/show.html.erb +1 -0
  9. data/app/views/govuk_publishing_components/components/_checkboxes.html.erb +40 -39
  10. data/app/views/govuk_publishing_components/components/_file_upload.html.erb +4 -0
  11. data/app/views/govuk_publishing_components/components/docs/textarea.yml +6 -8
  12. data/lib/govuk_publishing_components/presenters/checkboxes_helper.rb +6 -3
  13. data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +1 -2
  14. data/lib/govuk_publishing_components/version.rb +1 -1
  15. data/node_modules/sortablejs/Sortable.js +102 -117
  16. data/node_modules/sortablejs/Sortable.min.js +2 -2
  17. data/node_modules/sortablejs/modular/sortable.complete.esm.js +102 -117
  18. data/node_modules/sortablejs/modular/sortable.core.esm.js +102 -117
  19. data/node_modules/sortablejs/modular/sortable.esm.js +102 -117
  20. data/node_modules/sortablejs/package.json +1 -1
  21. data/node_modules/sortablejs/src/Sortable.js +5 -2
  22. data/node_modules/sortablejs/src/utils.js +2 -2
  23. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16c3c262e09722b90a73a068ab44323e447d40e7c833b0ef9e060bf113f776f2
4
- data.tar.gz: 38303d6dd5e90633a3b7a75126f0b1fcfc51c522417f9efc4f365992cc878171
3
+ metadata.gz: 6ce0c3f4602a7fc50dd1f1f38a9d177c256c320842afd37f83260571361c8aef
4
+ data.tar.gz: 851ec585153e68a005871ad0a242130d0e8df04e10902c888750f51186a63410
5
5
  SHA512:
6
- metadata.gz: b590dce6cb9e0f0d0b53a0921579325699c0f6911c0bc3aa619293fedaa455bce9b41769c1fb95a662c7210ecb059faff660f50a0f0ac3620124f6151e4fcc7b
7
- data.tar.gz: 0b1fbb803c88a2147aa091c46453d44c51ed35612a76f1d7815544a8858fd3f15bf432240ed7766d8831e2111e85597635b51d0157961aaba79eaedefd15ddbb
6
+ metadata.gz: 994f0af2defdd9971a6c22b14e039e9afc801ef18d704527287fc6d355ba1a2d9ea2c898fd1a067992e7a6f289529c8844e4822f8e855b69cfbcdad204dd4ea7
7
+ data.tar.gz: b9b4edbc35f12d6373aca1df522393529da9124a65eb64b8598c120963815be5f405b29dede59ea5a9277123c1d1632e2753ecc9d9b727bcb0a62e5932cc9b3b
@@ -110,13 +110,19 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
110
110
  let text
111
111
 
112
112
  if (checkableValue) {
113
+ const fieldset = checkableValue.closest('fieldset') || null
114
+ const redactedFieldset = fieldset && fieldset.dataset.ga4Redact
115
+
113
116
  // radio, check, option can have `:checked` pseudo-class
114
117
  if (!checkableValue.matches(':checked')) {
115
118
  action = 'remove'
116
119
  }
117
120
 
118
- text = checkableValue.innerText ||
119
- this.module.querySelector(`label[for='${window.CSS.escape(id)}']`).innerText
121
+ if (redactedFieldset && !checkableValue.dataset.ga4RedactPermit) {
122
+ text = '[REDACTED]'
123
+ } else {
124
+ text = checkableValue.innerText || this.module.querySelector(`label[for='${window.CSS.escape(id)}']`).innerText
125
+ }
120
126
 
121
127
  if (text) {
122
128
  text = text.replace(/\r?\n|\r/g, ' ')
@@ -83,12 +83,17 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
83
83
  for (var i = 0; i < labels.length; i++) {
84
84
  var label = labels[i]
85
85
  var labelFor = label.getAttribute('for')
86
+ var hiddenInput = label.getAttribute('data-ga4-hidden-input')
86
87
  var input = false
87
- if (labelFor) {
88
+
89
+ if (hiddenInput) {
90
+ input = this.module.querySelector('[id="' + hiddenInput + '"]')
91
+ } else if (labelFor) {
88
92
  input = this.module.querySelector('[id="' + labelFor + '"]')
89
93
  } else {
90
94
  input = label.querySelector('input')
91
95
  }
96
+
92
97
  inputs.push({
93
98
  input: input,
94
99
  label: label
@@ -122,9 +127,13 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
122
127
  // don't include conditional field control in text
123
128
  inputs.splice(i, 1)
124
129
  } else if (elem.checked) {
125
- input.answer = labelText
130
+ var fieldset = elem.closest('fieldset') || null
126
131
 
127
- var fieldset = elem.closest('fieldset')
132
+ if (fieldset.dataset.ga4Redact && !elem.dataset.ga4RedactPermit) {
133
+ input.answer = '[REDACTED]'
134
+ } else {
135
+ input.answer = labelText
136
+ }
128
137
 
129
138
  if (fieldset) {
130
139
  var legend = fieldset.querySelector('legend')
@@ -14,3 +14,7 @@ $search-icon-size: 40px;
14
14
  height: govuk-px-to-rem($search-icon-size);
15
15
  background: url("govuk_publishing_components/icon-search.svg") no-repeat -3px center;
16
16
  }
17
+
18
+ .gem-c-input--with-search-icon {
19
+ padding-left: govuk-spacing(6);
20
+ }
@@ -40,6 +40,7 @@ module GovukPublishingComponents
40
40
  gem_version: app.gem_version,
41
41
  gem_version_status: app.gem_version == GovukPublishingComponents::VERSION ? "green" : "red",
42
42
  sass_version: app.sass_version,
43
+ ruby_version: app.ruby_version,
43
44
  }
44
45
  end
45
46
  end
@@ -5,7 +5,8 @@ module GovukPublishingComponents
5
5
  def initialize(application)
6
6
  @application = application
7
7
  @dir = get_directory
8
- @gemfilelock = get_gemfile
8
+ @gemfilelock = get_file("Gemfile.lock")
9
+ @rubyfile = get_file(".ruby-version")
9
10
  end
10
11
 
11
12
  def readable_name
@@ -20,6 +21,10 @@ module GovukPublishingComponents
20
21
  parse_file(@gemfilelock, /sass-embedded \(([^)>=~ ]+)\)/)
21
22
  end
22
23
 
24
+ def ruby_version
25
+ @rubyfile.strip if @rubyfile
26
+ end
27
+
23
28
  private
24
29
 
25
30
  def get_directory
@@ -27,20 +32,20 @@ module GovukPublishingComponents
27
32
  Dir.exist?(app_dir) ? app_dir : false
28
33
  end
29
34
 
30
- def get_gemfile
31
- @dir ? get_gemfile_local : get_gemfile_remote
35
+ def get_file(name)
36
+ @dir ? get_local_file(name) : get_remote_file(name)
32
37
  end
33
38
 
34
- def get_gemfile_local
35
- lockfile = "#{@dir}/Gemfile.lock"
39
+ def get_local_file(name)
40
+ lockfile = "#{@dir}/#{name}"
36
41
  return unless File.file?(lockfile)
37
42
 
38
43
  @source = "local"
39
44
  File.read(lockfile)
40
45
  end
41
46
 
42
- def get_gemfile_remote
43
- uri = URI("https://raw.githubusercontent.com/alphagov/#{@application}/main/Gemfile.lock")
47
+ def get_remote_file(name)
48
+ uri = URI("https://raw.githubusercontent.com/alphagov/#{@application}/main/#{name}")
44
49
  result = Net::HTTP.get_response(uri)
45
50
  if result.is_a?(Net::HTTPSuccess)
46
51
  @source = "remote"
@@ -28,5 +28,12 @@
28
28
  } %>
29
29
  <% end %>
30
30
  </td>
31
+ <td class="govuk-table__cell">
32
+ <% if app[:ruby_version] %>
33
+ <%= render "govuk_publishing_components/components/tag", {
34
+ text: app[:ruby_version],
35
+ } %>
36
+ <% end %>
37
+ </td>
31
38
  </tr>
32
39
  <% end %>
@@ -24,6 +24,7 @@
24
24
  <th scope="col" class="govuk-table__header sticky-table-header">Source</th>
25
25
  <th scope="col" class="govuk-table__header sticky-table-header">Gem version</th>
26
26
  <th scope="col" class="govuk-table__header sticky-table-header">Sass version</th>
27
+ <th scope="col" class="govuk-table__header sticky-table-header">Ruby version</th>
27
28
  </tr>
28
29
  </thead>
29
30
  <tbody class="govuk-table__body">
@@ -6,60 +6,61 @@
6
6
  component_helper.add_class(cb_helper.css_classes.join(" ")) # cb_helper.css_classes generates "gem-c-checkboxes"
7
7
  component_helper.add_data_attribute({ module: "gem-checkboxes govuk-checkboxes" })
8
8
  %>
9
+ <% if cb_helper.items.any? %>
10
+ <%= tag.div(**component_helper.all_attributes) do %>
11
+ <% if cb_helper.should_have_fieldset %>
12
+ <% if cb_helper.heading_markup %>
13
+ <%= tag.fieldset class: "govuk-fieldset", "aria-describedby": cb_helper.fieldset_describedby do %>
14
+ <%= cb_helper.heading_markup %>
9
15
 
10
- <%= tag.div(**component_helper.all_attributes) do %>
11
- <% if cb_helper.should_have_fieldset %>
12
- <% if cb_helper.heading_markup %>
13
- <%= tag.fieldset class: "govuk-fieldset", "aria-describedby": cb_helper.fieldset_describedby do %>
14
- <%= cb_helper.heading_markup %>
15
-
16
- <% if cb_helper.description %>
17
- <%= tag.div cb_helper.description, class: "govuk-body" %>
18
- <% end %>
16
+ <% if cb_helper.description %>
17
+ <%= tag.div cb_helper.description, class: "govuk-body" %>
18
+ <% end %>
19
19
 
20
- <% if cb_helper.hint_text %>
21
- <%= tag.div cb_helper.hint_text, id: "#{id}-hint", class: "govuk-hint" %>
22
- <% end %>
20
+ <% if cb_helper.hint_text %>
21
+ <%= tag.div cb_helper.hint_text, id: "#{id}-hint", class: "govuk-hint" %>
22
+ <% end %>
23
23
 
24
- <% if cb_helper.error %>
25
- <%= tag.p error, id: "#{id}-error", class: "govuk-error-message" %>
26
- <% end %>
24
+ <% if cb_helper.error %>
25
+ <%= tag.p error, id: "#{id}-error", class: "govuk-error-message" %>
26
+ <% end %>
27
27
 
28
- <%= tag.div class: "govuk-checkboxes", data: {
29
- module: ("govuk-checkboxes" if cb_helper.has_conditional),
30
- nested: ("true" if cb_helper.has_nested),
31
- } do %>
32
- <% cb_helper.items.each_with_index do |item, index| %>
33
- <% if item === :or %>
34
- <%= tag.div t("components.checkboxes.or"), class: "govuk-checkboxes__divider" %>
35
- <% else %>
36
- <%= tag.div class: "govuk-checkboxes__item" do %>
37
- <%= cb_helper.checkbox_markup(item, index) %>
28
+ <%= tag.div class: "govuk-checkboxes", data: {
29
+ module: ("govuk-checkboxes" if cb_helper.has_conditional),
30
+ nested: ("true" if cb_helper.has_nested),
31
+ } do %>
32
+ <% cb_helper.items.each_with_index do |item, index| %>
33
+ <% if item === :or %>
34
+ <%= tag.div t("components.checkboxes.or"), class: "govuk-checkboxes__divider" %>
35
+ <% else %>
36
+ <%= tag.div class: "govuk-checkboxes__item" do %>
37
+ <%= cb_helper.checkbox_markup(item, index) %>
38
38
 
39
- <% if item[:items].present? %>
40
- <%= tag.div id: "#{id}-nested-#{index}", class: "govuk-checkboxes--nested", data: { parent: "#{id}-#{index}" } do %>
41
- <% item[:items].each_with_index do |nested_item, nested_index| %>
42
- <%= tag.div class: "govuk-checkboxes__item" do %>
43
- <%= cb_helper.checkbox_markup(nested_item, "#{index}-#{nested_index}") %>
39
+ <% if item[:items].present? %>
40
+ <%= tag.div id: "#{id}-nested-#{index}", class: "govuk-checkboxes--nested", data: { parent: "#{id}-#{index}" } do %>
41
+ <% item[:items].each_with_index do |nested_item, nested_index| %>
42
+ <%= tag.div class: "govuk-checkboxes__item" do %>
43
+ <%= cb_helper.checkbox_markup(nested_item, "#{index}-#{nested_index}") %>
44
+ <% end %>
44
45
  <% end %>
45
46
  <% end %>
46
47
  <% end %>
47
48
  <% end %>
48
- <% end %>
49
49
 
50
- <% if item[:conditional] %>
51
- <%= tag.div item[:conditional], id: "#{id}-#{index}-conditional-#{index}", class: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden" %>
52
- <% end %>
50
+ <% if item[:conditional] %>
51
+ <%= tag.div item[:conditional], id: "#{id}-#{index}-conditional-#{index}", class: "govuk-checkboxes__conditional govuk-checkboxes__conditional--hidden" %>
52
+ <% end %>
53
53
 
54
+ <% end %>
54
55
  <% end %>
55
56
  <% end %>
56
57
  <% end %>
57
58
  <% end %>
58
- <% end %>
59
59
 
60
- <% else %>
61
- <div class="govuk-checkboxes__item">
62
- <%= cb_helper.checkbox_markup(cb_helper.items[0], 0) %>
63
- </div>
60
+ <% else %>
61
+ <div class="govuk-checkboxes__item">
62
+ <%= cb_helper.checkbox_markup(cb_helper.items[0], 0) %>
63
+ </div>
64
+ <% end %>
64
65
  <% end %>
65
66
  <% end %>
@@ -18,6 +18,10 @@
18
18
  heading_level ||= nil
19
19
  javascript ||= false
20
20
 
21
+ if javascript
22
+ label[:data_attributes] = { ga4_hidden_input: "#{id}-input" }
23
+ end
24
+
21
25
  css_classes = %w(gem-c-file-upload govuk-file-upload)
22
26
  css_classes << "govuk-file-upload--error" if has_error
23
27
  form_group_css_classes = %w(govuk-form-group)
@@ -28,13 +28,6 @@ examples:
28
28
  text: "What is the nature of your medical emergency?"
29
29
  name: "emergency-name"
30
30
  textarea_id: "emergency-id"
31
- with_margin_bottom:
32
- description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to a margin bottom of 6 (30px).
33
- data:
34
- margin_bottom: 9
35
- label:
36
- text: "Can you provide more detail?"
37
- name: "more-detail"
38
31
  specific_rows:
39
32
  description: Textarea with 10 rows
40
33
  data:
@@ -64,6 +57,12 @@ examples:
64
57
  href: '#example-error-1'
65
58
  - text: Descriptive link to the question with an error 2
66
59
  href: '#example-error-2'
60
+ with bold_label:
61
+ data:
62
+ label:
63
+ text: "Can you provide more detail?"
64
+ bold: true
65
+ name: "more-detail"
67
66
  with_label_as_page_heading:
68
67
  data:
69
68
  label:
@@ -106,7 +105,6 @@ examples:
106
105
  textarea_id: "contextual-guidance-id"
107
106
  label:
108
107
  text: "Title"
109
- bold: true
110
108
  name: "described"
111
109
  rows: 2
112
110
  describedby: "contextual-guidance"
@@ -17,6 +17,8 @@ module GovukPublishingComponents
17
17
 
18
18
  def initialize(options)
19
19
  @items = options[:items] || []
20
+ return unless @items.any?
21
+
20
22
  @name = options[:name]
21
23
  @css_classes = %w[gem-c-checkboxes govuk-form-group]
22
24
  @css_classes << "govuk-form-group--error" if options[:error]
@@ -24,8 +26,8 @@ module GovukPublishingComponents
24
26
  @error = true if options[:error]
25
27
 
26
28
  # check if any item is set as being conditional
27
- @has_conditional = options[:items].any? { |item| item.is_a?(Hash) && item[:conditional] }
28
- @has_nested = options[:items].any? { |item| item.is_a?(Hash) && item[:items] }
29
+ @has_conditional = @items.any? { |item| item.is_a?(Hash) && item[:conditional] }
30
+ @has_nested = @items.any? { |item| item.is_a?(Hash) && item[:items] }
29
31
 
30
32
  @id = options[:id] || "checkboxes-#{SecureRandom.hex(4)}"
31
33
  @heading = options[:heading] || nil
@@ -41,7 +43,7 @@ module GovukPublishingComponents
41
43
  # should have a fieldset if there's a heading, or if more than one checkbox
42
44
  # separate check is in the view for if more than one checkbox and no heading, in which case fail
43
45
  def should_have_fieldset
44
- @items.length > 1 || @heading
46
+ @items.length > 1 || !@heading.blank? # rubocop:disable Rails/Present
45
47
  end
46
48
 
47
49
  def fieldset_describedby
@@ -91,6 +93,7 @@ module GovukPublishingComponents
91
93
  checked = true if checkbox[:checked].present?
92
94
  data = checkbox[:data_attributes] || {}
93
95
  data[:controls] = controls
96
+ # aria-controls is set as a data attribute then applied properly using JS
94
97
  data["aria-controls"] = aria_controls
95
98
  data[:behaviour] = "exclusive" if checkbox[:exclusive]
96
99
 
@@ -24,8 +24,7 @@ module GovukPublishingComponents
24
24
  end
25
25
 
26
26
  def questions_and_answers_markup
27
- question_and_answers.select { |_, value| value[:answer].present? }
28
- .map do |question, value|
27
+ question_and_answers.select { |_, value| value[:answer].present? }.map do |question, value|
29
28
  q_and_a_url = section_url(value[:anchor])
30
29
 
31
30
  {
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "64.0.0".freeze
2
+ VERSION = "64.1.1".freeze
3
3
  end
@@ -1,5 +1,5 @@
1
1
  /**!
2
- * Sortable 1.15.6
2
+ * Sortable 1.15.7
3
3
  * @author RubaXa <trash@rubaxa.org>
4
4
  * @author owenm <owen23355@gmail.com>
5
5
  * @license MIT
@@ -10,131 +10,113 @@
10
10
  (global = global || self, global.Sortable = factory());
11
11
  }(this, (function () { 'use strict';
12
12
 
13
- function ownKeys(object, enumerableOnly) {
14
- var keys = Object.keys(object);
15
- if (Object.getOwnPropertySymbols) {
16
- var symbols = Object.getOwnPropertySymbols(object);
17
- if (enumerableOnly) {
18
- symbols = symbols.filter(function (sym) {
19
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
20
- });
21
- }
22
- keys.push.apply(keys, symbols);
23
- }
24
- return keys;
25
- }
26
- function _objectSpread2(target) {
27
- for (var i = 1; i < arguments.length; i++) {
28
- var source = arguments[i] != null ? arguments[i] : {};
29
- if (i % 2) {
30
- ownKeys(Object(source), true).forEach(function (key) {
31
- _defineProperty(target, key, source[key]);
32
- });
33
- } else if (Object.getOwnPropertyDescriptors) {
34
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
35
- } else {
36
- ownKeys(Object(source)).forEach(function (key) {
37
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
38
- });
39
- }
40
- }
41
- return target;
13
+ function _arrayLikeToArray(r, a) {
14
+ (null == a || a > r.length) && (a = r.length);
15
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
16
+ return n;
42
17
  }
43
- function _typeof(obj) {
44
- "@babel/helpers - typeof";
45
-
46
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
47
- _typeof = function (obj) {
48
- return typeof obj;
49
- };
50
- } else {
51
- _typeof = function (obj) {
52
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
53
- };
54
- }
55
- return _typeof(obj);
56
- }
57
- function _defineProperty(obj, key, value) {
58
- if (key in obj) {
59
- Object.defineProperty(obj, key, {
60
- value: value,
61
- enumerable: true,
62
- configurable: true,
63
- writable: true
64
- });
65
- } else {
66
- obj[key] = value;
67
- }
68
- return obj;
18
+ function _arrayWithoutHoles(r) {
19
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
69
20
  }
70
- function _extends() {
71
- _extends = Object.assign || function (target) {
72
- for (var i = 1; i < arguments.length; i++) {
73
- var source = arguments[i];
74
- for (var key in source) {
75
- if (Object.prototype.hasOwnProperty.call(source, key)) {
76
- target[key] = source[key];
77
- }
78
- }
79
- }
80
- return target;
81
- };
82
- return _extends.apply(this, arguments);
83
- }
84
- function _objectWithoutPropertiesLoose(source, excluded) {
85
- if (source == null) return {};
86
- var target = {};
87
- var sourceKeys = Object.keys(source);
88
- var key, i;
89
- for (i = 0; i < sourceKeys.length; i++) {
90
- key = sourceKeys[i];
91
- if (excluded.indexOf(key) >= 0) continue;
92
- target[key] = source[key];
93
- }
94
- return target;
21
+ function _defineProperty(e, r, t) {
22
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
23
+ value: t,
24
+ enumerable: !0,
25
+ configurable: !0,
26
+ writable: !0
27
+ }) : e[r] = t, e;
95
28
  }
96
- function _objectWithoutProperties(source, excluded) {
97
- if (source == null) return {};
98
- var target = _objectWithoutPropertiesLoose(source, excluded);
99
- var key, i;
100
- if (Object.getOwnPropertySymbols) {
101
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
102
- for (i = 0; i < sourceSymbolKeys.length; i++) {
103
- key = sourceSymbolKeys[i];
104
- if (excluded.indexOf(key) >= 0) continue;
105
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
106
- target[key] = source[key];
29
+ function _extends() {
30
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
31
+ for (var e = 1; e < arguments.length; e++) {
32
+ var t = arguments[e];
33
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
107
34
  }
108
- }
109
- return target;
35
+ return n;
36
+ }, _extends.apply(null, arguments);
110
37
  }
111
- function _toConsumableArray(arr) {
112
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
38
+ function _iterableToArray(r) {
39
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
113
40
  }
114
- function _arrayWithoutHoles(arr) {
115
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
41
+ function _nonIterableSpread() {
42
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
116
43
  }
117
- function _iterableToArray(iter) {
118
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
44
+ function ownKeys(e, r) {
45
+ var t = Object.keys(e);
46
+ if (Object.getOwnPropertySymbols) {
47
+ var o = Object.getOwnPropertySymbols(e);
48
+ r && (o = o.filter(function (r) {
49
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
50
+ })), t.push.apply(t, o);
51
+ }
52
+ return t;
53
+ }
54
+ function _objectSpread2(e) {
55
+ for (var r = 1; r < arguments.length; r++) {
56
+ var t = null != arguments[r] ? arguments[r] : {};
57
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
58
+ _defineProperty(e, r, t[r]);
59
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
60
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
61
+ });
62
+ }
63
+ return e;
119
64
  }
120
- function _unsupportedIterableToArray(o, minLen) {
121
- if (!o) return;
122
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
123
- var n = Object.prototype.toString.call(o).slice(8, -1);
124
- if (n === "Object" && o.constructor) n = o.constructor.name;
125
- if (n === "Map" || n === "Set") return Array.from(o);
126
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
65
+ function _objectWithoutProperties(e, t) {
66
+ if (null == e) return {};
67
+ var o,
68
+ r,
69
+ i = _objectWithoutPropertiesLoose(e, t);
70
+ if (Object.getOwnPropertySymbols) {
71
+ var n = Object.getOwnPropertySymbols(e);
72
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
73
+ }
74
+ return i;
75
+ }
76
+ function _objectWithoutPropertiesLoose(r, e) {
77
+ if (null == r) return {};
78
+ var t = {};
79
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
80
+ if (-1 !== e.indexOf(n)) continue;
81
+ t[n] = r[n];
82
+ }
83
+ return t;
84
+ }
85
+ function _toConsumableArray(r) {
86
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
87
+ }
88
+ function _toPrimitive(t, r) {
89
+ if ("object" != typeof t || !t) return t;
90
+ var e = t[Symbol.toPrimitive];
91
+ if (void 0 !== e) {
92
+ var i = e.call(t, r || "default");
93
+ if ("object" != typeof i) return i;
94
+ throw new TypeError("@@toPrimitive must return a primitive value.");
95
+ }
96
+ return ("string" === r ? String : Number)(t);
127
97
  }
128
- function _arrayLikeToArray(arr, len) {
129
- if (len == null || len > arr.length) len = arr.length;
130
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
131
- return arr2;
98
+ function _toPropertyKey(t) {
99
+ var i = _toPrimitive(t, "string");
100
+ return "symbol" == typeof i ? i : i + "";
132
101
  }
133
- function _nonIterableSpread() {
134
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
102
+ function _typeof(o) {
103
+ "@babel/helpers - typeof";
104
+
105
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
106
+ return typeof o;
107
+ } : function (o) {
108
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
109
+ }, _typeof(o);
110
+ }
111
+ function _unsupportedIterableToArray(r, a) {
112
+ if (r) {
113
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
114
+ var t = {}.toString.call(r).slice(8, -1);
115
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
116
+ }
135
117
  }
136
118
 
137
- var version = "1.15.6";
119
+ var version = "1.15.7";
138
120
 
139
121
  function userAgent(pattern) {
140
122
  if (typeof window !== 'undefined' && window.navigator) {
@@ -177,7 +159,7 @@
177
159
  return false;
178
160
  }
179
161
  function getParentOrHost(el) {
180
- return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
162
+ return el.host && el !== document && el.host.nodeType && el.host !== el ? el.host : el.parentNode;
181
163
  }
182
164
  function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
183
165
  if (el) {
@@ -2061,8 +2043,11 @@
2061
2043
  _nulling: function _nulling() {
2062
2044
  pluginEvent('nulling', this);
2063
2045
  rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
2064
- savedInputChecked.forEach(function (el) {
2065
- el.checked = true;
2046
+ var el = this.el;
2047
+ savedInputChecked.forEach(function (checkEl) {
2048
+ if (el.contains(checkEl)) {
2049
+ checkEl.checked = true;
2050
+ }
2066
2051
  });
2067
2052
  savedInputChecked.length = lastDx = lastDy = 0;
2068
2053
  },