ndr_ui 5.0.1 → 5.0.3

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: ac1513f28fb442cd411ed3448be7429df4e1b31257f9f824582f7e7dade4a792
4
- data.tar.gz: 94183bcd72c12668f441de2c11ad9c94ae3821a597d743888abb6b5ccec14210
3
+ metadata.gz: b2c8d679fa84b0f26d8aeb70275d1a156923d26bce76e99d6b67f9a48f07b6c9
4
+ data.tar.gz: a05615082e74f125753a45e9461ca92c372bfda67d2a3243a3f3008dd24ef388
5
5
  SHA512:
6
- metadata.gz: cb20871cec4626f5ec59384fdb698d284f041064ae4e5d49e28bacf3e1f465ff459ace458a3f28f575fde366e063b42bcdc40534e6168bf1df393f8b50a2b69a
7
- data.tar.gz: 2b40d49fb9d537f91dcdada361515988431a0565bb44512eff1df38a49e193d3ced8026ffa13fc31e74d9f2316114f280a32e8d335303778600025166919f026
6
+ metadata.gz: 4449ba00a2a7d0e0619e017c48b4b3ca312524a747b9e6ea2d2fbc78e3119e3027ef8ec24b7442daf8c3484b8b9bbbf2c845d060a3f3f34b2d930b5af5761f3e
7
+ data.tar.gz: 3def4371d15455acaefa62d56808f5bfcce96513aa0210c348fecf0506042ab6fe4cd183117cf6ec732572cd87bf51ee7e38fdf775231c58e82a601112b824dc
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  ## [Unreleased]
2
2
  * no unreleased changes *
3
3
 
4
+ ## 5.0.3 / 2025-03-07
5
+ ### Fixed
6
+ * fix input group UI style in form and readonly mode
7
+
8
+ ## 5.0.2 / 2025-03-02
9
+ ### Fixed
10
+ * add row class to horizontal form row (.form-group)
11
+ * add `has-validation` class to input fields with addons
12
+
4
13
  ## 5.0.1 / 2025-02-03
5
14
  ### Fixed
6
15
  * fix cancel modal button
@@ -7,16 +7,50 @@ $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
- // for input fields with input-addons, remove background and border when the form is readonly.
16
- .input-group {
17
- .form-control-plaintext + .input-group-text {
18
- background: none;
19
- border:0;
15
+ // UI fix for form element in .input-group
16
+ form .input-group {
17
+ // for readonly fields following or followed by input-addons, set auto width to display content in one line
18
+ .form-control-plaintext:has(+ .input-group-text),
19
+ .input-group-text + .form-control-plaintext {
20
+ width: auto;
21
+ }
22
+
23
+ // for input-addons in readonly mode, reserve the border style for plain text and add more spacing on both sides
24
+ > .form-control-plaintext:has(+ .input-group-text),
25
+ > .input-group-text + .form-control-plaintext {
26
+ border: var(--bs-border-width) solid var(--bs-border-color);
27
+ padding-left: 8px;
28
+ padding-right: 8px;
29
+ }
30
+
31
+ // BS radius fix for elements in .input-group, as we added `.has-validation` class to .input-group by default
32
+ // remove right radius if an element is followed by another
33
+ // > .form-control in edit mode
34
+ .form-control:has(+ .input-group-text),
35
+ .input-group-text:has(+ .form-control) {
36
+ border-top-right-radius: 0;
37
+ border-bottom-right-radius: 0;
38
+ }
39
+ // > .form-control-plaintext in readonly mode
40
+ .form-control-plaintext:has(+ .input-group-text),
41
+ .input-group-text:has(+ .form-control-plaintext) {
42
+ border-top-right-radius: 0;
43
+ border-bottom-right-radius: 0;
44
+ }
45
+
46
+ // as a general global fix, ensure correct radius on first and last element
47
+ > :first-child {
48
+ border-top-left-radius: var(--bs-border-radius);
49
+ border-bottom-left-radius: var(--bs-border-radius);
50
+ }
51
+ > :last-child {
52
+ border-top-right-radius: var(--bs-border-radius);
53
+ border-bottom-right-radius: var(--bs-border-radius);
20
54
  }
21
55
  }
22
56
 
@@ -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
@@ -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
@@ -381,7 +381,7 @@ module NdrUi
381
381
  # ==== Examples
382
382
  # bootstrap_horizontal_form_group("The Label", [3, 9]) { 'This is the content' }
383
383
  # # =>
384
- # <div class="form-group">
384
+ # <div class="form-group row">
385
385
  # <label class="col-sm-3 col-form-label">The Label</label>
386
386
  # <div class="col-sm-9">This is the content</div>
387
387
  # </div>
@@ -395,7 +395,7 @@ module NdrUi
395
395
  # Prepend optional label:
396
396
  content = content_tag(:label, label, class: "col-sm-#{l} col-form-label") + content unless label.nil?
397
397
 
398
- content_tag(:div, content, class: 'form-group')
398
+ content_tag(:div, content, class: 'form-group row')
399
399
  end
400
400
 
401
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.1'
5
+ VERSION = '5.0.3'
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.1
4
+ version: 5.0.3
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-02-03 00:00:00.000000000 Z
11
+ date: 2025-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap