Skip to content

Commit

Permalink
Actualiza y mejor refrsco de campos tom-select
Browse files Browse the repository at this point in the history
  • Loading branch information
vtamara committed Apr 13, 2024
1 parent 0f8939e commit cf7680c
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 34 deletions.
24 changes: 12 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ GIT

GIT
remote: https://gitlab.com/pasosdeJesus/heb412_gen.git
revision: 9c6f38132a51415236c2bc8b11615a5a38d31987
revision: a3baaf388bacfb32a41b1b19827162ea58fc5814
branch: v2.2
specs:
heb412_gen (2.2.0.beta4)
Expand All @@ -65,7 +65,7 @@ GIT

GIT
remote: https://gitlab.com/pasosdeJesus/mr519_gen.git
revision: e3a9946bd7806be25ae2b0a99cab462117822b6c
revision: d8313cfeb2f5a63be2fd6ad9b9ca3116b9d7be93
branch: v2.2
specs:
mr519_gen (2.2.0.beta4)
Expand All @@ -74,7 +74,7 @@ GIT

GIT
remote: https://gitlab.com/pasosdeJesus/msip.git
revision: 707b66b873109230cb5b8ac51b85424fa9befe37
revision: 89594aaf2613cc4c6dde69c1a7954941b59b0d75
branch: v2.2
specs:
msip (2.2.0.beta5)
Expand All @@ -94,7 +94,7 @@ GIT

GIT
remote: https://gitlab.com/pasosdeJesus/sivel2_gen.git
revision: d804e97ffcf970bc41c924e028af6a1b1773719c
revision: 7076171410bf3bf0c55d4d91deeed7db31ca095d
branch: v2.2
specs:
sivel2_gen (2.2.0.beta4)
Expand Down Expand Up @@ -313,20 +313,20 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.1)
nokogiri (1.16.3)
nokogiri (1.16.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.3-aarch64-linux)
nokogiri (1.16.4-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.3-arm-linux)
nokogiri (1.16.4-arm-linux)
racc (~> 1.4)
nokogiri (1.16.3-arm64-darwin)
nokogiri (1.16.4-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.3-x86-linux)
nokogiri (1.16.4-x86-linux)
racc (~> 1.4)
nokogiri (1.16.3-x86_64-darwin)
nokogiri (1.16.4-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.3-x86_64-linux)
nokogiri (1.16.4-x86_64-linux)
racc (~> 1.4)
odf-report (0.8.1)
mime-types
Expand Down Expand Up @@ -590,4 +590,4 @@ DEPENDENCIES
will_paginate

BUNDLED WITH
2.5.7
2.5.9
22 changes: 16 additions & 6 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,21 @@ import '../../vendor/assets/javascripts/jquery-ui.js'
import 'popper.js' // Dialogos emergentes usados por bootstrap
import * as bootstrap from 'bootstrap' // Maquetacion y elementos de diseño
import 'chosen-js/chosen.jquery'; // Cuadros de seleccion potenciados

import TomSelect from 'tom-select';
window.TomSelect = TomSelect
window.configuracionTomSelect = {
create: false,
diacritics: true, //no sensitivo a acentos --falla que muestra error
sortField: {
field: "text",
direction: "asc"
}
}

import Msip__Motor from './controllers/msip/motor.js'
window.Msip__Motor = Msip__Motor

import 'bootstrap-datepicker'
import 'bootstrap-datepicker/dist/locales/bootstrap-datepicker.es.min.js'

Expand Down Expand Up @@ -86,12 +99,9 @@ promesaRecursosSprocketsYDocumento.then((mensaje) => {
if (p2ult == 'graficar/actos_individuales') {
plotly_serietiempo_actos()
}
new TomSelect('.tom-select', {
create: true,
sortField: {
field: "text",
direction: "asc"
}

document.querySelectorAll('.tom-select').forEach((el)=>{
new TomSelect(el, window.configuracionTomSelect)
})
window.AutocompletaAjaxEntidad.iniciar()

Expand Down
12 changes: 8 additions & 4 deletions app/views/msip/personas/_filtro_centropoblado.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<% municipio_id = params && params[:filtro] &&
params[:filtro][:busmunicipio] ? params[:filtro][:busmunicipio].to_i : 0 %>
<% centropoblado_id = params && params[:filtro] &&
params[:filtro][:buscentropoblado] ?
<% pais_id = params && params[:filtro] && params[:filtro][:buspais] ?
params[:filtro][:buspais].to_i : 0 %>
<% departamento_id = pais_id > 0 && params[:filtro][:busdepartamento] ?
params[:filtro][:busdepartamento].to_i : 0 %>
<% municipio_id = departamento_id > 0 && params[:filtro][:busmunicipio] ?
params[:filtro][:busmunicipio].to_i : 0 %>
<% centropoblado_id = municipio_id > 0 && params[:filtro][:buscentropoblado] ?
params[:filtro][:buscentropoblado].to_i : 0 %>
<%= f.input :buscentropoblado,
collection: Msip::Centropoblado.habilitados.where(
Expand All @@ -12,6 +15,7 @@
valud_method: :id,
selected: Msip::ModeloHelper.poromision(params, :buscentropoblado),
input_html: {
'data-enviarautomatico' => '',
class: 'tom-select',
data: {
"action": "change->msip--geodep#cambiar_centropoblado",
Expand Down
4 changes: 2 additions & 2 deletions app/views/msip/personas/_filtro_departamento.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<% pais_id = params && params[:filtro] && params[:filtro][:buspais] ?
params[:filtro][:buspais].to_i : 0 %>
<% departamento_id = params && params[:filtro] &&
params[:filtro][:busdepartamento] ?
<% departamento_id = pais_id > 0 && params[:filtro][:busdepartamento] ?
params[:filtro][:busdepartamento].to_i : 0 %>
<%= f.input :busdepartamento,
collection: Msip::Departamento.habilitados.where(pais_id: pais_id),
Expand All @@ -10,6 +9,7 @@
valud_method: :id,
selected: Msip::ModeloHelper.poromision(params, :busdepartamento),
input_html: {
'data-enviarautomatico' => '',
class: 'tom-select',
data: {
"action": "change->msip--geodep#cambiar_departamento",
Expand Down
10 changes: 6 additions & 4 deletions app/views/msip/personas/_filtro_municipio.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<% departamento_id = params && params[:filtro] &&
params[:filtro][:busdepartamento] ?
<% pais_id = params && params[:filtro] && params[:filtro][:buspais] ?
params[:filtro][:buspais].to_i : 0 %>
<% departamento_id = pais_id > 0 && params[:filtro][:busdepartamento] ?
params[:filtro][:busdepartamento].to_i : 0 %>
<% municipio_id = params && params[:filtro] &&
params[:filtro][:busmunicipio] ? params[:filtro][:busmunicipio].to_i : 0 %>
<% municipio_id = departamento_id > 0 && params[:filtro][:busmunicipio] ?
params[:filtro][:busmunicipio].to_i : 0 %>
<%= f.input :busmunicipio,
collection: Msip::Municipio.habilitados.where(
departamento_id: departamento_id
Expand All @@ -12,6 +13,7 @@
valud_method: :id,
selected: Msip::ModeloHelper.poromision(params, :busmunicipio),
input_html: {
'data-enviarautomatico' => '',
class: 'tom-select',
data: {
"action": "change->msip--geodep#cambiar_municipio",
Expand Down
1 change: 1 addition & 0 deletions app/views/msip/personas/_filtro_pais.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
valud_method: :id,
selected: Msip::ModeloHelper.poromision(params, :buspais),
input_html: {
'data-enviarautomatico' => '',
class: 'tom-select',
data: {
"action": "change->msip--geodep#cambiar_pais"
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1239,9 +1239,9 @@ camelcase@^6.2.0:
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==

caniuse-lite@^1.0.30001587:
version "1.0.30001608"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001608.tgz#7ae6e92ffb300e4b4ec2f795e0abab456ec06cc0"
integrity sha512-cjUJTQkk9fQlJR2s4HMuPMvTiRggl0rAVMtthQuyOlDWuqHXqN8azLq+pi8B2TjwKJ32diHjUqRIKeFX4z1FoA==
version "1.0.30001609"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001609.tgz#fc34fad75c0c6d6d6303bdbceec2da8f203dabd6"
integrity sha512-JFPQs34lHKx1B5t1EpQpWH4c+29zIyn/haGsbpfq3suuV9v56enjFt23zqijxGTMwy1p/4H2tjnQMY+p1WoAyA==

chalk@^2.4.2:
version "2.4.2"
Expand Down Expand Up @@ -1516,9 +1516,9 @@ domexception@^2.0.1:
webidl-conversions "^5.0.0"

electron-to-chromium@^1.4.668:
version "1.4.731"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.731.tgz#d3dc19f359045b750a1fb0bc42315a502d950187"
integrity sha512-+TqVfZjpRz2V/5SPpmJxq9qK620SC5SqCnxQIOi7i/U08ZDcTpKbT7Xjj9FU5CbXTMUb4fywbIr8C7cGv4hcjw==
version "1.4.736"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.736.tgz#ecb4348f4d5c70fb1e31c347e5bad6b751066416"
integrity sha512-Rer6wc3ynLelKNM4lOCg7/zPQj8tPOCB2hzD32PX9wd3hgRRi9MxEbmkFCokzcEhRVMiOVLjnL9ig9cefJ+6+Q==

emittery@^0.8.1:
version "0.8.1"
Expand Down

0 comments on commit cf7680c

Please sign in to comment.