@sankhyalabs/ezui 1.1.90 → 1.1.93
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-button_11.cjs.entry.js +220 -147
- package/dist/cjs/ez-calendar.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box_7.cjs.entry.js +1 -1
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +2 -2
- package/dist/cjs/ez-popover.cjs.entry.js +1 -1
- package/dist/cjs/ez-time-input.cjs.entry.js +1 -1
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/{index-a92e6d04.js → index-5c8eb919.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ez-form/store/form.slice.js +1 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +16 -0
- package/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.js +1 -1
- package/dist/collection/components/ez-list/ez-list.css +23 -2
- package/dist/collection/components/ez-list/ez-list.js +136 -66
- package/dist/collection/components/ez-tabselector/ez-tabselector.js +40 -46
- package/dist/collection/utils/index.js +2 -0
- package/dist/custom-elements/index.js +167 -94
- package/dist/esm/ez-button_11.entry.js +220 -147
- package/dist/esm/ez-calendar.entry.js +1 -1
- package/dist/esm/ez-collapsible-box_7.entry.js +1 -1
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +2 -2
- package/dist/esm/ez-popover.entry.js +1 -1
- package/dist/esm/ez-time-input.entry.js +1 -1
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/{index-4fb1605f.js → index-4688c617.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-d22db59d.entry.js → p-278ce681.entry.js} +1 -1
- package/dist/ezui/{p-038fd0cb.entry.js → p-33d1247f.entry.js} +1 -1
- package/dist/ezui/{p-552a0b2e.entry.js → p-4b5c4408.entry.js} +1 -1
- package/dist/ezui/{p-4c20d96e.entry.js → p-5793a2e1.entry.js} +1 -1
- package/dist/ezui/{p-60469339.entry.js → p-68f6b75e.entry.js} +1 -1
- package/dist/ezui/{p-7e0281cd.entry.js → p-7e1d9c29.entry.js} +1 -1
- package/dist/ezui/{p-f0137439.js → p-7ff8b7f7.js} +1 -1
- package/dist/ezui/{p-f241de18.entry.js → p-ca42d682.entry.js} +24 -24
- package/dist/types/components/ez-form/store/form.slice.d.ts +2 -1
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +4 -1
- package/dist/types/components/ez-list/ez-list.d.ts +11 -6
- package/dist/types/components/ez-tabselector/ez-tabselector.d.ts +13 -6
- package/dist/types/components.d.ts +7 -6
- package/dist/types/utils/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -3,12 +3,10 @@ export class EzTabselector {
|
|
|
3
3
|
constructor() {
|
|
4
4
|
this.setFocusedParam = (ev) => {
|
|
5
5
|
if (ev.key === "Enter") {
|
|
6
|
-
|
|
7
|
-
this.
|
|
8
|
-
this.selectedTab = this._processedTabs[this.selectedIndex]["tabKey"];
|
|
9
|
-
this.handleTabClick(this.selectedTab, parseInt(this.selectedIndex));
|
|
6
|
+
const selectedTab = this._processedTabs[this._focusedIndex];
|
|
7
|
+
this.handleTabClick(selectedTab);
|
|
10
8
|
ev.preventDefault();
|
|
11
|
-
this.setFocusedTab(
|
|
9
|
+
this.setFocusedTab(selectedTab.index);
|
|
12
10
|
}
|
|
13
11
|
else if (ev.key === "ArrowLeft" || ev.key === "ArrowRight") {
|
|
14
12
|
let operator = undefined;
|
|
@@ -21,48 +19,46 @@ export class EzTabselector {
|
|
|
21
19
|
else {
|
|
22
20
|
return;
|
|
23
21
|
}
|
|
24
|
-
if (this.
|
|
22
|
+
if (this._focusedIndex === undefined) {
|
|
25
23
|
if (operator === false) {
|
|
26
|
-
this.
|
|
24
|
+
this._focusedIndex = this.selectedIndex !== undefined ? this.selectedIndex - 1 : undefined;
|
|
27
25
|
}
|
|
28
26
|
else {
|
|
29
|
-
this.
|
|
27
|
+
this._focusedIndex = this.selectedIndex !== undefined ? this.selectedIndex + 1 : undefined;
|
|
30
28
|
}
|
|
31
29
|
}
|
|
32
30
|
else {
|
|
33
31
|
if (operator === false) {
|
|
34
|
-
this.
|
|
32
|
+
this._focusedIndex = this._focusedIndex - 1;
|
|
35
33
|
}
|
|
36
34
|
else {
|
|
37
|
-
this.
|
|
35
|
+
this._focusedIndex = this._focusedIndex + 1;
|
|
38
36
|
}
|
|
39
37
|
}
|
|
40
|
-
if (
|
|
41
|
-
this.
|
|
38
|
+
if (this._focusedIndex < 0) {
|
|
39
|
+
this._focusedIndex = 0;
|
|
42
40
|
}
|
|
43
|
-
else if (
|
|
44
|
-
this.
|
|
41
|
+
else if (this._focusedIndex > this._processedTabs.length - 1) {
|
|
42
|
+
this._focusedIndex = this._processedTabs.length - 1;
|
|
45
43
|
}
|
|
46
|
-
this.setFocusedBtn(true, this.
|
|
47
|
-
this.setFocusedTab(this.
|
|
48
|
-
this.ezChange.emit(this.selectedTab);
|
|
44
|
+
this.setFocusedBtn(true, this._focusedIndex);
|
|
45
|
+
this.setFocusedTab(this._focusedIndex);
|
|
49
46
|
}
|
|
50
47
|
else if (ev.key === "Tab" || ev.key === "Escape") {
|
|
51
|
-
|
|
52
|
-
this.
|
|
53
|
-
this.handleTabClick(
|
|
48
|
+
const currentTab = this._processedTabs[this.selectedIndex];
|
|
49
|
+
this._focusedIndex = undefined;
|
|
50
|
+
this.handleTabClick(currentTab);
|
|
54
51
|
ev.preventDefault();
|
|
55
52
|
this.setFocusedTab(this.selectedIndex);
|
|
56
53
|
}
|
|
57
|
-
// this.setFocusedTab();
|
|
58
54
|
};
|
|
59
55
|
}
|
|
60
|
-
handleTabClick(tab
|
|
61
|
-
this.selectedIndex = index
|
|
62
|
-
this.
|
|
63
|
-
this.selectedTab = tab;
|
|
64
|
-
this.ezChange.emit(
|
|
65
|
-
this.setFocusedBtn(false,
|
|
56
|
+
handleTabClick(tab) {
|
|
57
|
+
this.selectedIndex = tab.index;
|
|
58
|
+
this._focusedIndex = undefined;
|
|
59
|
+
this.selectedTab = tab.tabKey;
|
|
60
|
+
this.ezChange.emit(tab);
|
|
61
|
+
this.setFocusedBtn(false, tab.index);
|
|
66
62
|
}
|
|
67
63
|
componentWillRender() {
|
|
68
64
|
if (!this._processedTabs) {
|
|
@@ -70,16 +66,16 @@ export class EzTabselector {
|
|
|
70
66
|
if (this.tabs) {
|
|
71
67
|
this.tabs.split(",").forEach((label) => {
|
|
72
68
|
label = label.trim();
|
|
73
|
-
this._processedTabs.push(
|
|
69
|
+
this._processedTabs.push({ label, tabKey: label, index: this._processedTabs.length });
|
|
74
70
|
});
|
|
75
71
|
}
|
|
76
72
|
this._hostElem.querySelectorAll("ez-tab").forEach((elem) => {
|
|
77
73
|
const tabKey = elem.getAttribute("tabKey");
|
|
78
74
|
const label = elem.getAttribute("label");
|
|
79
|
-
const t =
|
|
75
|
+
const t = { label, tabKey, index: this._processedTabs.length };
|
|
80
76
|
const content = elem.firstChild;
|
|
81
77
|
if (content) {
|
|
82
|
-
content.setAttribute("slot", "tab" +
|
|
78
|
+
content.setAttribute("slot", "tab" + t.index);
|
|
83
79
|
this._hostElem.appendChild(content);
|
|
84
80
|
}
|
|
85
81
|
this._processedTabs.push(t);
|
|
@@ -181,12 +177,12 @@ export class EzTabselector {
|
|
|
181
177
|
h("div", { class: "scroll", ref: (el) => this._scrollContainer = el, onScroll: () => this.domScrollHandler(), onKeyDown: (ev) => this.setFocusedParam(ev) }, this._processedTabs.map((tab, index) => {
|
|
182
178
|
const labelStyle = { "min-width": this.getTextWidth(tab.label) };
|
|
183
179
|
const tabId = "tab" + index;
|
|
184
|
-
const isSelected = index ===
|
|
180
|
+
const isSelected = index === this.selectedIndex || (this.selectedTab && tab.tabKey === this.selectedTab);
|
|
185
181
|
if (isSelected) {
|
|
186
182
|
this.selectedTab = tab.tabKey;
|
|
187
|
-
this.selectedIndex = index
|
|
183
|
+
this.selectedIndex = index;
|
|
188
184
|
}
|
|
189
|
-
return h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab
|
|
185
|
+
return h("button", { id: tabId, class: `tab${isSelected ? " is-active" : ""}`, onClick: () => this.handleTabClick(tab), style: labelStyle },
|
|
190
186
|
h("span", { class: "tab-label", title: tab.label }, tab.label),
|
|
191
187
|
h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } }));
|
|
192
188
|
})),
|
|
@@ -202,11 +198,11 @@ export class EzTabselector {
|
|
|
202
198
|
}; }
|
|
203
199
|
static get properties() { return {
|
|
204
200
|
"selectedIndex": {
|
|
205
|
-
"type": "
|
|
201
|
+
"type": "number",
|
|
206
202
|
"mutable": true,
|
|
207
203
|
"complexType": {
|
|
208
|
-
"original": "
|
|
209
|
-
"resolved": "
|
|
204
|
+
"original": "number",
|
|
205
|
+
"resolved": "number",
|
|
210
206
|
"references": {}
|
|
211
207
|
},
|
|
212
208
|
"required": false,
|
|
@@ -261,19 +257,17 @@ export class EzTabselector {
|
|
|
261
257
|
"composed": true,
|
|
262
258
|
"docs": {
|
|
263
259
|
"tags": [],
|
|
264
|
-
"text": "Evento emitido ao clicar para abrir o popup (ezChange)."
|
|
260
|
+
"text": "Evento emitido ao clicar para abrir o popup (ezChange).\nO detail desse evento carrega tanto o tabKey quanto o index da aba\nselecionada."
|
|
265
261
|
},
|
|
266
262
|
"complexType": {
|
|
267
|
-
"original": "
|
|
268
|
-
"resolved": "
|
|
269
|
-
"references": {
|
|
263
|
+
"original": "Tab",
|
|
264
|
+
"resolved": "Tab",
|
|
265
|
+
"references": {
|
|
266
|
+
"Tab": {
|
|
267
|
+
"location": "local"
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
270
|
}
|
|
271
271
|
}]; }
|
|
272
272
|
static get elementRef() { return "_hostElem"; }
|
|
273
273
|
}
|
|
274
|
-
class Tab {
|
|
275
|
-
constructor(label, tabKey) {
|
|
276
|
-
this.label = label;
|
|
277
|
-
this.tabKey = tabKey;
|
|
278
|
-
}
|
|
279
|
-
}
|