@sankhyalabs/ezui 1.2.0-beta.19 → 1.2.0-beta.20

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 (132) hide show
  1. package/dist/cjs/FieldBuilder-cd3e45ed.js +119 -0
  2. package/dist/cjs/ez-actions-button.cjs.entry.js +64 -12
  3. package/dist/cjs/ez-button.cjs.entry.js +12 -10
  4. package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
  5. package/dist/cjs/ez-chip.cjs.entry.js +1 -1
  6. package/dist/cjs/ez-collapsible-box.cjs.entry.js +85 -6
  7. package/dist/cjs/ez-combo-box.cjs.entry.js +10 -6
  8. package/dist/cjs/ez-date-input.cjs.entry.js +8 -13
  9. package/dist/cjs/ez-date-time-input.cjs.entry.js +8 -13
  10. package/dist/cjs/ez-form.cjs.entry.js +41 -131
  11. package/dist/cjs/ez-grid-config.cjs.entry.js +2 -3
  12. package/dist/cjs/ez-grid.cjs.entry.js +1 -1
  13. package/dist/cjs/ez-list.cjs.entry.js +1 -1
  14. package/dist/cjs/ez-popover.cjs.entry.js +1 -1
  15. package/dist/cjs/ez-radio-button.cjs.entry.js +2 -2
  16. package/dist/cjs/ez-tabselector.cjs.entry.js +7 -5
  17. package/dist/cjs/ez-text-area.cjs.entry.js +6 -6
  18. package/dist/cjs/ez-text-edit.cjs.entry.js +103 -0
  19. package/dist/cjs/ez-text-input.cjs.entry.js +11 -1
  20. package/dist/cjs/ezui.cjs.js +1 -1
  21. package/dist/cjs/loader.cjs.js +1 -1
  22. package/dist/collection/collection-manifest.json +4 -3
  23. package/dist/collection/components/ez-actions-button/ez-actions-button.css +49 -20
  24. package/dist/collection/components/ez-actions-button/ez-actions-button.js +219 -23
  25. package/dist/collection/components/ez-button/ez-button.css +0 -6
  26. package/dist/collection/components/ez-button/ez-button.js +11 -9
  27. package/dist/collection/components/ez-calendar/ez-calendar.css +17 -20
  28. package/dist/collection/components/ez-chip/ez-chip.css +3 -2
  29. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +16 -0
  30. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +226 -7
  31. package/dist/collection/components/ez-combo-box/ez-combo-box.css +1 -22
  32. package/dist/collection/components/ez-combo-box/ez-combo-box.js +17 -14
  33. package/dist/collection/components/ez-date-input/ez-date-input.js +8 -13
  34. package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +8 -13
  35. package/dist/collection/components/ez-form/ez-form.js +22 -13
  36. package/dist/collection/components/ez-form/fieldbuilder/FieldBuilder.js +1 -1
  37. package/dist/collection/components/ez-form/structure/FormSheetMetadata.js +24 -14
  38. package/dist/collection/components/ez-grid/ez-grid.js +17 -1
  39. package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.css +36 -25
  40. package/dist/collection/components/ez-grid/subcomponents/ez-grid-config/ez-grid-config.js +1 -2
  41. package/dist/collection/components/ez-grid/subcomponents/ez-select-box/ez-select-box.js +5 -4
  42. package/dist/collection/components/ez-list/ez-list.css +9 -1
  43. package/dist/collection/components/ez-popover/ez-popover.css +1 -1
  44. package/dist/collection/components/ez-radio-button/ez-radio-button.css +16 -5
  45. package/dist/collection/components/ez-radio-button/ez-radio-button.js +1 -1
  46. package/dist/collection/components/ez-search/ez-search.js +6 -6
  47. package/dist/collection/components/ez-tabselector/ez-tabselector.css +9 -0
  48. package/dist/collection/components/ez-tabselector/ez-tabselector.js +7 -3
  49. package/dist/collection/components/ez-text-area/ez-text-area.css +6 -3
  50. package/dist/collection/components/ez-text-area/ez-text-area.js +5 -5
  51. package/dist/collection/components/ez-text-edit/ez-text-edit.css +19 -0
  52. package/dist/collection/components/ez-text-edit/ez-text-edit.js +188 -0
  53. package/dist/collection/components/ez-text-input/ez-text-input.css +18 -2
  54. package/dist/collection/components/ez-text-input/ez-text-input.js +28 -0
  55. package/dist/collection/utils/index.js +1 -0
  56. package/dist/custom-elements/index.d.ts +6 -0
  57. package/dist/custom-elements/index.js +467 -217
  58. package/dist/esm/FieldBuilder-9e9545fc.js +117 -0
  59. package/dist/esm/ez-actions-button.entry.js +64 -12
  60. package/dist/esm/ez-button.entry.js +12 -10
  61. package/dist/esm/ez-calendar.entry.js +1 -1
  62. package/dist/esm/ez-chip.entry.js +1 -1
  63. package/dist/esm/ez-collapsible-box.entry.js +86 -7
  64. package/dist/esm/ez-combo-box.entry.js +10 -6
  65. package/dist/esm/ez-date-input.entry.js +8 -13
  66. package/dist/esm/ez-date-time-input.entry.js +9 -14
  67. package/dist/esm/ez-form.entry.js +40 -130
  68. package/dist/esm/ez-grid-config.entry.js +2 -3
  69. package/dist/esm/ez-grid.entry.js +1 -1
  70. package/dist/esm/ez-list.entry.js +1 -1
  71. package/dist/esm/ez-popover.entry.js +1 -1
  72. package/dist/esm/ez-radio-button.entry.js +2 -2
  73. package/dist/esm/ez-tabselector.entry.js +7 -5
  74. package/dist/esm/ez-text-area.entry.js +6 -6
  75. package/dist/esm/ez-text-edit.entry.js +99 -0
  76. package/dist/esm/ez-text-input.entry.js +11 -1
  77. package/dist/esm/ezui.js +1 -1
  78. package/dist/esm/loader.js +1 -1
  79. package/dist/ezui/ezui.esm.js +1 -1
  80. package/dist/ezui/p-2cc6dd66.entry.js +1 -0
  81. package/dist/ezui/p-2ccad880.entry.js +1 -0
  82. package/dist/ezui/p-333d79c4.entry.js +1 -0
  83. package/dist/ezui/{p-1d47487a.entry.js → p-3c87845d.entry.js} +1 -1
  84. package/dist/ezui/p-4ad647fc.entry.js +1 -0
  85. package/dist/ezui/p-54ecd19a.js +1 -0
  86. package/dist/ezui/{p-b2cf7db2.entry.js → p-63d567cc.entry.js} +1 -1
  87. package/dist/ezui/p-6befd7e4.entry.js +1 -0
  88. package/dist/ezui/p-712bd293.entry.js +1 -0
  89. package/dist/ezui/{p-ce824077.entry.js → p-72c75a43.entry.js} +1 -1
  90. package/dist/ezui/{p-81eb2738.entry.js → p-802d23d9.entry.js} +1 -1
  91. package/dist/ezui/p-bca406db.entry.js +1 -0
  92. package/dist/ezui/p-be06251d.entry.js +1 -0
  93. package/dist/ezui/{p-e7d03a0d.entry.js → p-bffae598.entry.js} +1 -1
  94. package/dist/ezui/p-d91527dc.entry.js +1 -0
  95. package/dist/ezui/p-dd257f17.entry.js +1 -0
  96. package/dist/ezui/p-e1f2b5da.entry.js +1 -0
  97. package/dist/ezui/p-e230bfd2.entry.js +1 -0
  98. package/dist/ezui/p-e697ffd5.entry.js +1 -0
  99. package/dist/types/components/ez-actions-button/ez-actions-button.d.ts +42 -9
  100. package/dist/types/components/ez-collapsible-box/ez-collapsible-box.d.ts +46 -1
  101. package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +15 -5
  102. package/dist/types/components/ez-date-input/ez-date-input.d.ts +0 -1
  103. package/dist/types/components/ez-date-time-input/ez-date-time-input.d.ts +0 -1
  104. package/dist/types/components/ez-form/DataBinder.d.ts +2 -2
  105. package/dist/types/components/ez-form/ez-form.d.ts +21 -11
  106. package/dist/types/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.d.ts +3 -3
  107. package/dist/types/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.d.ts +2 -5
  108. package/dist/types/components/ez-form/structure/FormSheetMetadata.d.ts +3 -3
  109. package/dist/types/components/ez-grid/ez-grid.d.ts +1 -1
  110. package/dist/types/components/ez-grid/subcomponents/ez-select-box/ez-select-box.d.ts +2 -6
  111. package/dist/types/components/ez-search/ez-search.d.ts +3 -3
  112. package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +2 -0
  113. package/dist/types/components/ez-text-edit/ez-text-edit.d.ts +39 -0
  114. package/dist/types/components/ez-text-input/ez-text-input.d.ts +5 -0
  115. package/dist/types/components.d.ts +177 -26
  116. package/dist/types/utils/index.d.ts +1 -0
  117. package/package.json +5 -3
  118. package/react/components.d.ts +1 -0
  119. package/react/components.js +1 -0
  120. package/react/components.js.map +1 -1
  121. package/dist/ezui/p-21c0531b.entry.js +0 -1
  122. package/dist/ezui/p-2f02347d.entry.js +0 -1
  123. package/dist/ezui/p-416bedbe.entry.js +0 -1
  124. package/dist/ezui/p-52085ae4.entry.js +0 -1
  125. package/dist/ezui/p-5fe7e960.entry.js +0 -1
  126. package/dist/ezui/p-62110996.entry.js +0 -1
  127. package/dist/ezui/p-a27dafa4.entry.js +0 -1
  128. package/dist/ezui/p-aba3fa6c.entry.js +0 -1
  129. package/dist/ezui/p-abc21959.entry.js +0 -1
  130. package/dist/ezui/p-c019e137.entry.js +0 -1
  131. package/dist/ezui/p-d0671e14.entry.js +0 -1
  132. package/dist/ezui/p-e0f06d73.entry.js +0 -1
@@ -0,0 +1,188 @@
1
+ import { Component, Host, h, Prop, Event, State, Method } from '@stencil/core';
2
+ import { StringUtils } from '@sankhyalabs/core';
3
+ import { ApplicationUtils } from "../../utils";
4
+ export class EzTextEdit {
5
+ /**
6
+ * Aplica focus no campo.
7
+ */
8
+ async applyFocusSelect() {
9
+ this.calcSizeInput(this.value, true);
10
+ }
11
+ calcSizeInput(value, setSelect = false) {
12
+ var _a, _b;
13
+ const textInput = (_b = (_a = this._inputElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('input');
14
+ if (textInput != undefined) {
15
+ const sizeText = this.getWidthValue(value);
16
+ textInput.style.width = sizeText + 'px';
17
+ if (setSelect) {
18
+ setTimeout(() => textInput.select(), 100);
19
+ }
20
+ }
21
+ }
22
+ getWidthValue(value) {
23
+ if (this._valueBasis != undefined) {
24
+ const span = this._valueBasis;
25
+ if (value != undefined) {
26
+ const cursorSpace = 2;
27
+ span.innerHTML = value;
28
+ return span.clientWidth > 0 ? (span.clientWidth + cursorSpace) : cursorSpace;
29
+ }
30
+ else {
31
+ span.innerHTML = "";
32
+ }
33
+ }
34
+ return 0;
35
+ }
36
+ setStyledInput() {
37
+ var _a, _b;
38
+ let fontSize = "";
39
+ let fontWeight = "";
40
+ let fontFamily = "";
41
+ if (this.styled != undefined) {
42
+ fontSize = this.styled.fontSize;
43
+ fontWeight = this.styled.fontWeight;
44
+ fontFamily = this.styled.fontFamily;
45
+ }
46
+ const textInput = (_b = (_a = this._inputElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('input');
47
+ if (textInput != undefined) {
48
+ textInput.style.fontSize = fontSize;
49
+ textInput.style.fontWeight = fontWeight;
50
+ textInput.style.fontFamily = fontFamily;
51
+ }
52
+ const span = this._valueBasis;
53
+ if (span != undefined) {
54
+ span.style.fontSize = fontSize;
55
+ span.style.fontWeight = fontWeight;
56
+ span.style.fontFamily = fontFamily;
57
+ }
58
+ }
59
+ handleSaveEdition() {
60
+ if (this._newValue !== this.value && !StringUtils.isEmpty(this._newValue)) {
61
+ this.saveEdition.emit({ value: this.value, newValue: this._newValue });
62
+ }
63
+ else if (!this._newValue) {
64
+ ApplicationUtils.alert("Aviso", "Não é possível salvar um campo em branco.").then(() => {
65
+ this.setNewValue(this.value, true);
66
+ });
67
+ }
68
+ else {
69
+ this.cancelEdition.emit();
70
+ }
71
+ }
72
+ setNewValue(value, setSelect = false) {
73
+ this._newValue = value;
74
+ this.calcSizeInput(this._newValue, setSelect);
75
+ }
76
+ componentDidLoad() {
77
+ this.applyFocusSelect();
78
+ this.setNewValue(this.value);
79
+ }
80
+ componentDidRender() {
81
+ this.setStyledInput();
82
+ }
83
+ render() {
84
+ return (h(Host, null,
85
+ h("span", { class: "text-edit__hidden-value", ref: elem => this._valueBasis = elem }),
86
+ h("ez-text-input", { onInput: () => { this.calcSizeInput(this._newValue); }, class: "text-edit__form-input", value: this._newValue, ref: (elem) => this._inputElement = elem, mode: "slim", onEzChange: (evt) => this.setNewValue(evt === null || evt === void 0 ? void 0 : evt.detail), noBorder: true }),
87
+ h("ez-button", { class: "text-edit__icon-check", mode: "icon", iconName: "check", size: "small", onClick: () => { this.handleSaveEdition(); } }),
88
+ h("ez-button", { class: "text-edit__icon-close", mode: "icon", iconName: "close", size: "small", onClick: () => { this.cancelEdition.emit(); } })));
89
+ }
90
+ static get is() { return "ez-text-edit"; }
91
+ static get encapsulation() { return "shadow"; }
92
+ static get originalStyleUrls() { return {
93
+ "$": ["ez-text-edit.css"]
94
+ }; }
95
+ static get styleUrls() { return {
96
+ "$": ["ez-text-edit.css"]
97
+ }; }
98
+ static get properties() { return {
99
+ "value": {
100
+ "type": "string",
101
+ "mutable": false,
102
+ "complexType": {
103
+ "original": "string",
104
+ "resolved": "string",
105
+ "references": {}
106
+ },
107
+ "required": false,
108
+ "optional": false,
109
+ "docs": {
110
+ "tags": [],
111
+ "text": "Valor manipulado pelo componente atrav\u00E9s do input"
112
+ },
113
+ "attribute": "value",
114
+ "reflect": false
115
+ },
116
+ "styled": {
117
+ "type": "unknown",
118
+ "mutable": false,
119
+ "complexType": {
120
+ "original": "IStyled",
121
+ "resolved": "IStyled",
122
+ "references": {
123
+ "IStyled": {
124
+ "location": "local"
125
+ }
126
+ }
127
+ },
128
+ "required": false,
129
+ "optional": false,
130
+ "docs": {
131
+ "tags": [],
132
+ "text": "Define atributos do estilo"
133
+ }
134
+ }
135
+ }; }
136
+ static get states() { return {
137
+ "_newValue": {}
138
+ }; }
139
+ static get events() { return [{
140
+ "method": "saveEdition",
141
+ "name": "saveEdition",
142
+ "bubbles": true,
143
+ "cancelable": true,
144
+ "composed": true,
145
+ "docs": {
146
+ "tags": [],
147
+ "text": "Evento emitido ao salvar uma edi\u00E7\u00E3o"
148
+ },
149
+ "complexType": {
150
+ "original": "any",
151
+ "resolved": "any",
152
+ "references": {}
153
+ }
154
+ }, {
155
+ "method": "cancelEdition",
156
+ "name": "cancelEdition",
157
+ "bubbles": true,
158
+ "cancelable": true,
159
+ "composed": true,
160
+ "docs": {
161
+ "tags": [],
162
+ "text": "Disparado ao cancelar uma edi\u00E7\u00E3o"
163
+ },
164
+ "complexType": {
165
+ "original": "any",
166
+ "resolved": "any",
167
+ "references": {}
168
+ }
169
+ }]; }
170
+ static get methods() { return {
171
+ "applyFocusSelect": {
172
+ "complexType": {
173
+ "signature": "() => Promise<void>",
174
+ "parameters": [],
175
+ "references": {
176
+ "Promise": {
177
+ "location": "global"
178
+ }
179
+ },
180
+ "return": "Promise<void>"
181
+ },
182
+ "docs": {
183
+ "text": "Aplica focus no campo.",
184
+ "tags": []
185
+ }
186
+ }
187
+ }; }
188
+ }
@@ -37,6 +37,10 @@
37
37
  --ez-text-input__input--disabled--color: var(--text--disable, #AFB6C0);
38
38
  /*@doc Define a cor da borda do input quando com erro.*/
39
39
  --ez-text-input__input--error--border-color: #CC2936;
40
+ /*@doc Define a cor do input quando não possuir borda*/
41
+ --ez-text-input__input--noborder-color: white;
42
+ /*@doc Define o padding do input*/
43
+ --ez-text-input__input--padding: var(--space--medium, 6px);
40
44
 
41
45
  /* message box */
42
46
  /*@doc Define o tamanho da fonte da mensagem abaixo do input.*/
@@ -72,7 +76,6 @@ input {
72
76
  /*private*/
73
77
  width: 100%;
74
78
  box-sizing: border-box;
75
- padding: var(--space--medium, 6px);
76
79
 
77
80
  /*public*/
78
81
  height: var(--ez-text-input--height);
@@ -84,6 +87,7 @@ input {
84
87
  background-color: var(--ez-text-input__input--background-color);
85
88
  color: var(--ez-text-input--color);
86
89
  font-weight: var(--ez-text-input--font-weight);
90
+ padding: var(--ez-text-input__input--padding);
87
91
  }
88
92
 
89
93
  input:disabled {
@@ -103,7 +107,7 @@ input.icon--left {
103
107
  padding-left: var(--ez-text-input__icon--width);
104
108
  }
105
109
 
106
- input.icon--right {
110
+ input.icon--right {
107
111
  padding-right: var(--ez-text-input__icon--width);
108
112
  }
109
113
 
@@ -212,6 +216,11 @@ input:read-only {
212
216
  height: var(--ez-text-input--height--slim);
213
217
  }
214
218
 
219
+ .input__slim--title{
220
+ font-size: 16px;
221
+ font-weight: bold;
222
+ }
223
+
215
224
  .input--slim::-webkit-input-placeholder { /* Edge */
216
225
  /*public*/
217
226
  font-family: var(--ez-text-input--font-family);
@@ -275,4 +284,11 @@ input:read-only {
275
284
  .input--slim:disabled::placeholder {
276
285
  /*public*/
277
286
  color: var(--ez-text-input__input--disabled--color);
287
+ }
288
+
289
+ input.input__slim--noborder {
290
+ box-shadow: 0 0 0 0;
291
+ border: 0 none;
292
+ outline: 0;
293
+ background: var(--ez-text-input__input--noborder-color);
278
294
  }
@@ -14,6 +14,10 @@ export class EzTextInput {
14
14
  * Define o modo do tamanho do campo; opções: slim e regular.
15
15
  */
16
16
  this.mode = "regular";
17
+ /**
18
+ * Define se o campo contará com bordas ou não
19
+ */
20
+ this.noBorder = false;
17
21
  }
18
22
  observeErrorMessage() {
19
23
  if (this._inputElem) {
@@ -87,6 +91,11 @@ export class EzTextInput {
87
91
  this._contentLeftSlot.style.color = color;
88
92
  }
89
93
  }
94
+ adjustBorderInput() {
95
+ if (this.noBorder) {
96
+ this._inputElem.classList.add("input__slim--noborder");
97
+ }
98
+ }
90
99
  //---------------------------------------------
91
100
  // Public methods
92
101
  //---------------------------------------------
@@ -194,6 +203,7 @@ export class EzTextInput {
194
203
  this.observeErrorMessage();
195
204
  this.observeMask();
196
205
  this.adjustFloatingLabel();
206
+ this.adjustBorderInput();
197
207
  }
198
208
  componentWillLoad() {
199
209
  this.observeMask();
@@ -387,6 +397,24 @@ export class EzTextInput {
387
397
  "attribute": "mode",
388
398
  "reflect": true,
389
399
  "defaultValue": "\"regular\""
400
+ },
401
+ "noBorder": {
402
+ "type": "boolean",
403
+ "mutable": false,
404
+ "complexType": {
405
+ "original": "boolean",
406
+ "resolved": "boolean",
407
+ "references": {}
408
+ },
409
+ "required": false,
410
+ "optional": false,
411
+ "docs": {
412
+ "tags": [],
413
+ "text": "Define se o campo contar\u00E1 com bordas ou n\u00E3o"
414
+ },
415
+ "attribute": "no-border",
416
+ "reflect": true,
417
+ "defaultValue": "false"
390
418
  }
391
419
  }; }
392
420
  static get events() { return [{
@@ -1,3 +1,4 @@
1
1
  export { default as ApplicationUtils } from './ApplicationUtils';
2
2
  export { default as CSSVarsUtils } from './CSSVarsUtils';
3
3
  export { DialogType } from '../components/ez-dialog/DialogType';
4
+ export { buildField as formFieldBuilder } from '../components/ez-form/fieldbuilder/FieldBuilder';
@@ -182,6 +182,12 @@ export const EzTextArea: {
182
182
  new (): EzTextArea;
183
183
  };
184
184
 
185
+ interface EzTextEdit extends Components.EzTextEdit, HTMLElement {}
186
+ export const EzTextEdit: {
187
+ prototype: EzTextEdit;
188
+ new (): EzTextEdit;
189
+ };
190
+
185
191
  interface EzTextInput extends Components.EzTextInput, HTMLElement {}
186
192
  export const EzTextInput: {
187
193
  prototype: EzTextInput;