zutils 3.0.7 → 4.0.0

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.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.7
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Viana
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-28 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails
@@ -15,74 +15,78 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '5.0'
18
+ version: '7.0'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '5.0'
25
+ version: '7.0'
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: bundler
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - "~>"
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: '1.16'
32
+ version: '2.0'
33
33
  type: :development
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '1.16'
39
+ version: '2.0'
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rake
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: '10.0'
46
+ version: '13.0'
47
47
  type: :development
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '10.0'
54
- description: Utilidades gerais (views, models, helpers) para aplicações rails
53
+ version: '13.0'
54
+ description: Engine Rails com partials Bootstrap 5, helpers (bootstrap_flash, eval_with_rescue)
55
+ e controllers Stimulus reutilizáveis (filtering, toastr, bootstrap-table, dropdown,
56
+ tooltip) para os apps captei, sofia e reduz.
55
57
  email:
56
58
  - zezim.ricardo@gmail.com
57
59
  executables: []
58
60
  extensions: []
59
61
  extra_rdoc_files: []
60
62
  files:
61
- - ".gitignore"
62
- - CODE_OF_CONDUCT.md
63
- - Gemfile
64
63
  - LICENSE.txt
65
64
  - README.md
66
- - Rakefile
67
- - app/assets/javascripts/zutils.js
68
65
  - app/assets/stylesheets/zutils.scss
69
66
  - app/views/shared/_action_links.html.erb
70
67
  - app/views/shared/_btn_action_links.html.erb
71
68
  - app/views/shared/_card_list.html.erb
69
+ - app/views/shared/_dropdown_menu.html.erb
70
+ - app/views/shared/_empty_state.html.erb
71
+ - app/views/shared/_empty_state_card.html.erb
72
72
  - app/views/shared/_fields.html.erb
73
+ - app/views/shared/_file_chooser.html.erb
73
74
  - app/views/shared/_flash.html.erb
75
+ - app/views/shared/_flash_only_toastr.html.erb
74
76
  - app/views/shared/_form.html.erb
75
77
  - app/views/shared/_index.html.erb
76
78
  - app/views/shared/_list.html.erb
77
79
  - app/views/shared/_modal.html.erb
80
+ - app/views/shared/_pagination.html.erb
78
81
  - app/views/shared/_search_form.html.erb
79
82
  - app/views/shared/_show.html.erb
83
+ - app/views/shared/_turbo_modal.html.erb
80
84
  - bin/console
81
85
  - bin/setup
82
86
  - lib/zutils.rb
83
87
  - lib/zutils/engine.rb
88
+ - lib/zutils/helpers.rb
84
89
  - lib/zutils/version.rb
85
- - zutils.gemspec
86
90
  homepage: http://gitlab.tjpi.jus.br/
87
91
  licenses:
88
92
  - MIT
@@ -94,14 +98,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
94
98
  requirements:
95
99
  - - ">="
96
100
  - !ruby/object:Gem::Version
97
- version: '0'
101
+ version: '3.0'
98
102
  required_rubygems_version: !ruby/object:Gem::Requirement
99
103
  requirements:
100
104
  - - ">="
101
105
  - !ruby/object:Gem::Version
102
106
  version: '0'
103
107
  requirements: []
104
- rubygems_version: 3.6.5
108
+ rubygems_version: 3.6.7
105
109
  specification_version: 4
106
- summary: Utilidades gerais para aplicações rails
110
+ summary: Utilidades gerais (views, helpers e controllers Stimulus) para aplicações
111
+ Rails
107
112
  test_files: []
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at ricardo.viana@tjpi.jus.br. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in zutils.gemspec
6
- gemspec
data/Rakefile DELETED
@@ -1,2 +0,0 @@
1
- require "bundler/gem_tasks"
2
- task :default => :spec
@@ -1,86 +0,0 @@
1
- //= require selectize
2
-
3
- $(document).ready(function () {
4
- var selectizeCallback = null;
5
-
6
- $(".selectize_with_add").each(function(i, item) {
7
- $(item).selectize({
8
- create: function(input, callback) {
9
- selectizeCallback = callback;
10
-
11
- $("." + $(item).data('name') + "-modal").modal();
12
- $("#" + $(item).data('name') + "_name").val(input);
13
- }
14
- });
15
-
16
- $("." + $(item).data('name') + "-modal").on("hide.bs.modal", function(e) {
17
- if (selectizeCallback != null) {
18
- selectizeCallback();
19
- selecitzeCallback = null;
20
- }
21
-
22
- $("." + $(item).data('name') + "-modal form").trigger("reset");
23
- $("." + $(item).data('name') + "-modal form select").val(null).trigger('change');
24
- $.rails.enableFormElements($("." + $(item).data('name') + "-modal form"));
25
- });
26
-
27
- $("." + $(item).data('name') + "-modal form").on("submit", function(e) {
28
- e.preventDefault();
29
- $("." + $(item).data('name') + "-modal form").find('.has-error').removeClass('has-error');
30
- $("." + $(item).data('name') + "-modal form").find('.help-block').text("");
31
- $.ajax({
32
- method: "POST",
33
- dataType: "json",
34
- url: $(this).attr("action"),
35
- data: $(this).serialize(),
36
- success: function(response) {
37
- selectizeCallback({value: response.id, text: response.name});
38
- selectizeCallback = null;
39
-
40
- $("." + $(item).data('name') + "-modal").modal('toggle');
41
- },
42
- error: function(response) {
43
- $.each(response.responseJSON, function(key, value) {
44
- $("." + $(item).data('name') + "-modal form").find("." + $(item).data('model') + '_' + key).addClass('has-error');
45
- if (!($("." + $(item).data('name') + "-modal form" + " ." + $(item).data('model') + '_' + key).find('.help-block').length)) {
46
- $("." + $(item).data('name') + "-modal form").find("." + $(item).data('model') + '_' + key).append("<p class='help-block'></p>");
47
- }
48
- $("." + $(item).data('name') + "-modal form").find("." + $(item).data('model') + '_' + key).find('.help-block').text(value);
49
- });
50
- $.rails.enableFormElements($("." + $(item).data('name') + "-modal form" + ""));
51
- }
52
- });
53
- });
54
- });
55
-
56
- $(".selectize_with_add_without_modal").each(function(i, item) {
57
- $(item).selectize({
58
- create: function(input, callback) {
59
- $(item).parent().removeClass('has-error');
60
- $(item).parent().find('.help-block').text("");
61
- selectizeCallback = callback;
62
- data = {};
63
- data[$(item).data('model')] = {};
64
- data[$(item).data('model')][$(item).data('field')] = input;
65
- $.ajax({
66
- method: "POST",
67
- dataType: "json",
68
- url: "/" + $(item).data('pluralized'),
69
- data: data,
70
- success: function(response) {
71
- selectizeCallback({value: response.id, text: response.name});
72
- },
73
- error: function(response) {
74
- $(item).parent().addClass('has-error');
75
- if (!( $(item).parent().find('.help-block').length)) {
76
- $(item).parent().append("<p class='help-block'></p>");
77
- }
78
- $(item).parent().find('.help-block').text("Valor já existente: " + input);
79
- selectizeCallback();
80
- }
81
- });
82
- selectizeCallback = callback;
83
- }
84
- });
85
- });
86
- });
data/zutils.gemspec DELETED
@@ -1,39 +0,0 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "zutils/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "zutils"
8
- spec.version = Zutils::VERSION
9
- spec.authors = ["Ricardo Viana"]
10
- spec.email = ["zezim.ricardo@gmail.com"]
11
-
12
- spec.summary = "Utilidades gerais para aplicações rails"
13
- spec.description = "Utilidades gerais (views, models, helpers) para aplicações rails"
14
- spec.homepage = "http://gitlab.tjpi.jus.br/"
15
- spec.license = "MIT"
16
-
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
- # to allow pushing to a single host or delete this section to allow pushing to any host.
19
- # if spec.respond_to?(:metadata)
20
- # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
21
- # else
22
- # raise "RubyGems 2.0 or newer is required to protect against " \
23
- # "public gem pushes."
24
- # end
25
-
26
- # Specify which files should be added to the gem when it is released.
27
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
28
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
29
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
30
- end
31
- spec.bindir = "exe"
32
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
- spec.require_paths = ["lib"]
34
-
35
- spec.add_dependency 'rails', '>= 5.0'
36
-
37
- spec.add_development_dependency "bundler", "~> 1.16"
38
- spec.add_development_dependency "rake", "~> 10.0"
39
- end