@sankhyalabs/ezui 5.20.0-dev.2 → 5.20.0-dev.21
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/README.md +4 -5
- package/dist/cjs/{CSSVarsUtils-b136a156.js → CSSVarsUtils-10c9d5b4.js} +13 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-alert-list.cjs.entry.js +33 -28
- package/dist/cjs/ez-card-item_3.cjs.entry.js +6 -5
- package/dist/cjs/ez-combo-box.cjs.entry.js +8 -7
- package/dist/cjs/ez-date-input.cjs.entry.js +4 -1
- package/dist/cjs/ez-date-time-input.cjs.entry.js +4 -1
- package/dist/cjs/ez-form-view.cjs.entry.js +34 -15
- package/dist/cjs/ez-grid.cjs.entry.js +91 -30
- package/dist/cjs/ez-icon.cjs.entry.js +1 -1
- package/dist/cjs/ez-multi-selection-list.cjs.entry.js +2 -10
- package/dist/cjs/ez-number-input.cjs.entry.js +4 -1
- package/dist/cjs/ez-popup.cjs.entry.js +1 -1
- package/dist/cjs/ez-search.cjs.entry.js +7 -8
- package/dist/cjs/ez-split-button.cjs.entry.js +147 -0
- package/dist/cjs/ez-split-item.cjs.entry.js +20 -2
- package/dist/cjs/ez-split-panel.cjs.entry.js +15 -12
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/filter-column.cjs.entry.js +16 -5
- package/dist/cjs/index-a7b0c73d.js +8 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ez-alert-list/ez-alert-list.js +33 -28
- package/dist/collection/components/ez-card-item/ez-card-item.css +39 -6
- package/dist/collection/components/ez-card-item/ez-card-item.js +22 -3
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +1 -0
- package/dist/collection/components/ez-combo-box/ez-combo-box.js +7 -6
- package/dist/collection/components/ez-date-input/ez-date-input.js +3 -0
- package/dist/collection/components/ez-date-time-input/ez-date-time-input.js +3 -0
- package/dist/collection/components/ez-form-view/ez-form-view.css +17 -1
- package/dist/collection/components/ez-form-view/ez-form-view.js +22 -5
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/CheckBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/ComboBox.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/DateInput.tpl.js +3 -3
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/FileInput.tpl.js +4 -2
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/SearchInput.tpl.js +1 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/TextInput.tpl.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +12 -11
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +15 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.js +1 -3
- package/dist/collection/components/ez-grid/ez-grid.css +25 -1
- package/dist/collection/components/ez-grid/ez-grid.js +67 -10
- package/dist/collection/components/ez-grid/subcomponents/filter-column.js +16 -5
- package/dist/collection/components/ez-icon/ez-icon.css +1 -1
- package/dist/collection/components/ez-multi-selection-list/ez-multi-selection-list.js +2 -10
- package/dist/collection/components/ez-number-input/ez-number-input.js +3 -0
- package/dist/collection/components/ez-popup/ez-popup.css +2 -5
- package/dist/collection/components/ez-search/ez-search.css +2 -1
- package/dist/collection/components/ez-search/ez-search.js +5 -6
- package/dist/collection/components/ez-split-button/ez-split-button.css +229 -0
- package/dist/collection/components/ez-split-button/ez-split-button.js +436 -0
- package/dist/collection/components/ez-split-button/test/dropdownItems.js +42 -0
- package/dist/collection/components/ez-split-panel/ez-split-panel.css +6 -7
- package/dist/collection/components/ez-split-panel/ez-split-panel.js +35 -14
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.css +47 -12
- package/dist/collection/components/ez-split-panel/structure/item/ez-split-item.js +82 -2
- package/dist/collection/utils/CSSVarsUtils.js +13 -0
- package/dist/collection/utils/form/test/DataBinder.test.js +9 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +394 -124
- package/dist/esm/{CSSVarsUtils-a97cfa29.js → CSSVarsUtils-71ce76be.js} +13 -0
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-alert-list.entry.js +33 -28
- package/dist/esm/ez-card-item_3.entry.js +6 -5
- package/dist/esm/ez-combo-box.entry.js +8 -7
- package/dist/esm/ez-date-input.entry.js +4 -1
- package/dist/esm/ez-date-time-input.entry.js +4 -1
- package/dist/esm/ez-form-view.entry.js +35 -16
- package/dist/esm/ez-grid.entry.js +92 -31
- package/dist/esm/ez-icon.entry.js +1 -1
- package/dist/esm/ez-multi-selection-list.entry.js +2 -10
- package/dist/esm/ez-number-input.entry.js +4 -1
- package/dist/esm/ez-popup.entry.js +1 -1
- package/dist/esm/ez-search.entry.js +7 -8
- package/dist/esm/ez-split-button.entry.js +143 -0
- package/dist/esm/ez-split-item.entry.js +20 -2
- package/dist/esm/ez-split-panel.entry.js +15 -12
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/filter-column.entry.js +16 -5
- package/dist/esm/index-baa5e267.js +8 -4
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-f56dd1da.entry.js → p-07cbffce.entry.js} +1 -1
- package/dist/ezui/p-13dbad96.entry.js +1 -0
- package/dist/ezui/p-2eb8f73b.entry.js +1 -0
- package/dist/ezui/{p-40f72de4.entry.js → p-784fe207.entry.js} +1 -1
- package/dist/ezui/p-7af81663.entry.js +1 -0
- package/dist/ezui/p-801fd0f8.entry.js +1 -0
- package/dist/ezui/p-807560f0.entry.js +1 -0
- package/dist/ezui/p-940ed30b.entry.js +1 -0
- package/dist/ezui/{p-eb36f072.entry.js → p-99ead599.entry.js} +1 -1
- package/dist/ezui/{p-7eb3e1a5.js → p-9e11fc7b.js} +1 -1
- package/dist/ezui/p-9f1e89c9.entry.js +1 -0
- package/dist/ezui/{p-6e2f8e6b.entry.js → p-a2704c1a.entry.js} +2 -2
- package/dist/ezui/{p-51c5e071.entry.js → p-abc23d6f.entry.js} +1 -1
- package/dist/ezui/p-af95cd16.entry.js +1 -0
- package/dist/ezui/{p-c0f1715f.entry.js → p-b567fa8c.entry.js} +1 -1
- package/dist/ezui/p-b9fbf4e7.entry.js +1 -0
- package/dist/ezui/p-baf80b13.entry.js +1 -0
- package/dist/ezui/p-db77a984.entry.js +1 -0
- package/dist/ezui/{p-9cad9b6e.entry.js → p-e85c48d7.entry.js} +1 -1
- package/dist/types/components/ez-alert-list/ez-alert-list.d.ts +1 -1
- package/dist/types/components/ez-card-item/ez-card-item.d.ts +4 -0
- package/dist/types/components/ez-combo-box/ez-combo-box.d.ts +1 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +3 -0
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +2 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomHeader.d.ts +1 -1
- package/dist/types/components/ez-grid/ez-grid.d.ts +15 -2
- package/dist/types/components/ez-grid/subcomponents/filter-column.d.ts +4 -1
- package/dist/types/components/ez-multi-selection-list/ez-multi-selection-list.d.ts +0 -1
- package/dist/types/components/ez-split-button/ez-split-button.d.ts +89 -0
- package/dist/types/components/ez-split-button/test/dropdownItems.d.ts +2 -0
- package/dist/types/components/ez-split-panel/ez-split-panel.d.ts +23 -0
- package/dist/types/components/ez-split-panel/structure/item/ez-split-item.d.ts +27 -0
- package/dist/types/components.d.ts +155 -0
- package/dist/types/utils/CSSVarsUtils.d.ts +1 -0
- package/dist/types/utils/form/test/DataBinder.test.d.ts +1 -0
- package/package.json +13 -5
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridUtils.js +0 -8
- package/dist/ezui/p-133fae4a.entry.js +0 -1
- package/dist/ezui/p-24d3fede.entry.js +0 -1
- package/dist/ezui/p-43b03119.entry.js +0 -1
- package/dist/ezui/p-4a7f113d.entry.js +0 -1
- package/dist/ezui/p-596634e9.entry.js +0 -1
- package/dist/ezui/p-76ba9d67.entry.js +0 -1
- package/dist/ezui/p-796c1a88.entry.js +0 -1
- package/dist/ezui/p-af15c277.entry.js +0 -1
- package/dist/ezui/p-ba875f37.entry.js +0 -1
- package/dist/ezui/p-d6ffe679.entry.js +0 -1
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridUtils.d.ts +0 -1
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { h } from '@stencil/core';
|
|
3
|
+
export class EzSplitButton {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.rightDefaultTitle = 'Mais opções';
|
|
6
|
+
this.show = false;
|
|
7
|
+
this.enabled = true;
|
|
8
|
+
this.iconName = undefined;
|
|
9
|
+
this.image = undefined;
|
|
10
|
+
this.items = undefined;
|
|
11
|
+
this.label = undefined;
|
|
12
|
+
this.leftTitle = undefined;
|
|
13
|
+
this.rightTitle = 'Mais opções';
|
|
14
|
+
this.mode = 'default';
|
|
15
|
+
this.size = 'medium';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Remove o foco de ambos os botões.
|
|
19
|
+
*/
|
|
20
|
+
async setBlur() {
|
|
21
|
+
this.leftButton.blur();
|
|
22
|
+
this.rightButton.blur();
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Aplica o foco no botão principal.
|
|
26
|
+
*/
|
|
27
|
+
async setLeftButtonFocus() {
|
|
28
|
+
this.leftButton.focus();
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Aplica o foco no botão do dropdown.
|
|
32
|
+
*/
|
|
33
|
+
async setRightButtonFocus() {
|
|
34
|
+
this.rightButton.focus();
|
|
35
|
+
}
|
|
36
|
+
clickListener(evt) {
|
|
37
|
+
if (!this.enabled) {
|
|
38
|
+
evt.preventDefault();
|
|
39
|
+
evt.stopPropagation();
|
|
40
|
+
evt.stopImmediatePropagation();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
getIconSize(sizeParam = 'medium') {
|
|
44
|
+
var _a;
|
|
45
|
+
const sizeList = ['medium', 'large'];
|
|
46
|
+
const sizeLowerCase = (_a = this.size) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
47
|
+
return sizeList.includes(sizeLowerCase) ? sizeLowerCase : sizeParam;
|
|
48
|
+
}
|
|
49
|
+
closeDropdown() {
|
|
50
|
+
this.show = false;
|
|
51
|
+
}
|
|
52
|
+
toggleDropdown() {
|
|
53
|
+
this.show = !this.show;
|
|
54
|
+
}
|
|
55
|
+
handleButtonClick() {
|
|
56
|
+
this.buttonClick.emit();
|
|
57
|
+
}
|
|
58
|
+
handleDropdownItemClick(evt) {
|
|
59
|
+
this.dropdownItemClick.emit(evt.detail);
|
|
60
|
+
evt.stopPropagation();
|
|
61
|
+
this.closeDropdown();
|
|
62
|
+
}
|
|
63
|
+
handleDropdownSubActionClick(evt) {
|
|
64
|
+
this.dropdownSubActionClick.emit(evt.detail);
|
|
65
|
+
evt.stopPropagation();
|
|
66
|
+
this.closeDropdown();
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Método responsável em posicionar o dropdown na tela.
|
|
70
|
+
* Faz com que o dropdown se ajuste automaticamente ao espaco na tela
|
|
71
|
+
*/
|
|
72
|
+
positionDropdown() {
|
|
73
|
+
const { rightButton: _rightButton, dropdownParent: _dropdownParent } = this;
|
|
74
|
+
const rightButtonRect = _rightButton.getBoundingClientRect();
|
|
75
|
+
const dropdownParentRect = _dropdownParent.getBoundingClientRect();
|
|
76
|
+
const spaceBelow = window.innerHeight - rightButtonRect.bottom;
|
|
77
|
+
const spaceAbove = rightButtonRect.top;
|
|
78
|
+
const spaceRight = window.innerWidth - rightButtonRect.right;
|
|
79
|
+
const spaceLeft = rightButtonRect.left;
|
|
80
|
+
const hasSpaceBelow = spaceBelow < dropdownParentRect.height && spaceAbove > dropdownParentRect.height;
|
|
81
|
+
const hasSpaceRight = spaceRight < dropdownParentRect.width && spaceLeft > dropdownParentRect.width;
|
|
82
|
+
let top = `${rightButtonRect.bottom + window.scrollY}px`;
|
|
83
|
+
let left = `${rightButtonRect.left + window.scrollX}px`;
|
|
84
|
+
let bottom = 'auto';
|
|
85
|
+
if (hasSpaceBelow) {
|
|
86
|
+
bottom = `${window.innerHeight - rightButtonRect.top - window.scrollY}px`;
|
|
87
|
+
top = 'auto';
|
|
88
|
+
_dropdownParent.style.maxHeight = `${spaceAbove}px`;
|
|
89
|
+
}
|
|
90
|
+
if (hasSpaceRight) {
|
|
91
|
+
left = `${rightButtonRect.right - dropdownParentRect.width + window.scrollX}px`;
|
|
92
|
+
}
|
|
93
|
+
_dropdownParent.style.top = top;
|
|
94
|
+
_dropdownParent.style.bottom = bottom;
|
|
95
|
+
_dropdownParent.style.left = left;
|
|
96
|
+
}
|
|
97
|
+
setEvents() {
|
|
98
|
+
window.removeEventListener('scroll', this.positionDropdown.bind(this));
|
|
99
|
+
window.addEventListener('scroll', this.positionDropdown.bind(this));
|
|
100
|
+
}
|
|
101
|
+
componentWillLoad() {
|
|
102
|
+
this.setEvents();
|
|
103
|
+
}
|
|
104
|
+
componentDidLoad() {
|
|
105
|
+
if (this._element)
|
|
106
|
+
ElementIDUtils.addIDInfo(this._element);
|
|
107
|
+
if (this.leftButton) {
|
|
108
|
+
const dataInfo = { id: 'embedded' };
|
|
109
|
+
ElementIDUtils.addIDInfo(this.leftButton, 'left-button', dataInfo);
|
|
110
|
+
}
|
|
111
|
+
if (this.rightButton) {
|
|
112
|
+
const dataInfo = { id: 'embedded' };
|
|
113
|
+
ElementIDUtils.addIDInfo(this.rightButton, 'right-button', dataInfo);
|
|
114
|
+
}
|
|
115
|
+
this.positionDropdown();
|
|
116
|
+
}
|
|
117
|
+
componentDidUpdate() {
|
|
118
|
+
this.positionDropdown();
|
|
119
|
+
}
|
|
120
|
+
render() {
|
|
121
|
+
const hasIconButton = this.shouldShowIconOnLeftButton();
|
|
122
|
+
const hasLabelButton = this.shouldShowLabelOnLeftButton();
|
|
123
|
+
const iconSize = this.getIconSize();
|
|
124
|
+
return (h("div", { class: "label-icon" }, h("button", { class: `ez-split-button__left-button ${iconSize} ${this.mode}`, title: this.leftTitle || this.label, type: "button", disabled: !this.enabled, onClick: () => { this.handleButtonClick(); }, ref: el => (this.leftButton = el) }, hasIconButton && h("ez-icon", { href: this.image, iconName: this.iconName, size: iconSize }), hasLabelButton && h("label", { title: this.leftTitle || this.label }, this.label)), h("div", { class: "dropdown" }, h("button", { class: `ez-split-button__right-button ${iconSize} ez-split-button__right-button--${iconSize} ez-split-button__right-button--divider`, title: this.rightTitle || this.rightDefaultTitle, type: "button", disabled: !this.enabled, onClick: () => { this.toggleDropdown(); }, ref: el => (this.rightButton = el) }, h("ez-icon", { class: `ez-split-button__right-button-container ` + (iconSize ? `btn-icon--${iconSize}` : ''), iconName: 'chevron-down', size: iconSize })), h("div", { class: `dropdown-content dropdown-content--${this.size}`, ref: (ref) => (this.dropdownParent = ref) }, this.show && (h("ez-dropdown", { items: this.items, onClick: evt => { evt.stopPropagation(); }, onEzOutsideClick: () => { this.closeDropdown(); }, onEzClick: evt => { this.handleDropdownItemClick(evt); }, onEzSubActionClick: evt => { this.handleDropdownSubActionClick(evt); } }))))));
|
|
125
|
+
}
|
|
126
|
+
shouldShowLabelOnLeftButton() {
|
|
127
|
+
return ['icon-left', 'default'].includes(this.mode);
|
|
128
|
+
}
|
|
129
|
+
shouldShowIconOnLeftButton() {
|
|
130
|
+
return ['icon-left', 'icon-only'].includes(this.mode);
|
|
131
|
+
}
|
|
132
|
+
static get is() { return "ez-split-button"; }
|
|
133
|
+
static get encapsulation() { return "shadow"; }
|
|
134
|
+
static get originalStyleUrls() {
|
|
135
|
+
return {
|
|
136
|
+
"$": ["ez-split-button.css"]
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
static get styleUrls() {
|
|
140
|
+
return {
|
|
141
|
+
"$": ["ez-split-button.css"]
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
static get properties() {
|
|
145
|
+
return {
|
|
146
|
+
"enabled": {
|
|
147
|
+
"type": "boolean",
|
|
148
|
+
"mutable": false,
|
|
149
|
+
"complexType": {
|
|
150
|
+
"original": "boolean",
|
|
151
|
+
"resolved": "boolean",
|
|
152
|
+
"references": {}
|
|
153
|
+
},
|
|
154
|
+
"required": false,
|
|
155
|
+
"optional": false,
|
|
156
|
+
"docs": {
|
|
157
|
+
"tags": [],
|
|
158
|
+
"text": "Se false o usu\u00E1rio n\u00E3o pode interagir com o bot\u00E3o."
|
|
159
|
+
},
|
|
160
|
+
"attribute": "enabled",
|
|
161
|
+
"reflect": true,
|
|
162
|
+
"defaultValue": "true"
|
|
163
|
+
},
|
|
164
|
+
"iconName": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"mutable": false,
|
|
167
|
+
"complexType": {
|
|
168
|
+
"original": "string",
|
|
169
|
+
"resolved": "string",
|
|
170
|
+
"references": {}
|
|
171
|
+
},
|
|
172
|
+
"required": false,
|
|
173
|
+
"optional": false,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [],
|
|
176
|
+
"text": "Define o \u00EDcone a ser usado da biblioteca de \u00EDcones: [ez-icons](https://gilded-nasturtium-6b64dd.netlify.app/docs/components/layout-doc/icons/)"
|
|
177
|
+
},
|
|
178
|
+
"attribute": "icon-name",
|
|
179
|
+
"reflect": true
|
|
180
|
+
},
|
|
181
|
+
"image": {
|
|
182
|
+
"type": "string",
|
|
183
|
+
"mutable": false,
|
|
184
|
+
"complexType": {
|
|
185
|
+
"original": "string",
|
|
186
|
+
"resolved": "string",
|
|
187
|
+
"references": {}
|
|
188
|
+
},
|
|
189
|
+
"required": false,
|
|
190
|
+
"optional": false,
|
|
191
|
+
"docs": {
|
|
192
|
+
"tags": [],
|
|
193
|
+
"text": "Define o caminho usado nos modos `icon-only` e `icon-left` para imagens n\u00E3o contempladas na biblioteca de \u00EDcones."
|
|
194
|
+
},
|
|
195
|
+
"attribute": "image",
|
|
196
|
+
"reflect": true
|
|
197
|
+
},
|
|
198
|
+
"items": {
|
|
199
|
+
"type": "unknown",
|
|
200
|
+
"mutable": false,
|
|
201
|
+
"complexType": {
|
|
202
|
+
"original": "Array<IDropdownItem>",
|
|
203
|
+
"resolved": "IDropdownItem[]",
|
|
204
|
+
"references": {
|
|
205
|
+
"Array": {
|
|
206
|
+
"location": "global"
|
|
207
|
+
},
|
|
208
|
+
"IDropdownItem": {
|
|
209
|
+
"location": "import",
|
|
210
|
+
"path": "../ez-dropdown/structure/DropdownItem"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"required": false,
|
|
215
|
+
"optional": false,
|
|
216
|
+
"docs": {
|
|
217
|
+
"tags": [],
|
|
218
|
+
"text": "Define o conte\u00FAdo do dropdown."
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"label": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"mutable": false,
|
|
224
|
+
"complexType": {
|
|
225
|
+
"original": "string",
|
|
226
|
+
"resolved": "string",
|
|
227
|
+
"references": {}
|
|
228
|
+
},
|
|
229
|
+
"required": false,
|
|
230
|
+
"optional": false,
|
|
231
|
+
"docs": {
|
|
232
|
+
"tags": [],
|
|
233
|
+
"text": "Texto a ser apresentado como label do bot\u00E3o."
|
|
234
|
+
},
|
|
235
|
+
"attribute": "label",
|
|
236
|
+
"reflect": true
|
|
237
|
+
},
|
|
238
|
+
"leftTitle": {
|
|
239
|
+
"type": "string",
|
|
240
|
+
"mutable": false,
|
|
241
|
+
"complexType": {
|
|
242
|
+
"original": "string",
|
|
243
|
+
"resolved": "string",
|
|
244
|
+
"references": {}
|
|
245
|
+
},
|
|
246
|
+
"required": false,
|
|
247
|
+
"optional": false,
|
|
248
|
+
"docs": {
|
|
249
|
+
"tags": [],
|
|
250
|
+
"text": "Texto a ser apresentado como title do bot\u00E3o principal"
|
|
251
|
+
},
|
|
252
|
+
"attribute": "left-title",
|
|
253
|
+
"reflect": true
|
|
254
|
+
},
|
|
255
|
+
"rightTitle": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"mutable": false,
|
|
258
|
+
"complexType": {
|
|
259
|
+
"original": "string",
|
|
260
|
+
"resolved": "string",
|
|
261
|
+
"references": {}
|
|
262
|
+
},
|
|
263
|
+
"required": false,
|
|
264
|
+
"optional": false,
|
|
265
|
+
"docs": {
|
|
266
|
+
"tags": [],
|
|
267
|
+
"text": "Texto a ser apresentado como title do bot\u00E3o dropdown"
|
|
268
|
+
},
|
|
269
|
+
"attribute": "right-title",
|
|
270
|
+
"reflect": true,
|
|
271
|
+
"defaultValue": "'Mais op\u00E7\u00F5es'"
|
|
272
|
+
},
|
|
273
|
+
"mode": {
|
|
274
|
+
"type": "string",
|
|
275
|
+
"mutable": false,
|
|
276
|
+
"complexType": {
|
|
277
|
+
"original": "'default' | 'icon-only' | 'icon-left'",
|
|
278
|
+
"resolved": "\"default\" | \"icon-left\" | \"icon-only\"",
|
|
279
|
+
"references": {}
|
|
280
|
+
},
|
|
281
|
+
"required": false,
|
|
282
|
+
"optional": false,
|
|
283
|
+
"docs": {
|
|
284
|
+
"tags": [],
|
|
285
|
+
"text": "Define o modo de uso do bot\u00E3o."
|
|
286
|
+
},
|
|
287
|
+
"attribute": "mode",
|
|
288
|
+
"reflect": true,
|
|
289
|
+
"defaultValue": "'default'"
|
|
290
|
+
},
|
|
291
|
+
"size": {
|
|
292
|
+
"type": "string",
|
|
293
|
+
"mutable": false,
|
|
294
|
+
"complexType": {
|
|
295
|
+
"original": "'medium' | 'large'",
|
|
296
|
+
"resolved": "\"large\" | \"medium\"",
|
|
297
|
+
"references": {}
|
|
298
|
+
},
|
|
299
|
+
"required": false,
|
|
300
|
+
"optional": false,
|
|
301
|
+
"docs": {
|
|
302
|
+
"tags": [],
|
|
303
|
+
"text": "Define o tamanho do ez-split-button."
|
|
304
|
+
},
|
|
305
|
+
"attribute": "size",
|
|
306
|
+
"reflect": true,
|
|
307
|
+
"defaultValue": "'medium'"
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
static get states() {
|
|
312
|
+
return {
|
|
313
|
+
"show": {}
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
static get events() {
|
|
317
|
+
return [{
|
|
318
|
+
"method": "buttonClick",
|
|
319
|
+
"name": "buttonClick",
|
|
320
|
+
"bubbles": true,
|
|
321
|
+
"cancelable": true,
|
|
322
|
+
"composed": true,
|
|
323
|
+
"docs": {
|
|
324
|
+
"tags": [],
|
|
325
|
+
"text": "Emitido quando o bot\u00E3o principal \u00E9 clicado"
|
|
326
|
+
},
|
|
327
|
+
"complexType": {
|
|
328
|
+
"original": "void",
|
|
329
|
+
"resolved": "void",
|
|
330
|
+
"references": {}
|
|
331
|
+
}
|
|
332
|
+
}, {
|
|
333
|
+
"method": "dropdownItemClick",
|
|
334
|
+
"name": "dropdownItemClick",
|
|
335
|
+
"bubbles": true,
|
|
336
|
+
"cancelable": true,
|
|
337
|
+
"composed": true,
|
|
338
|
+
"docs": {
|
|
339
|
+
"tags": [],
|
|
340
|
+
"text": "Emitido quando um item do dropdown \u00E9 clicado"
|
|
341
|
+
},
|
|
342
|
+
"complexType": {
|
|
343
|
+
"original": "IDropdownItem",
|
|
344
|
+
"resolved": "IDropdownItem",
|
|
345
|
+
"references": {
|
|
346
|
+
"IDropdownItem": {
|
|
347
|
+
"location": "import",
|
|
348
|
+
"path": "../ez-dropdown/structure/DropdownItem"
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}, {
|
|
353
|
+
"method": "dropdownSubActionClick",
|
|
354
|
+
"name": "dropdownSubActionClick",
|
|
355
|
+
"bubbles": true,
|
|
356
|
+
"cancelable": true,
|
|
357
|
+
"composed": true,
|
|
358
|
+
"docs": {
|
|
359
|
+
"tags": [],
|
|
360
|
+
"text": "Emitido quando uma subAction de um item do dropdown \u00E9 clicada"
|
|
361
|
+
},
|
|
362
|
+
"complexType": {
|
|
363
|
+
"original": "IDropdownSubAction",
|
|
364
|
+
"resolved": "IDropdownSubAction",
|
|
365
|
+
"references": {
|
|
366
|
+
"IDropdownSubAction": {
|
|
367
|
+
"location": "import",
|
|
368
|
+
"path": "../ez-dropdown/structure/DropdownItem"
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}];
|
|
373
|
+
}
|
|
374
|
+
static get methods() {
|
|
375
|
+
return {
|
|
376
|
+
"setBlur": {
|
|
377
|
+
"complexType": {
|
|
378
|
+
"signature": "() => Promise<void>",
|
|
379
|
+
"parameters": [],
|
|
380
|
+
"references": {
|
|
381
|
+
"Promise": {
|
|
382
|
+
"location": "global"
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
"return": "Promise<void>"
|
|
386
|
+
},
|
|
387
|
+
"docs": {
|
|
388
|
+
"text": "Remove o foco de ambos os bot\u00F5es.",
|
|
389
|
+
"tags": []
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
"setLeftButtonFocus": {
|
|
393
|
+
"complexType": {
|
|
394
|
+
"signature": "() => Promise<void>",
|
|
395
|
+
"parameters": [],
|
|
396
|
+
"references": {
|
|
397
|
+
"Promise": {
|
|
398
|
+
"location": "global"
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
"return": "Promise<void>"
|
|
402
|
+
},
|
|
403
|
+
"docs": {
|
|
404
|
+
"text": "Aplica o foco no bot\u00E3o principal.",
|
|
405
|
+
"tags": []
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
"setRightButtonFocus": {
|
|
409
|
+
"complexType": {
|
|
410
|
+
"signature": "() => Promise<void>",
|
|
411
|
+
"parameters": [],
|
|
412
|
+
"references": {
|
|
413
|
+
"Promise": {
|
|
414
|
+
"location": "global"
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
"return": "Promise<void>"
|
|
418
|
+
},
|
|
419
|
+
"docs": {
|
|
420
|
+
"text": "Aplica o foco no bot\u00E3o do dropdown.",
|
|
421
|
+
"tags": []
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
static get elementRef() { return "_element"; }
|
|
427
|
+
static get listeners() {
|
|
428
|
+
return [{
|
|
429
|
+
"name": "click",
|
|
430
|
+
"method": "clickListener",
|
|
431
|
+
"target": undefined,
|
|
432
|
+
"capture": true,
|
|
433
|
+
"passive": false
|
|
434
|
+
}];
|
|
435
|
+
}
|
|
436
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const dropdownItems = [
|
|
2
|
+
{
|
|
3
|
+
id: "1",
|
|
4
|
+
label: "label1",
|
|
5
|
+
type: 'item',
|
|
6
|
+
iconName: "iconName1",
|
|
7
|
+
subAction: {
|
|
8
|
+
id: "1",
|
|
9
|
+
label: "subActionLabel1",
|
|
10
|
+
type: "primary"
|
|
11
|
+
},
|
|
12
|
+
group: "group"
|
|
13
|
+
}, {
|
|
14
|
+
id: "2",
|
|
15
|
+
label: "label2",
|
|
16
|
+
type: 'item',
|
|
17
|
+
iconName: "iconName2",
|
|
18
|
+
subAction: null,
|
|
19
|
+
group: null,
|
|
20
|
+
}, {
|
|
21
|
+
id: "3",
|
|
22
|
+
label: "label3",
|
|
23
|
+
type: 'item',
|
|
24
|
+
iconName: "iconName3",
|
|
25
|
+
subAction: null,
|
|
26
|
+
group: null,
|
|
27
|
+
}, {
|
|
28
|
+
id: "",
|
|
29
|
+
label: "",
|
|
30
|
+
type: 'divider',
|
|
31
|
+
iconName: "",
|
|
32
|
+
subAction: null,
|
|
33
|
+
group: null,
|
|
34
|
+
}, {
|
|
35
|
+
id: "4",
|
|
36
|
+
label: "label4",
|
|
37
|
+
type: 'item',
|
|
38
|
+
iconName: "iconName4",
|
|
39
|
+
subAction: null,
|
|
40
|
+
group: null,
|
|
41
|
+
}
|
|
42
|
+
];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StringUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { Host, h } from '@stencil/core';
|
|
2
3
|
import Split from 'split-grid';
|
|
3
|
-
import { StringUtils } from "@sankhyalabs/core";
|
|
4
4
|
export class SplitPanel {
|
|
5
5
|
constructor() {
|
|
6
6
|
this._items = [];
|
|
7
7
|
this.direction = 'column';
|
|
8
|
+
this.anchorToExpand = false;
|
|
8
9
|
}
|
|
9
10
|
componentDidLoad() {
|
|
10
11
|
this._panelID = StringUtils.generateUUID();
|
|
@@ -31,7 +32,7 @@ export class SplitPanel {
|
|
|
31
32
|
getGutters() {
|
|
32
33
|
const gutters = {
|
|
33
34
|
columnGutters: [],
|
|
34
|
-
rowGutters: []
|
|
35
|
+
rowGutters: [],
|
|
35
36
|
};
|
|
36
37
|
if (!this._items.length) {
|
|
37
38
|
return gutters;
|
|
@@ -41,19 +42,19 @@ export class SplitPanel {
|
|
|
41
42
|
if (index == this._items.length - 1)
|
|
42
43
|
return;
|
|
43
44
|
let gutterTrack = item.dataset.trackNumber;
|
|
44
|
-
if (index ===
|
|
45
|
+
if (index === this._items.length - 1) {
|
|
45
46
|
gutterTrack = this._items.length.toString();
|
|
46
47
|
}
|
|
47
48
|
gutters[proToChange].push({
|
|
48
49
|
track: Number(gutterTrack),
|
|
49
|
-
element: this._element.querySelector(`ez-split-panel[data-panel-id="${this._panelID}"] > [data-item-track="${item.dataset.trackNumber}"]`)
|
|
50
|
+
element: this._element.querySelector(`ez-split-panel[data-panel-id="${this._panelID}"] > [data-item-track="${item.dataset.trackNumber}"]`),
|
|
50
51
|
});
|
|
51
52
|
});
|
|
52
53
|
return gutters;
|
|
53
54
|
}
|
|
54
55
|
addItemGutter(item) {
|
|
55
56
|
const gutter = document.createElement('div');
|
|
56
|
-
gutter.classList.add(
|
|
57
|
+
gutter.classList.add('ez-split-gutter');
|
|
57
58
|
gutter.classList.add(this.direction);
|
|
58
59
|
gutter.dataset.itemTrack = `${item.dataset.trackNumber}`;
|
|
59
60
|
gutter.dataset.trackNumber = (Number(item.dataset.trackNumber) + 1).toString();
|
|
@@ -61,29 +62,31 @@ export class SplitPanel {
|
|
|
61
62
|
}
|
|
62
63
|
getElementStyle() {
|
|
63
64
|
const style = {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
display: 'grid',
|
|
66
|
+
height: '100%',
|
|
67
|
+
width: '100%',
|
|
68
|
+
position: this.anchorToExpand ? 'relative' : 'unset',
|
|
67
69
|
};
|
|
68
70
|
return style;
|
|
69
71
|
}
|
|
70
72
|
getGridTemplate() {
|
|
71
73
|
let template = '';
|
|
72
|
-
this._items.forEach((
|
|
74
|
+
this._items.forEach((col, index) => {
|
|
75
|
+
const size = col.size || '1fr';
|
|
73
76
|
if (index === this._items.length - 1) {
|
|
74
|
-
template += `
|
|
77
|
+
template += ` ${size}`;
|
|
75
78
|
return;
|
|
76
79
|
}
|
|
77
80
|
if (index === 0) {
|
|
78
|
-
template +=
|
|
81
|
+
template += `${size} 5px`;
|
|
79
82
|
return;
|
|
80
83
|
}
|
|
81
|
-
template += `
|
|
84
|
+
template += ` ${size} 5px`;
|
|
82
85
|
});
|
|
83
86
|
return template;
|
|
84
87
|
}
|
|
85
88
|
render() {
|
|
86
|
-
return
|
|
89
|
+
return h(Host, { style: this.getElementStyle() });
|
|
87
90
|
}
|
|
88
91
|
static get is() { return "ez-split-panel"; }
|
|
89
92
|
static get originalStyleUrls() {
|
|
@@ -115,6 +118,24 @@ export class SplitPanel {
|
|
|
115
118
|
"attribute": "direction",
|
|
116
119
|
"reflect": false,
|
|
117
120
|
"defaultValue": "'column'"
|
|
121
|
+
},
|
|
122
|
+
"anchorToExpand": {
|
|
123
|
+
"type": "boolean",
|
|
124
|
+
"mutable": false,
|
|
125
|
+
"complexType": {
|
|
126
|
+
"original": "boolean",
|
|
127
|
+
"resolved": "boolean",
|
|
128
|
+
"references": {}
|
|
129
|
+
},
|
|
130
|
+
"required": false,
|
|
131
|
+
"optional": false,
|
|
132
|
+
"docs": {
|
|
133
|
+
"tags": [],
|
|
134
|
+
"text": "Respons\u00E1vel por definir o painel que limita o tamanho do item expandido."
|
|
135
|
+
},
|
|
136
|
+
"attribute": "anchor-to-expand",
|
|
137
|
+
"reflect": false,
|
|
138
|
+
"defaultValue": "false"
|
|
118
139
|
}
|
|
119
140
|
};
|
|
120
141
|
}
|
|
@@ -1,12 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
ez-split-item {
|
|
2
|
+
/*@doc Define altura mínima da snk-grid */
|
|
3
|
+
--snk-grid-min-height: 0;
|
|
4
|
+
/*@doc Define altura mínima da grid */
|
|
5
|
+
--ez-grid--min-height: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.box_split-item {
|
|
9
|
+
background-color: var(--background--xlight);
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
border-radius: var(--border--radius-medium);
|
|
13
|
+
box-shadow: var(--shadow);
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
display: flex;
|
|
17
|
+
padding: var(--space--nano);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.box_split-item > .ez-split-item--content {
|
|
21
|
+
overflow: auto;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.expanded__item {
|
|
25
|
+
position: absolute;
|
|
26
|
+
z-index: var(--more-visible);
|
|
27
|
+
top: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: 100%;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ez-split-item--header {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ez-split-item--header-buttons {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ez-split-item--content {
|
|
45
|
+
display: block;
|
|
46
|
+
height: 100%;
|
|
47
|
+
}
|