pg_rails 7.1.11 → 7.1.13

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: 0f6553a59df0df7aeb2906baac1974c3f2ef6f5b17bd83f4df1b4fbf3f7f2819
4
- data.tar.gz: 20e9aa024c6aebb771ebea3c3b852a2e47a6d7583d043bcbc750d3ec2642e336
3
+ metadata.gz: 4a90a7a62e376e482f5e3c072c38f859478a7a333d606de01c8d5481cefd8fb5
4
+ data.tar.gz: ec85008cd9234bb9c7435ca6838af3ca380c2f34c43fb80bd30e9d2608d2dfc6
5
5
  SHA512:
6
- metadata.gz: b5b1ff627eeff7269b53d81a2b8d39184118741001cb4d36d89eba76801910315551ef563d55216f5a2e5b372b7afd3ff66ef7a4bae8428f94b20a28004c727b
7
- data.tar.gz: c7af654f04ac7fba7d48e9c220f9396bb5ab24508350035447c792f0fd0afe213ccb529ed5360db4e1baa4f27cd5cbf387d6f3b4a71877edccf10395359fc8a6
6
+ metadata.gz: 9039afd99e6a910e4e1a47c125e8285992360d1979836a0d7df1c1f9f4b0837ee4bf8b5d266384998cabcc765dfe8bd4b0fa96143ba9baa58946b4697e97addd
7
+ data.tar.gz: c2b42d1565fc804d2ef3015c197820abc54a8425d66d27f6b57f21a768779ceab9ade935dfefb85db8016bcce98988f3378b9bb1cf99a4dfc0f223a335b0a046
@@ -12,9 +12,6 @@ export default class extends Controller {
12
12
  if (this.element.dataset.removeOnHide) {
13
13
  this.element.addEventListener('hidden.bs.modal', (e) => {
14
14
  this.element.remove()
15
- window.Stimulus.controllers.map((c) => { return c.calendar })
16
- .filter((e) => { return e })
17
- .forEach((c) => { c.refetchEvents() })
18
15
  })
19
16
  }
20
17
  this.modalPuntero.show()
@@ -35,6 +32,7 @@ export default class extends Controller {
35
32
 
36
33
  disconnect (e) {
37
34
  this.modalPuntero.hide()
35
+ this.element.dispatchEvent(new Event('hidden.bs.modal'))
38
36
  this.modalPuntero.dispose()
39
37
  }
40
38
  }
@@ -7,7 +7,7 @@ class NotificationComponent < BaseComponent
7
7
  erb_template <<~ERB
8
8
  <div class="notification d-flex flex-column flex-sm-row justify-content-between <%= 'unseen' if @notification.unseen? %>"
9
9
  id="<%= dom_id(@notification) %>" data-id="<%= @notification.id %>">
10
- <div class="pe-3">
10
+ <div class="pe-3 trix-content">
11
11
  <%= @notification.message.html_safe %>
12
12
  </div>
13
13
  <div class="notification--time d-flex flex-column justify-content-end text-body-tertiary text-end">
@@ -61,8 +61,7 @@ module PgEngine
61
61
  return unless Pundit.policy!(Current.user, object).edit?
62
62
 
63
63
  helpers.content_tag :span, rel: :tooltip, title: 'Modificar' do
64
- helpers.link_to edit_object_url, data: { turbo_frame: :main },
65
- class: "btn btn-sm #{klass}" do
64
+ helpers.link_to edit_object_url, class: "btn btn-sm #{klass}" do
66
65
  helpers.content_tag(:span, nil, class: clase_icono('pencil')) + text
67
66
  end
68
67
  end
@@ -72,8 +71,7 @@ module PgEngine
72
71
  return unless Pundit.policy!(Current.user, object).show?
73
72
 
74
73
  helpers.content_tag :span, rel: :tooltip, title: 'Ver' do
75
- helpers.link_to object_url, data: { turbo_frame: :main },
76
- class: "btn btn-sm #{klass}" do
74
+ helpers.link_to object_url, class: "btn btn-sm #{klass}" do
77
75
  helpers.content_tag(:span, nil, class: clase_icono('eye-fill')) + text
78
76
  end
79
77
  end
@@ -91,8 +91,6 @@ module PgEngine
91
91
  # real sino filtro booleano por presencia de discarded_at
92
92
  return :boolean if campo.to_s == 'discarded'
93
93
 
94
- pg_warn("no existe el campo: #{nombre_campo}")
95
-
96
94
  return
97
95
  end
98
96
  columna.type
@@ -1,3 +1,36 @@
1
- - %w[danger warning info success].each do |status|
2
- h1 class="text-#{status}" = status
3
- h1 class="text-#{status}-emphasis" = "#{status} emphasis"
1
+ .row
2
+ .col
3
+ - %w[danger warning info success].each do |status|
4
+ h1 class="text-#{status}" = status
5
+ h1 class="text-#{status}-emphasis" = "#{status} emphasis"
6
+
7
+ .col
8
+ - %w[danger warning info success].each do |status|
9
+ .alert class="alert-#{status}"
10
+ = "Alert #{status}"
11
+
12
+ .row
13
+ .col
14
+ div class="p-3 mb-2 bg-primary text-white" .bg-primary
15
+ div class="p-3 mb-2 bg-primary-subtle text-primary-emphasis" .bg-primary-subtle
16
+ div class="p-3 mb-2 bg-secondary text-white" .bg-secondary
17
+ div class="p-3 mb-2 bg-secondary-subtle text-secondary-emphasis" .bg-secondary-subtle
18
+ div class="p-3 mb-2 bg-success text-white" .bg-success
19
+ div class="p-3 mb-2 bg-success-subtle text-success-emphasis" .bg-success-subtle
20
+ div class="p-3 mb-2 bg-danger text-white" .bg-danger
21
+ div class="p-3 mb-2 bg-danger-subtle text-danger-emphasis" .bg-danger-subtle
22
+ div class="p-3 mb-2 bg-warning text-dark" .bg-warning
23
+ div class="p-3 mb-2 bg-warning-subtle text-warning-emphasis" .bg-warning-subtle
24
+ div class="p-3 mb-2 bg-info text-dark" .bg-info
25
+ .col
26
+ div class="p-3 mb-2 bg-info-subtle text-info-emphasis" .bg-info-subtle
27
+ div class="p-3 mb-2 bg-light text-dark" .bg-light
28
+ div class="p-3 mb-2 bg-light-subtle text-light-emphasis" .bg-light-subtle
29
+ div class="p-3 mb-2 bg-dark-subtle text-dark-emphasis" .bg-dark-subtle
30
+ div class="p-3 mb-2 bg-body-secondary" .bg-body-secondary
31
+ div class="p-3 mb-2 bg-body-tertiary" .bg-body-tertiary
32
+ div class="p-3 mb-2 bg-dark text-white" .bg-dark
33
+ div class="p-3 mb-2 bg-body text-body" .bg-body
34
+ div class="p-3 mb-2 bg-black text-white" .bg-black
35
+ div class="p-3 mb-2 bg-white text-dark" .bg-white
36
+ div class="p-3 mb-2 bg-transparent text-body" .bg-transparent
@@ -4,6 +4,7 @@ html, body {
4
4
 
5
5
  /* Style & Colors */
6
6
  $text-color: $gray-300;
7
+ // TODO: set text-color-dark, y tiene que ir en overrides, no acá
7
8
  $text-hover-color: $gray-100;
8
9
  $chevron-color: 200,200,200,.5;
9
10
 
@@ -3,11 +3,21 @@ import * as bootstrap from 'bootstrap'
3
3
  document.addEventListener('turbo:load', bindTooltips)
4
4
  document.addEventListener('turbo:render', bindTooltips)
5
5
 
6
- function bindTooltips () {
7
- const tooltipsQuery = '[data-bs-toggle="tooltip"]'
6
+ const tooltipsQuery = '[data-bs-toggle="tooltip"]'
8
7
 
8
+ function bindTooltips () {
9
9
  const toastElList = document.querySelectorAll(tooltipsQuery)
10
10
  Array.from(toastElList).map(tooltipEl => {
11
11
  return new bootstrap.Tooltip(tooltipEl)
12
12
  })
13
13
  }
14
+
15
+ document.addEventListener('show.bs.tooltip', (ev) => {
16
+ const toastElList = document.querySelectorAll(tooltipsQuery)
17
+ Array.from(toastElList).forEach(tooltipEl => {
18
+ const tooltip = bootstrap.Tooltip.getInstance(tooltipEl)
19
+ if (tooltip) {
20
+ tooltip.hide()
21
+ }
22
+ })
23
+ })
@@ -9,6 +9,7 @@ import SwitcherController from './switcher_controller'
9
9
  import FiltrosController from './filtros_controller'
10
10
  import NotificationsController from './notifications_controller'
11
11
  import SelectizeController from './selectize_controller'
12
+ import ThemeController from './theme_controller'
12
13
 
13
14
  application.register('navbar', NavbarController)
14
15
  application.register('nested', NestedController)
@@ -19,5 +20,6 @@ application.register('switcher', SwitcherController)
19
20
  application.register('filtros', FiltrosController)
20
21
  application.register('notifications', NotificationsController)
21
22
  application.register('selectize', SelectizeController)
23
+ application.register('theme', ThemeController)
22
24
 
23
25
  // TODO: testear con capybara todo lo que se pueda
@@ -0,0 +1,12 @@
1
+ import { Controller } from '@hotwired/stimulus'
2
+
3
+ // Connects to data-controller="theme"
4
+ export default class extends Controller {
5
+ dark () {
6
+ document.documentElement.setAttribute('data-bs-theme', 'dark')
7
+ }
8
+
9
+ light () {
10
+ document.documentElement.setAttribute('data-bs-theme', 'light')
11
+ }
12
+ }
@@ -81,14 +81,14 @@ export function flashMessage (message, flashType = 'warning', toast = false) {
81
81
  }
82
82
 
83
83
  export function fadeOut (e) {
84
- if (window.getComputedStyle(e).visibility !== 'hidden') {
84
+ if (e && window.getComputedStyle(e).visibility !== 'hidden') {
85
85
  e.classList.add('fade-out')
86
86
  e.addEventListener('animationend', onAnimationEndHide, { once: true })
87
87
  }
88
88
  }
89
89
 
90
90
  export function fadeIn (e) {
91
- if (window.getComputedStyle(e).visibility !== 'visible') {
91
+ if (e && window.getComputedStyle(e).visibility !== 'visible') {
92
92
  e.classList.add('fade-in')
93
93
  e.addEventListener('animationend', onAnimationEndShow, { once: true })
94
94
  }
@@ -77,6 +77,10 @@ html
77
77
  = yield(:filtros)
78
78
  = content
79
79
  div style="width:100%; height: 10em"
80
+ .d-flex.gap-1.justify-content-center.opacity-50 data-controller="theme"
81
+ | (Beta) Tema:
82
+ = link_to 'Claro', 'javascript:void(0)', 'data-action': 'theme#light'
83
+ = link_to 'Oscuro', 'javascript:void(0)', 'data-action': 'theme#dark'
80
84
  = render partial: 'layouts/footer'
81
85
  div style="width:100%; height: 10em"
82
86
  = render_turbo_stream_title
@@ -7,7 +7,7 @@
7
7
  | Ir al #{object.class.nombre_singular.downcase}
8
8
  a.btn-close[type="button" data-bs-dismiss="modal" aria-label="Close"]
9
9
  .modal-body
10
- = turbo_frame_tag :modal_generic, target: :_top do
10
+ = turbo_frame_tag :modal_generic do
11
11
  .float-end
12
12
  = object.edit_link
13
13
  = object.destroy_link
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.1.11'
4
+ VERSION = '7.1.13'
5
5
  end
@@ -8,7 +8,7 @@ $danger-bg-subtle: tint-color($danger, 98%);
8
8
  $warning-border-subtle: tint-color($warning, 20%);
9
9
  // $danger-border-subtle: tint-color($danger, 60%);
10
10
  $secondary-bg-subtle: tint-color($secondary, 92%);
11
- $warning-bg-subtle: tint-color($warning, 40%);
11
+ // $warning-bg-subtle: tint-color($warning, 40%);
12
12
 
13
13
 
14
14
  $btn-close-focus-shadow: none;
@@ -21,6 +21,10 @@ $info: #87accc;
21
21
  $warning-text-emphasis: $orange;
22
22
  $danger-text-emphasis: #910303;
23
23
 
24
+ $tooltip-opacity: 1;
25
+ $tooltip-bg: var(--bs-primary) !default;
26
+ $tooltip-color: var(--bs-light) !default;
27
+
24
28
  $font-size-base: 0.9rem;
25
29
  $enable-validation-icons: false;
26
30
  $focus-ring-width: .05rem;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.11
4
+ version: 7.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-03 00:00:00.000000000 Z
11
+ date: 2024-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -838,6 +838,7 @@ files:
838
838
  - pg_layout/app/javascript/controllers/pg_form_controller.js
839
839
  - pg_layout/app/javascript/controllers/selectize_controller.js
840
840
  - pg_layout/app/javascript/controllers/switcher_controller.js
841
+ - pg_layout/app/javascript/controllers/theme_controller.js
841
842
  - pg_layout/app/javascript/utils/cookies.js
842
843
  - pg_layout/app/javascript/utils/utils.ts
843
844
  - pg_layout/app/lib/navbar.rb