vue-intergrall-plugins 0.0.245 → 0.0.246

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.
@@ -1987,6 +1987,7 @@ var script$y = {
1987
1987
  var _this3 = this;
1988
1988
 
1989
1989
  var varList = input.nextSibling;
1990
+ var currentInstance = this;
1990
1991
  input.setAttribute("placeholder", "{{var_".concat(this.lastVar, "}}"));
1991
1992
  input.setAttribute("id", "{{var_".concat(this.lastVar, "}}"));
1992
1993
  input.addEventListener("input", function (event) {
@@ -1999,23 +2000,42 @@ var script$y = {
1999
2000
  input.classList.add("active");
2000
2001
 
2001
2002
  if (varList) {
2002
- for (var i = 0; i < varList.children.length; i++) {
2003
- varList.children[i].addEventListener("click", function () {
2004
- input.value = "[".concat(this.innerText, "]");
2005
- input.classList.add("active");
2006
- input.dispatchEvent(new Event('input'));
2007
- });
2008
- }
2003
+ (function () {
2004
+ var handleNextFocus = function handleNextFocus() {
2005
+ var allInputs = document.querySelectorAll(".input-var-".concat(currentInstance.identifier));
2006
+ var stop = false;
2007
+
2008
+ if (allInputs.length) {
2009
+ allInputs.forEach(function (elem) {
2010
+ if (!elem.value && !stop) {
2011
+ stop = true;
2012
+ elem.focus();
2013
+ }
2014
+ });
2015
+ }
2009
2016
 
2010
- var containerGeral = document.querySelector(".tg-container");
2011
- varList.classList.add("visible");
2012
- var maxBottom = containerGeral.getBoundingClientRect().bottom,
2013
- currentBottom = varList.getBoundingClientRect().bottom;
2017
+ if (!stop && _this3.$refs["template-single-button"]) _this3.$refs["template-single-button"].focus();
2018
+ };
2014
2019
 
2015
- if (currentBottom > maxBottom) {
2016
- varList.style.top = "-".concat(varList.getBoundingClientRect().height, "px");
2017
- varList.style.borderTop = "1px solid currentColor";
2018
- }
2020
+ for (var i = 0; i < varList.children.length; i++) {
2021
+ varList.children[i].addEventListener("click", function () {
2022
+ input.value = "[".concat(this.innerText, "]");
2023
+ input.classList.add("active");
2024
+ input.dispatchEvent(new Event('input'));
2025
+ handleNextFocus();
2026
+ });
2027
+ }
2028
+
2029
+ var containerGeral = document.querySelector(".tg-container");
2030
+ varList.classList.add("visible");
2031
+ var maxBottom = containerGeral.getBoundingClientRect().bottom,
2032
+ currentBottom = varList.getBoundingClientRect().bottom;
2033
+
2034
+ if (currentBottom > maxBottom) {
2035
+ varList.style.top = "-".concat(varList.getBoundingClientRect().height, "px");
2036
+ varList.style.borderTop = "1px solid currentColor";
2037
+ }
2038
+ })();
2019
2039
  }
2020
2040
  });
2021
2041
  input.addEventListener("blur", function () {
@@ -2201,7 +2221,7 @@ var __vue_inject_styles__$y = undefined;
2201
2221
  var __vue_scope_id__$y = undefined;
2202
2222
  /* module identifier */
2203
2223
 
2204
- var __vue_module_identifier__$y = "data-v-add8fb80";
2224
+ var __vue_module_identifier__$y = "data-v-affaa3f8";
2205
2225
  /* functional template */
2206
2226
 
2207
2227
  var __vue_is_functional_template__$y = false;
@@ -9492,6 +9512,9 @@ var script$h = {
9492
9512
 
9493
9513
  this.adjustOnSelect();
9494
9514
  },
9515
+ focusSelect: function focusSelect() {
9516
+ if (this.$refs["template-v-select"] && this.$refs["template-v-select"].$el) this.$refs["template-v-select"].$el.querySelector("input").focus();
9517
+ },
9495
9518
  selectIfIsUnique: function selectIfIsUnique() {
9496
9519
  if (Object.keys(this.templates).length === 1) {
9497
9520
  for (var key in this.templates) {
@@ -9502,9 +9525,7 @@ var script$h = {
9502
9525
  }
9503
9526
  }
9504
9527
 
9505
- if (!this.codTemplate && this.$refs["template-v-select"] && this.$refs["template-v-select"].$el) {
9506
- this.$refs["template-v-select"].$el.querySelector("input").focus();
9507
- }
9528
+ if (!this.codTemplate) this.focusSelect();
9508
9529
  },
9509
9530
  selectIfHasContact24h: function selectIfHasContact24h() {
9510
9531
  if (this.templates['envio_msg']) {
@@ -9651,7 +9672,7 @@ var __vue_staticRenderFns__$h = [];
9651
9672
 
9652
9673
  var __vue_inject_styles__$h = function __vue_inject_styles__(inject) {
9653
9674
  if (!inject) return;
9654
- inject("data-v-730cbd76_0", {
9675
+ inject("data-v-e3f5b41e_0", {
9655
9676
  source: "*{box-sizing:border-box}.toasted svg{margin-right:10px}.d-none{display:none}ul{list-style-type:none}h1,h2,h3,h4,p{margin:0;padding:0}.tg-container{width:100%;max-width:800px;display:flex;flex-direction:column;overflow-x:hidden;overflow-y:auto}.tg-options{width:100%;display:flex}.tg-options.column{flex-direction:column}.tg-options h4{margin-right:5px}.tg-select{flex:1;height:34px;overflow:hidden}.tg-select .vs__dropdown-toggle{background-color:#fff;height:34px;overflow:hidden;display:flex;align-items:center}.tg-select .vs__selected-options{height:34px;overflow:hidden}.tg-select .vs__selected-options>span{white-space:nowrap;text-overflow:ellipsis;flex:1}.tg-select .vs__selected-options>input{flex-grow:0}.vs__dropdown-option{transition:background-color 150ms;white-space:normal}.vs__dropdown-option:nth-child(odd){background-color:#f1f1f1}.vs__dropdown-option--highlight,.vs__dropdown-option--selected,.vs__dropdown-option:active,.vs__dropdown-option:focus,.vs__dropdown-option:hover{background-color:#5897fb!important;color:#fff}.tg-component{width:100%}.ts-container{width:100%;display:flex;justify-content:space-between}.ts-content{--border-color:#CCC;--background-color:#DFF0D8;--input-background-color:#FFF;--input-border-default:#007BFF;--input-border-error:#E74C3C;--placeholder-color:#BBB;flex:2;font-size:.7rem;padding:10px 0}.ts-content footer,.ts-content header,.ts-content section{padding:3px 5px;background-color:var(--background-color)}.ts-content header,.ts-content section{border-right:1px solid var(--border-color);border-left:1px solid var(--border-color)}.ts-content header{border-top-left-radius:2.5px;border-top-right-radius:2.5px;border-top:1px solid var(--border-color)}.ts-content header{font-weight:550}.ts-content section{line-height:25px}.ts-content section.margin-bottom{border-bottom-left-radius:2.5px;border-bottom-right-radius:2.5px;border-bottom:1px solid var(--border-color)}.ts-content footer{border:1px solid var(--border-color);border-top:unset;border-bottom-left-radius:2.5px;border-bottom-right-radius:2.5px}.ts-content input{border:1px solid transparent;outline:0;font-size:.8rem;padding:2.5px 5px;background-color:var(--input-background-color)}.ts-content input::placeholder{color:var(--placeholder-color)}.ts-content input.active,.ts-content input:focus{border:1px solid var(--input-border-default)}.ts-content input.invalid{border:1px solid var(--input-border-error)!important}.ts-content__var{display:inline-block;position:relative}.ts-dropdown{margin:0;padding:0;position:absolute;top:19px;left:0;background:#eee;width:100%;z-index:1;transition:all 150ms;visibility:hidden;opacity:0;list-style-type:none;border:1px solid #444;border-top:unset}.ts-dropdown li{width:100%;opacity:.9;cursor:pointer;font-weight:550;padding:2px 5px;transition:background-color 150ms}.ts-dropdown li:focus,.ts-dropdown li:focus-within,.ts-dropdown li:hover{opacity:1;background-color:#555;color:#fff}.ts-dropdown.visible{visibility:visible;opacity:1}.tg-btn{width:40%;display:flex;justify-content:center;align-items:center}.tg-btn button{border:unset;display:block;min-width:180px;height:35px;padding:0 10px;font-weight:500;background-color:#007bff;color:#fff;transition:transform .3s ease-in-out;user-select:none;cursor:pointer;box-shadow:inset 0 -2px rgba(0,0,0,.2);opacity:.9;border-radius:2.5px}.tg-btn button>svg{margin-right:5px;color:#003166}.tg-btn button:hover{opacity:1}.tg-btn button:active{opacity:1;box-shadow:inset 0 -1px rgba(0,0,0,.2);-webkit-transform:translateY(1px);-moz-transform:translateY(1px);-o-transform:translateY(1px);-ms-transform:translateY(1px);transform:translateY(1px)}.tg-btn button:active{opacity:1;box-shadow:inset 0 -1px rgba(0,0,0,.2);-webkit-transform:translateY(1px);-moz-transform:translateY(1px);-o-transform:translateY(1px);-ms-transform:translateY(1px);transform:translateY(1px)}.tg-btn button:active,.tg-btn button:focus{outline:2px solid #000}.tg-btn.small-btn{width:auto;margin:0 5px}.tg-btn.small-btn svg{margin-right:0}.tg-btn.small-btn button{min-width:35px;width:35px;padding:0;display:flex;justify-content:center;align-items:center}.tm-container{border:1px solid var(--border-color);border-radius:2.5px;display:flex}",
9656
9677
  map: undefined,
9657
9678
  media: undefined
@@ -9663,7 +9684,7 @@ var __vue_inject_styles__$h = function __vue_inject_styles__(inject) {
9663
9684
  var __vue_scope_id__$h = undefined;
9664
9685
  /* module identifier */
9665
9686
 
9666
- var __vue_module_identifier__$h = "data-v-730cbd76";
9687
+ var __vue_module_identifier__$h = "data-v-e3f5b41e";
9667
9688
  /* functional template */
9668
9689
 
9669
9690
  var __vue_is_functional_template__$h = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intergrall-plugins",
3
- "version": "0.0.245",
3
+ "version": "0.0.246",
4
4
  "description": "",
5
5
  "main": "dist/vue-intergrall-plugins.ssr.js",
6
6
  "browser": "dist/vue-intergrall-plugins.esm.js",
@@ -141,6 +141,9 @@
141
141
  }
142
142
  this.adjustOnSelect()
143
143
  },
144
+ focusSelect() {
145
+ if(this.$refs["template-v-select"] && this.$refs["template-v-select"].$el) this.$refs["template-v-select"].$el.querySelector("input").focus()
146
+ },
144
147
  selectIfIsUnique() {
145
148
  if(Object.keys(this.templates).length === 1) {
146
149
  for(let key in this.templates) {
@@ -150,9 +153,7 @@
150
153
  this.adjustOnSelect()
151
154
  }
152
155
  }
153
- if(!this.codTemplate && this.$refs["template-v-select"] && this.$refs["template-v-select"].$el) {
154
- this.$refs["template-v-select"].$el.querySelector("input").focus()
155
- }
156
+ if(!this.codTemplate) this.focusSelect()
156
157
  },
157
158
  selectIfHasContact24h() {
158
159
  if(this.templates['envio_msg']) {
@@ -171,6 +171,8 @@ export default {
171
171
  setEvent(input) {
172
172
  const varList = input.nextSibling
173
173
 
174
+ const currentInstance = this
175
+
174
176
  input.setAttribute("placeholder", `{{var_${this.lastVar}}}`);
175
177
  input.setAttribute("id", `{{var_${this.lastVar}}}`);
176
178
  input.addEventListener("input", (event) => {
@@ -181,11 +183,26 @@ export default {
181
183
  input.classList.remove("invalid");
182
184
  input.classList.add("active");
183
185
  if(varList) {
186
+ const handleNextFocus = () => {
187
+ const allInputs = document.querySelectorAll(`.input-var-${currentInstance.identifier}`)
188
+ let stop = false
189
+ if(allInputs.length) {
190
+ allInputs.forEach(elem => {
191
+ if(!elem.value && !stop) {
192
+ stop = true
193
+ elem.focus()
194
+ }
195
+ })
196
+ }
197
+ if(!stop && this.$refs["template-single-button"]) this.$refs["template-single-button"].focus()
198
+ }
199
+
184
200
  for(let i = 0; i < varList.children.length; i++) {
185
201
  varList.children[i].addEventListener("click", function() {
186
202
  input.value = `[${this.innerText}]`
187
203
  input.classList.add("active")
188
204
  input.dispatchEvent(new Event('input'))
205
+ handleNextFocus()
189
206
  })
190
207
  }
191
208
 
@@ -213,8 +230,7 @@ export default {
213
230
  if(varList) varList.classList.remove("visible")
214
231
  });
215
232
  input.addEventListener("keydown", (event) => {
216
- if (event.keyCode == 13 && this.hasButton)
217
- this.$emit("click-trigger");
233
+ if (event.keyCode == 13 && this.hasButton) this.$emit("click-trigger");
218
234
  });
219
235
  this.lastVar += 1;
220
236
  },