@sankhyalabs/ezui 2.0.7 → 2.0.9
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.
- package/dist/cjs/ez-form.cjs.entry.js +22 -4
- package/dist/cjs/ez-grid.cjs.entry.js +10 -21
- package/dist/cjs/ez-scroller.cjs.entry.js +82 -4
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-form/DataBinder.js +14 -2
- package/dist/collection/components/ez-form/ez-form.js +8 -2
- package/dist/collection/components/ez-grid/controller/DataUnitBridge.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +6 -17
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +2 -2
- package/dist/collection/components/ez-grid/ez-grid.js +2 -2
- package/dist/collection/components/ez-scroller/ez-scroller.css +87 -14
- package/dist/collection/components/ez-scroller/ez-scroller.js +125 -5
- package/dist/custom-elements/index.js +115 -31
- package/dist/esm/ez-form.entry.js +22 -4
- package/dist/esm/ez-grid.entry.js +10 -21
- package/dist/esm/ez-scroller.entry.js +83 -5
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-1ba371a3.entry.js +1 -0
- package/dist/ezui/p-ac296141.entry.js +1 -0
- package/dist/ezui/{p-a7733cb4.entry.js → p-d0b8330e.entry.js} +1 -1
- package/dist/types/components/ez-form/DataBinder.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +1 -2
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +2 -1
- package/dist/types/components/ez-scroller/ez-scroller.d.ts +21 -16
- package/dist/types/components.d.ts +16 -0
- package/package.json +1 -1
- package/dist/ezui/p-e0aa9cb1.entry.js +0 -1
- package/dist/ezui/p-e3ee814c.entry.js +0 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
/*@doc Define a cor de efeito de sombreado com componente.*/
|
|
3
|
+
--ez-scroller--box-shadow-color: var(--background--body, #fafcff);
|
|
4
|
+
|
|
2
5
|
display: flex;
|
|
3
6
|
cursor: grab;
|
|
4
7
|
width: 100%;
|
|
@@ -11,49 +14,119 @@
|
|
|
11
14
|
.ez-scroller__container{
|
|
12
15
|
display: flex;
|
|
13
16
|
flex-direction: column;
|
|
14
|
-
overflow: hidden;
|
|
17
|
+
overflow-y: hidden;
|
|
18
|
+
overflow-x: hidden;
|
|
15
19
|
scrollbar-width: thin;
|
|
20
|
+
|
|
21
|
+
/*public*/
|
|
22
|
+
scrollbar-color: var(--scrollbar--primary) var(--scrollbar--secondary);
|
|
16
23
|
}
|
|
17
24
|
|
|
18
25
|
.ez-scroller__container--horizontal{
|
|
19
26
|
flex-direction: row;
|
|
20
27
|
overflow-y: hidden;
|
|
28
|
+
overflow-x: hidden;
|
|
29
|
+
padding-bottom: var(--space--small);
|
|
30
|
+
margin-bottom: calc(var(--space--small) * -1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ez-scroller__container--horizontal:not(.ez-scroller__container--no-overlay):not(.ez-scroller__container--locked):hover {
|
|
34
|
+
overflow-x: overlay;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ez-scroller__container--horizontal.ez-scroller__container--no-overlay {
|
|
38
|
+
padding-bottom: 8px;
|
|
39
|
+
margin-bottom: -8px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ez-scroller__container--horizontal.ez-scroller__container--no-overlay:not(.ez-scroller__container--locked):hover {
|
|
21
43
|
overflow-x: auto;
|
|
44
|
+
padding-bottom: 0px;
|
|
22
45
|
}
|
|
23
46
|
|
|
24
47
|
.ez-scroller__container--vertical{
|
|
25
|
-
overflow-y:
|
|
48
|
+
overflow-y: hidden;
|
|
26
49
|
overflow-x: hidden;
|
|
50
|
+
padding-right: var(--space--small);
|
|
51
|
+
margin-right: calc(var(--space--small) * -1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ez-scroller__container--vertical:not(.ez-scroller__container--no-overlay):not(.ez-scroller__container--locked):hover {
|
|
55
|
+
overflow-y: overlay;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ez-scroller__container--vertical.ez-scroller__container--no-overlay {
|
|
59
|
+
padding-right: 8px;
|
|
60
|
+
margin-right: -8px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ez-scroller__container--vertical.ez-scroller__container--no-overlay:not(.ez-scroller__container--locked):hover {
|
|
64
|
+
overflow-y: auto;
|
|
65
|
+
padding-right: 0px;
|
|
27
66
|
}
|
|
28
67
|
|
|
29
68
|
.ez-scroller__container--both{
|
|
30
69
|
overflow: auto;
|
|
31
70
|
}
|
|
32
71
|
|
|
33
|
-
::-webkit-scrollbar-track {
|
|
72
|
+
.ez-scroller__container::-webkit-scrollbar-track {
|
|
34
73
|
background-color: var(--scrollbar--secondary);
|
|
35
74
|
border-radius: var(--border--radius-small);
|
|
36
75
|
visibility: hidden;
|
|
37
76
|
}
|
|
38
77
|
|
|
39
|
-
::-webkit-scrollbar-thumb {
|
|
40
|
-
background-color: transparent;
|
|
41
|
-
border-radius: var(--border--radius-small);
|
|
42
|
-
/*provisório*/
|
|
43
|
-
background-color: var(--scrollbar--primary);
|
|
44
|
-
}
|
|
45
|
-
:hover::-webkit-scrollbar-thumb {
|
|
78
|
+
.ez-scroller__container::-webkit-scrollbar-thumb {
|
|
46
79
|
background-color: var(--scrollbar--primary);
|
|
80
|
+
border-radius: var(--border--radius-small);
|
|
47
81
|
}
|
|
48
82
|
|
|
49
|
-
::-webkit-scrollbar {
|
|
50
|
-
background-color:
|
|
83
|
+
.ez-scroller__container::-webkit-scrollbar {
|
|
84
|
+
background-color: var(--scrollbar--secondary);
|
|
51
85
|
width: var(--space--small);
|
|
52
86
|
height: var(--space--small);
|
|
53
87
|
max-width: var(--space--small);
|
|
54
88
|
min-width: var(--space--small);
|
|
55
89
|
}
|
|
56
90
|
|
|
57
|
-
|
|
58
|
-
|
|
91
|
+
.ez-scroller__shadow-start,
|
|
92
|
+
.ez-scroller__shadow-end {
|
|
93
|
+
display: flex;
|
|
94
|
+
z-index: 1;
|
|
95
|
+
background: var(--ez-scroller--box-shadow-color);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ez-scroller__shadow-start--horizontal,
|
|
99
|
+
.ez-scroller__shadow-end--horizontal {
|
|
100
|
+
min-height: 100%;
|
|
101
|
+
width: 10px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.ez-scroller__shadow-start--horizontal {
|
|
105
|
+
box-shadow: var(--ez-scroller--box-shadow-color) 6px 0px 10px 8px;
|
|
106
|
+
margin-right: -6px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.ez-scroller__shadow-end--horizontal {
|
|
110
|
+
box-shadow: var(--ez-scroller--box-shadow-color) -6px 0px 10px 8px;
|
|
111
|
+
margin-left: -6px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.ez-scroller__shadow-start--vertical,
|
|
115
|
+
.ez-scroller__shadow-end--vertical {
|
|
116
|
+
min-width: 100%;
|
|
117
|
+
height: 10px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.ez-scroller__shadow-start--vertical {
|
|
121
|
+
box-shadow: var(--ez-scroller--box-shadow-color) 0px 6px 10px 8px;
|
|
122
|
+
margin-bottom: -6px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.ez-scroller__shadow-end--vertical {
|
|
126
|
+
box-shadow: var(--ez-scroller--box-shadow-color) 0px -6px 10px 8px;
|
|
127
|
+
margin-top: -6px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.ez-scroller__shadow--hidden {
|
|
131
|
+
display: none;
|
|
59
132
|
}
|
|
@@ -1,21 +1,74 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UserAgentUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { Component, h, Host, Listen, Prop, State } from '@stencil/core';
|
|
2
3
|
import { EzScrollDirection } from './EzScrollDirection';
|
|
3
4
|
export class EzScroller {
|
|
4
5
|
constructor() {
|
|
6
|
+
this._classHidden = "ez-scroller__shadow--hidden";
|
|
7
|
+
this.isFirefox = false;
|
|
5
8
|
/**
|
|
6
9
|
* Determina se haverá scroll na direção Vertical, Horizontal ou Ambos.
|
|
7
10
|
* Por padrão, a direção é "Ambos".
|
|
8
11
|
*/
|
|
9
12
|
this.direction = EzScrollDirection.BOTH;
|
|
13
|
+
/**
|
|
14
|
+
* Determina se o scroll estará bloqueado quando necessário.
|
|
15
|
+
*/
|
|
16
|
+
this.locked = false;
|
|
17
|
+
/**
|
|
18
|
+
* Determina de o efeito de sombreado está ativo.
|
|
19
|
+
*/
|
|
20
|
+
this.activeShadow = false;
|
|
10
21
|
}
|
|
11
22
|
//---------------------------------------------
|
|
12
23
|
// Private methods
|
|
13
24
|
//---------------------------------------------
|
|
14
25
|
getContainerClass() {
|
|
15
|
-
return `ez-scroller__container ez-scroller__container--${this.direction}
|
|
26
|
+
return `ez-scroller__container ez-scroller__container--${this.direction}
|
|
27
|
+
${this.locked ? " ez-scroller__container--locked" : ""}
|
|
28
|
+
${this.isFirefox ? " ez-scroller__container--no-overlay" : ""}
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
getShadowStartClass() {
|
|
32
|
+
return `ez-scroller__shadow-start ez-scroller__shadow-start--${this.direction}`;
|
|
33
|
+
}
|
|
34
|
+
getShadowEndClass() {
|
|
35
|
+
return `ez-scroller__shadow-end ez-scroller__shadow-end--${this.direction}`;
|
|
16
36
|
}
|
|
17
37
|
finishDrag() {
|
|
18
|
-
this.
|
|
38
|
+
if (this._controller) {
|
|
39
|
+
this._container.classList.remove("dragging");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
updateShadow() {
|
|
43
|
+
const container = this._container;
|
|
44
|
+
if (container) {
|
|
45
|
+
let remainingScroll;
|
|
46
|
+
if (this.direction === EzScrollDirection.HORIZONTAL) {
|
|
47
|
+
const { scrollWidth, clientWidth, scrollLeft } = container;
|
|
48
|
+
remainingScroll = scrollWidth - clientWidth - Math.ceil(scrollLeft);
|
|
49
|
+
this._startHidden = container.scrollLeft > 0;
|
|
50
|
+
}
|
|
51
|
+
else if (this.direction === EzScrollDirection.VERTICAL) {
|
|
52
|
+
const { scrollHeight, clientHeight, scrollTop } = container;
|
|
53
|
+
remainingScroll = scrollHeight - clientHeight - Math.ceil(scrollTop);
|
|
54
|
+
this._startHidden = container.scrollTop > 0;
|
|
55
|
+
}
|
|
56
|
+
this._endHidden = remainingScroll > 0;
|
|
57
|
+
const shadowPositions = ["", "start", "end", "middle"];
|
|
58
|
+
const currentPosition = shadowPositions[Number(this._startHidden) | Number(this._endHidden) << 1];
|
|
59
|
+
if (currentPosition === "start") {
|
|
60
|
+
this._shadowStart.classList.remove(this._classHidden);
|
|
61
|
+
this._shadowEnd.classList.add(this._classHidden);
|
|
62
|
+
}
|
|
63
|
+
else if (currentPosition === "end") {
|
|
64
|
+
this._shadowStart.classList.add(this._classHidden);
|
|
65
|
+
this._shadowEnd.classList.remove(this._classHidden);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this._shadowStart.classList.remove(this._classHidden);
|
|
69
|
+
this._shadowEnd.classList.remove(this._classHidden);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
19
72
|
}
|
|
20
73
|
//---------------------------------------------
|
|
21
74
|
// Event handlers
|
|
@@ -28,6 +81,10 @@ export class EzScroller {
|
|
|
28
81
|
}
|
|
29
82
|
}
|
|
30
83
|
mouseDownHandler(evt) {
|
|
84
|
+
if (this.locked) {
|
|
85
|
+
this.finishDrag();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
31
88
|
if (!this._controller) {
|
|
32
89
|
this._controller = new ScrollCtrl(this._container);
|
|
33
90
|
}
|
|
@@ -38,6 +95,10 @@ export class EzScroller {
|
|
|
38
95
|
this.finishDrag();
|
|
39
96
|
}
|
|
40
97
|
mouseMoveHandler(evt) {
|
|
98
|
+
if (this.locked) {
|
|
99
|
+
this.finishDrag();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
41
102
|
if (this._controller) {
|
|
42
103
|
if (evt.buttons === 0) {
|
|
43
104
|
this.finishDrag();
|
|
@@ -47,9 +108,29 @@ export class EzScroller {
|
|
|
47
108
|
}
|
|
48
109
|
}
|
|
49
110
|
}
|
|
111
|
+
componentDidLoad() {
|
|
112
|
+
this.isFirefox = UserAgentUtils.isFirefox();
|
|
113
|
+
}
|
|
114
|
+
componentDidRender() {
|
|
115
|
+
var _a, _b;
|
|
116
|
+
if (this.direction === EzScrollDirection.BOTH) {
|
|
117
|
+
(_a = this._shadowStart) === null || _a === void 0 ? void 0 : _a.classList.add(this._classHidden);
|
|
118
|
+
(_b = this._shadowEnd) === null || _b === void 0 ? void 0 : _b.classList.add(this._classHidden);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (this._container && this.activeShadow) {
|
|
122
|
+
this._container.onscroll = this.updateShadow.bind(this);
|
|
123
|
+
this.updateShadow();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
50
126
|
render() {
|
|
51
|
-
return (h(
|
|
52
|
-
|
|
127
|
+
return (h(Host, null,
|
|
128
|
+
this.activeShadow &&
|
|
129
|
+
h("span", { ref: ref => this._shadowStart = ref, class: this.getShadowStartClass() }),
|
|
130
|
+
h("div", { ref: ref => this._container = ref, class: this.getContainerClass() },
|
|
131
|
+
h("slot", null)),
|
|
132
|
+
this.activeShadow &&
|
|
133
|
+
h("span", { ref: ref => this._shadowEnd = ref, class: this.getShadowEndClass() })));
|
|
53
134
|
}
|
|
54
135
|
static get is() { return "ez-scroller"; }
|
|
55
136
|
static get encapsulation() { return "shadow"; }
|
|
@@ -82,8 +163,47 @@ export class EzScroller {
|
|
|
82
163
|
"attribute": "direction",
|
|
83
164
|
"reflect": false,
|
|
84
165
|
"defaultValue": "EzScrollDirection.BOTH"
|
|
166
|
+
},
|
|
167
|
+
"locked": {
|
|
168
|
+
"type": "boolean",
|
|
169
|
+
"mutable": false,
|
|
170
|
+
"complexType": {
|
|
171
|
+
"original": "boolean",
|
|
172
|
+
"resolved": "boolean",
|
|
173
|
+
"references": {}
|
|
174
|
+
},
|
|
175
|
+
"required": false,
|
|
176
|
+
"optional": false,
|
|
177
|
+
"docs": {
|
|
178
|
+
"tags": [],
|
|
179
|
+
"text": "Determina se o scroll estar\u00E1 bloqueado quando necess\u00E1rio."
|
|
180
|
+
},
|
|
181
|
+
"attribute": "locked",
|
|
182
|
+
"reflect": false,
|
|
183
|
+
"defaultValue": "false"
|
|
184
|
+
},
|
|
185
|
+
"activeShadow": {
|
|
186
|
+
"type": "boolean",
|
|
187
|
+
"mutable": false,
|
|
188
|
+
"complexType": {
|
|
189
|
+
"original": "boolean",
|
|
190
|
+
"resolved": "boolean",
|
|
191
|
+
"references": {}
|
|
192
|
+
},
|
|
193
|
+
"required": false,
|
|
194
|
+
"optional": false,
|
|
195
|
+
"docs": {
|
|
196
|
+
"tags": [],
|
|
197
|
+
"text": "Determina de o efeito de sombreado est\u00E1 ativo."
|
|
198
|
+
},
|
|
199
|
+
"attribute": "active-shadow",
|
|
200
|
+
"reflect": false,
|
|
201
|
+
"defaultValue": "false"
|
|
85
202
|
}
|
|
86
203
|
}; }
|
|
204
|
+
static get states() { return {
|
|
205
|
+
"isFirefox": {}
|
|
206
|
+
}; }
|
|
87
207
|
static get listeners() { return [{
|
|
88
208
|
"name": "click",
|
|
89
209
|
"method": "clickListener",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLElement as HTMLElement$1, createEvent, h, Host, forceUpdate, proxyCustomElement } from '@stencil/core/internal/client';
|
|
2
2
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
3
|
-
import { FloatingManager, DateUtils as DateUtils$1, TimeFormatter, UserInterface, Action, WaitingChangeException, ApplicationContext, DataUnitAction, DataUnit, ObjectUtils as ObjectUtils$1, StringUtils as StringUtils$1, NumberUtils as NumberUtils$1, DataType, SortMode, MaskFormatter } from '@sankhyalabs/core';
|
|
3
|
+
import { FloatingManager, DateUtils as DateUtils$1, TimeFormatter, UserInterface, Action, WaitingChangeException, ApplicationContext, DataUnitAction, DataUnit, ObjectUtils as ObjectUtils$1, StringUtils as StringUtils$1, NumberUtils as NumberUtils$1, DataType, SortMode, UserAgentUtils, MaskFormatter } from '@sankhyalabs/core';
|
|
4
4
|
|
|
5
5
|
var DialogType;
|
|
6
6
|
(function (DialogType) {
|
|
@@ -2652,7 +2652,10 @@ class DataBinder {
|
|
|
2652
2652
|
markInvalid(field) {
|
|
2653
2653
|
this._invalidFields.set(field.name, field);
|
|
2654
2654
|
if (this._fields.has(field.name)) {
|
|
2655
|
-
|
|
2655
|
+
const fieldElement = this._fields.get(field.name).field;
|
|
2656
|
+
if (!fieldElement["errorMessage"]) {
|
|
2657
|
+
this.updateErrorMessage(field.name, fieldElement);
|
|
2658
|
+
}
|
|
2656
2659
|
}
|
|
2657
2660
|
}
|
|
2658
2661
|
clearInvalid() {
|
|
@@ -2679,7 +2682,16 @@ class DataBinder {
|
|
|
2679
2682
|
}
|
|
2680
2683
|
updateErrorMessage(fieldName, field) {
|
|
2681
2684
|
const invalidField = this._invalidFields.get(fieldName);
|
|
2682
|
-
|
|
2685
|
+
if (invalidField) {
|
|
2686
|
+
field["errorMessage"] = invalidField.message;
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
getErrorMessage(fieldName) {
|
|
2690
|
+
if (this._fields.has(fieldName)) {
|
|
2691
|
+
const fieldElement = this._fields.get(fieldName).field;
|
|
2692
|
+
return fieldElement["errorMessage"] || null;
|
|
2693
|
+
}
|
|
2694
|
+
return undefined;
|
|
2683
2695
|
}
|
|
2684
2696
|
updateBind(fieldName, field) {
|
|
2685
2697
|
const oldBind = this._fields.get(fieldName);
|
|
@@ -2857,10 +2869,16 @@ let EzForm$1 = class extends HTMLElement$1 {
|
|
|
2857
2869
|
.map(f => f.dataset.fieldName)
|
|
2858
2870
|
.concat(metadata.getRequiredFields());
|
|
2859
2871
|
const invalidFields = [];
|
|
2860
|
-
requiredFields.forEach(field => {
|
|
2872
|
+
new Set(requiredFields).forEach(field => {
|
|
2861
2873
|
const value = record[field];
|
|
2862
2874
|
if (value == undefined || value === "") {
|
|
2863
|
-
|
|
2875
|
+
const errorMessage = this._dataBinder.getErrorMessage(field);
|
|
2876
|
+
if (errorMessage) {
|
|
2877
|
+
invalidFields.push({ name: field, message: errorMessage });
|
|
2878
|
+
}
|
|
2879
|
+
else {
|
|
2880
|
+
invalidFields.push({ name: field, message: "Essa informação é obrigatória" });
|
|
2881
|
+
}
|
|
2864
2882
|
}
|
|
2865
2883
|
});
|
|
2866
2884
|
if (invalidFields.length > 0) {
|
|
@@ -117574,7 +117592,7 @@ class DataSource {
|
|
|
117574
117592
|
this.duObserver = (action) => {
|
|
117575
117593
|
switch (action.type) {
|
|
117576
117594
|
case Action.METADATA_LOADED:
|
|
117577
|
-
this._controller.setColumnsDef(this.buildColumnDefs()
|
|
117595
|
+
this._controller.setColumnsDef(this.buildColumnDefs());
|
|
117578
117596
|
break;
|
|
117579
117597
|
case Action.LOADING_DATA:
|
|
117580
117598
|
this._waitingForLoad = true;
|
|
@@ -117602,7 +117620,7 @@ class DataSource {
|
|
|
117602
117620
|
};
|
|
117603
117621
|
this._dataUnit = dataUnit;
|
|
117604
117622
|
this._controller = controller;
|
|
117605
|
-
this._controller.setColumnsDef(this.buildColumnDefs()
|
|
117623
|
+
this._controller.setColumnsDef(this.buildColumnDefs());
|
|
117606
117624
|
this._options = options;
|
|
117607
117625
|
this._dataUnit.subscribe(this.duObserver);
|
|
117608
117626
|
}
|
|
@@ -117921,23 +117939,8 @@ class AgGridController {
|
|
|
117921
117939
|
}
|
|
117922
117940
|
this._gridOptions.api.refreshServerSide({ purge: false });
|
|
117923
117941
|
}
|
|
117924
|
-
setColumnsDef(cols
|
|
117925
|
-
const newColDefs = [];
|
|
117926
|
-
if (showCheckSelection) {
|
|
117927
|
-
newColDefs.push({
|
|
117928
|
-
colId: this.CHECK_BOX_COL_ID,
|
|
117929
|
-
headerName: "",
|
|
117930
|
-
checkboxSelection: true,
|
|
117931
|
-
headerComponent: "ezGridHeaderComponent",
|
|
117932
|
-
headerClass: "ag-column-select-header",
|
|
117933
|
-
width: 28,
|
|
117934
|
-
suppressMovable: true,
|
|
117935
|
-
suppressAutoSize: true,
|
|
117936
|
-
suppressMenu: true,
|
|
117937
|
-
lockPosition: true,
|
|
117938
|
-
pinned: true
|
|
117939
|
-
});
|
|
117940
|
-
}
|
|
117942
|
+
setColumnsDef(cols) {
|
|
117943
|
+
const newColDefs = [Object.assign({ colId: this.CHECK_BOX_COL_ID, headerName: "", checkboxSelection: true, width: 28, suppressMovable: true, suppressAutoSize: true, suppressMenu: true, lockPosition: true, pinned: true }, this._multipleSelection && { headerComponent: "ezGridHeaderComponent", headerClass: "ag-column-select-header" })];
|
|
117941
117944
|
if (this._statusResolver != undefined) {
|
|
117942
117945
|
newColDefs.push({
|
|
117943
117946
|
colId: this.STATUS_COL_ID,
|
|
@@ -118155,9 +118158,13 @@ class AgGridController {
|
|
|
118155
118158
|
info['column'] = { colId: e['column'].colId, actualWidth: e['column'].actualWidth };
|
|
118156
118159
|
}
|
|
118157
118160
|
info['isUserChange'] = isUserChange;
|
|
118161
|
+
info['isElementResize'] = this.isElementResize(e);
|
|
118158
118162
|
this._columnStateChangeCallback(type, this.getColumnsState(), info);
|
|
118159
118163
|
}
|
|
118160
118164
|
}
|
|
118165
|
+
isElementResize(e) {
|
|
118166
|
+
return e["target"] && e["target"].getAttribute("ref") === "eResize";
|
|
118167
|
+
}
|
|
118161
118168
|
isUIEvent(source, type) {
|
|
118162
118169
|
let optionsArr = ["uiColumnMoved", "uiColumnResized", "uiColumnDragged", "uiColumnExpanded", "uiColumnSorted"];
|
|
118163
118170
|
if (type === 'dragStopped') {
|
|
@@ -118206,7 +118213,7 @@ let EzGrid$1 = class extends HTMLElement$1 {
|
|
|
118206
118213
|
* Método responsável por receber a definição das colunas
|
|
118207
118214
|
*/
|
|
118208
118215
|
async setColumnsDef(cols) {
|
|
118209
|
-
this._gridController.setColumnsDef(cols
|
|
118216
|
+
this._gridController.setColumnsDef(cols);
|
|
118210
118217
|
}
|
|
118211
118218
|
/**
|
|
118212
118219
|
* Adiciona item de menu nas colunas.
|
|
@@ -118262,7 +118269,7 @@ let EzGrid$1 = class extends HTMLElement$1 {
|
|
|
118262
118269
|
var _a;
|
|
118263
118270
|
this.ezColumnStateChange.emit({ type, state, isUserChange: info.isUserChange });
|
|
118264
118271
|
if (info.isUserChange) {
|
|
118265
|
-
if (type === 'columnMovedEnd') {
|
|
118272
|
+
if (type === 'columnMovedEnd' && !info.isElementResize) {
|
|
118266
118273
|
let newConfig;
|
|
118267
118274
|
if (this.config) {
|
|
118268
118275
|
newConfig = { columns: [] };
|
|
@@ -119449,27 +119456,79 @@ var EzScrollDirection;
|
|
|
119449
119456
|
EzScrollDirection["BOTH"] = "both";
|
|
119450
119457
|
})(EzScrollDirection || (EzScrollDirection = {}));
|
|
119451
119458
|
|
|
119452
|
-
const ezScrollerCss = ":host{display:flex;cursor:grab;width:100%}.dragging{cursor:grabbing}.ez-scroller__container{display:flex;flex-direction:column;overflow:hidden;scrollbar-width:thin}.ez-scroller__container--horizontal{flex-direction:row;overflow-y:hidden;overflow-x:auto}.ez-scroller__container--vertical{overflow-y:
|
|
119459
|
+
const ezScrollerCss = ":host{--ez-scroller--box-shadow-color:var(--background--body, #fafcff);display:flex;cursor:grab;width:100%}.dragging{cursor:grabbing}.ez-scroller__container{display:flex;flex-direction:column;overflow-y:hidden;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--scrollbar--primary) var(--scrollbar--secondary)}.ez-scroller__container--horizontal{flex-direction:row;overflow-y:hidden;overflow-x:hidden;padding-bottom:var(--space--small);margin-bottom:calc(var(--space--small) * -1)}.ez-scroller__container--horizontal:not(.ez-scroller__container--no-overlay):not(.ez-scroller__container--locked):hover{overflow-x:overlay}.ez-scroller__container--horizontal.ez-scroller__container--no-overlay{padding-bottom:8px;margin-bottom:-8px}.ez-scroller__container--horizontal.ez-scroller__container--no-overlay:not(.ez-scroller__container--locked):hover{overflow-x:auto;padding-bottom:0px}.ez-scroller__container--vertical{overflow-y:hidden;overflow-x:hidden;padding-right:var(--space--small);margin-right:calc(var(--space--small) * -1)}.ez-scroller__container--vertical:not(.ez-scroller__container--no-overlay):not(.ez-scroller__container--locked):hover{overflow-y:overlay}.ez-scroller__container--vertical.ez-scroller__container--no-overlay{padding-right:8px;margin-right:-8px}.ez-scroller__container--vertical.ez-scroller__container--no-overlay:not(.ez-scroller__container--locked):hover{overflow-y:auto;padding-right:0px}.ez-scroller__container--both{overflow:auto}.ez-scroller__container::-webkit-scrollbar-track{background-color:var(--scrollbar--secondary);border-radius:var(--border--radius-small);visibility:hidden}.ez-scroller__container::-webkit-scrollbar-thumb{background-color:var(--scrollbar--primary);border-radius:var(--border--radius-small)}.ez-scroller__container::-webkit-scrollbar{background-color:var(--scrollbar--secondary);width:var(--space--small);height:var(--space--small);max-width:var(--space--small);min-width:var(--space--small)}.ez-scroller__shadow-start,.ez-scroller__shadow-end{display:flex;z-index:1;background:var(--ez-scroller--box-shadow-color)}.ez-scroller__shadow-start--horizontal,.ez-scroller__shadow-end--horizontal{min-height:100%;width:10px}.ez-scroller__shadow-start--horizontal{box-shadow:var(--ez-scroller--box-shadow-color) 6px 0px 10px 8px;margin-right:-6px}.ez-scroller__shadow-end--horizontal{box-shadow:var(--ez-scroller--box-shadow-color) -6px 0px 10px 8px;margin-left:-6px}.ez-scroller__shadow-start--vertical,.ez-scroller__shadow-end--vertical{min-width:100%;height:10px}.ez-scroller__shadow-start--vertical{box-shadow:var(--ez-scroller--box-shadow-color) 0px 6px 10px 8px;margin-bottom:-6px}.ez-scroller__shadow-end--vertical{box-shadow:var(--ez-scroller--box-shadow-color) 0px -6px 10px 8px;margin-top:-6px}.ez-scroller__shadow--hidden{display:none}";
|
|
119453
119460
|
|
|
119454
119461
|
let EzScroller$1 = class extends HTMLElement$1 {
|
|
119455
119462
|
constructor() {
|
|
119456
119463
|
super();
|
|
119457
119464
|
this.__registerHost();
|
|
119458
119465
|
this.__attachShadow();
|
|
119466
|
+
this._classHidden = "ez-scroller__shadow--hidden";
|
|
119467
|
+
this.isFirefox = false;
|
|
119459
119468
|
/**
|
|
119460
119469
|
* Determina se haverá scroll na direção Vertical, Horizontal ou Ambos.
|
|
119461
119470
|
* Por padrão, a direção é "Ambos".
|
|
119462
119471
|
*/
|
|
119463
119472
|
this.direction = EzScrollDirection.BOTH;
|
|
119473
|
+
/**
|
|
119474
|
+
* Determina se o scroll estará bloqueado quando necessário.
|
|
119475
|
+
*/
|
|
119476
|
+
this.locked = false;
|
|
119477
|
+
/**
|
|
119478
|
+
* Determina de o efeito de sombreado está ativo.
|
|
119479
|
+
*/
|
|
119480
|
+
this.activeShadow = false;
|
|
119464
119481
|
}
|
|
119465
119482
|
//---------------------------------------------
|
|
119466
119483
|
// Private methods
|
|
119467
119484
|
//---------------------------------------------
|
|
119468
119485
|
getContainerClass() {
|
|
119469
|
-
return `ez-scroller__container ez-scroller__container--${this.direction}
|
|
119486
|
+
return `ez-scroller__container ez-scroller__container--${this.direction}
|
|
119487
|
+
${this.locked ? " ez-scroller__container--locked" : ""}
|
|
119488
|
+
${this.isFirefox ? " ez-scroller__container--no-overlay" : ""}
|
|
119489
|
+
`;
|
|
119490
|
+
}
|
|
119491
|
+
getShadowStartClass() {
|
|
119492
|
+
return `ez-scroller__shadow-start ez-scroller__shadow-start--${this.direction}`;
|
|
119493
|
+
}
|
|
119494
|
+
getShadowEndClass() {
|
|
119495
|
+
return `ez-scroller__shadow-end ez-scroller__shadow-end--${this.direction}`;
|
|
119470
119496
|
}
|
|
119471
119497
|
finishDrag() {
|
|
119472
|
-
this.
|
|
119498
|
+
if (this._controller) {
|
|
119499
|
+
this._container.classList.remove("dragging");
|
|
119500
|
+
}
|
|
119501
|
+
}
|
|
119502
|
+
updateShadow() {
|
|
119503
|
+
const container = this._container;
|
|
119504
|
+
if (container) {
|
|
119505
|
+
let remainingScroll;
|
|
119506
|
+
if (this.direction === EzScrollDirection.HORIZONTAL) {
|
|
119507
|
+
const { scrollWidth, clientWidth, scrollLeft } = container;
|
|
119508
|
+
remainingScroll = scrollWidth - clientWidth - Math.ceil(scrollLeft);
|
|
119509
|
+
this._startHidden = container.scrollLeft > 0;
|
|
119510
|
+
}
|
|
119511
|
+
else if (this.direction === EzScrollDirection.VERTICAL) {
|
|
119512
|
+
const { scrollHeight, clientHeight, scrollTop } = container;
|
|
119513
|
+
remainingScroll = scrollHeight - clientHeight - Math.ceil(scrollTop);
|
|
119514
|
+
this._startHidden = container.scrollTop > 0;
|
|
119515
|
+
}
|
|
119516
|
+
this._endHidden = remainingScroll > 0;
|
|
119517
|
+
const shadowPositions = ["", "start", "end", "middle"];
|
|
119518
|
+
const currentPosition = shadowPositions[Number(this._startHidden) | Number(this._endHidden) << 1];
|
|
119519
|
+
if (currentPosition === "start") {
|
|
119520
|
+
this._shadowStart.classList.remove(this._classHidden);
|
|
119521
|
+
this._shadowEnd.classList.add(this._classHidden);
|
|
119522
|
+
}
|
|
119523
|
+
else if (currentPosition === "end") {
|
|
119524
|
+
this._shadowStart.classList.add(this._classHidden);
|
|
119525
|
+
this._shadowEnd.classList.remove(this._classHidden);
|
|
119526
|
+
}
|
|
119527
|
+
else {
|
|
119528
|
+
this._shadowStart.classList.remove(this._classHidden);
|
|
119529
|
+
this._shadowEnd.classList.remove(this._classHidden);
|
|
119530
|
+
}
|
|
119531
|
+
}
|
|
119473
119532
|
}
|
|
119474
119533
|
//---------------------------------------------
|
|
119475
119534
|
// Event handlers
|
|
@@ -119482,6 +119541,10 @@ let EzScroller$1 = class extends HTMLElement$1 {
|
|
|
119482
119541
|
}
|
|
119483
119542
|
}
|
|
119484
119543
|
mouseDownHandler(evt) {
|
|
119544
|
+
if (this.locked) {
|
|
119545
|
+
this.finishDrag();
|
|
119546
|
+
return;
|
|
119547
|
+
}
|
|
119485
119548
|
if (!this._controller) {
|
|
119486
119549
|
this._controller = new ScrollCtrl(this._container);
|
|
119487
119550
|
}
|
|
@@ -119492,6 +119555,10 @@ let EzScroller$1 = class extends HTMLElement$1 {
|
|
|
119492
119555
|
this.finishDrag();
|
|
119493
119556
|
}
|
|
119494
119557
|
mouseMoveHandler(evt) {
|
|
119558
|
+
if (this.locked) {
|
|
119559
|
+
this.finishDrag();
|
|
119560
|
+
return;
|
|
119561
|
+
}
|
|
119495
119562
|
if (this._controller) {
|
|
119496
119563
|
if (evt.buttons === 0) {
|
|
119497
119564
|
this.finishDrag();
|
|
@@ -119501,8 +119568,25 @@ let EzScroller$1 = class extends HTMLElement$1 {
|
|
|
119501
119568
|
}
|
|
119502
119569
|
}
|
|
119503
119570
|
}
|
|
119571
|
+
componentDidLoad() {
|
|
119572
|
+
this.isFirefox = UserAgentUtils.isFirefox();
|
|
119573
|
+
}
|
|
119574
|
+
componentDidRender() {
|
|
119575
|
+
var _a, _b;
|
|
119576
|
+
if (this.direction === EzScrollDirection.BOTH) {
|
|
119577
|
+
(_a = this._shadowStart) === null || _a === void 0 ? void 0 : _a.classList.add(this._classHidden);
|
|
119578
|
+
(_b = this._shadowEnd) === null || _b === void 0 ? void 0 : _b.classList.add(this._classHidden);
|
|
119579
|
+
return;
|
|
119580
|
+
}
|
|
119581
|
+
if (this._container && this.activeShadow) {
|
|
119582
|
+
this._container.onscroll = this.updateShadow.bind(this);
|
|
119583
|
+
this.updateShadow();
|
|
119584
|
+
}
|
|
119585
|
+
}
|
|
119504
119586
|
render() {
|
|
119505
|
-
return (h(
|
|
119587
|
+
return (h(Host, null, this.activeShadow &&
|
|
119588
|
+
h("span", { ref: ref => this._shadowStart = ref, class: this.getShadowStartClass() }), h("div", { ref: ref => this._container = ref, class: this.getContainerClass() }, h("slot", null)), this.activeShadow &&
|
|
119589
|
+
h("span", { ref: ref => this._shadowEnd = ref, class: this.getShadowEndClass() })));
|
|
119506
119590
|
}
|
|
119507
119591
|
static get style() { return ezScrollerCss; }
|
|
119508
119592
|
};
|
|
@@ -121041,7 +121125,7 @@ const EzNumberInput = /*@__PURE__*/proxyCustomElement(EzNumberInput$1, [1,"ez-nu
|
|
|
121041
121125
|
const EzPopover = /*@__PURE__*/proxyCustomElement(EzPopover$1, [1,"ez-popover",{"autoClose":[516,"auto-close"],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxWidth":[513,"box-width"],"opened":[1540],"innerElement":[1537,"inner-element"]}]);
|
|
121042
121126
|
const EzPopup = /*@__PURE__*/proxyCustomElement(EzPopup$1, [1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"heightMode":[1537,"height-mode"],"ezTitle":[1,"ez-title"]}]);
|
|
121043
121127
|
const EzRadioButton = /*@__PURE__*/proxyCustomElement(EzRadioButton$1, [1,"ez-radio-button",{"value":[1544],"options":[1040],"enabled":[516],"label":[513],"direction":[1537]}]);
|
|
121044
|
-
const EzScroller = /*@__PURE__*/proxyCustomElement(EzScroller$1, [1,"ez-scroller",{"direction":[1]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]]);
|
|
121128
|
+
const EzScroller = /*@__PURE__*/proxyCustomElement(EzScroller$1, [1,"ez-scroller",{"direction":[1],"locked":[4],"activeShadow":[4,"active-shadow"],"isFirefox":[32]},[[2,"click","clickListener"],[1,"mousedown","mouseDownHandler"],[1,"mouseup","mouseUpHandler"],[1,"mousemove","mouseMoveHandler"]]]);
|
|
121045
121129
|
const EzSearch = /*@__PURE__*/proxyCustomElement(EzSearch$1, [1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errorMessage":[1537,"error-message"],"optionLoader":[16],"showSelectedValue":[4,"show-selected-value"],"showOptionValue":[4,"show-option-value"],"suppressEmptyOption":[4,"suppress-empty-option"],"mode":[513]}]);
|
|
121046
121130
|
const EzTabselector = /*@__PURE__*/proxyCustomElement(EzTabselector$1, [1,"ez-tabselector",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32]}]);
|
|
121047
121131
|
const EzTextArea = /*@__PURE__*/proxyCustomElement(EzTextArea$1, [1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errorMessage":[1537,"error-message"],"rows":[1538],"canShowError":[516,"can-show-error"],"mode":[513]}]);
|
|
@@ -676,7 +676,10 @@ class DataBinder {
|
|
|
676
676
|
markInvalid(field) {
|
|
677
677
|
this._invalidFields.set(field.name, field);
|
|
678
678
|
if (this._fields.has(field.name)) {
|
|
679
|
-
|
|
679
|
+
const fieldElement = this._fields.get(field.name).field;
|
|
680
|
+
if (!fieldElement["errorMessage"]) {
|
|
681
|
+
this.updateErrorMessage(field.name, fieldElement);
|
|
682
|
+
}
|
|
680
683
|
}
|
|
681
684
|
}
|
|
682
685
|
clearInvalid() {
|
|
@@ -703,7 +706,16 @@ class DataBinder {
|
|
|
703
706
|
}
|
|
704
707
|
updateErrorMessage(fieldName, field) {
|
|
705
708
|
const invalidField = this._invalidFields.get(fieldName);
|
|
706
|
-
|
|
709
|
+
if (invalidField) {
|
|
710
|
+
field["errorMessage"] = invalidField.message;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
getErrorMessage(fieldName) {
|
|
714
|
+
if (this._fields.has(fieldName)) {
|
|
715
|
+
const fieldElement = this._fields.get(fieldName).field;
|
|
716
|
+
return fieldElement["errorMessage"] || null;
|
|
717
|
+
}
|
|
718
|
+
return undefined;
|
|
707
719
|
}
|
|
708
720
|
updateBind(fieldName, field) {
|
|
709
721
|
const oldBind = this._fields.get(fieldName);
|
|
@@ -880,10 +892,16 @@ let EzForm = class {
|
|
|
880
892
|
.map(f => f.dataset.fieldName)
|
|
881
893
|
.concat(metadata.getRequiredFields());
|
|
882
894
|
const invalidFields = [];
|
|
883
|
-
requiredFields.forEach(field => {
|
|
895
|
+
new Set(requiredFields).forEach(field => {
|
|
884
896
|
const value = record[field];
|
|
885
897
|
if (value == undefined || value === "") {
|
|
886
|
-
|
|
898
|
+
const errorMessage = this._dataBinder.getErrorMessage(field);
|
|
899
|
+
if (errorMessage) {
|
|
900
|
+
invalidFields.push({ name: field, message: errorMessage });
|
|
901
|
+
}
|
|
902
|
+
else {
|
|
903
|
+
invalidFields.push({ name: field, message: "Essa informação é obrigatória" });
|
|
904
|
+
}
|
|
887
905
|
}
|
|
888
906
|
});
|
|
889
907
|
if (invalidFields.length > 0) {
|