@sankhyalabs/sankhyablocks 1.1.23 → 1.1.27
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/ApplicationUtils-05b74ee9.js +39 -0
- package/dist/cjs/AssetsUtils-bd004f63.js +24 -0
- package/dist/cjs/CSSVarsUtils-75ca9c64.js +19 -0
- package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
- package/dist/cjs/ez-action-chip.cjs.entry.js +27 -0
- package/dist/cjs/ez-application.cjs.entry.js +26 -0
- package/dist/cjs/ez-button_4.cjs.entry.js +660 -0
- package/dist/cjs/ez-calendar.cjs.entry.js +223 -0
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +47 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +278 -0
- package/dist/cjs/ez-date-input.cjs.entry.js +102 -0
- package/dist/cjs/ez-date-time-input.cjs.entry.js +145 -0
- package/dist/cjs/ez-dialog.cjs.entry.js +89 -0
- package/dist/cjs/ez-form.cjs.entry.js +785 -0
- package/dist/cjs/ez-grid.cjs.entry.js +110485 -0
- package/dist/cjs/ez-icon.cjs.entry.js +41 -0
- package/dist/cjs/ez-label-chip.cjs.entry.js +104 -0
- package/dist/cjs/ez-modal_2.cjs.entry.js +316 -0
- package/dist/cjs/ez-number-input.cjs.entry.js +86 -0
- package/dist/cjs/ez-popover.cjs.entry.js +120 -0
- package/dist/cjs/ez-popup.cjs.entry.js +48 -0
- package/dist/cjs/ez-search.cjs.entry.js +64 -0
- package/dist/cjs/ez-tabselector.cjs.entry.js +198 -0
- package/dist/cjs/ez-text-area.cjs.entry.js +114 -0
- package/dist/cjs/ez-text-input.cjs.entry.js +201 -0
- package/dist/cjs/ez-time-input.cjs.entry.js +118 -0
- package/dist/cjs/ez-toast.cjs.entry.js +44 -0
- package/dist/cjs/ez-upload.cjs.entry.js +356 -0
- package/dist/cjs/index-6ac5268e.js +1769 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sankhyablocks.cjs.js +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +52 -1313
- package/dist/cjs/test-du.cjs.entry.js +76 -0
- package/dist/collection/collection-manifest.json +36 -1
- package/dist/collection/components/snk-application/snk-application.js +8 -4
- package/dist/{collection/temp → components}/ApplicationUtils.js +37 -31
- package/dist/components/AssetsUtils.js +22 -0
- package/dist/components/CSSVarsUtils.js +17 -0
- package/dist/components/_commonjsHelpers.js +17 -0
- package/dist/components/ez-action-chip.js +44 -0
- package/dist/components/ez-application.js +39 -0
- package/dist/components/ez-button.js +6 -0
- package/dist/components/ez-button2.js +105 -0
- package/dist/components/ez-calendar.js +6 -0
- package/dist/components/ez-calendar2.js +242 -0
- package/dist/components/ez-check.js +6 -0
- package/dist/components/ez-check2.js +94 -0
- package/dist/components/ez-collapsible-box.js +67 -0
- package/dist/components/ez-combo-box.js +6 -0
- package/dist/components/ez-combo-box2.js +311 -0
- package/dist/components/ez-date-input.js +135 -0
- package/dist/components/ez-date-time-input.js +179 -0
- package/dist/components/ez-dialog.js +124 -0
- package/dist/components/ez-form.js +6 -0
- package/dist/components/ez-form2.js +807 -0
- package/dist/components/ez-grid.js +110576 -0
- package/dist/components/ez-icon.js +6 -0
- package/dist/components/ez-icon2.js +56 -0
- package/dist/components/ez-label-chip.js +125 -0
- package/dist/components/ez-list.js +6 -0
- package/dist/components/ez-list2.js +523 -0
- package/dist/components/ez-modal.js +6 -0
- package/dist/components/ez-modal2.js +82 -0
- package/dist/components/ez-number-input.js +115 -0
- package/dist/components/ez-popover.js +145 -0
- package/dist/components/ez-popup.js +67 -0
- package/dist/components/ez-search.js +100 -0
- package/dist/components/ez-tabselector.js +6 -0
- package/dist/components/ez-tabselector2.js +213 -0
- package/dist/components/ez-text-area.js +137 -0
- package/dist/components/ez-text-input.js +6 -0
- package/dist/components/ez-text-input2.js +223 -0
- package/dist/components/ez-time-input.js +153 -0
- package/dist/components/ez-toast.js +64 -0
- package/dist/components/ez-upload.js +382 -0
- package/dist/components/grid-config.js +6 -0
- package/dist/components/grid-config2.js +318 -0
- package/dist/components/select-box.js +6 -0
- package/dist/components/select-box2.js +47 -0
- package/dist/components/snk-application.js +5 -1266
- package/dist/components/test-du.js +101 -0
- package/dist/esm/ApplicationUtils-e0b6d857.js +37 -0
- package/dist/esm/AssetsUtils-98074c9c.js +22 -0
- package/dist/esm/CSSVarsUtils-0787c3f3.js +17 -0
- package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
- package/dist/esm/ez-action-chip.entry.js +23 -0
- package/dist/esm/ez-application.entry.js +22 -0
- package/dist/esm/ez-button_4.entry.js +653 -0
- package/dist/esm/ez-calendar.entry.js +219 -0
- package/dist/esm/ez-collapsible-box.entry.js +43 -0
- package/dist/esm/ez-combo-box.entry.js +274 -0
- package/dist/esm/ez-date-input.entry.js +98 -0
- package/dist/esm/ez-date-time-input.entry.js +141 -0
- package/dist/esm/ez-dialog.entry.js +85 -0
- package/dist/esm/ez-form.entry.js +781 -0
- package/dist/esm/ez-grid.entry.js +110481 -0
- package/dist/esm/ez-icon.entry.js +37 -0
- package/dist/esm/ez-label-chip.entry.js +100 -0
- package/dist/esm/ez-modal_2.entry.js +311 -0
- package/dist/esm/ez-number-input.entry.js +82 -0
- package/dist/esm/ez-popover.entry.js +116 -0
- package/dist/esm/ez-popup.entry.js +44 -0
- package/dist/esm/ez-search.entry.js +60 -0
- package/dist/esm/ez-tabselector.entry.js +194 -0
- package/dist/esm/ez-text-area.entry.js +110 -0
- package/dist/esm/ez-text-input.entry.js +197 -0
- package/dist/esm/ez-time-input.entry.js +114 -0
- package/dist/esm/ez-toast.entry.js +40 -0
- package/dist/esm/ez-upload.entry.js +352 -0
- package/dist/esm/index-df166135.js +1738 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-application.entry.js +6 -1267
- package/dist/esm/test-du.entry.js +72 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-action-chip/ez-action-chip.css +67 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-application/ez-application.css +3 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-button/ez-button.css +180 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-calendar/ez-calendar.css +319 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-check/ez-check.css +327 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +162 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-combo-box/ez-combo-box.css +217 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-input/ez-date-input.css +49 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-date-time-input/ez-date-time-input.css +44 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-dialog/ez-dialog.css +527 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-form/ez-form.css +5 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/ez-grid.css +31 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/gridconfig/grid-config.css +129 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-grid/subcomponents/select-box/select-box.css +10 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-icon/ez-icon.css +176 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-label-chip/ez-label-chip.css +139 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-list/ez-list.css +335 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-modal/ez-modal.css +358 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-number-input/ez-number-input.css +4 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popover/ez-popover.css +44 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-popup/ez-popup.css +405 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-search/ez-search.css +3 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-tabselector/ez-tabselector.css +138 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-area/ez-text-area.css +165 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-text-input/ez-text-input.css +196 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-time-input/ez-time-input.css +10 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-toast/ez-toast.css +127 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/ez-upload/ez-upload.css +568 -0
- package/dist/node_modules/@sankhyalabs/ezui/dist/collection/components/test-du/test-du.css +3 -0
- package/dist/sankhyablocks/p-08e1cded.entry.js +1 -0
- package/dist/sankhyablocks/p-0a77ac95.entry.js +57 -0
- package/dist/sankhyablocks/p-112455b1.js +1 -0
- package/dist/sankhyablocks/p-126c4aaa.entry.js +1 -0
- package/dist/sankhyablocks/p-1421b89a.entry.js +1 -0
- package/dist/sankhyablocks/p-1beadcaf.entry.js +1 -0
- package/dist/sankhyablocks/p-1c423f5d.entry.js +1 -0
- package/dist/sankhyablocks/p-28a0dbf0.entry.js +1 -0
- package/dist/sankhyablocks/p-4763d5c2.js +1 -0
- package/dist/sankhyablocks/p-4c66200a.entry.js +1 -0
- package/dist/sankhyablocks/p-5dc772be.entry.js +1 -0
- package/dist/sankhyablocks/p-5ff3e300.entry.js +1 -0
- package/dist/sankhyablocks/p-7122cec4.entry.js +1 -0
- package/dist/sankhyablocks/p-811b4b9d.js +1 -0
- package/dist/sankhyablocks/p-813fe4f7.js +1 -0
- package/dist/sankhyablocks/p-9b33a005.entry.js +1 -0
- package/dist/sankhyablocks/p-9e22ec87.entry.js +1 -0
- package/dist/sankhyablocks/p-9f7239df.entry.js +1 -0
- package/dist/sankhyablocks/p-9f7e6e48.js +1 -0
- package/dist/sankhyablocks/p-a47e0537.entry.js +1 -0
- package/dist/sankhyablocks/p-a9aba60a.entry.js +1 -0
- package/dist/sankhyablocks/p-afda7940.entry.js +1 -0
- package/dist/sankhyablocks/p-b3a83eaf.entry.js +1 -0
- package/dist/sankhyablocks/p-b96a8d40.entry.js +1 -0
- package/dist/sankhyablocks/p-c61c0e40.entry.js +1 -0
- package/dist/sankhyablocks/p-ca29d028.entry.js +1 -0
- package/dist/sankhyablocks/p-cd17abb1.entry.js +1 -0
- package/dist/sankhyablocks/p-d3a5366d.entry.js +369 -0
- package/dist/sankhyablocks/p-d5703a41.entry.js +1 -0
- package/dist/sankhyablocks/p-e5f77a59.entry.js +1 -0
- package/dist/sankhyablocks/p-e9e94d51.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +1 -1
- package/dist/types/components.d.ts +1 -1
- package/package.json +11 -3
- package/react/components.d.ts +29 -0
- package/react/components.js +29 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/index-20a7d705.js +0 -733
- package/dist/esm/index-8d3572c4.js +0 -707
- package/dist/sankhyablocks/p-5fa264b9.js +0 -1
- package/dist/sankhyablocks/p-f3bdd8c3.entry.js +0 -57
- package/dist/types/temp/ApplicationUtils.d.ts +0 -7
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { g as getSpritePath } from './AssetsUtils.js';
|
|
3
|
+
import { StringUtils } from '@sankhyalabs/core';
|
|
4
|
+
import { d as defineCustomElement$8 } from './ez-button2.js';
|
|
5
|
+
import { d as defineCustomElement$7 } from './ez-check2.js';
|
|
6
|
+
import { d as defineCustomElement$6 } from './ez-combo-box2.js';
|
|
7
|
+
import { d as defineCustomElement$5 } from './ez-icon2.js';
|
|
8
|
+
import { d as defineCustomElement$4 } from './ez-list2.js';
|
|
9
|
+
import { d as defineCustomElement$3 } from './ez-tabselector2.js';
|
|
10
|
+
import { d as defineCustomElement$2 } from './ez-text-input2.js';
|
|
11
|
+
import { d as defineCustomElement$1 } from './select-box2.js';
|
|
12
|
+
|
|
13
|
+
const gridConfigCss = ".sc-grid-config-h{--ez-grid-config__footer--padding-top:var(--space--medium, 12px);--ez-grid-config__main--padding-right:var(--space--medium, 12px);--ez-grid-config__tabselector-container--padding:var(--space--medium, 12px);--ez-grid-config__button-close--padding-left:var(--space--medium, 12px);--ez-grid-config__subtitle--font-family:var(--font-pattern, \"Sora\");--ez-grid-config__title--font-family:var(--font-pattern, \"Sora\");--ez-grid-config__title--font-weight:var(--text-weight--large, 700);--ez-grid-config__subtitle--font-size:var(--text--medium, 14px);--ez-grid-config__scrollbar--width:var(--space--medium, 12px);--ez-grid-config__main__scrollbar--background-color:var(--text--primary, #626e82);--ez-grid-config__main__scrollbar--border-radius:var(--border--radius-medium, 12px);--ez-grid__group--font-family:var(--font-pattern, \"Sora\");--ez-grid__group--font-size:var(--text--medium, 14px);--ez-grid__group--font-weight:var(--text-weight--large, 600);--ez-grid__group--padding-bottom:var(--space-small, 6px);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}.padding-right--medium.sc-grid-config{padding-right:var(--space--medium)}ez-list.sc-grid-config{height:100%}.heigth-calc.sc-grid-config{max-height:calc(100% - 24px)}.grid-config__footer.sc-grid-config{padding-top:var(--ez-grid-config__footer--padding-top);display:flex;justify-content:flex-end;width:100%}.hidden.sc-grid-config{display:none}.grid-config__main.sc-grid-config{padding-right:var(--ez-grid-config__main--padding-right);overflow-y:auto}.tabselector-container.sc-grid-config{padding:var(--ez-grid-config__tabselector-container--padding) 0}.button-close.sc-grid-config{padding-left:var(--ez-grid-config__button-close--padding-left)}.title-container.sc-grid-config{display:flex;justify-content:space-between;align-items:center;width:359px}.subtitle.sc-grid-config{font-family:var(--ez-grid-config__subtitle--font-family);font-size:var(--ez-grid-config__subtitle--font-size);color:var(--text--primary)}.title.sc-grid-config{display:flex;margin:0;font-family:var(--ez-grid-config__title--font-family);font-size:var(--title--large);font-weight:var(--ez-grid-config__title--font-weight);line-height:normal;letter-spacing:0em;text-align:left;color:var(--title--primary)}.grid-config__main.sc-grid-config::-webkit-scrollbar-track{background-color:#f0f2f5}.grid-config__main.sc-grid-config::-webkit-scrollbar-thumb{background-color:var(--ez-grid-config__main__scrollbar--background-color);border-radius:var(--ez-grid-config__main__scrollbar--border-radius)}.grid-config__main.sc-grid-config::-webkit-scrollbar{background-color:#f0f2f5;width:var(--ez-grid-config__scrollbar--width);max-width:var(--ez-grid-config__scrollbar--width);min-width:var(--ez-grid-config__scrollbar--width)}.group-name.sc-grid-config{font-family:var(--ez-grid__group--font-family);font-size:var(--ez-grid__group--font-size);font-weight:var(--ez-grid__group--font-weight);padding-bottom:var(--ez-grid__group--padding-bottom)}";
|
|
14
|
+
|
|
15
|
+
const GridConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.__registerHost();
|
|
19
|
+
this.configFinish = createEvent(this, "configFinish", 7);
|
|
20
|
+
this.configCancel = createEvent(this, "configCancel", 7);
|
|
21
|
+
this._columnListHistory = [];
|
|
22
|
+
this._orderListItems = [];
|
|
23
|
+
this._columListItems = [];
|
|
24
|
+
this.selectedTab = "Colunas";
|
|
25
|
+
this._selectedIndex = -1;
|
|
26
|
+
}
|
|
27
|
+
/* Creation Methods */
|
|
28
|
+
createOrderList() {
|
|
29
|
+
var _a;
|
|
30
|
+
let newList = [];
|
|
31
|
+
if (((_a = this._columnListHistory) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
32
|
+
this._columnListHistory.find(group => group.group === "Visíveis").items.forEach(column => {
|
|
33
|
+
let item = { label: column.label };
|
|
34
|
+
newList.push(item);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.columns.forEach(column => {
|
|
39
|
+
let item = { name: column.name, label: column.label };
|
|
40
|
+
if (!column.hidden) {
|
|
41
|
+
newList.push(item);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
this._orderListItems = newList;
|
|
46
|
+
}
|
|
47
|
+
createColumnList() {
|
|
48
|
+
let visibleGroup = {
|
|
49
|
+
group: 'Visíveis',
|
|
50
|
+
items: [],
|
|
51
|
+
};
|
|
52
|
+
let hiddenGroup = {
|
|
53
|
+
group: 'Ocultas',
|
|
54
|
+
items: [],
|
|
55
|
+
sort: 'ASC'
|
|
56
|
+
};
|
|
57
|
+
this.columns.forEach(column => {
|
|
58
|
+
let item = { label: column.label };
|
|
59
|
+
if (column.hidden) {
|
|
60
|
+
hiddenGroup.items.push(item);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
visibleGroup.items.push(item);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
if (this._columnListHistory.length <= 0) {
|
|
67
|
+
this._columListItems = [visibleGroup, hiddenGroup];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
buildColumnListSlot(item, group) {
|
|
71
|
+
return (h("div", null, h("ez-check", { mode: 'switch', id: 'switch' + item + group, value: group.group === "Visíveis", onEzChange: (ev) => { this.switchColumnGroup(ev, item); } })));
|
|
72
|
+
}
|
|
73
|
+
buildOrderListSlot(item) {
|
|
74
|
+
let existingItem = this.columns.find(columnItem => columnItem.label === item.label);
|
|
75
|
+
return (h("div", null, h("select-box", { selectedOption: existingItem === null || existingItem === void 0 ? void 0 : existingItem.sort, key: 'select-box' + item, onEzChange: (ev) => { ev.stopPropagation(); this.updateOrder(ev.detail, item); } })));
|
|
76
|
+
}
|
|
77
|
+
updateOrder(sortOrder, updatedItem) {
|
|
78
|
+
let newList = [...this.columns];
|
|
79
|
+
let newItem = newList.find(item => item.label === updatedItem.label);
|
|
80
|
+
if (newItem) {
|
|
81
|
+
newItem.sort = sortOrder.value;
|
|
82
|
+
}
|
|
83
|
+
this.columns = newList;
|
|
84
|
+
}
|
|
85
|
+
/* Actions Methods */
|
|
86
|
+
switchColumnGroup(ev, switchedItem) {
|
|
87
|
+
ev.stopPropagation();
|
|
88
|
+
let newList = [...this._columListItems];
|
|
89
|
+
if (ev.detail === true) {
|
|
90
|
+
let hiddenGroup = newList.find(group => group.group === "Ocultas");
|
|
91
|
+
let index = hiddenGroup.items.findIndex(item => item.label === switchedItem.label);
|
|
92
|
+
if (index >= 0) {
|
|
93
|
+
hiddenGroup.items.splice(index, 1);
|
|
94
|
+
}
|
|
95
|
+
let visibleGroup = newList.find(group => group.group === "Visíveis");
|
|
96
|
+
visibleGroup.items.push(switchedItem);
|
|
97
|
+
this._columListItems = newList;
|
|
98
|
+
this.createOrderList();
|
|
99
|
+
}
|
|
100
|
+
else if (ev.detail === false) {
|
|
101
|
+
let visibleGroup = newList.find(group => group.group === "Visíveis");
|
|
102
|
+
let index = visibleGroup.items.findIndex(item => item.label === switchedItem.label);
|
|
103
|
+
if (index >= 0) {
|
|
104
|
+
visibleGroup.items.splice(index, 1);
|
|
105
|
+
}
|
|
106
|
+
let hiddenGroup = newList.find(group => group.group === "Ocultas");
|
|
107
|
+
hiddenGroup.items.push(switchedItem);
|
|
108
|
+
this._columListItems = newList;
|
|
109
|
+
this.createOrderList();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
finish() {
|
|
113
|
+
let newColumnList = [];
|
|
114
|
+
this._columListItems.forEach(group => {
|
|
115
|
+
group.items.forEach(item => {
|
|
116
|
+
const baseColumn = this.columns.find(column => column.label === item.label);
|
|
117
|
+
let newColumnItem = Object.assign({}, baseColumn);
|
|
118
|
+
if (group.group === "Ocultas") {
|
|
119
|
+
newColumnItem.hidden = true;
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
newColumnItem.hidden = false;
|
|
123
|
+
}
|
|
124
|
+
newColumnList.push(newColumnItem);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
this._columnListHistory = [];
|
|
128
|
+
this.columns = newColumnList;
|
|
129
|
+
this.configFinish.emit(this.columns);
|
|
130
|
+
}
|
|
131
|
+
async locateColumn(evt, searchingText) {
|
|
132
|
+
var _a;
|
|
133
|
+
const hitEnter = evt.key === "Enter";
|
|
134
|
+
if (!searchingText) {
|
|
135
|
+
searchingText = (_a = evt.currentTarget) === null || _a === void 0 ? void 0 : _a.value;
|
|
136
|
+
}
|
|
137
|
+
let newSelected = -1;
|
|
138
|
+
if (this.selectedTab === "Ordenação das linhas") {
|
|
139
|
+
if (searchingText) {
|
|
140
|
+
const matchedIndexes = [];
|
|
141
|
+
let orderListDatasource;
|
|
142
|
+
await this._orderList.getList().then(listGroup => {
|
|
143
|
+
orderListDatasource = listGroup;
|
|
144
|
+
orderListDatasource.forEach((column, index) => {
|
|
145
|
+
if (this.compareWords(column, searchingText)) {
|
|
146
|
+
matchedIndexes.push(index);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
if (matchedIndexes.length > 0) {
|
|
151
|
+
if (hitEnter) {
|
|
152
|
+
for (let j = 0; j < matchedIndexes.length; j++) {
|
|
153
|
+
if (matchedIndexes[j] > this._selectedIndex) {
|
|
154
|
+
newSelected = matchedIndexes[j];
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (newSelected === -1) {
|
|
160
|
+
newSelected = matchedIndexes[0];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
this._selectedIndex = newSelected;
|
|
164
|
+
let selectedColumn;
|
|
165
|
+
selectedColumn = orderListDatasource[newSelected];
|
|
166
|
+
if (selectedColumn) {
|
|
167
|
+
this._orderList.setSelection({ label: selectedColumn.label }, true);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
this._orderList.setSelection(undefined);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
this._orderList.setSelection(undefined);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
if (searchingText) {
|
|
179
|
+
const matchedIndexes = [];
|
|
180
|
+
this.columns.forEach((column, index) => {
|
|
181
|
+
if (this.compareWords(column, searchingText)) {
|
|
182
|
+
matchedIndexes.push(index);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
if (matchedIndexes.length > 0) {
|
|
186
|
+
if (hitEnter) {
|
|
187
|
+
for (let j = 0; j < matchedIndexes.length; j++) {
|
|
188
|
+
if (matchedIndexes[j] > this._selectedIndex) {
|
|
189
|
+
newSelected = matchedIndexes[j];
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (newSelected === -1) {
|
|
195
|
+
newSelected = matchedIndexes[0];
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
this._selectedIndex = newSelected;
|
|
199
|
+
let selectedColumn = this.columns[newSelected];
|
|
200
|
+
if (selectedColumn) {
|
|
201
|
+
this._columnList.setSelection({ label: selectedColumn.label }, true);
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
this._columnList.setSelection(undefined);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
this._columnList.setSelection(undefined);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
compareWords(column, searchingText) {
|
|
213
|
+
if (StringUtils.replaceAccentuatedChars(column.label).indexOf(StringUtils.replaceAccentuatedChars(searchingText)) > -1) {
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
closeConfig() {
|
|
219
|
+
this._columnListHistory = [];
|
|
220
|
+
this.configCancel.emit();
|
|
221
|
+
}
|
|
222
|
+
/* Handlers */
|
|
223
|
+
handleTabChange(ev) {
|
|
224
|
+
var _a;
|
|
225
|
+
if ((_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.selectedTab) {
|
|
226
|
+
if (ev.target.selectedTab === "Ordenação das linhas") {
|
|
227
|
+
this._columnListHistory = this._columnList.dataSource;
|
|
228
|
+
this.createOrderList();
|
|
229
|
+
}
|
|
230
|
+
this.selectedTab = ev.target.selectedTab;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
handleColumnListChange(ev) {
|
|
234
|
+
var _a;
|
|
235
|
+
if (ev.detail) {
|
|
236
|
+
let visibleItems = (_a = ev.detail.find(group => group.group === "Visíveis")) === null || _a === void 0 ? void 0 : _a.items;
|
|
237
|
+
if (visibleItems) {
|
|
238
|
+
this._orderListItems = visibleItems;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
componentWillRender() {
|
|
243
|
+
var _a;
|
|
244
|
+
if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
245
|
+
this.createColumnList();
|
|
246
|
+
this.createOrderList();
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
componentDidRender() {
|
|
250
|
+
var _a;
|
|
251
|
+
if (((_a = this.columns) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
252
|
+
this.locateColumn(new KeyboardEvent("arrow-right", { key: "ArrowRight" }), this._searchElement.value);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
render() {
|
|
256
|
+
return (h(Host, null, h("div", { class: "grid-config__header" }, h("div", { class: "title-container" }, h("div", { class: "" }, h("label", { class: "title" }, "Configura\u00E7\u00E3o da Grade"), h("label", { class: "subtitle" }, "Defina visibilidade e ordem das colunas.")), h("div", { class: "button-close" }, h("ez-button", { mode: 'icon', image: getSpritePath("close"), size: 'medium', onClick: () => this.closeConfig() }))), h("div", { class: "tabselector-container" }, h("ez-tabselector", { selectedTab: this.selectedTab, selectedIndex: 0, onEzChange: (ev) => { this.handleTabChange(ev); }, tabs: 'Colunas, Ordena\u00E7\u00E3o das linhas' })), h("div", null, h("ez-text-input", { ref: (el) => this._searchElement = el, label: "Localizar coluna", onKeyUp: evt => this.locateColumn(evt) }, h("ez-icon", { slot: "leftIcon", size: "medium", href: getSpritePath("search") })))), h("div", { class: "grid-config__main" }, h("ez-list", { ref: (el) => this._columnList = el, class: this.selectedTab === "Colunas" ? "" : "hidden", dataSource: this._columListItems, onEzChange: ev => this.handleColumnListChange(ev), ezDraggable: true, ezSelectable: true, itemSlotBuilder: (item, group) => this.buildColumnListSlot(item, group), useGroups: true }), h("div", { class: this.selectedTab === "Ordenação das linhas" ? "group-name" : "hidden" }, "Sequ\u00EAncia da ordena\u00E7\u00E3o"), h("ez-list", { ref: (el) => this._orderList = el, class: this.selectedTab === "Ordenação das linhas" ? "heigth-calc" : "hidden", dataSource: this._orderListItems, ezSelectable: true, ezDraggable: true, itemSlotBuilder: (item) => this.buildOrderListSlot(item) })), h("div", { class: "grid-config__footer" }, h("ez-button", { class: "padding-right--medium", label: "Cancelar", onClick: () => this.closeConfig() }), h("ez-button", { label: "Concluir", class: "button--primary", onClick: () => this.finish() }))));
|
|
257
|
+
}
|
|
258
|
+
static get assetsDirs() { return ["../assets"]; }
|
|
259
|
+
static get style() { return gridConfigCss; }
|
|
260
|
+
}, [2, "grid-config", {
|
|
261
|
+
"selectedTab": [1025, "selected-tab"],
|
|
262
|
+
"columns": [1040]
|
|
263
|
+
}]);
|
|
264
|
+
function defineCustomElement() {
|
|
265
|
+
if (typeof customElements === "undefined") {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const components = ["grid-config", "ez-button", "ez-check", "ez-combo-box", "ez-icon", "ez-list", "ez-tabselector", "ez-text-input", "select-box"];
|
|
269
|
+
components.forEach(tagName => { switch (tagName) {
|
|
270
|
+
case "grid-config":
|
|
271
|
+
if (!customElements.get(tagName)) {
|
|
272
|
+
customElements.define(tagName, GridConfig);
|
|
273
|
+
}
|
|
274
|
+
break;
|
|
275
|
+
case "ez-button":
|
|
276
|
+
if (!customElements.get(tagName)) {
|
|
277
|
+
defineCustomElement$8();
|
|
278
|
+
}
|
|
279
|
+
break;
|
|
280
|
+
case "ez-check":
|
|
281
|
+
if (!customElements.get(tagName)) {
|
|
282
|
+
defineCustomElement$7();
|
|
283
|
+
}
|
|
284
|
+
break;
|
|
285
|
+
case "ez-combo-box":
|
|
286
|
+
if (!customElements.get(tagName)) {
|
|
287
|
+
defineCustomElement$6();
|
|
288
|
+
}
|
|
289
|
+
break;
|
|
290
|
+
case "ez-icon":
|
|
291
|
+
if (!customElements.get(tagName)) {
|
|
292
|
+
defineCustomElement$5();
|
|
293
|
+
}
|
|
294
|
+
break;
|
|
295
|
+
case "ez-list":
|
|
296
|
+
if (!customElements.get(tagName)) {
|
|
297
|
+
defineCustomElement$4();
|
|
298
|
+
}
|
|
299
|
+
break;
|
|
300
|
+
case "ez-tabselector":
|
|
301
|
+
if (!customElements.get(tagName)) {
|
|
302
|
+
defineCustomElement$3();
|
|
303
|
+
}
|
|
304
|
+
break;
|
|
305
|
+
case "ez-text-input":
|
|
306
|
+
if (!customElements.get(tagName)) {
|
|
307
|
+
defineCustomElement$2();
|
|
308
|
+
}
|
|
309
|
+
break;
|
|
310
|
+
case "select-box":
|
|
311
|
+
if (!customElements.get(tagName)) {
|
|
312
|
+
defineCustomElement$1();
|
|
313
|
+
}
|
|
314
|
+
break;
|
|
315
|
+
} });
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export { GridConfig as G, defineCustomElement as d };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$2 } from './ez-combo-box2.js';
|
|
3
|
+
import { d as defineCustomElement$1 } from './ez-text-input2.js';
|
|
4
|
+
|
|
5
|
+
const selectBoxCss = "ez-combo-box{width:100px}.grid-config-combo{--ez-text-input--height:28px;--ez-text-input__input--background-color:#fff;--ez-text-input__input--border-color:#dce0e8}";
|
|
6
|
+
|
|
7
|
+
const SelectBox = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.ezChange = createEvent(this, "ezChange", 7);
|
|
13
|
+
this.selectedOption = { value: "na", label: "N/A" };
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return (h("ez-combo-box", { class: "grid-config-combo inverted", label: "", value: this.selectedOption, enabled: true, canShowError: false, suppressEmptyOption: true }, h("option", { value: "na" }, "N/A"), h("option", { value: "asc" }, "A-Z"), h("option", { value: "desc" }, "Z-A")));
|
|
17
|
+
}
|
|
18
|
+
static get assetsDirs() { return ["../assets"]; }
|
|
19
|
+
static get style() { return selectBoxCss; }
|
|
20
|
+
}, [1, "select-box", {
|
|
21
|
+
"selectedOption": [1, "selected-option"]
|
|
22
|
+
}]);
|
|
23
|
+
function defineCustomElement() {
|
|
24
|
+
if (typeof customElements === "undefined") {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const components = ["select-box", "ez-combo-box", "ez-text-input"];
|
|
28
|
+
components.forEach(tagName => { switch (tagName) {
|
|
29
|
+
case "select-box":
|
|
30
|
+
if (!customElements.get(tagName)) {
|
|
31
|
+
customElements.define(tagName, SelectBox);
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
case "ez-combo-box":
|
|
35
|
+
if (!customElements.get(tagName)) {
|
|
36
|
+
defineCustomElement$2();
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
case "ez-text-input":
|
|
40
|
+
if (!customElements.get(tagName)) {
|
|
41
|
+
defineCustomElement$1();
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
} });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { SelectBox as S, defineCustomElement as d };
|