@sankhyalabs/ezui 1.2.0-beta.10 → 1.2.0-beta.11

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.
@@ -9,6 +9,10 @@ const ezViewStackCss = ":host{width:100%;height:100%}.ez-view-stack__container{w
9
9
  let EzViewStack = class {
10
10
  constructor(hostRef) {
11
11
  index.registerInstance(this, hostRef);
12
+ /**
13
+ * Indetificador único do componente
14
+ */
15
+ this._dataKey = 'id_'.concat(Date.now().toString());
12
16
  }
13
17
  /**
14
18
  * Exibe a aba desejada de acordo com o index passado na tela fazendo com a ativa atual seja removida ou oculta dependendo da hidePolicy.
@@ -21,17 +25,17 @@ let EzViewStack = class {
21
25
  }
22
26
  }
23
27
  /**
24
- * Retorna o index que est� atualmente ativo e sendo exibido.
28
+ * Retorna o index que está atualmente ativo e sendo exibido.
25
29
  */
26
30
  async getSelectedIndex() {
27
31
  return this._focusedIndex;
28
32
  }
29
33
  policyHideRemove() {
30
- let element = this._hostElem.querySelector(`#el_${this._focusedIndex}`);
34
+ let element = this._hostElem.querySelector(`#${this._dataKey}_el_${this._focusedIndex}`);
31
35
  this.checkElementVisibility(element);
32
36
  }
33
37
  policyShowAppend(index) {
34
- let selectedElement = this._hostElem.querySelector(`#el_${index}`);
38
+ let selectedElement = this._hostElem.querySelector(`#${this._dataKey}_el_${index}`);
35
39
  if (selectedElement) {
36
40
  selectedElement.removeAttribute("style");
37
41
  }
@@ -54,8 +58,8 @@ let EzViewStack = class {
54
58
  this._focusedIndex = 0;
55
59
  this._totalStackItems = 0;
56
60
  this._hostElem.classList.add("ez-view-stack__container");
57
- this._hostElem.querySelectorAll("stack-item").forEach((element, index) => {
58
- element.setAttribute("id", `el_${index}`);
61
+ this._hostElem.querySelectorAll(":scope > stack-item").forEach((element, index) => {
62
+ element.setAttribute("id", `${this._dataKey}_el_${index}`);
59
63
  if (index !== 0) {
60
64
  this.checkElementVisibility(element);
61
65
  }
@@ -1,5 +1,11 @@
1
1
  import { Component, h, Host, Element, Method } from '@stencil/core';
2
2
  export class EzViewStack {
3
+ constructor() {
4
+ /**
5
+ * Indetificador único do componente
6
+ */
7
+ this._dataKey = 'id_'.concat(Date.now().toString());
8
+ }
3
9
  /**
4
10
  * Exibe a aba desejada de acordo com o index passado na tela fazendo com a ativa atual seja removida ou oculta dependendo da hidePolicy.
5
11
  */
@@ -11,17 +17,17 @@ export class EzViewStack {
11
17
  }
12
18
  }
13
19
  /**
14
- * Retorna o index que est� atualmente ativo e sendo exibido.
20
+ * Retorna o index que está atualmente ativo e sendo exibido.
15
21
  */
16
22
  async getSelectedIndex() {
17
23
  return this._focusedIndex;
18
24
  }
19
25
  policyHideRemove() {
20
- let element = this._hostElem.querySelector(`#el_${this._focusedIndex}`);
26
+ let element = this._hostElem.querySelector(`#${this._dataKey}_el_${this._focusedIndex}`);
21
27
  this.checkElementVisibility(element);
22
28
  }
23
29
  policyShowAppend(index) {
24
- let selectedElement = this._hostElem.querySelector(`#el_${index}`);
30
+ let selectedElement = this._hostElem.querySelector(`#${this._dataKey}_el_${index}`);
25
31
  if (selectedElement) {
26
32
  selectedElement.removeAttribute("style");
27
33
  }
@@ -44,8 +50,8 @@ export class EzViewStack {
44
50
  this._focusedIndex = 0;
45
51
  this._totalStackItems = 0;
46
52
  this._hostElem.classList.add("ez-view-stack__container");
47
- this._hostElem.querySelectorAll("stack-item").forEach((element, index) => {
48
- element.setAttribute("id", `el_${index}`);
53
+ this._hostElem.querySelectorAll(":scope > stack-item").forEach((element, index) => {
54
+ element.setAttribute("id", `${this._dataKey}_el_${index}`);
49
55
  if (index !== 0) {
50
56
  this.checkElementVisibility(element);
51
57
  }
@@ -100,7 +106,7 @@ export class EzViewStack {
100
106
  "return": "Promise<number>"
101
107
  },
102
108
  "docs": {
103
- "text": "Retorna o index que est\uFFFD atualmente ativo e sendo exibido.",
109
+ "text": "Retorna o index que est\u00E1 atualmente ativo e sendo exibido.",
104
110
  "tags": []
105
111
  }
106
112
  }
@@ -123772,6 +123772,10 @@ let EzViewStack$1 = class extends HTMLElement$1 {
123772
123772
  constructor() {
123773
123773
  super();
123774
123774
  this.__registerHost();
123775
+ /**
123776
+ * Indetificador único do componente
123777
+ */
123778
+ this._dataKey = 'id_'.concat(Date.now().toString());
123775
123779
  }
123776
123780
  /**
123777
123781
  * Exibe a aba desejada de acordo com o index passado na tela fazendo com a ativa atual seja removida ou oculta dependendo da hidePolicy.
@@ -123784,17 +123788,17 @@ let EzViewStack$1 = class extends HTMLElement$1 {
123784
123788
  }
123785
123789
  }
123786
123790
  /**
123787
- * Retorna o index que est� atualmente ativo e sendo exibido.
123791
+ * Retorna o index que está atualmente ativo e sendo exibido.
123788
123792
  */
123789
123793
  async getSelectedIndex() {
123790
123794
  return this._focusedIndex;
123791
123795
  }
123792
123796
  policyHideRemove() {
123793
- let element = this._hostElem.querySelector(`#el_${this._focusedIndex}`);
123797
+ let element = this._hostElem.querySelector(`#${this._dataKey}_el_${this._focusedIndex}`);
123794
123798
  this.checkElementVisibility(element);
123795
123799
  }
123796
123800
  policyShowAppend(index) {
123797
- let selectedElement = this._hostElem.querySelector(`#el_${index}`);
123801
+ let selectedElement = this._hostElem.querySelector(`#${this._dataKey}_el_${index}`);
123798
123802
  if (selectedElement) {
123799
123803
  selectedElement.removeAttribute("style");
123800
123804
  }
@@ -123817,8 +123821,8 @@ let EzViewStack$1 = class extends HTMLElement$1 {
123817
123821
  this._focusedIndex = 0;
123818
123822
  this._totalStackItems = 0;
123819
123823
  this._hostElem.classList.add("ez-view-stack__container");
123820
- this._hostElem.querySelectorAll("stack-item").forEach((element, index) => {
123821
- element.setAttribute("id", `el_${index}`);
123824
+ this._hostElem.querySelectorAll(":scope > stack-item").forEach((element, index) => {
123825
+ element.setAttribute("id", `${this._dataKey}_el_${index}`);
123822
123826
  if (index !== 0) {
123823
123827
  this.checkElementVisibility(element);
123824
123828
  }
@@ -5,6 +5,10 @@ const ezViewStackCss = ":host{width:100%;height:100%}.ez-view-stack__container{w
5
5
  let EzViewStack = class {
6
6
  constructor(hostRef) {
7
7
  registerInstance(this, hostRef);
8
+ /**
9
+ * Indetificador único do componente
10
+ */
11
+ this._dataKey = 'id_'.concat(Date.now().toString());
8
12
  }
9
13
  /**
10
14
  * Exibe a aba desejada de acordo com o index passado na tela fazendo com a ativa atual seja removida ou oculta dependendo da hidePolicy.
@@ -17,17 +21,17 @@ let EzViewStack = class {
17
21
  }
18
22
  }
19
23
  /**
20
- * Retorna o index que est� atualmente ativo e sendo exibido.
24
+ * Retorna o index que está atualmente ativo e sendo exibido.
21
25
  */
22
26
  async getSelectedIndex() {
23
27
  return this._focusedIndex;
24
28
  }
25
29
  policyHideRemove() {
26
- let element = this._hostElem.querySelector(`#el_${this._focusedIndex}`);
30
+ let element = this._hostElem.querySelector(`#${this._dataKey}_el_${this._focusedIndex}`);
27
31
  this.checkElementVisibility(element);
28
32
  }
29
33
  policyShowAppend(index) {
30
- let selectedElement = this._hostElem.querySelector(`#el_${index}`);
34
+ let selectedElement = this._hostElem.querySelector(`#${this._dataKey}_el_${index}`);
31
35
  if (selectedElement) {
32
36
  selectedElement.removeAttribute("style");
33
37
  }
@@ -50,8 +54,8 @@ let EzViewStack = class {
50
54
  this._focusedIndex = 0;
51
55
  this._totalStackItems = 0;
52
56
  this._hostElem.classList.add("ez-view-stack__container");
53
- this._hostElem.querySelectorAll("stack-item").forEach((element, index) => {
54
- element.setAttribute("id", `el_${index}`);
57
+ this._hostElem.querySelectorAll(":scope > stack-item").forEach((element, index) => {
58
+ element.setAttribute("id", `${this._dataKey}_el_${index}`);
55
59
  if (index !== 0) {
56
60
  this.checkElementVisibility(element);
57
61
  }
@@ -5,6 +5,10 @@ const ezViewStackCss = ":host{width:100%;height:100%}.ez-view-stack__container{w
5
5
  let EzViewStack = class {
6
6
  constructor(hostRef) {
7
7
  registerInstance(this, hostRef);
8
+ /**
9
+ * Indetificador único do componente
10
+ */
11
+ this._dataKey = 'id_'.concat(Date.now().toString());
8
12
  }
9
13
  /**
10
14
  * Exibe a aba desejada de acordo com o index passado na tela fazendo com a ativa atual seja removida ou oculta dependendo da hidePolicy.
@@ -17,17 +21,17 @@ let EzViewStack = class {
17
21
  }
18
22
  }
19
23
  /**
20
- * Retorna o index que est� atualmente ativo e sendo exibido.
24
+ * Retorna o index que está atualmente ativo e sendo exibido.
21
25
  */
22
26
  async getSelectedIndex() {
23
27
  return this._focusedIndex;
24
28
  }
25
29
  policyHideRemove() {
26
- let element = this._hostElem.querySelector(`#el_${this._focusedIndex}`);
30
+ let element = this._hostElem.querySelector(`#${this._dataKey}_el_${this._focusedIndex}`);
27
31
  this.checkElementVisibility(element);
28
32
  }
29
33
  policyShowAppend(index) {
30
- let selectedElement = this._hostElem.querySelector(`#el_${index}`);
34
+ let selectedElement = this._hostElem.querySelector(`#${this._dataKey}_el_${index}`);
31
35
  if (selectedElement) {
32
36
  selectedElement.removeAttribute("style");
33
37
  }
@@ -50,8 +54,8 @@ let EzViewStack = class {
50
54
  this._focusedIndex = 0;
51
55
  this._totalStackItems = 0;
52
56
  this._hostElem.classList.add("ez-view-stack__container");
53
- this._hostElem.querySelectorAll("stack-item").forEach((element, index) => {
54
- element.setAttribute("id", `el_${index}`);
57
+ this._hostElem.querySelectorAll(":scope > stack-item").forEach((element, index) => {
58
+ element.setAttribute("id", `${this._dataKey}_el_${index}`);
55
59
  if (index !== 0) {
56
60
  this.checkElementVisibility(element);
57
61
  }
@@ -0,0 +1 @@
1
+ import{r as t,h as i,g as e,H as s}from"./p-3c7ea91b.js";let h=class{constructor(i){t(this,i),this._dataKey="id_".concat(Date.now().toString())}async show(t){t!==this._focusedIndex&&0<=t&&t<this._totalStackItems&&(this.policyHideRemove(),this.policyShowAppend(t),this._focusedIndex=t)}async getSelectedIndex(){return this._focusedIndex}policyHideRemove(){let t=this._hostElem.querySelector(`#${this._dataKey}_el_${this._focusedIndex}`);this.checkElementVisibility(t)}policyShowAppend(t){let i=this._hostElem.querySelector(`#${this._dataKey}_el_${t}`);i?i.removeAttribute("style"):this._hostElem.append(this._elemList[t])}checkElementVisibility(t){"hide"!==t.getAttribute("hidePolicy")&&t.getAttribute("hidePolicy")?"remove"===t.getAttribute("hidePolicy")&&t.remove():t.setAttribute("style","display: none")}componentWillRender(){this._elemList||(this._elemList=[],this._focusedIndex=0,this._totalStackItems=0,this._hostElem.classList.add("ez-view-stack__container"),this._hostElem.querySelectorAll(":scope > stack-item").forEach(((t,i)=>{t.setAttribute("id",`${this._dataKey}_el_${i}`),0!==i&&this.checkElementVisibility(t),this._totalStackItems++,this._elemList.push(t)})))}disconectCallback(){this._hostElem=null,this._elemList=null}render(){return i(s,null)}get _hostElem(){return e(this)}};h.style=":host{width:100%;height:100%}.ez-view-stack__container{width:100%;height:100%}";export{h as ez_view_stack}
@@ -3,12 +3,16 @@ export declare class EzViewStack {
3
3
  private _elemList;
4
4
  private _focusedIndex;
5
5
  private _totalStackItems;
6
+ /**
7
+ * Indetificador único do componente
8
+ */
9
+ private _dataKey;
6
10
  /**
7
11
  * Exibe a aba desejada de acordo com o index passado na tela fazendo com a ativa atual seja removida ou oculta dependendo da hidePolicy.
8
12
  */
9
13
  show(index: number): Promise<void>;
10
14
  /**
11
- * Retorna o index que est� atualmente ativo e sendo exibido.
15
+ * Retorna o index que está atualmente ativo e sendo exibido.
12
16
  */
13
17
  getSelectedIndex(): Promise<number>;
14
18
  policyHideRemove(): void;
@@ -955,7 +955,7 @@ export namespace Components {
955
955
  }
956
956
  interface EzViewStack {
957
957
  /**
958
- * Retorna o index que est� atualmente ativo e sendo exibido.
958
+ * Retorna o index que está atualmente ativo e sendo exibido.
959
959
  */
960
960
  "getSelectedIndex": () => Promise<number>;
961
961
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/ezui",
3
- "version": "1.2.0-beta.10",
3
+ "version": "1.2.0-beta.11",
4
4
  "description": "Biblioteca de componentes Sankhya.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/custom-elements/index.js",
@@ -1 +0,0 @@
1
- import{r as t,h as i,g as e,H as s}from"./p-3c7ea91b.js";let h=class{constructor(i){t(this,i)}async show(t){t!==this._focusedIndex&&0<=t&&t<this._totalStackItems&&(this.policyHideRemove(),this.policyShowAppend(t),this._focusedIndex=t)}async getSelectedIndex(){return this._focusedIndex}policyHideRemove(){let t=this._hostElem.querySelector(`#el_${this._focusedIndex}`);this.checkElementVisibility(t)}policyShowAppend(t){let i=this._hostElem.querySelector(`#el_${t}`);i?i.removeAttribute("style"):this._hostElem.append(this._elemList[t])}checkElementVisibility(t){"hide"!==t.getAttribute("hidePolicy")&&t.getAttribute("hidePolicy")?"remove"===t.getAttribute("hidePolicy")&&t.remove():t.setAttribute("style","display: none")}componentWillRender(){this._elemList||(this._elemList=[],this._focusedIndex=0,this._totalStackItems=0,this._hostElem.classList.add("ez-view-stack__container"),this._hostElem.querySelectorAll("stack-item").forEach(((t,i)=>{t.setAttribute("id",`el_${i}`),0!==i&&this.checkElementVisibility(t),this._totalStackItems++,this._elemList.push(t)})))}disconectCallback(){this._hostElem=null,this._elemList=null}render(){return i(s,null)}get _hostElem(){return e(this)}};h.style=":host{width:100%;height:100%}.ez-view-stack__container{width:100%;height:100%}";export{h as ez_view_stack}