@sankhyalabs/ezui 1.1.55 → 1.1.59

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 (39) hide show
  1. package/dist/cjs/ez-action-chip.cjs.entry.js +2 -27
  2. package/dist/cjs/ez-button_16.cjs.entry.js +27 -9
  3. package/dist/cjs/ez-label-chip.cjs.entry.js +4 -31
  4. package/dist/cjs/ezui.cjs.js +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/collection/collection-manifest.json +1 -1
  7. package/dist/collection/components/ez-action-chip/ez-action-chip.css +3 -4
  8. package/dist/collection/components/ez-action-chip/ez-action-chip.js +3 -28
  9. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +142 -0
  10. package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.js +157 -0
  11. package/dist/collection/components/ez-form/subcomponents/structure/FieldSet.js +1 -1
  12. package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +8 -1
  13. package/dist/collection/components/ez-label-chip/ez-label-chip.css +28 -8
  14. package/dist/collection/components/ez-label-chip/ez-label-chip.js +4 -31
  15. package/dist/collection/components/ez-tabselector/ez-tabselector.css +1 -0
  16. package/dist/collection/components/ez-text-input/ez-text-input.css +1 -1
  17. package/dist/custom-elements/index.d.ts +4 -4
  18. package/dist/custom-elements/index.js +35 -69
  19. package/dist/esm/ez-action-chip.entry.js +2 -27
  20. package/dist/esm/ez-button_16.entry.js +27 -9
  21. package/dist/esm/ez-label-chip.entry.js +4 -31
  22. package/dist/esm/ezui.js +1 -1
  23. package/dist/esm/loader.js +1 -1
  24. package/dist/ezui/ezui.esm.js +1 -1
  25. package/dist/ezui/p-7998aed5.entry.js +1 -0
  26. package/dist/ezui/p-88b9c3d4.entry.js +1 -0
  27. package/dist/ezui/p-aa94210b.entry.js +1 -0
  28. package/dist/types/components/ez-action-chip/ez-action-chip.d.ts +0 -2
  29. package/dist/types/components/{ez-collapsable-box/ez-collapsable-box.d.ts → ez-collapsible-box/ez-collapsible-box.d.ts} +9 -1
  30. package/dist/types/components/ez-label-chip/ez-label-chip.d.ts +0 -2
  31. package/dist/types/components.d.ts +25 -9
  32. package/package.json +1 -1
  33. package/react/components.d.ts +1 -1
  34. package/react/components.js +1 -1
  35. package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.css +0 -69
  36. package/dist/collection/components/ez-collapsable-box/ez-collapsable-box.js +0 -108
  37. package/dist/ezui/p-4bc6fd41.entry.js +0 -1
  38. package/dist/ezui/p-55c5b134.entry.js +0 -1
  39. package/dist/ezui/p-b81916dd.entry.js +0 -1
@@ -0,0 +1,157 @@
1
+ import { Component, h, Host, Prop, Event, Watch, Method } from '@stencil/core';
2
+ export class EzCollapsibleBox {
3
+ constructor() {
4
+ /**
5
+ * Valor externalizado que garante a exibição ou não do componente
6
+ */
7
+ this.value = false;
8
+ /**
9
+ * Define o tamanho do texto e do ícone do componente.
10
+ */
11
+ this.headersize = "small";
12
+ /**
13
+ * Define o local onde o ícone será renderizado.
14
+ */
15
+ this.iconplacement = "left";
16
+ }
17
+ observeValue() {
18
+ this.ezChange.emit();
19
+ }
20
+ /**
21
+ * Esconde ou revela o conteúdo do componente
22
+ */
23
+ async showHide() {
24
+ this.value = !this.value;
25
+ }
26
+ 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));
37
+ }
38
+ static get is() { return "ez-collapsible-box"; }
39
+ static get encapsulation() { return "shadow"; }
40
+ static get originalStyleUrls() { return {
41
+ "$": ["ez-collapsible-box.css"]
42
+ }; }
43
+ static get styleUrls() { return {
44
+ "$": ["ez-collapsible-box.css"]
45
+ }; }
46
+ static get properties() { return {
47
+ "value": {
48
+ "type": "boolean",
49
+ "mutable": true,
50
+ "complexType": {
51
+ "original": "boolean",
52
+ "resolved": "boolean",
53
+ "references": {}
54
+ },
55
+ "required": false,
56
+ "optional": false,
57
+ "docs": {
58
+ "tags": [],
59
+ "text": "Valor externalizado que garante a exibi\u00E7\u00E3o ou n\u00E3o do componente"
60
+ },
61
+ "attribute": "value",
62
+ "reflect": true,
63
+ "defaultValue": "false"
64
+ },
65
+ "label": {
66
+ "type": "string",
67
+ "mutable": false,
68
+ "complexType": {
69
+ "original": "string",
70
+ "resolved": "string",
71
+ "references": {}
72
+ },
73
+ "required": false,
74
+ "optional": false,
75
+ "docs": {
76
+ "tags": [],
77
+ "text": "Label \u00E9 o t\u00EDtulo do campo"
78
+ },
79
+ "attribute": "label",
80
+ "reflect": true
81
+ },
82
+ "headersize": {
83
+ "type": "string",
84
+ "mutable": false,
85
+ "complexType": {
86
+ "original": "string",
87
+ "resolved": "string",
88
+ "references": {}
89
+ },
90
+ "required": false,
91
+ "optional": false,
92
+ "docs": {
93
+ "tags": [],
94
+ "text": "Define o tamanho do texto e do \u00EDcone do componente."
95
+ },
96
+ "attribute": "headersize",
97
+ "reflect": true,
98
+ "defaultValue": "\"small\""
99
+ },
100
+ "iconplacement": {
101
+ "type": "string",
102
+ "mutable": false,
103
+ "complexType": {
104
+ "original": "string",
105
+ "resolved": "string",
106
+ "references": {}
107
+ },
108
+ "required": false,
109
+ "optional": false,
110
+ "docs": {
111
+ "tags": [],
112
+ "text": "Define o local onde o \u00EDcone ser\u00E1 renderizado."
113
+ },
114
+ "attribute": "iconplacement",
115
+ "reflect": true,
116
+ "defaultValue": "\"left\""
117
+ }
118
+ }; }
119
+ static get events() { return [{
120
+ "method": "ezChange",
121
+ "name": "ezChange",
122
+ "bubbles": true,
123
+ "cancelable": true,
124
+ "composed": true,
125
+ "docs": {
126
+ "tags": [],
127
+ "text": ""
128
+ },
129
+ "complexType": {
130
+ "original": "string",
131
+ "resolved": "string",
132
+ "references": {}
133
+ }
134
+ }]; }
135
+ static get methods() { return {
136
+ "showHide": {
137
+ "complexType": {
138
+ "signature": "() => Promise<void>",
139
+ "parameters": [],
140
+ "references": {
141
+ "Promise": {
142
+ "location": "global"
143
+ }
144
+ },
145
+ "return": "Promise<void>"
146
+ },
147
+ "docs": {
148
+ "text": "Esconde ou revela o conte\u00FAdo do componente",
149
+ "tags": []
150
+ }
151
+ }
152
+ }; }
153
+ static get watchers() { return [{
154
+ "propName": "value",
155
+ "methodName": "observeValue"
156
+ }]; }
157
+ }
@@ -21,7 +21,7 @@ export const FieldSet = ({ store, formName, source, dataUnit, enabled }) => {
21
21
  return h("div", { class: "col col--sd-12 padding--small" },
22
22
  h("div", { class: "row margin-top--large" },
23
23
  h("div", { class: "col col--sd-12 align--middle padding-horizontal--medium" },
24
- h("ez-collapsable-box", { value: isCollapsed, label: label, onEzChange: () => store.dispatch(collapseExpandGroup(fieldSetName, !isCollapsed)) }),
24
+ h("ez-collapsible-box", { value: isCollapsed, label: label, onEzChange: () => store.dispatch(collapseExpandGroup(fieldSetName, !isCollapsed)) }),
25
25
  isCollapsed ? null :
26
26
  h("div", { class: "col col--sd-12" }, fields.map(field => h(Field, { enabled: enabled, field: field, dataUnit: dataUnit, forceScroll: fieldToScroll === field.name }))))));
27
27
  };
@@ -7,6 +7,13 @@ function removeHandler(dataUnit) {
7
7
  }
8
8
  });
9
9
  }
10
+ function saveHandler(dataUnit) {
11
+ setTimeout(() => {
12
+ //Esse debouncing é necessário quando o usuário clica no botão de salvar
13
+ //sem ter tirado o foco o último campo alterado.
14
+ dataUnit.save();
15
+ }, 50);
16
+ }
10
17
  export const NavigationBar = ({ dataUnit: du, buttonProps, enabled }) => {
11
18
  if (buttonProps.previousVisible
12
19
  || buttonProps.nextVisible
@@ -22,7 +29,7 @@ export const NavigationBar = ({ dataUnit: du, buttonProps, enabled }) => {
22
29
  buttonProps.addVisible ? h("ez-button", { key: du.name + '_add', label: "Adicionar", enabled: enabled, onClick: () => du.insert(), class: "button--secondary margin-right--medium" }) : null,
23
30
  buttonProps.reloadVisible ? h("ez-button", { key: du.name + '_reload', title: "Recarregar", enabled: enabled, mode: "icon", onClick: () => du.load(), image: "/themes/default/images/icons/actions-sprite.svg#rotate", class: "button--secondary margin-right--medium" }) : null,
24
31
  buttonProps.cancelVisible ? h("ez-button", { key: du.name + '_cancel', label: "Cancelar", enabled: enabled && du.hasChanges(), onClick: () => du.cancel(), class: "button--secondary margin-right--medium" }) : null,
25
- buttonProps.saveVisible ? h("ez-button", { key: du.name + '_save', label: "Salvar", enabled: enabled && du.hasChanges(), onClick: () => du.save(), class: "button--primary margin-right--medium" }) : null);
32
+ buttonProps.saveVisible ? h("ez-button", { key: du.name + '_save', label: "Salvar", enabled: enabled && du.hasChanges(), onClick: () => saveHandler(du), class: "button--primary margin-right--medium" }) : null);
26
33
  }
27
34
  else {
28
35
  return null;
@@ -24,6 +24,7 @@
24
24
  --lc__message_box--font-size: var(--text--small, 12px);
25
25
  --lc__message_box--info--color: var(--color--success, #22085d);
26
26
  --lc__message_box--error--color: var(--color--error, #FF0000);
27
+ --lc--close__image: url('data:image/svg+xml;utf8,<svg width="8" height="8" viewBox="0 0 8 8" xmlns="http://www.w3.org/2000/svg"><path d="M 4.7098145,3.9968334 7.8535703,0.85318776 C 7.9473034,0.75946455 8,0.63233985 8,0.49978585 8,0.36723841 7.947304,0.24011361 7.8535703,0.14638378 7.7598354,0.05266059 7.6327257,6.48e-8 7.500152,6.48e-8 7.3676457,6.48e-8 7.2404691,0.0526608 7.1467354,0.14638378 L 4.00298,3.2900293 0.8591984,0.14638378 C 0.76546463,0.05266059 0.63834103,6.48e-8 0.50578123,6.48e-8 0.3732281,6.48e-8 0.24609783,0.05266059 0.15236397,0.14638378 0.05863012,0.24011361 0.00597395,0.36723841 0.00597395,0.49978585 c 0,0.132554 0.05265617,0.2596787 0.14639002,0.35340191 L 3.2961455,3.9968334 0.15236397,7.1411589 C 0.10466427,7.1872561 0.06663114,7.2424161 0.04046961,7.303371 0.01431473,7.3643212 5.6180845e-4,7.429943 1.6859246e-5,7.4962264 -5.2808998e-4,7.5625744 0.01214297,7.6283944 0.03729854,7.6897476 c 0.02514888,0.061416 0.06227604,0.1171794 0.1092096,0.1640783 0.0469402,0.046903 0.10274083,0.083936 0.16415749,0.1090508 0.0614166,0.025114 0.12721688,0.037703 0.19355667,0.037103 0.06634,-5.714e-4 0.13190027,-0.014457 0.19284393,-0.04064 0.0609507,-0.026246 0.11606474,-0.064351 0.16213217,-0.1120492 L 4.00298,4.7036374 7.1467354,7.8472967 c 0.093734,0.09373 0.2209103,0.1463572 0.3534166,0.1463572 0.1325737,0 0.2596834,-0.052623 0.3534183,-0.1463572 C 7.9473034,7.753567 8,7.6264624 8,7.493895 8,7.3613281 7.9473086,7.2342224 7.8535703,7.1404927 Z"/></svg>');
27
28
  }
28
29
 
29
30
  .padding-right--small {
@@ -34,6 +35,26 @@
34
35
  padding-left: var(--lc--space--medium);
35
36
  }
36
37
 
38
+ .btn-close {
39
+ align-items: flex-start;
40
+ display: flex;
41
+ outline: none;
42
+ border: none;
43
+ padding: 0px 0px 0px 6px;
44
+ background-color: unset;
45
+ cursor: pointer;
46
+ }
47
+
48
+ .btn-close::after {
49
+ content: '';
50
+ display: flex;
51
+ background-color: var(--lc__label--color-primary);
52
+ width: 8px;
53
+ height: 8px;
54
+ -webkit-mask-image: var(--lc--close__image);
55
+ mask-image: var(--lc--close__image);
56
+ }
57
+
37
58
  .label__container {
38
59
  /*private*/
39
60
  width: fit-content;
@@ -41,14 +62,15 @@
41
62
  flex-wrap: wrap;
42
63
  position: relative;
43
64
  align-items: center;
65
+ background-color: #FFFFFF;
44
66
  align-self: center;
45
67
  color: var(--lc__label--title--primary);
46
68
  fill: var(--lc__label--title--primary);
47
69
  border: var(--lc__border);
48
70
  border-radius: var(--lc--border-radius);
49
71
  border-color: var( --lc__border-color-strokes);
50
- padding-right: var(--space--large, 12px);
51
- padding-left: var(--space--large, 12px);
72
+ padding-right: var(--space--medium, 12px);
73
+ padding-left: var(--space--medium, 12px);
52
74
  }
53
75
 
54
76
  .label__container:hover {
@@ -66,8 +88,8 @@
66
88
  align-self: center;
67
89
  border: var(--lc__border);
68
90
  border-radius: var(--lc--border-radius);
69
- padding-right: var(--space--large, 12px);
70
- padding-left: var(--space--large, 12px);
91
+ padding-right: var(--space--medium, 12px);
92
+ padding-left: var(--space--medium, 12px);
71
93
  fill: var(--lc__label--color-primary);
72
94
  color: var(--lc__label--color-primary);
73
95
  border-color: var(--lc__label--background-color);
@@ -85,8 +107,8 @@
85
107
  border: var(--lc__border);
86
108
  border-color: var(--lc__label-color--disable-secondary);
87
109
  border-radius: var(--lc--border-radius);
88
- padding-right: var(--space--large, 12px);
89
- padding-left: var(--space--large, 12px);
110
+ padding-right: var(--space--medium, 12px);
111
+ padding-left: var(--space--medium, 12px);
90
112
  fill: var(--lc__label--text--disabled);
91
113
  color: var(--lc__label--text--disabled);
92
114
  background-color: var(--lc__label-color--disable-secondary);
@@ -96,8 +118,6 @@ label {
96
118
  /*private*/
97
119
  display: flex;
98
120
  align-items: center;
99
- width: calc(100% - var(--lc__icon--width));
100
- width: fit-content;
101
121
  font-weight: var(--text-weight--large, 600);
102
122
  cursor: pointer;
103
123
  /*public*/
@@ -56,33 +56,6 @@ export class EzLabelChip {
56
56
  }
57
57
  }
58
58
  }
59
- handleSlotChange(ev) {
60
- const slot = ev.target;
61
- const content = slot.assignedElements()[0];
62
- if (content) {
63
- content.style.position = "absolute";
64
- content.style.display = "flex";
65
- content.style.alignItems = "center";
66
- content.style.justifyContent = "center";
67
- content.style.overflow = "hidden";
68
- content.style.top = "0px";
69
- content.style.width = "var(--lc__icon--width)";
70
- content.style.height = "var(--lc--height)";
71
- if (slot.name == "leftIcon") {
72
- content.style.left = "0px";
73
- this._labelElem.classList.add('padding-left--small');
74
- }
75
- else if (slot.name == "rightIcon") {
76
- content.style.right = "0px";
77
- if (this.removable) {
78
- this._iconElement.classList.add('padding-right--small');
79
- }
80
- else {
81
- this._labelElem.classList.add('padding-right--small');
82
- }
83
- }
84
- }
85
- }
86
59
  //---------------------------------------------
87
60
  // Lifecycle web component
88
61
  //---------------------------------------------
@@ -108,12 +81,12 @@ export class EzLabelChip {
108
81
  }
109
82
  render() {
110
83
  return (h("div", { onClick: (ev) => this.handleClick(ev), class: this.value ? "label__container--active" : "label__container", ref: (el) => this._divElem = el },
111
- h("slot", { name: "leftIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } }),
112
- h("label", { class: this.removable ? "padding-right--small" : " ", ref: (el) => this._labelElem = el }, this.label),
84
+ h("slot", { name: "leftIcon" }),
85
+ h("label", { ref: (el) => this._labelElem = el }, this.label),
113
86
  this.removable ?
114
- h("ez-icon", { class: "label__icon align--middle padding-horizontal--medium", onClick: () => { this.removeChip.emit(); }, ref: (el) => this._iconElement = el, href: "/themes/default/images/icons/actions-sprite.svg#close", size: "x-small" })
87
+ h("button", { class: "btn-close", onClick: () => { this.removeChip.emit(); } })
115
88
  : null,
116
- h("slot", { name: "rightIcon", onSlotchange: (ev) => { this.handleSlotChange(ev); } })));
89
+ h("slot", { name: "rightIcon" })));
117
90
  }
118
91
  static get is() { return "ez-label-chip"; }
119
92
  static get encapsulation() { return "shadow"; }
@@ -20,6 +20,7 @@
20
20
  width: 100%;
21
21
  scroll-behavior: smooth;
22
22
  overflow-x: auto;
23
+ scrollbar-width: none;
23
24
  }
24
25
 
25
26
  .scroll.startHidden{
@@ -16,7 +16,7 @@
16
16
  --it__input--border: var(--border--medium, 2px solid);
17
17
  --it__input--border-color: var(--it__input--background-color);
18
18
  /*no modo normal usamos a borda com a mesma cor do bg*/
19
- --it__input--focus--border-color: var(--color--primary, #008561);
19
+ --it__input--focus--border-color: var(--color--alert-cold-800, #042EFF);
20
20
  --it__input--disabled--background-color: var(--color--disable-secondary, #F2F5F8);
21
21
  --it__input--disabled--color: var(--text--disable, #AFB6C0);
22
22
  --it__input--error--border-color: #CC2936;
@@ -26,10 +26,10 @@ export const EzCheck: {
26
26
  new (): EzCheck;
27
27
  };
28
28
 
29
- interface EzCollapsableBox extends Components.EzCollapsableBox, HTMLElement {}
30
- export const EzCollapsableBox: {
31
- prototype: EzCollapsableBox;
32
- new (): EzCollapsableBox;
29
+ interface EzCollapsibleBox extends Components.EzCollapsibleBox, HTMLElement {}
30
+ export const EzCollapsibleBox: {
31
+ prototype: EzCollapsibleBox;
32
+ new (): EzCollapsibleBox;
33
33
  };
34
34
 
35
35
  interface EzComboBox extends Components.EzComboBox, HTMLElement {}