@sankhyalabs/ezui 1.1.123 → 1.1.126

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.
Files changed (89) hide show
  1. package/dist/assets/actions-sprite.svg +257 -0
  2. package/dist/cjs/{CSSVarsUtils-8fbdf2e0.js → CSSVarsUtils-1034b7b6.js} +2 -0
  3. package/dist/cjs/ez-collapsible-box.cjs.entry.js +22 -9
  4. package/dist/cjs/ez-combo-box.cjs.entry.js +7 -3
  5. package/dist/cjs/ez-date-input.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-date-time-input.cjs.entry.js +1 -1
  7. package/dist/cjs/ez-filter-input.cjs.entry.js +1 -1
  8. package/dist/cjs/ez-form.cjs.entry.js +3 -3
  9. package/dist/cjs/ez-grid.cjs.entry.js +112 -22
  10. package/dist/cjs/ez-list.cjs.entry.js +6 -0
  11. package/dist/cjs/ez-number-input.cjs.entry.js +1 -1
  12. package/dist/cjs/ez-search.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-text-area.cjs.entry.js +13 -3
  14. package/dist/cjs/ez-text-input.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
  16. package/dist/cjs/ezui.cjs.js +1 -1
  17. package/dist/cjs/grid-config.cjs.entry.js +167 -31
  18. package/dist/cjs/loader.cjs.js +1 -1
  19. package/dist/cjs/select-box.cjs.entry.js +1 -1
  20. package/dist/collection/components/assets/actions-sprite.svg +257 -0
  21. package/dist/collection/components/ez-check/ez-check.js +1 -1
  22. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +91 -83
  23. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +49 -18
  24. package/dist/collection/components/ez-combo-box/ez-combo-box.css +6 -0
  25. package/dist/collection/components/ez-combo-box/ez-combo-box.js +23 -1
  26. package/dist/collection/components/ez-form/ez-form.css +5 -0
  27. package/dist/collection/components/ez-form/structure/FormItem.js +1 -1
  28. package/dist/collection/components/ez-form/structure/FormSheet.js +1 -1
  29. package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +38 -18
  30. package/dist/collection/components/ez-grid/ez-grid.js +117 -7
  31. package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +190 -37
  32. package/dist/collection/components/ez-grid/subcomponents/select-box/select-box.js +3 -3
  33. package/dist/collection/components/ez-list/ez-list.js +23 -1
  34. package/dist/collection/components/ez-text-area/ez-text-area.js +15 -4
  35. package/dist/collection/components/ez-text-input/ez-text-input.css +4 -0
  36. package/dist/collection/utils/CSSVarsUtils.js +2 -0
  37. package/dist/custom-elements/index.js +337 -76
  38. package/dist/esm/{CSSVarsUtils-667e0016.js → CSSVarsUtils-eb4c5af6.js} +2 -0
  39. package/dist/esm/ez-collapsible-box.entry.js +23 -10
  40. package/dist/esm/ez-combo-box.entry.js +7 -3
  41. package/dist/esm/ez-date-input.entry.js +1 -1
  42. package/dist/esm/ez-date-time-input.entry.js +1 -1
  43. package/dist/esm/ez-filter-input.entry.js +1 -1
  44. package/dist/esm/ez-form.entry.js +3 -3
  45. package/dist/esm/ez-grid.entry.js +112 -22
  46. package/dist/esm/ez-list.entry.js +6 -0
  47. package/dist/esm/ez-number-input.entry.js +1 -1
  48. package/dist/esm/ez-search.entry.js +1 -1
  49. package/dist/esm/ez-text-area.entry.js +13 -3
  50. package/dist/esm/ez-text-input.entry.js +1 -1
  51. package/dist/esm/ez-time-input.entry.js +1 -1
  52. package/dist/esm/ezui.js +1 -1
  53. package/dist/esm/grid-config.entry.js +167 -31
  54. package/dist/esm/loader.js +1 -1
  55. package/dist/esm/select-box.entry.js +1 -1
  56. package/dist/ezui/ezui.esm.js +1 -1
  57. package/dist/ezui/{p-4262a462.entry.js → p-248d8511.entry.js} +1 -1
  58. package/dist/ezui/p-35edc488.entry.js +1 -0
  59. package/dist/ezui/{p-2d894fed.entry.js → p-5821c335.entry.js} +1 -1
  60. package/dist/ezui/p-5a9ab4f7.entry.js +1 -0
  61. package/dist/ezui/{p-e62f5c77.entry.js → p-5f725a93.entry.js} +1 -1
  62. package/dist/ezui/p-7d5b2ebf.entry.js +1 -0
  63. package/dist/ezui/p-7f87f762.entry.js +1 -0
  64. package/dist/ezui/p-91706181.entry.js +1 -0
  65. package/dist/ezui/p-933a7475.js +1 -0
  66. package/dist/ezui/p-b59ab2d5.entry.js +1 -0
  67. package/dist/ezui/{p-1db59c89.entry.js → p-c6b2b2e5.entry.js} +1 -1
  68. package/dist/ezui/{p-0927092b.entry.js → p-cbfb94cb.entry.js} +1 -1
  69. package/dist/ezui/p-cf8309fc.entry.js +1 -0
  70. package/dist/ezui/{p-5e989ecf.entry.js → p-ec205792.entry.js} +1 -1
  71. package/dist/ezui/{p-8543a1b3.entry.js → p-ed1e0331.entry.js} +1 -1
  72. package/dist/ezui/{p-28ce145e.entry.js → p-f65302bb.entry.js} +1 -1
  73. package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +12 -3
  74. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +4 -0
  75. package/dist/types/components/ez-grid/controller/EzGridController.d.ts +35 -1
  76. package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +3 -3
  77. package/dist/types/components/ez-grid/ez-grid.d.ts +14 -3
  78. package/dist/types/components/ez-grid/subcomponents/gridconfig/grid-config.d.ts +10 -4
  79. package/dist/types/components/ez-list/ez-list.d.ts +5 -0
  80. package/dist/types/components.d.ts +44 -10
  81. package/package.json +3 -3
  82. package/dist/ezui/p-0965bcae.entry.js +0 -1
  83. package/dist/ezui/p-46d1340b.entry.js +0 -1
  84. package/dist/ezui/p-6745931a.entry.js +0 -1
  85. package/dist/ezui/p-91e51dc9.entry.js +0 -1
  86. package/dist/ezui/p-9a9b2936.entry.js +0 -1
  87. package/dist/ezui/p-a44dcc62.entry.js +0 -1
  88. package/dist/ezui/p-c621cab9.entry.js +0 -1
  89. package/dist/ezui/p-d54c157f.js +0 -1
@@ -1,7 +1,4 @@
1
1
  :host {
2
- /*@doc Define a altura do componente quando colapsado.*/
3
- --ez-collapsible-box--height: 42px;
4
-
5
2
  /*@doc Define o tamanho da fonte do header.*/
6
3
  --ez-collapsible-box--font-size: var(--title--medium, 14px);
7
4
  /*@doc Define a família da fonte do header.*/
@@ -10,30 +7,16 @@
10
7
  --ez-collapsible-box--font-weight: var(--text-weight--large, 600);
11
8
  /*@doc Define a cor da fonte do header.*/
12
9
  --ez-collapsible-box--color: var(--title--primary);
13
-
14
- /*@doc Contém a imagem do chevron no tamanho xsmall.*/
15
- --ez-collapsible-box__btn--image--xsmall: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="12px" width="7.5px"><path d="M 0,10.56 4.5967752,6.0000006 0,1.3800006 1.4516132,0 7.5,6.0000006 1.4516132,12 Z"/></svg>');
16
-
17
- /*@doc Contém a imagem do chevron no tamanho small.*/
18
- --ez-collapsible-box__btn--image--small: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="14px" width="8.68px"><path d="M 0,12.32 5.3200012,7.0000007 0,1.6100007 1.6800004,0 8.68,7.0000007 1.6800004,14 Z"/></svg>');
19
-
20
- /*@doc Contém a imagem do chevron no tamanho medium.*/
21
- --ez-collapsible-box__btn--image--medium: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="10px"><path d="M 0.21915251,13.860393 6.0795475,8.0000007 0.21915251,2.0624968 2.0698036,0.28895588 9.7808475,8.0000007 2.0698036,15.711044 Z"/></svg>');
22
-
23
- /*@doc Contém a imagem do chevron no tamanho large.*/
24
- --ez-collapsible-box__btn--image--large: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="18px" width="11.25px"><path d="M 0,15.84 6.8951628,9.0000009 0,2.0700009 2.1774198,0 11.25,9.0000009 2.1774198,18 Z"/></svg>');
25
-
26
- /*@doc Contém a imagem do chevron no tamanho xlarge.*/
27
- --ez-collapsible-box__btn--image--xlarge: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="20px" width="12.5px"><path d="M 0,17.6 7.661292,10.000001 0,2.300001 2.4193553,0 12.5,10.000001 2.4193553,20 Z"/></svg>');
28
-
29
10
  /*@doc Define a cor do chevron.*/
30
- --ez-collapsible-box__btn--fill: var(--ez-collapsible-box--color);
31
-
32
- /*@doc Define a largura do botão que contém o chevron.*/
33
- --ez-collapsible-box__btn--width: 10px;
34
-
35
- /*@doc Define a altura do botão que contém o chevron.*/
36
- --ez-collapsible-box__btn--height: 16px;
11
+ --ez-collapsible-box__icon--color: var(--ez-collapsible-box--color);
12
+ /*@doc Define o espaçamento superior ao header.*/
13
+ --ez-collapsible-box__header--padding-top: 0px;
14
+ /*@doc Define o espaçamento inferior ao header.*/
15
+ --ez-collapsible-box__header--padding-bottom: 0px;
16
+ /*@doc Define o espaçamento à direita do header.*/
17
+ --ez-collapsible-box__header--padding-right: 0px;
18
+ /*@doc Define o espaçamento à esquerda do header.*/
19
+ --ez-collapsible-box__header--padding-left: 0px;
37
20
 
38
21
  /***************
39
22
  host style
@@ -44,33 +27,51 @@
44
27
  width: 100%;
45
28
  }
46
29
 
47
- .collapsible-box__title {
30
+ .collapsible-box {
48
31
  /*private*/
32
+ display: flex;
33
+ flex-direction: column;
49
34
  width: 100%;
50
- align-self: center;
35
+ }
36
+
37
+ .collapsible-box__header {
38
+ /*private*/
51
39
  display: flex;
52
40
  box-sizing: border-box;
41
+
42
+ /*public*/
43
+ padding-top: var(--ez-collapsible-box__header--padding-top);
44
+ padding-bottom: var(--ez-collapsible-box__header--padding-bottom);
45
+ padding-right: var(--ez-collapsible-box__header--padding-right);
46
+ padding-left: var(--ez-collapsible-box__header--padding-left);
53
47
  }
54
48
 
55
- .collapsible-box__label {
56
- white-space: nowrap;
57
- overflow: hidden;
49
+ .collapsible-box__title {
50
+ /*private*/
51
+ position: relative;
52
+ width: auto;
53
+ display: flex;
54
+ box-sizing: border-box;
55
+ align-items: center;
56
+ outline: none;
57
+ border: none;
58
+ background-color: unset;
58
59
  cursor: pointer;
59
- text-overflow: ellipsis;
60
- width: 100%;
60
+ padding: 0px;
61
+ text-align: left;
61
62
 
62
63
  /*public*/
63
- font-family: var(--ez-collapsible-box--font-family);
64
- font-size: var(--ez-collapsible-box--font-size);
65
- font-weight: var(--ez-collapsible-box--font-weight);
66
- color: var(--ez-collapsible-box--color);
64
+ margin-bottom: var(--space--medium, 12px);
67
65
  }
68
66
 
69
- .collapsible-box__label--icon-right {
67
+ .collapsible-box__label {
68
+ /*private*/
70
69
  white-space: nowrap;
71
70
  overflow: hidden;
72
71
  cursor: pointer;
73
72
  text-overflow: ellipsis;
73
+ box-sizing: border-box;
74
+ margin-left: 6px;
74
75
 
75
76
  /*public*/
76
77
  font-family: var(--ez-collapsible-box--font-family);
@@ -79,84 +80,91 @@
79
80
  color: var(--ez-collapsible-box--color);
80
81
  }
81
82
 
82
- .collapsible-box__btn {
83
+ .collapsible-box__icon {
83
84
  /*private*/
84
- outline: none;
85
- border: none;
86
- background-color: unset;
87
- cursor: pointer;
88
- padding: 1px 6px;
85
+ transform: rotate(90deg) translate(0px, 14%);
86
+
87
+ /*public*/
88
+ transition: transform var(--transition);
89
+ --ez-icon--color: var(--ez-collapsible-box__icon--color, --ez-collapsible-box--color);
89
90
  }
90
91
 
91
- .collapsible-box__btn::after {
92
+ .collapsible-box__icon--collapsed {
92
93
  /*private*/
93
- content: '';
94
- display: flex;
94
+ transform: rotate(0deg) translate(-14%, 0px);
95
+ }
95
96
 
96
- /*public*/
97
- background-color: var(--ez-collapsible-box__btn--fill);
98
- /*parece estranho, mas o bg funciona como fill pq aplicaremos mascara.*/
99
- width: var(--ez-collapsible-box__btn--width);
100
- height: var(--ez-collapsible-box__btn--height);
101
- transition: transform var(--transition);
102
- transform: rotate(90deg);
97
+ .collapsible-box__title--icon-right {
98
+ /*private*/
99
+ flex-direction: row-reverse;
103
100
  }
104
101
 
105
- .collapsible-box__btn--xsmall::after {
106
- width: 7.5px;
107
- height: 12px;
108
- -webkit-mask-image: var(--ez-collapsible-box__btn--image--xsmall);
109
- mask-image: var(--ez-collapsible-box__btn--image--xsmall);
102
+ .collapsible-box__title--icon-right .collapsible-box__icon {
103
+ /*private*/
104
+ transform: rotate(90deg) translate(0px, -14%);
110
105
  }
111
106
 
112
- .collapsible-box__btn--small::after {
113
- width: 8.68px;
114
- height: 14px;
115
- -webkit-mask-image: var(--ez-collapsible-box__btn--image--small);
116
- mask-image: var(--ez-collapsible-box__btn--image--small);
107
+ .collapsible-box__title--icon-right .collapsible-box__icon--collapsed {
108
+ /*private*/
109
+ transform: rotate(0deg) translate(14%, 0px);
117
110
  }
118
111
 
119
- .collapsible-box__btn--medium::after {
120
- width: 10px;
121
- height: 16px;
122
- -webkit-mask-image: var(--ez-collapsible-box__btn--image--medium);
123
- mask-image: var(--ez-collapsible-box__btn--image--medium);
112
+ .collapsible-box__title--icon-right .collapsible-box__label {
113
+ /*private*/
114
+ margin-left: 0px;
115
+ margin-right: 6px;
124
116
  }
125
117
 
126
- .collapsible-box__btn--large::after {
127
- width: 11.25px;
128
- height: 18px;
129
- -webkit-mask-image: var(--ez-collapsible-box__btn--image--large);
130
- mask-image: var(--ez-collapsible-box__btn--image--large);
118
+ .collapsible-box__title--stretched {
119
+ width: 100%;
120
+ justify-content: space-between;
131
121
  }
132
122
 
133
- .collapsible-box__btn--xlarge::after {
134
- width: 12.5px;
135
- height: 20px;
136
- -webkit-mask-image: var(--ez-collapsible-box__btn--image--xlarge);
137
- mask-image: var(--ez-collapsible-box__btn--image--xlarge);
123
+ .collapsible-box__content {
124
+ /*private*/
125
+ display: flex;
126
+ flex-wrap: wrap;
127
+ overflow: hidden;
128
+ width: 100%;
129
+ height: 0px;
130
+ max-height: 0px;
131
+ opacity: 0;
132
+
133
+ /*public*/
134
+ transition: all var(--transition, 0.5s);
138
135
  }
139
136
 
140
- .collapsible-box__btn--collapsed::after {
141
- transform: rotate(0deg);
137
+ .collapsible-box__content--show {
138
+ /*private*/
139
+ height: 100%;
140
+ max-height: none;
141
+ opacity: 1;
142
+
143
+ /*public*/
144
+ transition: all var(--transition, 0.5s);
142
145
  }
143
146
 
144
- .font--xsmall {
147
+ .font--x-small {
148
+ /*private*/
145
149
  font-size: 10px;
146
150
  }
147
151
 
148
152
  .font--small {
153
+ /*private*/
149
154
  font-size: 12px;
150
155
  }
151
156
 
152
157
  .font--medium {
158
+ /*private*/
153
159
  font-size: 14px;
154
160
  }
155
161
 
156
162
  .font--large {
163
+ /*private*/
157
164
  font-size: 16px;
158
165
  }
159
166
 
160
- .font--xlarge {
167
+ .font--x-large {
168
+ /*private*/
161
169
  font-size: 20px;
162
170
  }
@@ -1,39 +1,52 @@
1
- import { Component, h, Host, Prop, Event, Watch, Method } from "@stencil/core";
1
+ import { Component, h, Prop, Event, Watch, Method } from "@stencil/core";
2
2
  export class EzCollapsibleBox {
3
3
  constructor() {
4
4
  /**
5
- * Valor externalizado que garante a exibição ou não do componente
5
+ * Valor externalizado que garante a exibição ou não do componente.
6
6
  */
7
7
  this.value = false;
8
8
  /**
9
9
  * Define o tamanho do texto e do ícone do componente.
10
+ * Tamanhos suportados: "x-small", "small", "medium", "large" e "x-large".
10
11
  */
11
12
  this.headerSize = "small";
12
13
  /**
13
14
  * Define o local onde o ícone será renderizado.
14
15
  */
15
16
  this.iconPlacement = "left";
17
+ /**
18
+ * Define se o titulo irá ocupar toda a largura do componente.
19
+ */
20
+ this.stretchTitle = false;
16
21
  }
17
- observeValue() {
22
+ observeCollapsedValue() {
18
23
  this.ezChange.emit(this.value);
19
24
  }
20
25
  /**
21
- * Esconde ou revela o conteúdo do componente
26
+ * Esconde ou revela o conteúdo do componente.
22
27
  */
23
28
  async showHide() {
24
29
  this.value = !this.value;
25
30
  }
31
+ /**
32
+ * Retorna o tamanho configurado do texto e do ícone.
33
+ */
34
+ getHeaderSize() {
35
+ const sizeAlias = ["xsmall", "xlarge"];
36
+ const sizeList = ["x-small", "small", "medium", "large", "x-large"];
37
+ const headerSize = sizeAlias.includes(this.headerSize) ? this.headerSize.replace('x', 'x-') : this.headerSize;
38
+ return sizeList.includes(headerSize) ? headerSize : "small";
39
+ }
26
40
  render() {
27
- return (h(Host, null,
28
- this.iconPlacement == "right" ?
29
- h("div", { class: "collapsible-box__title" },
30
- h("label", { class: (this.iconPlacement == "right" ? "collapsible-box__label--icon-right " : "collapsible-box__label ") + (this.headerSize ? "font--" + this.headerSize : ""), onClick: () => this.showHide(), title: this.label }, this.label),
31
- h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.headerSize : "collapsible-box__btn " + "collapsible-box__btn--" + this.headerSize, onClick: () => this.showHide() }))
32
- :
33
- h("div", { class: "collapsible-box__title" },
34
- h("button", { class: this.value ? "collapsible-box__btn collapsible-box__btn--collapsed " + "collapsible-box__btn--" + this.headerSize : "collapsible-box__btn " + "collapsible-box__btn--" + this.headerSize, onClick: () => this.showHide() }),
35
- h("label", { class: (this.iconPlacement == "right" ? "collapsible-box__label--icon-right " : "collapsible-box__label ") + (this.headerSize ? "font--" + this.headerSize : ""), onClick: () => this.showHide(), title: this.label }, this.label)),
36
- !this.value ? h("slot", null) : null));
41
+ return (h("div", { class: "collapsible-box" },
42
+ h("div", { class: "collapsible-box__header" },
43
+ h("button", { onClick: () => this.showHide(), class: "collapsible-box__title" +
44
+ (this.iconPlacement === "right" ? " collapsible-box__title--icon-right" : "") +
45
+ (this.stretchTitle ? " collapsible-box__title--stretched" : "") },
46
+ h("ez-icon", { slot: "icon", "icon-name": "chevron-right", size: this.getHeaderSize(), class: "collapsible-box__icon collapsible-box__icon--" + this.getHeaderSize() + (this.value ? " collapsible-box__icon--collapsed" : "") }),
47
+ h("label", { class: "collapsible-box__label font--" + this.getHeaderSize(), title: this.label }, this.label))),
48
+ h("div", { class: "collapsible-box__content" + (this.value ? "" : " collapsible-box__content--show") },
49
+ h("slot", null))));
37
50
  }
38
51
  static get is() { return "ez-collapsible-box"; }
39
52
  static get encapsulation() { return "shadow"; }
@@ -56,7 +69,7 @@ export class EzCollapsibleBox {
56
69
  "optional": false,
57
70
  "docs": {
58
71
  "tags": [],
59
- "text": "Valor externalizado que garante a exibi\u00E7\u00E3o ou n\u00E3o do componente"
72
+ "text": "Valor externalizado que garante a exibi\u00E7\u00E3o ou n\u00E3o do componente."
60
73
  },
61
74
  "attribute": "value",
62
75
  "reflect": true,
@@ -91,7 +104,7 @@ export class EzCollapsibleBox {
91
104
  "optional": false,
92
105
  "docs": {
93
106
  "tags": [],
94
- "text": "Define o tamanho do texto e do \u00EDcone do componente."
107
+ "text": "Define o tamanho do texto e do \u00EDcone do componente.\nTamanhos suportados: \"x-small\", \"small\", \"medium\", \"large\" e \"x-large\"."
95
108
  },
96
109
  "attribute": "header-size",
97
110
  "reflect": true,
@@ -114,6 +127,24 @@ export class EzCollapsibleBox {
114
127
  "attribute": "icon-placement",
115
128
  "reflect": true,
116
129
  "defaultValue": "\"left\""
130
+ },
131
+ "stretchTitle": {
132
+ "type": "boolean",
133
+ "mutable": false,
134
+ "complexType": {
135
+ "original": "boolean",
136
+ "resolved": "boolean",
137
+ "references": {}
138
+ },
139
+ "required": false,
140
+ "optional": false,
141
+ "docs": {
142
+ "tags": [],
143
+ "text": "Define se o titulo ir\u00E1 ocupar toda a largura do componente."
144
+ },
145
+ "attribute": "stretch-title",
146
+ "reflect": true,
147
+ "defaultValue": "false"
117
148
  }
118
149
  }; }
119
150
  static get events() { return [{
@@ -145,13 +176,13 @@ export class EzCollapsibleBox {
145
176
  "return": "Promise<void>"
146
177
  },
147
178
  "docs": {
148
- "text": "Esconde ou revela o conte\u00FAdo do componente",
179
+ "text": "Esconde ou revela o conte\u00FAdo do componente.",
149
180
  "tags": []
150
181
  }
151
182
  }
152
183
  }; }
153
184
  static get watchers() { return [{
154
185
  "propName": "value",
155
- "methodName": "observeValue"
186
+ "methodName": "observeCollapsedValue"
156
187
  }]; }
157
188
  }
@@ -89,6 +89,12 @@
89
89
  width: var(--ez-combo-box--width);
90
90
  }
91
91
 
92
+ .suppressed-search-input{
93
+ --ez-text-input__input--border-color: var(--color--strokes, #dce0e8);
94
+ --ez-text-input__input--disabled--background-color: var(--background--xlight, #fff);
95
+ --ez-text-input__input--disabled--color: var(--title--primary, #000);
96
+ }
97
+
92
98
  .list-container {
93
99
  position: relative;
94
100
  width: 100%;
@@ -15,6 +15,10 @@ export class EzComboBox {
15
15
  * Ajusta a opção de mostrar o "value" para cada opção. Por padrão não mostra
16
16
  */
17
17
  this.showOptionValue = false;
18
+ /**
19
+ * Desabilita a digitação dentro do componente.
20
+ */
21
+ this.suppressSearch = false;
18
22
  /**
19
23
  * Remove a opção vazia da lista de opções
20
24
  */
@@ -266,7 +270,7 @@ export class EzComboBox {
266
270
  }
267
271
  render() {
268
272
  return (h(Host, null,
269
- h("ez-text-input", { ref: elem => this._inputElement = elem, enabled: this.enabled, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onEzChange: event => event.stopPropagation(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, this.searchMode ?
273
+ h("ez-text-input", { class: this.suppressSearch ? "suppressed-search-input" : "", ref: elem => this._inputElement = elem, enabled: this.enabled && !this.suppressSearch, onInput: evt => this.onTextInputChangeHandler(evt), onClick: () => this.onTextInputClickHandler(), onFocusout: () => this.onTextInputFocusOutHandler(), onEzChange: event => event.stopPropagation(), onKeyDown: event => this.keyDownHandler(event), label: this.label, value: this.getText(), canShowError: this.canShowError, errorMessage: this.errorMessage, mode: this.mode }, this.searchMode ?
270
274
  h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-search", onClick: () => { this.loadOptions("ADVANCED"); }, slot: "leftIcon" })
271
275
  :
272
276
  h("button", { disabled: !this.enabled, tabindex: -1, class: "btn-open-options", slot: "rightIcon", onClick: () => this.showOptions() })),
@@ -430,6 +434,24 @@ export class EzComboBox {
430
434
  "reflect": false,
431
435
  "defaultValue": "false"
432
436
  },
437
+ "suppressSearch": {
438
+ "type": "boolean",
439
+ "mutable": false,
440
+ "complexType": {
441
+ "original": "boolean",
442
+ "resolved": "boolean",
443
+ "references": {}
444
+ },
445
+ "required": false,
446
+ "optional": false,
447
+ "docs": {
448
+ "tags": [],
449
+ "text": "Desabilita a digita\u00E7\u00E3o dentro do componente."
450
+ },
451
+ "attribute": "suppress-search",
452
+ "reflect": false,
453
+ "defaultValue": "false"
454
+ },
433
455
  "optionLoader": {
434
456
  "type": "unknown",
435
457
  "mutable": false,
@@ -2,4 +2,9 @@ ez-form {
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: 100%;
5
+ }
6
+
7
+ .dynamic-content ez-collapsible-box {
8
+ --ez-collapsible-box__header--padding-right: var(--space-small, 6px);
9
+ --ez-collapsible-box__header--padding-left: var(--space-small, 6px);
5
10
  }
@@ -3,7 +3,7 @@ import { buildField } from "../fieldbuilder/FieldBuilder";
3
3
  export const FormItem = ({ source }) => {
4
4
  if ("items" in source) {
5
5
  const fieldSet = source;
6
- return h("ez-collapsible-box", { label: source.label }, fieldSet.items.map(fi => buildField(fi)));
6
+ return h("ez-collapsible-box", { label: source.label, "header-size": "large" }, fieldSet.items.map(fi => buildField(fi)));
7
7
  }
8
8
  else {
9
9
  return buildField(source);
@@ -1,6 +1,6 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { FormItem } from "./FormItem";
3
3
  export const FormSheet = ({ store, source }) => {
4
- return (h("div", { class: "box__container" },
4
+ return (h("div", { class: "dynamic-content box__container" },
5
5
  h("div", { class: "row padding-vertical--small" }, source.items.map(item => h(FormItem, { store: store, source: item })))));
6
6
  };
@@ -44,6 +44,7 @@ export default class AgGridController {
44
44
  serverSideStoreType: "partial",
45
45
  rowSelection: this._multipleSelection ? "multiple" : "single",
46
46
  serverSideDatasource: this._dataSource,
47
+ sortingOrder: ['desc', 'asc', null],
47
48
  getRowNodeId: (params) => typeof params === "string" ? params : params[this._idAttribName],
48
49
  getMainMenuItems: (params) => {
49
50
  const column = params.column;
@@ -83,6 +84,7 @@ export default class AgGridController {
83
84
  opt.onSelectionChanged = e => this.onSelectionChange(e);
84
85
  opt.onPaginationChanged = () => this.onPaginationChange();
85
86
  opt.onRowDoubleClicked = evt => this.onRowDoubleClick(evt);
87
+ opt.onDragStopped = evt => this.onCallStateChange("columnMovedEnd", evt);
86
88
  opt.onViewportChanged = () => {
87
89
  if (this._dataUnit) {
88
90
  this.selectRows(this._dataUnit.getSelection());
@@ -170,6 +172,7 @@ export default class AgGridController {
170
172
  const colDefs = [];
171
173
  if (showCheckSelection) {
172
174
  colDefs.push({
175
+ colId: "checkBoxColumn",
173
176
  headerName: "",
174
177
  checkboxSelection: true,
175
178
  headerCheckboxSelection: false,
@@ -207,13 +210,24 @@ export default class AgGridController {
207
210
  if (this._grid === undefined) {
208
211
  throw new Error("Erro interno: Grid ainda não inicializado.");
209
212
  }
210
- //TODO neste ponto estamos utilizando um método descontinuado,
211
- //pelo fato de que o applyColumnState não reordena as colunas conforme
212
- //o estado passado.
213
- //https://stackoverflow.com/questions/51488241/ag-grid-how-to-save-and-reload-column-order
214
- //Assim que for corrigido o applyColumnState devemos substituir o setColumnState por ele.
215
- // this._gridOptions.columnApi.applyColumnState({ state: state.map(s => this.buildColState(s)) });
216
- this._gridOptions.columnApi.setColumnState(state.map(s => this.buildColState(s)));
213
+ let columns = this.getColumnsDef();
214
+ let visibleColumns = [];
215
+ let sort = [];
216
+ state.forEach((cfgColumn, index) => {
217
+ this._gridOptions.columnApi.moveColumn(cfgColumn.name, index + 1);
218
+ this._gridOptions.columnApi.setColumnWidth(cfgColumn.name, cfgColumn.width);
219
+ visibleColumns.push(cfgColumn.name);
220
+ if (cfgColumn.ascending !== undefined) {
221
+ sort.push({ colId: cfgColumn.name, sort: cfgColumn.ascending !== true ? 'desc' : 'asc', sortIndex: cfgColumn.orderIndex });
222
+ }
223
+ });
224
+ let invisibleColumns = columns.filter(column => !visibleColumns.includes(column.name)).map(column => column.name);
225
+ this._gridOptions.columnApi.setColumnsVisible(visibleColumns, true);
226
+ this._gridOptions.columnApi.setColumnsVisible(invisibleColumns, false);
227
+ this._gridOptions.columnApi.applyColumnState({
228
+ state: sort,
229
+ defaultState: { sort: null },
230
+ });
217
231
  }
218
232
  getColumnsState() {
219
233
  if (this._grid === undefined) {
@@ -306,21 +320,27 @@ export default class AgGridController {
306
320
  }
307
321
  }
308
322
  }
309
- buildColState(source) {
310
- return {
311
- colId: source.name,
312
- sort: source.sort,
313
- sortIndex: source.sortIndex,
314
- width: source.width,
315
- pinned: source.pinned ? "left" : null,
316
- hide: source.hidden
317
- };
318
- }
319
323
  onCallStateChange(type, e) {
320
324
  const finished = !("finished" in e) || e["finished"];
321
325
  if (finished && this._columnStateChangeCallback) {
322
- this._columnStateChangeCallback(type, this.getColumnsState());
326
+ let info = {};
327
+ let isUserChange = this.isUIEvent(e['source'], e['type']);
328
+ if (type === 'columnResize') {
329
+ info['column'] = { colId: e['column'].colId, actualWidth: e['column'].actualWidth };
330
+ }
331
+ info['isUserChange'] = isUserChange;
332
+ this._columnStateChangeCallback(type, this.getColumnsState(), info);
333
+ }
334
+ }
335
+ isUIEvent(source, type) {
336
+ let optionsArr = ["uiColumnMoved", "uiColumnResized", "uiColumnDragged", "uiColumnExpanded", "uiColumnSorted"];
337
+ if (type === 'dragStopped') {
338
+ return true;
339
+ }
340
+ if (source) {
341
+ return optionsArr.includes(source);
323
342
  }
343
+ return false;
324
344
  }
325
345
  onSelectionChange(e) {
326
346
  if (this._selectionChangeCallback) {