ndr_ui 5.0.0 → 5.0.2

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: b932ab48f36e6593dfbcb4de77da6f3026262e4a63db157668b2888a2e59cf46
4
- data.tar.gz: 0a817d12dfffdb8053b58006dcf0359bc14be594c8cbe4a15ff8c76ee9c69a92
3
+ metadata.gz: a2fe83273bc89d89c52221125280a72d2e21d8d1a6b5a08a60f705a822ee4892
4
+ data.tar.gz: a7582a30f48f0b3b448f90f462adb12d66163ebf1fbefd5ca619c039130109b2
5
5
  SHA512:
6
- metadata.gz: 1caf182beb7757e40762e3ba5373fd823083ce53af7f632eb94cee88d257ee615d660c72034c4f2ea857f434262054c1d77658952ed60bafd61e6a51d8e93f02
7
- data.tar.gz: baa4a91ace512e0dbe82c9468d37291c6eddd82387f7551594d678c4314b0e89ab2c99e561e9ab05d32316d5db19df8409ae25240ad00ca32eaeb201e5891a1a
6
+ metadata.gz: 297e03b359f052b0945aefa379ebc60cf34aff58862c8623d2be1cd7c4888ce1a5b2d2964de0457e970c23d25956c8aa6349cc7207a9eb2ca1b34c30970400a4
7
+ data.tar.gz: 459e1b57cc9573c494c72fef667e0c7efc5b02217fc6f4a4f605d56f3eaccc5a34d50393d3a19df10c6e86b6bfcf16fd96993748c816d437632224539495fae2
data/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  ## [Unreleased]
2
2
  * no unreleased changes *
3
3
 
4
+ ## 5.0.2 / 2025-03-02
5
+ ### Fixed
6
+ * add row class to horizontal form row (.form-group)
7
+ * add `has-validation` class to input fields with addons
8
+
9
+ ## 5.0.1 / 2025-02-03
10
+ ### Fixed
11
+ * fix cancel modal button
12
+ * re-introdce `btn-default` style
13
+ * fix `bootstrap_tab_nav_tag` helper method with required classes
14
+ * allow more padding at the end for `bootstrap_list_badge_and_link_to`
15
+ * fix offset class name in line with Bootstrap 5 upgrade
16
+ * fix `bootstrap_alert_tag` style with close button option
17
+
4
18
  ## 5.0.0 / 2025-01-24
5
19
  ### Changed
6
20
  * Support Bootstrap to v5.3.3
@@ -7,9 +7,9 @@ $bootstrap-icons-font-dir: ".";
7
7
  // Fieldsets don't behave properly with Bootstrap in Firefox
8
8
  // https://stackoverflow.com/questions/17408815/fieldset-resizes-wrong-appears-to-have-unremovable-min-width-min-content/17863685#17863685
9
9
  @-moz-document url-prefix() {
10
- fieldset {
11
- display: table-cell;
12
- }
10
+ fieldset {
11
+ display: table-cell;
12
+ }
13
13
  }
14
14
 
15
15
  // for input fields with input-addons, remove background and border when the form is readonly.
@@ -19,3 +19,25 @@ $bootstrap-icons-font-dir: ".";
19
19
  border:0;
20
20
  }
21
21
  }
22
+
23
+ // UI fix for .input-group in readonly mode
24
+ form .input-group {
25
+ // for input-addons in readonly mode, remove background and border
26
+ .form-control-plaintext + .input-group-text,
27
+ .input-group-text:has(+ .form-control-plaintext) {
28
+ background: none;
29
+ border:0;
30
+ }
31
+
32
+ // for readonly fields following or followed by input-addons, set auto width to display content in one line
33
+ .form-control-plaintext:has(+ .input-group-text),
34
+ .input-group-text + .form-control-plaintext {
35
+ width: auto;
36
+ }
37
+ }
38
+
39
+ // Bootstrap don't have btn-default anymore
40
+ // however, we keep btn-default in codebase/helpers and set global default setting here.
41
+ .btn-default {
42
+ @extend .btn-outline-secondary;
43
+ }
@@ -18,7 +18,7 @@ module NdrUi
18
18
  div_content << text_field_without_inline_errors(method, options)
19
19
  div_content << @template.content_tag(:span, append, class: 'input-group-text') if append.present?
20
20
 
21
- @template.content_tag(:div, @template.safe_join(div_content), class: 'input-group')
21
+ @template.content_tag(:div, @template.safe_join(div_content), class: 'input-group has-validation')
22
22
  end
23
23
  end
24
24
  end
@@ -218,7 +218,7 @@ module NdrUi
218
218
  end
219
219
 
220
220
  def bootstrap_modal_button(label)
221
- button_tag(label, class: 'btn btn-default', 'data-bs-dismiss': 'modal')
221
+ button_tag(label, type: 'button', class: 'btn btn-default', 'data-bs-dismiss': 'modal')
222
222
  end
223
223
 
224
224
  private
@@ -227,8 +227,8 @@ module NdrUi
227
227
  def bootstrap_modal_classes(options)
228
228
  options = options.stringify_keys
229
229
 
230
- classes = %w(modal-dialog)
231
- classes << "modal-#{options['size']}" if MODAL_SIZES.include?(options['size'])
230
+ classes = %w[modal-dialog]
231
+ classes << "modal-#{options['size']}" if MODAL_SIZES.include?(options['size'].to_s)
232
232
  classes.join(' ')
233
233
  end
234
234
  end
@@ -51,8 +51,8 @@ module NdrUi
51
51
  # <%= bootstrap_alert_tag(:info) do %>
52
52
  # Check it out!!
53
53
  # <% end %>
54
- # # => <div class="alert alert-info"><button type="button" class="btn-close"
55
- # data-bs-dismiss="alert"></button>Check it out!!</div>
54
+ # # => <div class="alert alert-info">Check it out!!
55
+ # <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>
56
56
  #
57
57
  # Ids for css and/or javascript are easy to produce:
58
58
  #
@@ -79,7 +79,7 @@ module NdrUi
79
79
  options['class'] = classes.join(' ')
80
80
 
81
81
  if options.delete('dismissible')
82
- message = button_tag('', type: 'button', class: 'btn-close', 'data-bs-dismiss': 'alert') + message
82
+ message = message.html_safe + button_tag('', type: 'button', class: 'btn-close', 'data-bs-dismiss': 'alert')
83
83
  end
84
84
  content_tag(:div, message, options)
85
85
  end
@@ -203,16 +203,18 @@ module NdrUi
203
203
  # ==== Examples
204
204
  #
205
205
  # <%= bootstrap_tab_nav_tag("Fruits", "#fruits", true) %>
206
- # # => <li class="active"><a href="#fruits" data-bs-toggle="tab">Fruits</a></li>
206
+ # # => <li class="nav-item"><a class="nav-link active" href="#fruits" data-bs-toggle="tab">Fruits</a></li>
207
207
  def bootstrap_tab_nav_tag(title, linkto, active = false)
208
208
  content_tag('li',
209
- link_to(title, linkto, 'data-bs-toggle': 'tab'),
210
- active ? { class: 'active' } : {})
209
+ link_to(title, linkto, 'data-bs-toggle': 'tab', class: "nav-link#{active ? ' active' : ''}"),
210
+ class: 'nav-item')
211
211
  end
212
212
 
213
213
  # Convenience wrapper for a bootstrap_list_link_to with badge
214
214
  def bootstrap_list_badge_and_link_to(type, count, name, path)
215
- html = content_tag(:div, bootstrap_badge_tag(type, count), class: 'float-end') + name
215
+ html = content_tag(:div, bootstrap_badge_tag(type, count), class: 'float-end') +
216
+ content_tag(:div, name, class: 'pe-5')
217
+
216
218
  bootstrap_list_link_to(html, path)
217
219
  end
218
220
 
@@ -306,7 +308,7 @@ module NdrUi
306
308
  # <%= button_control_group("Apples", class: "some_class") %>
307
309
  # # =>
308
310
  # <div class="form-group">
309
- # <div class="col-sm-9 col-sm-offset-3">
311
+ # <div class="col-sm-9 offset-sm-3">
310
312
  # <div class="some_class">Apples</div>
311
313
  # </div>
312
314
  # </div>
@@ -379,21 +381,21 @@ module NdrUi
379
381
  # ==== Examples
380
382
  # bootstrap_horizontal_form_group("The Label", [3, 9]) { 'This is the content' }
381
383
  # # =>
382
- # <div class="form-group">
384
+ # <div class="form-group row">
383
385
  # <label class="col-sm-3 col-form-label">The Label</label>
384
386
  # <div class="col-sm-9">This is the content</div>
385
387
  # </div>
386
388
  #
387
389
  def bootstrap_horizontal_form_group(label = nil, ratio = [2, 10], &block)
388
390
  l, r = ratio[0..1].map(&:to_i)
389
- offset = label.nil? ? " col-sm-offset-#{l}" : ''
391
+ offset = label.nil? ? " offset-sm-#{l}" : ''
390
392
 
391
393
  # Main content:
392
394
  content = content_tag(:div, class: "col-sm-#{r}" + offset, &block)
393
395
  # Prepend optional label:
394
396
  content = content_tag(:label, label, class: "col-sm-#{l} col-form-label") + content unless label.nil?
395
397
 
396
- content_tag(:div, content, class: 'form-group')
398
+ content_tag(:div, content, class: 'form-group row')
397
399
  end
398
400
 
399
401
  # This helper produces a pair of HTML dt, dd tags to display name and value pairs.
@@ -2,5 +2,5 @@
2
2
 
3
3
  # This stores the current version of the NdrUi gem. Use semantic versioning http://semver.org
4
4
  module NdrUi
5
- VERSION = '5.0.0'
5
+ VERSION = '5.0.2'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ndr_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - NDR Development Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-24 00:00:00.000000000 Z
11
+ date: 2025-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap