simplecov-tailwindcss 2.0.0 → 2.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 (54) hide show
  1. checksums.yaml +4 -4
  2. data/.all-contributorsrc +28 -0
  3. data/.erb-lint.yml +8 -0
  4. data/.eslintignore +1 -0
  5. data/.eslintrc.json +10 -0
  6. data/{CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md} +12 -12
  7. data/.github/CONTRIBUTING.md +66 -0
  8. data/.github/ISSUE_TEMPLATE/bug_report.yml +54 -0
  9. data/.github/ISSUE_TEMPLATE/config.yml +11 -0
  10. data/.github/ISSUE_TEMPLATE/feature_request.yml +26 -0
  11. data/.github/PULL_REQUEST_TEMPLATE.md +2 -2
  12. data/.github/workflows/builds.yml +91 -0
  13. data/.github/workflows/github_publish.yml +1 -1
  14. data/.github/workflows/lints.yml +49 -0
  15. data/.github/workflows/rubygem_publish.yml +1 -1
  16. data/.github/workflows/tests.yml +17 -13
  17. data/.gitignore +1 -0
  18. data/.markdownlint.yml +18 -18
  19. data/.prettierignore +0 -1
  20. data/.prettierrc.json +12 -0
  21. data/.rubocop.yml +4907 -652
  22. data/.ruby-version +1 -1
  23. data/.vscode/settings.json +5 -0
  24. data/CHANGELOG.md +16 -0
  25. data/Gemfile +12 -9
  26. data/README.md +43 -28
  27. data/dist/app.css +3 -3
  28. data/dist/app.js +10 -10
  29. data/dist/scripts/controllers/darktheme_controller.js +13 -16
  30. data/dist/scripts/controllers/navigation_controller.js +9 -13
  31. data/dist/scripts/controllers/search_controller.js +48 -61
  32. data/dist/scripts/controllers/slideover_controller.js +11 -24
  33. data/dist/scripts/timeago.js +2 -2
  34. data/lib/simplecov-tailwindcss/version.rb +1 -1
  35. data/lib/simplecov-tailwindcss.rb +69 -53
  36. data/package.json +61 -55
  37. data/public/application.css +1 -1
  38. data/public/application.js +2 -2
  39. data/simplecov-tailwindcss.gemspec +23 -23
  40. data/tailwind.config.js +7 -7
  41. data/test/simplecov-tailwindcss/simplecov_tailwindcss_test.rb +2 -2
  42. data/views/dialog.erb +75 -29
  43. data/views/file_detail.erb +57 -56
  44. data/views/group_page.erb +2 -2
  45. data/views/main.erb +8 -9
  46. data/views/stat_card.erb +1 -1
  47. data/yarn.lock +1367 -310
  48. metadata +15 -9
  49. data/.eslintrc.js +0 -91
  50. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  51. data/.github/ISSUE_TEMPLATE/feature-request.md +0 -20
  52. data/.github/ISSUE_TEMPLATE/question.md +0 -10
  53. data/.prettierrc +0 -7
  54. data/CONTRIBUTING.md +0 -132
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.1
1
+ 3.1.2
@@ -0,0 +1,5 @@
1
+ {
2
+ "yaml.schemas": {
3
+ "https://json.schemastore.org/github-issue-config.json": "file:///Users/chiefpansancolt/Documents/GitHub/ruby-gems/simplecov-tailwindcss/.github/ISSUE_TEMPLATE/config.yml"
4
+ }
5
+ }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## Version [2.1.0](https://github.com/chiefpansancolt/simplecov-tailwindcss/releases/tag/2.1.0)
4
+
5
+ ### Features
6
+
7
+ - Touch up Color contrast on file views ([#22](https://github.com/chiefpansancolt/simplecov-tailwindcss/issues/22))
8
+ - Add File Details for slideover view of File ([#27](https://github.com/chiefpansancolt/simplecov-tailwindcss/issues/27))
9
+
10
+ ### Updates
11
+
12
+ - Updated view of File list to show Percent covered better ([#29](https://github.com/chiefpansancolt/simplecov-tailwindcss/issues/29))
13
+
14
+ ### Bug Fixes
15
+
16
+ - Fixed View not changing per row ([#26](https://github.com/chiefpansancolt/simplecov-tailwindcss/issues/26))
17
+ - Fix bottom of small file views ([#23](https://github.com/chiefpansancolt/simplecov-tailwindcss/issues/23))
18
+
3
19
  ## Version [2.0.0](https://github.com/chiefpansancolt/simplecov-tailwindcss/releases/tag/2.0.0)
4
20
 
5
21
  ### Features
data/Gemfile CHANGED
@@ -1,18 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
5
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
6
 
7
7
  gemspec
8
8
 
9
- gem 'json'
10
- gem 'minitest'
11
- gem 'mocha'
12
- gem 'pry'
13
- gem 'rake'
9
+ gem "json"
10
+ gem "minitest"
11
+ gem "mocha"
12
+ gem "pry"
13
+ gem "rake"
14
14
 
15
15
  group :development do
16
- gem 'rubocop'
17
- gem 'rubocop-performance'
18
- end
16
+ gem "erb_lint"
17
+ gem "rubocop"
18
+ gem "rubocop-minitest"
19
+ gem "rubocop-performance"
20
+ gem "rubocop-rake"
21
+ end
data/README.md CHANGED
@@ -1,27 +1,20 @@
1
1
  # Simplecov Tailwind
2
2
 
3
- ![Tests](https://github.com/chiefpansancolt/simplecov-tailwindcss/workflows/Tests/badge.svg)
4
- ![GitHub release](https://img.shields.io/github/release/chiefpansancolt/simplecov-tailwindcss?logo=github&style=flat-square)
5
- ![Gem](https://img.shields.io/gem/dt/simplecov-tailwindcss?logo=rubygems&style=flat-square)
6
- [![Discord](https://img.shields.io/discord/450095227185659905?label=Discord&logo=discord&style=flat-square)](https://discord.gg/FPfA3w6)
3
+ [![GitHub](https://img.shields.io/github/license/chiefpansancolt/simplecov-tailwindcss?label=License&style=flat-square)](/LICENSE)
4
+ [![GitHub Workflow Tests Status](https://img.shields.io/github/actions/workflow/status/chiefpansancolt/simplecov-tailwindcss/tests.yml?label=Tests&logo=github&style=flat-square)](https://github.com/chiefpansancolt/simplecov-tailwindcss/actions/workflows/tests.yml)
5
+ [![GitHub Workflow Builds Status](https://img.shields.io/github/actions/workflow/status/chiefpansancolt/simplecov-tailwindcss/builds.yml?label=Build&logo=github&style=flat-square)](https://github.com/chiefpansancolt/simplecov-tailwindcss/actions/workflows/builds.yml)
6
+ [![GitHub Workflow Lints Status](https://img.shields.io/github/actions/workflow/status/chiefpansancolt/simplecov-tailwindcss/lints.yml?label=Lints&logo=github&style=flat-square)](https://github.com/chiefpansancolt/simplecov-tailwindcss/actions/workflows/lints.yml)
7
+ [![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/chiefpansancolt/simplecov-tailwindcss?label=Release&logo=github&style=flat-square)](https://github.com/chiefpansancolt/simplecov-tailwindcss/releases)
8
+ [![Gem](https://img.shields.io/gem/v/simplecov-tailwindcss?color=orange&label=Gem%20Version&logo=rubygems&style=flat-square)](https://rubygems.org/gems/simplecov-tailwindcss)
9
+ [![Discord](https://img.shields.io/discord/450095227185659905?label=Discord&logo=discord&style=flat-square)](https://discord.gg/pBxGpfrmD4)
7
10
 
8
11
  > Note: To learn more about SimpleCov, check out the main repo at https://github.com/colszowka/simplecov
9
12
 
10
- Generates a HTML Tailwind Design report generated from Simplecov using ruby 2.3 or greater.
11
-
12
- ## Table of Contents
13
-
14
- - [Installing](#installing)
15
- - [Usage](#usage)
16
- - [Change Log](#change-log)
17
- - [Contributing](#contributing)
18
- - [Development](#development)
19
- - [License](#license)
20
-
13
+ Generates a HTML Tailwind Design report generated from Simplecov using ruby 2.5 or greater.
21
14
 
22
15
  ## Installing
23
16
 
24
- Add the below to your Gemfile to make Simplecov Material available as a formatter for your application
17
+ Add the below to your Gemfile to make Simplecov Material available as a formatter for your application.
25
18
 
26
19
  ### Ruby Gems Host
27
20
 
@@ -29,8 +22,8 @@ Add the below to your Gemfile to make Simplecov Material available as a formatte
29
22
  # ./Gemfile
30
23
 
31
24
  group :test do
32
- gem "simplecov", require: false
33
- gem "simplecov-tailwindcss", require: false
25
+ gem 'simplecov', require: false
26
+ gem 'simplecov-tailwindcss', require: false
34
27
  end
35
28
  ```
36
29
 
@@ -59,7 +52,7 @@ In your helper ensure your line about formatter usage is one of the following.
59
52
  Ensure to add the require tag at the top of your helper class where Simplecov is configured
60
53
 
61
54
  ```ruby
62
- require "simplecov-tailwindcss"
55
+ require 'simplecov-tailwindcss'
63
56
  ```
64
57
 
65
58
  **Single Formatter Usage:**
@@ -71,21 +64,21 @@ SimpleCov.formatter = SimpleCov::Formatter::TailwindFormatter
71
64
  **Multi Formatter Usage:**
72
65
 
73
66
  ```ruby
74
- SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
75
- SimpleCov::Formatter::HTMLFormatter,
76
- SimpleCov::Formatter::TailwindFormatter
77
- ])
67
+ SimpleCov.formatters =
68
+ SimpleCov::Formatter::MultiFormatter.new(
69
+ [SimpleCov::Formatter::HTMLFormatter, SimpleCov::Formatter::TailwindFormatter],
70
+ )
78
71
  ```
79
72
 
80
73
  ## Change Log
81
74
 
82
- Check out the [Change Log](https://github.com/chiefpansancolt/simplecov-tailwindcss/blob/master/CHANGELOG.md) for new breaking changes/features/bug fixes per release of a new version.
75
+ Check out the [Change Log](https://github.com/chiefpansancolt/simplecov-tailwindcss/blob/main/CHANGELOG.md) for new breaking changes/features/bug fixes per release of a new version.
83
76
 
84
77
  ## Contributing
85
78
 
86
- Bug Reports, Feature Requests, and Pull Requests are welcome on GitHub at https://github.com/chiefpansancolt/simplecov-tailwindcss. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](https://github.com/chiefpansancolt/simplecov-tailwindcss/blob/master/CODE_OF_CONDUCT.md) code of conduct.
79
+ Bug Reports, Feature Requests, and Pull Requests are welcome on GitHub at https://github.com/chiefpansancolt/simplecov-tailwindcss. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](https://github.com/chiefpansancolt/simplecov-tailwindcss/blob/main/.github/CODE_OF_CONDUCT.md) code of conduct.
87
80
 
88
- To see more about Contributing check out this [document](https://github.com/chiefpansancolt/simplecov-tailwindcss/blob/master/CONTRIBUTING.md).
81
+ To see more about Contributing check out this [document](https://github.com/chiefpansancolt/simplecov-tailwindcss/blob/main/.github/CONTRIBUTING.md).
89
82
 
90
83
  - Fork Repo and create new branch
91
84
  - Once all is changed and committed create a pull request.
@@ -96,7 +89,7 @@ To see more about Contributing check out this [document](https://github.com/chie
96
89
 
97
90
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `yarn test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
98
91
 
99
- When working with SCSS or JS ensure to run `yarn build` to compile tailwind and JS to the public folder. This will ensure you have the latest CSS and JS used when testing locally.
92
+ When working with CSS or JS ensure to run `yarn build` to compile tailwind and JS to the public folder. This will ensure you have the latest CSS and JS used when testing locally.
100
93
 
101
94
  _**NOTE: Do not commit any changes made in public folder from compiling as this will be performed by the owner before building of a release.**_
102
95
 
@@ -106,4 +99,26 @@ To install this gem onto your local machine, run `yarn gem:build`. Gems will be
106
99
 
107
100
  ## License
108
101
 
109
- Simplecov Tailwind is available as open source under the terms of the [MIT License](https://github.com/chiefpansancolt/simplecov-tailwindcss/blob/master/LICENSE).
102
+ Simplecov Tailwind is available as open source under the terms of the [MIT License](https://github.com/chiefpansancolt/simplecov-tailwindcss/blob/main/LICENSE).
103
+
104
+ ## Contributors ✨
105
+
106
+ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
107
+
108
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
109
+ <!-- prettier-ignore-start -->
110
+ <!-- markdownlint-disable -->
111
+ <table>
112
+ <tr>
113
+ <td align="center"><a href="https://chrispezza.me"><img src="https://avatars3.githubusercontent.com/u/5841177?v=4" width="100px;" alt=""/><br /><sub><b>Christopher Pezza</b></sub></a><br /><a href="https://github.com/chiefpansancolt/simplecov-tailwindcss/commits?author=chiefpansancolt" title="Code">💻</a> <a href="https://github.com/chiefpansancolt/simplecov-tailwindcss/commits?author=chiefpansancolt" title="Documentation">📖</a> <a href="#tool-chiefpansancolt" title="Tools">🔧</a> <a href="https://github.com/chiefpansancolt/simplecov-tailwindcss/commits?author=chiefpansancolt" title="Tests">⚠️</a> <a href="#maintenance-chiefpansancolt" title="Maintenance">🚧</a></td>
114
+ </tr>
115
+ </table>
116
+
117
+ <!-- markdownlint-enable -->
118
+ <!-- prettier-ignore-end -->
119
+
120
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
121
+
122
+ This project follows the
123
+ [all-contributors](https://github.com/all-contributors/all-contributors)
124
+ specification. Contributions of any kind welcome!
data/dist/app.css CHANGED
@@ -1,3 +1,3 @@
1
- @import "tailwindcss/base";
2
- @import "tailwindcss/components";
3
- @import "tailwindcss/utilities";
1
+ @import 'tailwindcss/base';
2
+ @import 'tailwindcss/components';
3
+ @import 'tailwindcss/utilities';
data/dist/app.js CHANGED
@@ -1,13 +1,13 @@
1
- import { Application } from "@hotwired/stimulus"
2
- import SearchController from "./scripts/controllers/search_controller"
3
- import NavigationController from "./scripts/controllers/navigation_controller"
4
- import DarkthemeController from "./scripts/controllers/darktheme_controller"
5
- import SlideoverController from "./scripts/controllers/slideover_controller"
1
+ import { Application } from '@hotwired/stimulus'
2
+ import SearchController from './scripts/controllers/search_controller'
3
+ import NavigationController from './scripts/controllers/navigation_controller'
4
+ import DarkthemeController from './scripts/controllers/darktheme_controller'
5
+ import SlideoverController from './scripts/controllers/slideover_controller'
6
6
 
7
- import "./scripts/timeago.js"
7
+ import './scripts/timeago.js'
8
8
 
9
9
  window.Stimulus = Application.start()
10
- Stimulus.register("search", SearchController)
11
- Stimulus.register("navigation", NavigationController)
12
- Stimulus.register("darktheme", DarkthemeController)
13
- Stimulus.register("slideover", SlideoverController)
10
+ Stimulus.register('search', SearchController)
11
+ Stimulus.register('navigation', NavigationController)
12
+ Stimulus.register('darktheme', DarkthemeController)
13
+ Stimulus.register('slideover', SlideoverController)
@@ -1,37 +1,34 @@
1
- import { Controller } from "@hotwired/stimulus"
1
+ import { Controller } from '@hotwired/stimulus'
2
2
 
3
3
  export default class extends Controller {
4
- static targets = ["body"]
5
- static classes = ["dark"]
4
+ static targets = ['body']
5
+ static classes = ['dark']
6
6
 
7
7
  initialize() {
8
- if (
9
- window.matchMedia &&
10
- window.matchMedia("(prefers-color-scheme: dark)").matches
11
- ) {
12
- localStorage.setItem("color-theme", "dark")
8
+ if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
9
+ localStorage.setItem('color-theme', 'dark')
13
10
  this.bodyTarget.classList.add(this.darkClass)
14
11
  } else {
15
- localStorage.setItem("color-theme", "light")
12
+ localStorage.setItem('color-theme', 'light')
16
13
  }
17
14
  }
18
15
 
19
16
  toggle() {
20
- if (localStorage.getItem("color-theme")) {
21
- if (localStorage.getItem("color-theme") === "light") {
17
+ if (localStorage.getItem('color-theme')) {
18
+ if (localStorage.getItem('color-theme') === 'light') {
22
19
  this.bodyTarget.classList.add(this.darkClass)
23
- localStorage.setItem("color-theme", "dark")
20
+ localStorage.setItem('color-theme', 'dark')
24
21
  } else {
25
22
  this.bodyTarget.classList.remove(this.darkClass)
26
- localStorage.setItem("color-theme", "light")
23
+ localStorage.setItem('color-theme', 'light')
27
24
  }
28
25
  } else {
29
- if (this.bodyTarget.classList.contains("dark")) {
26
+ if (this.bodyTarget.classList.contains('dark')) {
30
27
  this.bodyTarget.classList.remove(this.darkClass)
31
- localStorage.setItem("color-theme", "light")
28
+ localStorage.setItem('color-theme', 'light')
32
29
  } else {
33
30
  this.bodyTarget.classList.add(this.darkClass)
34
- localStorage.setItem("color-theme", "dark")
31
+ localStorage.setItem('color-theme', 'dark')
35
32
  }
36
33
  }
37
34
  }
@@ -1,18 +1,16 @@
1
- import { Controller } from "@hotwired/stimulus"
1
+ import { Controller } from '@hotwired/stimulus'
2
2
 
3
3
  export default class extends Controller {
4
- static classes = ["hide", "active", "inactive"]
4
+ static classes = ['hide', 'active', 'inactive']
5
5
  static values = { currentActive: String }
6
6
 
7
7
  initialize() {
8
8
  let url = new URL(document.location)
9
- this.currentActiveValue = url.searchParams.get("tabName")
10
- ? url.searchParams.get("tabName")
11
- : ""
9
+ this.currentActiveValue = url.searchParams.get('tabName') ? url.searchParams.get('tabName') : ''
12
10
  }
13
11
 
14
12
  connect() {
15
- if (this.currentActiveValue != "") {
13
+ if (this.currentActiveValue != '') {
16
14
  this.navigate()
17
15
  }
18
16
  }
@@ -20,20 +18,20 @@ export default class extends Controller {
20
18
  navigateEvent(event) {
21
19
  let url = new URL(document.location)
22
20
  this.currentActiveValue = event.currentTarget.dataset.index
23
- url.searchParams.set("tabName", event.currentTarget.dataset.index)
24
- window.history.pushState({}, "", url)
21
+ url.searchParams.set('tabName', event.currentTarget.dataset.index)
22
+ window.history.pushState({}, '', url)
25
23
  this.navigate()
26
24
  }
27
25
 
28
26
  navigate() {
29
- let navBodies = document.querySelectorAll(".navBody")
27
+ let navBodies = document.querySelectorAll('.navBody')
30
28
  navBodies.forEach((el) => {
31
29
  if (!el.classList.contains(this.hideClass)) {
32
30
  el.classList.add(this.hideClass)
33
31
  }
34
32
  })
35
33
 
36
- let navs = document.querySelectorAll(".nav")
34
+ let navs = document.querySelectorAll('.nav')
37
35
  navs.forEach((nav) => {
38
36
  if (nav.classList.contains(...this.activeClasses)) {
39
37
  nav.classList.remove(...this.activeClasses)
@@ -48,8 +46,6 @@ export default class extends Controller {
48
46
  }
49
47
  })
50
48
 
51
- document
52
- .getElementById(this.currentActiveValue)
53
- .classList.remove(this.hideClass)
49
+ document.getElementById(this.currentActiveValue).classList.remove(this.hideClass)
54
50
  }
55
51
  }
@@ -1,8 +1,8 @@
1
- import { Controller } from "@hotwired/stimulus"
1
+ import { Controller } from '@hotwired/stimulus'
2
2
 
3
3
  export default class extends Controller {
4
- static targets = ["asc", "desc", "sort"]
5
- static classes = ["hide", "buttonActive", "buttonInactive"]
4
+ static targets = ['asc', 'desc', 'sort']
5
+ static classes = ['hide', 'buttonActive', 'buttonInactive']
6
6
  static values = {
7
7
  currentSearch: String,
8
8
  currentSort: String,
@@ -12,25 +12,19 @@ export default class extends Controller {
12
12
 
13
13
  initialize() {
14
14
  let url = new URL(document.location)
15
- this.currentSearchValue = url.searchParams.get("q")
16
- ? url.searchParams.get("q")
17
- : ""
18
- this.currentSortOrderValue = url.searchParams.get("o")
19
- ? url.searchParams.get("o")
20
- : -1
21
- this.currentSortValue = url.searchParams.get("s")
22
- ? url.searchParams.get("s")
23
- : "coveredpercent"
24
- this.currentViewValue = url.searchParams.get("tabName")
25
- ? url.searchParams.get("tabName")
26
- : "All Files"
15
+ this.currentSearchValue = url.searchParams.get('q') ? url.searchParams.get('q') : ''
16
+ this.currentSortOrderValue = url.searchParams.get('o') ? url.searchParams.get('o') : -1
17
+ this.currentSortValue = url.searchParams.get('s') ? url.searchParams.get('s') : 'coveredpercent'
18
+ this.currentViewValue = url.searchParams.get('tabName')
19
+ ? url.searchParams.get('tabName')
20
+ : 'All Files'
27
21
  }
28
22
 
29
23
  connect() {
30
- if (this.currentSearchValue != "") {
24
+ if (this.currentSearchValue != '') {
31
25
  this.search()
32
26
  }
33
- if (this.currentSortValue != "") {
27
+ if (this.currentSortValue != '') {
34
28
  this.order()
35
29
  }
36
30
  }
@@ -38,22 +32,22 @@ export default class extends Controller {
38
32
  sortEvent(event) {
39
33
  let url = new URL(document.location)
40
34
  this.currentSortValue = event.currentTarget.value
41
- url.searchParams.set("s", event.currentTarget.value)
42
- window.history.pushState({}, "", url)
43
- this.currentViewValue = url.searchParams.get("tabName")
44
- ? url.searchParams.get("tabName")
45
- : "All Files"
35
+ url.searchParams.set('s', event.currentTarget.value)
36
+ window.history.pushState({}, '', url)
37
+ this.currentViewValue = url.searchParams.get('tabName')
38
+ ? url.searchParams.get('tabName')
39
+ : 'All Files'
46
40
  this.sort()
47
41
  }
48
42
 
49
43
  orderEvent(event) {
50
44
  let url = new URL(document.location)
51
45
  this.currentSortOrderValue = event.currentTarget.value
52
- url.searchParams.set("o", event.currentTarget.value)
53
- window.history.pushState({}, "", url)
54
- this.currentViewValue = url.searchParams.get("tabName")
55
- ? url.searchParams.get("tabName")
56
- : "All Files"
46
+ url.searchParams.set('o', event.currentTarget.value)
47
+ window.history.pushState({}, '', url)
48
+ this.currentViewValue = url.searchParams.get('tabName')
49
+ ? url.searchParams.get('tabName')
50
+ : 'All Files'
57
51
  this.order()
58
52
  }
59
53
 
@@ -76,49 +70,50 @@ export default class extends Controller {
76
70
  const sortValue = this.currentSortValue
77
71
  const sortOrder = this.currentSortOrderValue
78
72
  this.sortTarget.value = this.currentSortValue
79
- let list = Array.from(
80
- document.getElementById(this.currentViewValue + "-list").children
81
- ).filter((item) => item.id != this.currentViewValue + "-hideListItem")
73
+ let list = Array.from(document.getElementById(this.currentViewValue + '-list').children).filter(
74
+ (item) => item.id != this.currentViewValue + '-hideListItem'
75
+ )
82
76
  list.sort(function (a, b) {
83
77
  let value1, value2
78
+ /* eslint-disable indent */
84
79
  switch (sortValue) {
85
- case "coveredpercent":
80
+ case 'coveredpercent':
86
81
  value1 = a.dataset.coveredPercent
87
82
  value2 = b.dataset.coveredPercent
88
83
  break
89
- case "lines":
84
+ case 'lines':
90
85
  value1 = a.dataset.lines
91
86
  value2 = b.dataset.lines
92
87
  break
93
- case "releventlines":
88
+ case 'releventlines':
94
89
  value1 = a.dataset.releventLines
95
90
  value2 = b.dataset.releventLines
96
91
  break
97
- case "coveredlines":
92
+ case 'coveredlines':
98
93
  value1 = a.dataset.coveredLines
99
94
  value2 = b.dataset.coveredLines
100
95
  break
101
- case "missedlines":
96
+ case 'missedlines':
102
97
  value1 = a.dataset.missedLines
103
98
  value2 = b.dataset.missedLines
104
99
  break
105
- case "coveredstrength":
100
+ case 'coveredstrength':
106
101
  value1 = a.dataset.coveredStrength
107
102
  value2 = b.dataset.coveredStrength
108
103
  break
109
- case "branchcoveredpercentches":
104
+ case 'branchcoveredpercentches':
110
105
  value1 = a.dataset.branchCoveredPercent
111
106
  value2 = b.dataset.branchCoveredPercent
112
107
  break
113
- case "branches":
108
+ case 'branches':
114
109
  value1 = a.dataset.branches
115
110
  value2 = b.dataset.branches
116
111
  break
117
- case "branchescoveredes":
112
+ case 'branchescoveredes':
118
113
  value1 = a.dataset.branchesCovered
119
114
  value2 = b.dataset.branchesCovered
120
115
  break
121
- case "branchesmisseds":
116
+ case 'branchesmisseds':
122
117
  value1 = a.dataset.branchesMissed
123
118
  value2 = b.dataset.branchesMissed
124
119
  break
@@ -127,39 +122,33 @@ export default class extends Controller {
127
122
  value2 = 0
128
123
  break
129
124
  }
125
+ /* eslint-enable indent */
130
126
 
131
- return (
132
- sortOrder * value1.localeCompare(value2, undefined, { numeric: true })
133
- )
127
+ return sortOrder * value1.localeCompare(value2, undefined, { numeric: true })
134
128
  })
135
129
  for (let i = 0; i < list.length; ++i) {
136
- document
137
- .getElementById(this.currentViewValue + "-list")
138
- .appendChild(list[i])
130
+ document.getElementById(this.currentViewValue + '-list').appendChild(list[i])
139
131
  }
140
132
  }
141
133
 
142
134
  searchEvent(event) {
143
135
  let url = new URL(document.location)
144
136
  this.currentSearchValue = event.currentTarget.value.toLowerCase()
145
- url.searchParams.set("q", event.currentTarget.value.toLowerCase())
146
- window.history.pushState({}, "", url)
147
- this.currentViewValue = url.searchParams.get("tabName")
148
- ? url.searchParams.get("tabName")
149
- : "All Files"
137
+ url.searchParams.set('q', event.currentTarget.value.toLowerCase())
138
+ window.history.pushState({}, '', url)
139
+ this.currentViewValue = url.searchParams.get('tabName')
140
+ ? url.searchParams.get('tabName')
141
+ : 'All Files'
150
142
  this.search()
151
143
  }
152
144
 
153
145
  search() {
154
- let list = Array.from(
155
- document.getElementById(this.currentViewValue + "-list").children
156
- ).filter((item) => item.id != this.currentViewValue + "-hideListItem")
146
+ let list = Array.from(document.getElementById(this.currentViewValue + '-list').children).filter(
147
+ (item) => item.id != this.currentViewValue + '-hideListItem'
148
+ )
157
149
  for (let i = 0; i < list.length; i++) {
158
150
  const item = list[i]
159
- if (
160
- item.dataset.fileName.toLowerCase().indexOf(this.currentSearchValue) >
161
- -1
162
- ) {
151
+ if (item.dataset.fileName.toLowerCase().indexOf(this.currentSearchValue) > -1) {
163
152
  item.classList.remove(this.hideClass)
164
153
  } else {
165
154
  item.classList.add(this.hideClass)
@@ -170,9 +159,7 @@ export default class extends Controller {
170
159
  const current = Array.from(list).filter((item) =>
171
160
  item.classList.contains(this.hideClass)
172
161
  ).length
173
- const hiddenRow = document.getElementById(
174
- this.currentViewValue + "-hideListItem"
175
- )
162
+ const hiddenRow = document.getElementById(this.currentViewValue + '-hideListItem')
176
163
  if (total == current) {
177
164
  hiddenRow.classList.remove(this.hideClass)
178
165
  } else {
@@ -1,14 +1,8 @@
1
- import { Controller } from "@hotwired/stimulus"
1
+ import { Controller } from '@hotwired/stimulus'
2
2
 
3
3
  export default class extends Controller {
4
- static targets = ["container", "background", "view"]
5
- static classes = [
6
- "hide",
7
- "toBackground",
8
- "fromBackground",
9
- "toView",
10
- "fromView",
11
- ]
4
+ static targets = ['container', 'background', 'view']
5
+ static classes = ['hide', 'toBackground', 'fromBackground', 'toView', 'fromView']
12
6
  static values = {
13
7
  allowClose: Boolean,
14
8
  openTimeout: Number,
@@ -17,11 +11,11 @@ export default class extends Controller {
17
11
  }
18
12
 
19
13
  initialize() {
20
- this.currentActiveValue = window.location.hash.replace("#", "")
14
+ this.currentActiveValue = window.location.hash.replace('#', '')
21
15
  }
22
16
 
23
17
  connect() {
24
- if (this.currentActiveValue != "") {
18
+ if (this.currentActiveValue != '') {
25
19
  this.open()
26
20
  }
27
21
  }
@@ -36,9 +30,7 @@ export default class extends Controller {
36
30
  }
37
31
 
38
32
  open() {
39
- document
40
- .getElementById(this.currentActiveValue)
41
- .classList.remove(this.hideClass)
33
+ document.getElementById(this.currentActiveValue).classList.remove(this.hideClass)
42
34
  this.containerTarget.classList.remove(this.hideClass)
43
35
 
44
36
  requestAnimationFrame(() => {
@@ -60,10 +52,8 @@ export default class extends Controller {
60
52
  requestAnimationFrame(() => {
61
53
  setTimeout(() => {
62
54
  this.containerTarget.classList.add(this.hideClass)
63
- document
64
- .getElementById(this.currentActiveValue)
65
- .classList.add(this.hideClass)
66
- this.currentActiveValue = ""
55
+ document.getElementById(this.currentActiveValue).classList.add(this.hideClass)
56
+ this.currentActiveValue = ''
67
57
  this.remove_hash_from_url()
68
58
  }, this.closeTimeoutValue)
69
59
  })
@@ -76,10 +66,7 @@ export default class extends Controller {
76
66
  }
77
67
 
78
68
  closeWithKeyboard(e) {
79
- if (
80
- e.keyCode === 27 &&
81
- !this.containerTarget.classList.contains(this.hideClass)
82
- ) {
69
+ if (e.keyCode === 27 && !this.containerTarget.classList.contains(this.hideClass)) {
83
70
  this.close()
84
71
  }
85
72
  }
@@ -87,8 +74,8 @@ export default class extends Controller {
87
74
  remove_hash_from_url() {
88
75
  var uri = window.location.toString()
89
76
 
90
- if (uri.indexOf("#") > 0) {
91
- var clean_uri = uri.substring(0, uri.indexOf("#"))
77
+ if (uri.indexOf('#') > 0) {
78
+ var clean_uri = uri.substring(0, uri.indexOf('#'))
92
79
  window.history.replaceState({}, document.title, clean_uri)
93
80
  }
94
81
  }
@@ -1,3 +1,3 @@
1
- import { render } from "timeago.js"
1
+ import { render } from 'timeago.js'
2
2
 
3
- render(document.querySelectorAll(".timeago"))
3
+ render(document.querySelectorAll('.timeago'))
@@ -3,7 +3,7 @@
3
3
  module SimpleCov
4
4
  module Formatter
5
5
  class TailwindFormatter
6
- VERSION = "2.0.0"
6
+ VERSION = "2.1.1"
7
7
  end
8
8
  end
9
9
  end