@sankhyalabs/sankhyablocks 1.3.34 → 1.4.0-beta.2
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/SnkMessageBuilder-d8215915.js +221 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/css-shim-b8158822.js +6 -0
- package/dist/cjs/dom-36862b77.js +75 -0
- package/dist/cjs/filter-item-type.enum-3daf58d3.js +16 -0
- package/dist/cjs/index-84fe3b86.js +20 -0
- package/dist/cjs/index-93965c41.js +141 -0
- package/dist/cjs/index-b0b676c5.js +3298 -0
- package/dist/cjs/index-e90ae303.js +2408 -0
- package/dist/cjs/loader.cjs.js +19 -3
- package/dist/cjs/sankhyablocks.cjs.js +117 -5
- package/dist/cjs/shadow-css-346c0795.js +389 -0
- package/dist/cjs/snk-application.cjs.entry.js +744 -174
- package/dist/cjs/snk-crud.cjs.entry.js +70 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +272 -0
- package/dist/cjs/snk-filter-bar.cjs.entry.js +466 -0
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +47 -0
- package/dist/cjs/snk-filter-detail.cjs.entry.js +84 -0
- package/dist/cjs/snk-filter-item.cjs.entry.js +177 -0
- package/dist/cjs/snk-filter-list.cjs.entry.js +91 -0
- package/dist/cjs/snk-filter-modal.cjs.entry.js +37 -0
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +23 -0
- package/dist/cjs/snk-filter-number.cjs.entry.js +24 -0
- package/dist/cjs/snk-filter-period.cjs.entry.js +37 -0
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +89 -0
- package/dist/cjs/snk-filter-search.cjs.entry.js +44 -0
- package/dist/cjs/snk-filter-text.cjs.entry.js +22 -0
- package/dist/cjs/snk-form.cjs.entry.js +133 -0
- package/dist/cjs/snk-grid.cjs.entry.js +79 -0
- package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
- package/dist/cjs/snk-taskbar.cjs.entry.js +160 -0
- package/dist/cjs/taskbar-elements-283c737e.js +93 -0
- package/dist/cjs/taskbar-processor-6bd0d35c.js +47 -0
- package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
- package/dist/collection/collection-manifest.json +19 -2
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +9 -2
- package/dist/collection/components/snk-application/snk-application.js +1179 -627
- package/dist/collection/components/snk-crud/snk-crud.css +6 -0
- package/dist/collection/components/snk-crud/snk-crud.js +201 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.css +6 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +517 -0
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +100 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +88 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +64 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +65 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +78 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +161 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +118 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +63 -0
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +12 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +153 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +278 -0
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +233 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +196 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +136 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +452 -0
- package/dist/collection/components/snk-form/snk-form.css +34 -0
- package/dist/collection/components/snk-form/snk-form.js +258 -0
- package/dist/collection/components/snk-grid/snk-grid.css +18 -0
- package/dist/collection/components/snk-grid/snk-grid.js +203 -0
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +80 -79
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +86 -0
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +43 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +3 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +307 -0
- package/dist/collection/components/teste-pesquisa/teste-pesquisa.js +12 -9
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +37 -12
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +52 -21
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +62 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +4 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js +47 -0
- package/dist/collection/lib/index.js +1 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +121 -0
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +23 -0
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +30 -0
- package/dist/collection/lib/message/resources/snk-form.msg.js +10 -0
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +17 -0
- package/dist/components/SnkMessageBuilder.js +199 -0
- package/dist/components/filter-item-type.enum.js +14 -0
- package/dist/components/index.d.ts +20 -5
- package/dist/components/index.js +24 -0
- package/dist/components/index2.js +2394 -0
- package/dist/components/index3.js +139 -0
- package/dist/components/snk-application2.js +727 -146
- package/dist/components/snk-crud.d.ts +11 -0
- package/dist/components/snk-crud.js +139 -0
- package/dist/components/snk-data-unit.d.ts +11 -0
- package/dist/components/snk-data-unit.js +294 -0
- package/dist/components/snk-filter-bar.d.ts +11 -0
- package/dist/components/snk-filter-bar.js +6 -0
- package/dist/components/snk-filter-bar2.js +504 -0
- package/dist/components/snk-filter-binary-select.d.ts +11 -0
- package/dist/components/snk-filter-binary-select.js +63 -0
- package/dist/components/snk-filter-detail.d.ts +11 -0
- package/dist/components/snk-filter-detail.js +6 -0
- package/dist/components/snk-filter-detail2.js +98 -0
- package/dist/components/snk-filter-item.d.ts +11 -0
- package/dist/components/snk-filter-item.js +6 -0
- package/dist/components/snk-filter-item2.js +198 -0
- package/dist/components/snk-filter-list.d.ts +11 -0
- package/dist/components/snk-filter-list.js +6 -0
- package/dist/components/snk-filter-list2.js +111 -0
- package/dist/components/snk-filter-modal.d.ts +11 -0
- package/dist/components/snk-filter-modal.js +6 -0
- package/dist/components/snk-filter-modal2.js +73 -0
- package/dist/components/snk-filter-multi-select.d.ts +11 -0
- package/dist/components/snk-filter-multi-select.js +39 -0
- package/dist/components/snk-filter-number.d.ts +11 -0
- package/dist/components/snk-filter-number.js +40 -0
- package/dist/components/snk-filter-period.d.ts +11 -0
- package/dist/components/snk-filter-period.js +53 -0
- package/dist/components/snk-filter-personalized.d.ts +11 -0
- package/dist/components/snk-filter-personalized.js +107 -0
- package/dist/components/snk-filter-search.d.ts +11 -0
- package/dist/components/snk-filter-search.js +62 -0
- package/dist/components/snk-filter-text.d.ts +11 -0
- package/dist/components/snk-filter-text.js +38 -0
- package/dist/components/snk-form.d.ts +11 -0
- package/dist/components/snk-form.js +6 -0
- package/dist/components/snk-form2.js +159 -0
- package/dist/components/snk-grid.d.ts +11 -0
- package/dist/components/snk-grid.js +6 -0
- package/dist/components/snk-grid2.js +133 -0
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-taskbar.d.ts +11 -0
- package/dist/components/snk-taskbar.js +6 -0
- package/dist/components/snk-taskbar2.js +264 -0
- package/dist/components/taskbar-processor.js +45 -0
- package/dist/components/teste-pesquisa.js +1 -1
- package/dist/esm/SnkMessageBuilder-35a20271.js +199 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/css-shim-b3f2ee8d.js +4 -0
- package/dist/esm/dom-665d6011.js +73 -0
- package/dist/esm/filter-item-type.enum-a79b2fa8.js +14 -0
- package/dist/esm/index-2b4d2d14.js +3262 -0
- package/dist/esm/index-5992b7e6.js +139 -0
- package/dist/esm/index-c683b2b0.js +2394 -0
- package/dist/esm/index-c71285cb.js +17 -0
- package/dist/esm/loader.js +19 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/sankhyablocks.js +117 -5
- package/dist/esm/shadow-css-b18e99d7.js +387 -0
- package/dist/esm/snk-application.entry.js +717 -147
- package/dist/esm/snk-crud.entry.js +66 -0
- package/dist/esm/snk-data-unit.entry.js +268 -0
- package/dist/esm/snk-filter-bar.entry.js +462 -0
- package/dist/esm/snk-filter-binary-select.entry.js +43 -0
- package/dist/esm/snk-filter-detail.entry.js +80 -0
- package/dist/esm/snk-filter-item.entry.js +173 -0
- package/dist/esm/snk-filter-list.entry.js +87 -0
- package/dist/esm/snk-filter-modal.entry.js +33 -0
- package/dist/esm/snk-filter-multi-select.entry.js +19 -0
- package/dist/esm/snk-filter-number.entry.js +20 -0
- package/dist/esm/snk-filter-period.entry.js +33 -0
- package/dist/esm/snk-filter-personalized.entry.js +85 -0
- package/dist/esm/snk-filter-search.entry.js +40 -0
- package/dist/esm/snk-filter-text.entry.js +18 -0
- package/dist/esm/snk-form.entry.js +129 -0
- package/dist/esm/snk-grid.entry.js +75 -0
- package/dist/esm/snk-pesquisa.entry.js +2 -2
- package/dist/esm/snk-taskbar.entry.js +156 -0
- package/dist/esm/taskbar-elements-35d64ff9.js +90 -0
- package/dist/esm/taskbar-processor-aa6772c9.js +45 -0
- package/dist/esm/teste-pesquisa.entry.js +2 -2
- package/dist/sankhyablocks/SnkMessageBuilder-35a20271.js +199 -0
- package/dist/sankhyablocks/app-globals-0f993ce5.js +3 -0
- package/dist/sankhyablocks/css-shim-b3f2ee8d.js +4 -0
- package/dist/sankhyablocks/dom-665d6011.js +73 -0
- package/dist/sankhyablocks/filter-item-type.enum-a79b2fa8.js +14 -0
- package/dist/sankhyablocks/index-2b4d2d14.js +3262 -0
- package/dist/sankhyablocks/index-5992b7e6.js +139 -0
- package/dist/sankhyablocks/index-c683b2b0.js +2394 -0
- package/dist/sankhyablocks/index-c71285cb.js +17 -0
- package/dist/sankhyablocks/index.esm.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +129 -1
- package/dist/sankhyablocks/shadow-css-b18e99d7.js +387 -0
- package/dist/sankhyablocks/snk-application.entry.js +8166 -0
- package/dist/sankhyablocks/snk-crud.entry.js +66 -0
- package/dist/sankhyablocks/snk-data-unit.entry.js +268 -0
- package/dist/sankhyablocks/snk-filter-bar.entry.js +462 -0
- package/dist/sankhyablocks/snk-filter-binary-select.entry.js +43 -0
- package/dist/sankhyablocks/snk-filter-detail.entry.js +80 -0
- package/dist/sankhyablocks/snk-filter-item.entry.js +173 -0
- package/dist/sankhyablocks/snk-filter-list.entry.js +87 -0
- package/dist/sankhyablocks/snk-filter-modal.entry.js +33 -0
- package/dist/sankhyablocks/snk-filter-multi-select.entry.js +19 -0
- package/dist/sankhyablocks/snk-filter-number.entry.js +20 -0
- package/dist/sankhyablocks/snk-filter-period.entry.js +33 -0
- package/dist/sankhyablocks/snk-filter-personalized.entry.js +85 -0
- package/dist/sankhyablocks/snk-filter-search.entry.js +40 -0
- package/dist/sankhyablocks/snk-filter-text.entry.js +18 -0
- package/dist/sankhyablocks/snk-form.entry.js +129 -0
- package/dist/sankhyablocks/snk-grid.entry.js +75 -0
- package/dist/sankhyablocks/snk-pesquisa.entry.js +311 -0
- package/dist/sankhyablocks/snk-taskbar.entry.js +156 -0
- package/dist/sankhyablocks/taskbar-elements-35d64ff9.js +90 -0
- package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +45 -0
- package/dist/sankhyablocks/teste-pesquisa.entry.js +33 -0
- package/dist/types/components/snk-application/errorhandler/snk-error-handler.d.ts +1 -0
- package/dist/types/components/snk-application/snk-application.d.ts +149 -16
- package/dist/types/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +14 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +23 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +12 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +11 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +16 -0
- package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +40 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +23 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +29 -0
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +12 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +84 -0
- package/dist/types/components.d.ts +744 -8
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +7 -6
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/totals-fetcher.d.ts +8 -0
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/lib/message/SnkMessageBuilder.d.ts +42 -0
- package/dist/types/lib/message/resources/snk-data-unit.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-form.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-taskbar.msg.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +15 -4
- package/loader/package.json +1 -0
- package/package.json +5 -5
- package/react/components.d.ts +0 -2
- package/react/components.js +0 -2
- package/react/components.js.map +1 -1
- package/dist/cjs/index-1133bc2a.js +0 -1235
- package/dist/esm/index-ffda6382.js +0 -1208
- package/dist/sankhyablocks/p-2a7b4cb3.entry.js +0 -1
- package/dist/sankhyablocks/p-9520d78a.entry.js +0 -1
- package/dist/sankhyablocks/p-98e8490d.entry.js +0 -69
- package/dist/sankhyablocks/p-edcb9d8e.js +0 -2
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { F as FilterItemType } from './filter-item-type.enum.js';
|
|
3
|
+
|
|
4
|
+
const SnkFilterPeriod$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
this.__registerHost();
|
|
8
|
+
}
|
|
9
|
+
ezChangeListener() {
|
|
10
|
+
const start = this._startDate.value;
|
|
11
|
+
const end = this._endDate.value;
|
|
12
|
+
this.value = (start || end ? { start, end } : undefined);
|
|
13
|
+
}
|
|
14
|
+
getDate(prop) {
|
|
15
|
+
const objValue = this.value ? this.value[prop] : null;
|
|
16
|
+
if (objValue instanceof Date) {
|
|
17
|
+
return objValue;
|
|
18
|
+
}
|
|
19
|
+
if (typeof objValue === "string") {
|
|
20
|
+
let date = new Date(objValue);
|
|
21
|
+
date.setMinutes(date.getMinutes() + date.getTimezoneOffset());
|
|
22
|
+
return date;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
if (!this.config || this.config.type !== FilterItemType.PERIOD) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
return (h("div", { class: "ez-col ez-col--nowrap" }, h("ez-date-input", { label: this.config.label, ref: ref => this._startDate = ref, value: this.getDate("start") }), h("label", { class: "ez-text ez-text--medium ez-text--primary ez-margin--medium" }, "at\u00E9"), h("ez-date-input", { label: this.config.label, ref: ref => this._endDate = ref, value: this.getDate("end") })));
|
|
31
|
+
}
|
|
32
|
+
}, [0, "snk-filter-period", {
|
|
33
|
+
"config": [16],
|
|
34
|
+
"value": [8]
|
|
35
|
+
}, [[0, "ezChange", "ezChangeListener"]]]);
|
|
36
|
+
function defineCustomElement$1() {
|
|
37
|
+
if (typeof customElements === "undefined") {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const components = ["snk-filter-period"];
|
|
41
|
+
components.forEach(tagName => { switch (tagName) {
|
|
42
|
+
case "snk-filter-period":
|
|
43
|
+
if (!customElements.get(tagName)) {
|
|
44
|
+
customElements.define(tagName, SnkFilterPeriod$1);
|
|
45
|
+
}
|
|
46
|
+
break;
|
|
47
|
+
} });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const SnkFilterPeriod = SnkFilterPeriod$1;
|
|
51
|
+
const defineCustomElement = defineCustomElement$1;
|
|
52
|
+
|
|
53
|
+
export { SnkFilterPeriod, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkFilterPersonalized extends Components.SnkFilterPersonalized, HTMLElement {}
|
|
4
|
+
export const SnkFilterPersonalized: {
|
|
5
|
+
prototype: SnkFilterPersonalized;
|
|
6
|
+
new (): SnkFilterPersonalized;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { U as UserInterface, c as convertType, A as ApplicationContext } from './index2.js';
|
|
3
|
+
import { F as FilterItemType } from './filter-item-type.enum.js';
|
|
4
|
+
|
|
5
|
+
const SnkFilterPersonalized$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
}
|
|
10
|
+
getValue(param, index) {
|
|
11
|
+
if (this.value && index >= 0 && index < this.value.length) {
|
|
12
|
+
const rawValue = this.value[index];
|
|
13
|
+
if (param.type === UserInterface.SEARCH) {
|
|
14
|
+
return rawValue;
|
|
15
|
+
}
|
|
16
|
+
return convertType(param.dataType, rawValue);
|
|
17
|
+
}
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
setValue(index, value) {
|
|
21
|
+
if (this.value == undefined) {
|
|
22
|
+
this.value = Array(index).fill(null);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
this.value = [...this.value];
|
|
26
|
+
}
|
|
27
|
+
this.value[index] = value;
|
|
28
|
+
if (this.value.filter(item => item != undefined).length == 0) {
|
|
29
|
+
this.value = null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
doSearch(mode, argument, param) {
|
|
33
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
34
|
+
if (this.fix) {
|
|
35
|
+
this.fix();
|
|
36
|
+
}
|
|
37
|
+
return new Promise((resolve, reject) => {
|
|
38
|
+
application.executePreparedSearch(mode, argument, param.searchContext)
|
|
39
|
+
.then(result => {
|
|
40
|
+
resolve(result);
|
|
41
|
+
if (this.unfix) {
|
|
42
|
+
this.unfix();
|
|
43
|
+
}
|
|
44
|
+
}).catch(reason => {
|
|
45
|
+
reject(reason);
|
|
46
|
+
if (this.unfix) {
|
|
47
|
+
this.unfix();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
getParamsInterface() {
|
|
53
|
+
var _a, _b, _c;
|
|
54
|
+
const params = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.personalizedFilter) === null || _c === void 0 ? void 0 : _c.parameters;
|
|
55
|
+
return params.map((param, index) => {
|
|
56
|
+
var _a;
|
|
57
|
+
switch (param.type) {
|
|
58
|
+
case UserInterface.SEARCH:
|
|
59
|
+
return h("ez-search", { suppressEmptyOption: true, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail), label: param.label, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, param) });
|
|
60
|
+
case UserInterface.SWITCH:
|
|
61
|
+
case UserInterface.CHECKBOX:
|
|
62
|
+
const mode = UserInterface.SWITCH === param.type ? "switch" : "regular";
|
|
63
|
+
return h("ez-check", { class: "ez-padding-bottom--medium", mode: mode, value: this.getValue(param, index), label: param.label, onEzChange: evt => this.setValue(index, evt.detail) });
|
|
64
|
+
case UserInterface.DECIMALNUMBER:
|
|
65
|
+
case UserInterface.INTEGERNUMBER:
|
|
66
|
+
return h("ez-number-input", { label: param.label, value: this.getValue(param, index), precision: (_a = param.props) === null || _a === void 0 ? void 0 : _a.precision, onEzChange: evt => this.setValue(index, evt.detail) });
|
|
67
|
+
case UserInterface.OPTIONSELECTOR:
|
|
68
|
+
return h("ez-combo-box", { label: param.label, value: this.getValue(param, index), options: param.options, onEzChange: evt => { var _a; return this.setValue(index, (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); } });
|
|
69
|
+
case UserInterface.DATE:
|
|
70
|
+
return h("ez-date-input", { label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
|
|
71
|
+
case UserInterface.DATETIME:
|
|
72
|
+
return h("ez-date-time-input", { label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
|
|
73
|
+
default:
|
|
74
|
+
return h("ez-text-input", { label: param.label, value: this.getValue(param, index), onEzChange: evt => this.setValue(index, evt.detail) });
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
if (!this.config || this.config.type !== FilterItemType.PERSONALIZED) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
return (h(Host, null, this.getParamsInterface()));
|
|
83
|
+
}
|
|
84
|
+
}, [0, "snk-filter-personalized", {
|
|
85
|
+
"config": [16],
|
|
86
|
+
"value": [1040],
|
|
87
|
+
"fix": [16],
|
|
88
|
+
"unfix": [16]
|
|
89
|
+
}]);
|
|
90
|
+
function defineCustomElement$1() {
|
|
91
|
+
if (typeof customElements === "undefined") {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const components = ["snk-filter-personalized"];
|
|
95
|
+
components.forEach(tagName => { switch (tagName) {
|
|
96
|
+
case "snk-filter-personalized":
|
|
97
|
+
if (!customElements.get(tagName)) {
|
|
98
|
+
customElements.define(tagName, SnkFilterPersonalized$1);
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
} });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const SnkFilterPersonalized = SnkFilterPersonalized$1;
|
|
105
|
+
const defineCustomElement = defineCustomElement$1;
|
|
106
|
+
|
|
107
|
+
export { SnkFilterPersonalized, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkFilterSearch extends Components.SnkFilterSearch, HTMLElement {}
|
|
4
|
+
export const SnkFilterSearch: {
|
|
5
|
+
prototype: SnkFilterSearch;
|
|
6
|
+
new (): SnkFilterSearch;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { A as ApplicationContext } from './index2.js';
|
|
3
|
+
import { F as FilterItemType } from './filter-item-type.enum.js';
|
|
4
|
+
|
|
5
|
+
const SnkFilterSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
}
|
|
10
|
+
ezChangeListener(_evt) {
|
|
11
|
+
this.value = this._searchInput.value;
|
|
12
|
+
}
|
|
13
|
+
doSearch(mode, argument) {
|
|
14
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
15
|
+
if (this.fix) {
|
|
16
|
+
this.fix();
|
|
17
|
+
}
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
application.executePreparedSearch(mode, argument, this.config.props.searchContext)
|
|
20
|
+
.then(result => {
|
|
21
|
+
resolve(result);
|
|
22
|
+
if (this.unfix) {
|
|
23
|
+
this.unfix();
|
|
24
|
+
}
|
|
25
|
+
}).catch(reason => {
|
|
26
|
+
reject(reason);
|
|
27
|
+
if (this.unfix) {
|
|
28
|
+
this.unfix();
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
if (!this.config || this.config.type !== FilterItemType.SEARCH) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
return (h("ez-search", { suppressEmptyOption: true, value: this.config.value, label: this.config.label, ref: ref => this._searchInput = ref, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument) }));
|
|
38
|
+
}
|
|
39
|
+
}, [0, "snk-filter-search", {
|
|
40
|
+
"config": [16],
|
|
41
|
+
"value": [16],
|
|
42
|
+
"fix": [16],
|
|
43
|
+
"unfix": [16]
|
|
44
|
+
}, [[0, "ezChange", "ezChangeListener"]]]);
|
|
45
|
+
function defineCustomElement$1() {
|
|
46
|
+
if (typeof customElements === "undefined") {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const components = ["snk-filter-search"];
|
|
50
|
+
components.forEach(tagName => { switch (tagName) {
|
|
51
|
+
case "snk-filter-search":
|
|
52
|
+
if (!customElements.get(tagName)) {
|
|
53
|
+
customElements.define(tagName, SnkFilterSearch$1);
|
|
54
|
+
}
|
|
55
|
+
break;
|
|
56
|
+
} });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const SnkFilterSearch = SnkFilterSearch$1;
|
|
60
|
+
const defineCustomElement = defineCustomElement$1;
|
|
61
|
+
|
|
62
|
+
export { SnkFilterSearch, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkFilterText extends Components.SnkFilterText, HTMLElement {}
|
|
4
|
+
export const SnkFilterText: {
|
|
5
|
+
prototype: SnkFilterText;
|
|
6
|
+
new (): SnkFilterText;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const SnkFilterText$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.__registerHost();
|
|
7
|
+
}
|
|
8
|
+
ezChangeListener(evt) {
|
|
9
|
+
this.value = evt.detail;
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
if (!this.config) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
return (h("ez-text-input", { label: this.config.label, value: this.config.value }));
|
|
16
|
+
}
|
|
17
|
+
}, [0, "snk-filter-text", {
|
|
18
|
+
"config": [16],
|
|
19
|
+
"value": [1]
|
|
20
|
+
}, [[0, "ezChange", "ezChangeListener"]]]);
|
|
21
|
+
function defineCustomElement$1() {
|
|
22
|
+
if (typeof customElements === "undefined") {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const components = ["snk-filter-text"];
|
|
26
|
+
components.forEach(tagName => { switch (tagName) {
|
|
27
|
+
case "snk-filter-text":
|
|
28
|
+
if (!customElements.get(tagName)) {
|
|
29
|
+
customElements.define(tagName, SnkFilterText$1);
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
} });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const SnkFilterText = SnkFilterText$1;
|
|
36
|
+
const defineCustomElement = defineCustomElement$1;
|
|
37
|
+
|
|
38
|
+
export { SnkFilterText, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkForm extends Components.SnkForm, HTMLElement {}
|
|
4
|
+
export const SnkForm: {
|
|
5
|
+
prototype: SnkForm;
|
|
6
|
+
new (): SnkForm;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { A as ApplicationContext } from './index2.js';
|
|
3
|
+
import { T as TaskbarProcessor } from './taskbar-processor.js';
|
|
4
|
+
import { d as defineCustomElement$1 } from './snk-taskbar2.js';
|
|
5
|
+
|
|
6
|
+
const snkFormCss = ".sc-snk-form-h{display:block}.snk-form.sc-snk-form{position:relative;padding:var(--space--large);padding-top:var(--space--medium)}.snk-form__header.sc-snk-form{position:relative;padding-top:var(--space--medium);padding-bottom:var(--space--medium);margin-bottom:var(--space--medium)}.snk-form__header--fixed.sc-snk-form{position:sticky;top:0;background:var(--background--body);z-index:var(--more-visible, 2);padding-left:var(--space--large);padding-right:var(--space--large);margin-left:calc(var(--space--large) * -1);margin-right:calc(var(--space--large) * -1);width:calc(100% + (var(--space--large) * 2))}";
|
|
7
|
+
|
|
8
|
+
const SnkForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.exit = createEvent(this, "exit", 7);
|
|
13
|
+
this.actionClick = createEvent(this, "actionClick", 7);
|
|
14
|
+
this._taskbarProcessor = new TaskbarProcessor({
|
|
15
|
+
"snkForm.regular": ["PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "GRID_MODE", "INSERT"],
|
|
16
|
+
"snkForm.finish_edition": ["CANCEL", "SAVE"]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
getFormConfig() {
|
|
20
|
+
return (this._dataState && this._dataState.insertionMode ? this._insertionFormConfig : this._editionFormConfig);
|
|
21
|
+
}
|
|
22
|
+
getInsertionHiddenFields(formConfig) {
|
|
23
|
+
const hiddenFields = [];
|
|
24
|
+
formConfig === null || formConfig === void 0 ? void 0 : formConfig.forEach(cfg => {
|
|
25
|
+
const def = this._dataUnit.getField(cfg.name);
|
|
26
|
+
if (def === null || def === void 0 ? void 0 : def.readOnly) {
|
|
27
|
+
hiddenFields.push(cfg.name);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return hiddenFields;
|
|
31
|
+
}
|
|
32
|
+
exitForm() {
|
|
33
|
+
if (this._dataUnit.isDirty()) {
|
|
34
|
+
this._dataUnit.cancelEdition({ after: () => this.exit.emit() });
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this.exit.emit();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
getDisabledButtons() {
|
|
41
|
+
const disabled = [];
|
|
42
|
+
if (!this._dataState.hasPrevious) {
|
|
43
|
+
disabled.push("PREVIOUS");
|
|
44
|
+
}
|
|
45
|
+
if (!this._dataState.hasNext) {
|
|
46
|
+
disabled.push("NEXT");
|
|
47
|
+
}
|
|
48
|
+
return disabled;
|
|
49
|
+
}
|
|
50
|
+
loadInsertionConfig() {
|
|
51
|
+
if (this._dataUnit && this._configLoaded) {
|
|
52
|
+
this._insertionFormConfig = this._editionFormConfig.filter(fieldCfg => {
|
|
53
|
+
const def = this._dataUnit.getField(fieldCfg.name);
|
|
54
|
+
if (def === null || def === void 0 ? void 0 : def.readOnly) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
63
|
+
* através de um pequeno modulo na estrutura da aplicação:
|
|
64
|
+
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
65
|
+
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-form.msg.ts"
|
|
66
|
+
*/
|
|
67
|
+
getMessage(key) {
|
|
68
|
+
return this._application.messagesBuilder.getMessage(key, this.getMessageParams());
|
|
69
|
+
}
|
|
70
|
+
getMessageParams() {
|
|
71
|
+
var _a;
|
|
72
|
+
return ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectedRecords) ? this._dataState.selectedRecords[0] : undefined;
|
|
73
|
+
}
|
|
74
|
+
componentWillLoad() {
|
|
75
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
76
|
+
if (this._application) {
|
|
77
|
+
this._application.loadFormConfig(this.configName).then(cfg => {
|
|
78
|
+
this._configLoaded = true;
|
|
79
|
+
this._editionFormConfig = cfg;
|
|
80
|
+
this.loadInsertionConfig();
|
|
81
|
+
});
|
|
82
|
+
//Forçamos a carga dos acessos pra aproveitar a request inicial.
|
|
83
|
+
this._application.getAllAccess();
|
|
84
|
+
}
|
|
85
|
+
let parent = this._element.parentElement;
|
|
86
|
+
while (parent) {
|
|
87
|
+
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
88
|
+
this._snkDataUnit = parent;
|
|
89
|
+
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
90
|
+
this._dataState = this._snkDataUnit.dataState;
|
|
91
|
+
if (this._dataUnit) {
|
|
92
|
+
this.loadInsertionConfig();
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
96
|
+
this._dataUnit = evt.detail;
|
|
97
|
+
this.loadInsertionConfig();
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
|
|
101
|
+
this._dataState = evt.detail;
|
|
102
|
+
});
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
parent = parent.parentElement;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
componentWillRender() {
|
|
109
|
+
var _a;
|
|
110
|
+
const taskbarId = ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "snkForm.finish_edition" : "snkForm.regular";
|
|
111
|
+
const disabledButtons = [];
|
|
112
|
+
if (!this._dataState || !this._dataState.hasPrevious) {
|
|
113
|
+
disabledButtons.push("PREVIOUS");
|
|
114
|
+
}
|
|
115
|
+
if (!this._dataState || !this._dataState.hasNext) {
|
|
116
|
+
disabledButtons.push("NEXT");
|
|
117
|
+
}
|
|
118
|
+
this._taskbarProcessor.process(taskbarId, this.taskbarManager, this._dataState, disabledButtons);
|
|
119
|
+
}
|
|
120
|
+
render() {
|
|
121
|
+
var _a;
|
|
122
|
+
if (!this._configLoaded || !this._dataUnit || !this._dataState) {
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
return (h("section", { class: "snk-form" }, h("div", { class: "snk-form__header snk-form__header--fixed ez-row" }, h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6", key: "formHeader" }, h("ez-button", { title: this.getMessage("snkForm.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small", onClick: () => this.exitForm() }), h("h1", { class: "ez-title ez-title--primary ez-title--xlarge ez-align--middle" }, this.getMessage("snkForm.title"))), h("div", { class: "ez-col ez-col--sd-6 ez-col--tb-6 ez-align--right" }, h("snk-taskbar", { key: "formTaskbar", buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, primaryButton: ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", dataUnit: this._dataUnit }))), h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { key: "ezForm" + this._snkDataUnit.entityName, dataUnit: this._dataUnit, config: this.getFormConfig(), recordsValidator: this.recordsValidator }))))));
|
|
126
|
+
}
|
|
127
|
+
get _element() { return this; }
|
|
128
|
+
static get style() { return snkFormCss; }
|
|
129
|
+
}, [2, "snk-form", {
|
|
130
|
+
"configName": [1, "config-name"],
|
|
131
|
+
"recordsValidator": [16],
|
|
132
|
+
"actionsList": [16],
|
|
133
|
+
"taskbarManager": [16],
|
|
134
|
+
"_dataUnit": [32],
|
|
135
|
+
"_configLoaded": [32],
|
|
136
|
+
"_dataState": [32],
|
|
137
|
+
"_editionFormConfig": [32],
|
|
138
|
+
"_insertionFormConfig": [32]
|
|
139
|
+
}]);
|
|
140
|
+
function defineCustomElement() {
|
|
141
|
+
if (typeof customElements === "undefined") {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const components = ["snk-form", "snk-taskbar"];
|
|
145
|
+
components.forEach(tagName => { switch (tagName) {
|
|
146
|
+
case "snk-form":
|
|
147
|
+
if (!customElements.get(tagName)) {
|
|
148
|
+
customElements.define(tagName, SnkForm);
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
case "snk-taskbar":
|
|
152
|
+
if (!customElements.get(tagName)) {
|
|
153
|
+
defineCustomElement$1();
|
|
154
|
+
}
|
|
155
|
+
break;
|
|
156
|
+
} });
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export { SnkForm as S, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkGrid extends Components.SnkGrid, HTMLElement {}
|
|
4
|
+
export const SnkGrid: {
|
|
5
|
+
prototype: SnkGrid;
|
|
6
|
+
new (): SnkGrid;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { A as ApplicationContext } from './index2.js';
|
|
3
|
+
import { T as TaskbarElement, d as defineCustomElement$1 } from './snk-taskbar2.js';
|
|
4
|
+
import { T as TaskbarProcessor } from './taskbar-processor.js';
|
|
5
|
+
import { d as defineCustomElement$6 } from './snk-filter-bar2.js';
|
|
6
|
+
import { d as defineCustomElement$5 } from './snk-filter-detail2.js';
|
|
7
|
+
import { d as defineCustomElement$4 } from './snk-filter-item2.js';
|
|
8
|
+
import { d as defineCustomElement$3 } from './snk-filter-list2.js';
|
|
9
|
+
import { d as defineCustomElement$2 } from './snk-filter-modal2.js';
|
|
10
|
+
|
|
11
|
+
const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--small)}";
|
|
12
|
+
|
|
13
|
+
const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.__registerHost();
|
|
17
|
+
this.actionClick = createEvent(this, "actionClick", 7);
|
|
18
|
+
this.gridDoubleClick = createEvent(this, "gridDoubleClick", 7);
|
|
19
|
+
this._topTaskbarProcessor = new TaskbarProcessor({
|
|
20
|
+
"snkGridTopTaskbar": ["FORM_MODE", "CONFIG_GRID", "INSERT"]
|
|
21
|
+
});
|
|
22
|
+
this._headerTaskbarProcessor = new TaskbarProcessor({
|
|
23
|
+
"snkGridHeaderTaskbar.unselected": ["REFRESH"],
|
|
24
|
+
"snkGridHeaderTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "REFRESH"]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
actionClickHandler(evt) {
|
|
28
|
+
if (evt.detail === TaskbarElement.CONFIG_GRID && this._grid) {
|
|
29
|
+
this._grid.openGridConfig();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
saveConfig(config) {
|
|
33
|
+
const snkApplication = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
34
|
+
if (snkApplication) {
|
|
35
|
+
snkApplication.saveGridConfig(config);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
componentWillLoad() {
|
|
39
|
+
const snkApplication = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
40
|
+
if (snkApplication) {
|
|
41
|
+
snkApplication.loadGridConfig(this.configName).then(cfg => {
|
|
42
|
+
this._gridConfig = cfg;
|
|
43
|
+
this._configLoaded = true;
|
|
44
|
+
});
|
|
45
|
+
//Forçamos a carga dos acessos pra aproveitar a request inicial.
|
|
46
|
+
snkApplication.getAllAccess();
|
|
47
|
+
}
|
|
48
|
+
let parent = this._element.parentElement;
|
|
49
|
+
while (parent) {
|
|
50
|
+
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
51
|
+
this._snkDataUnit = parent;
|
|
52
|
+
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
53
|
+
if (!this._dataUnit) {
|
|
54
|
+
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
55
|
+
this._dataUnit = evt.detail;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
this._snkDataUnit.addEventListener("dataStateChange", (evt) => {
|
|
59
|
+
this._dataState = evt.detail;
|
|
60
|
+
});
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
parent = parent.parentElement;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
componentWillRender() {
|
|
67
|
+
const headerTaskbarId = this._dataState && this._dataState.selectedRecords.length > 0 ? "snkGridHeaderTaskbar.selected" : "snkGridHeaderTaskbar.unselected";
|
|
68
|
+
this._headerTaskbarProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState);
|
|
69
|
+
this._topTaskbarProcessor.process("snkGridTopTaskbar", this.taskbarManager, this._dataState);
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
if (!this._configLoaded || !this._dataUnit) {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-padding-bottom--medium ez-margin-bottom--medium" }, h("snk-filter-bar", { dataUnit: this._dataUnit, class: "snk-grid__filter-bar ez-align--top", configName: this.configName }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", onActionClick: evt => this.actionClickHandler(evt), key: "topTaskbar", dataUnit: this._dataUnit, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: "INSERT" })), h("ez-grid", { ref: ref => this._grid = ref, dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: evt => { this.saveConfig(evt.detail); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver }, h("snk-taskbar", { dataUnit: this._dataUnit, buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" }))));
|
|
76
|
+
}
|
|
77
|
+
get _element() { return this; }
|
|
78
|
+
static get style() { return snkGridCss; }
|
|
79
|
+
}, [6, "snk-grid", {
|
|
80
|
+
"configName": [1, "config-name"],
|
|
81
|
+
"actionsList": [16],
|
|
82
|
+
"taskbarManager": [16],
|
|
83
|
+
"statusResolver": [16],
|
|
84
|
+
"_dataUnit": [32],
|
|
85
|
+
"_configLoaded": [32],
|
|
86
|
+
"_dataState": [32],
|
|
87
|
+
"_gridConfig": [32]
|
|
88
|
+
}]);
|
|
89
|
+
function defineCustomElement() {
|
|
90
|
+
if (typeof customElements === "undefined") {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const components = ["snk-grid", "snk-filter-bar", "snk-filter-detail", "snk-filter-item", "snk-filter-list", "snk-filter-modal", "snk-taskbar"];
|
|
94
|
+
components.forEach(tagName => { switch (tagName) {
|
|
95
|
+
case "snk-grid":
|
|
96
|
+
if (!customElements.get(tagName)) {
|
|
97
|
+
customElements.define(tagName, SnkGrid);
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
case "snk-filter-bar":
|
|
101
|
+
if (!customElements.get(tagName)) {
|
|
102
|
+
defineCustomElement$6();
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case "snk-filter-detail":
|
|
106
|
+
if (!customElements.get(tagName)) {
|
|
107
|
+
defineCustomElement$5();
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
case "snk-filter-item":
|
|
111
|
+
if (!customElements.get(tagName)) {
|
|
112
|
+
defineCustomElement$4();
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
case "snk-filter-list":
|
|
116
|
+
if (!customElements.get(tagName)) {
|
|
117
|
+
defineCustomElement$3();
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
case "snk-filter-modal":
|
|
121
|
+
if (!customElements.get(tagName)) {
|
|
122
|
+
defineCustomElement$2();
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
case "snk-taskbar":
|
|
126
|
+
if (!customElements.get(tagName)) {
|
|
127
|
+
defineCustomElement$1();
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
} });
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export { SnkGrid as S, defineCustomElement as d };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { ObjectUtils, StringUtils } from '
|
|
2
|
+
import { O as ObjectUtils, S as StringUtils } from './index2.js';
|
|
3
3
|
|
|
4
4
|
const snkPesquisaCss = ".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__content-scrollbar--background-color-primary:var(--scrollbar--primary, #2B3A54);--snk-pesquisa__content-scrollbar--background-color-secondary:var(--scrollbar--secondary, #E5EAF0);--snk-pesquisa__content-scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__content-scrollbar--width:var(--space--medium, 12px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);max-height:100%;height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__content-scrollbar--background-color-primary) var(--snk-pesquisa__content-scrollbar--background-color-secondary);padding-right:var(--snk-pesquisa__content--padding-right)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__content-scrollbar--background-color-secondary);border-radius:var(--snk-pesquisa__content-scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__content-scrollbar--background-color-primary);border-radius:var(--snk-pesquisa__content-scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__content-scrollbar--background-color-secondary);width:var(--snk-pesquisa__content-scrollbar--width);max-width:var(--snk-pesquisa__content-scrollbar--width);min-width:var(--snk-pesquisa__content-scrollbar--width)}.snk-pesquisa__records.sc-snk-pesquisa{font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);color:var(--snk-pesquisa__records--color);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}";
|
|
5
5
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkTaskbar extends Components.SnkTaskbar, HTMLElement {}
|
|
4
|
+
export const SnkTaskbar: {
|
|
5
|
+
prototype: SnkTaskbar;
|
|
6
|
+
new (): SnkTaskbar;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|