@sankhyalabs/sankhyablocks 5.5.0 → 5.7.0
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-26da04f7.js → SnkMessageBuilder-056d1c24.js} +23 -1
- package/dist/cjs/{filter-item-type.enum-3daf58d3.js → filter-item-type.enum-aa823a00.js} +1 -0
- package/dist/cjs/filter-type.enum-b14ce507.js +11 -0
- package/dist/cjs/index-8d94b7e0.js +7 -0
- package/dist/cjs/index-de79181a.js +201 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/presentationMode-52ec3bdd.js +7 -0
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-attach.cjs.entry.js +2 -1
- package/dist/cjs/snk-crud.cjs.entry.js +2 -1
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-c43df27b.js → snk-data-unit-289081c4.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +4 -3
- package/dist/cjs/snk-expression-item.cjs.entry.js +213 -0
- package/dist/cjs/snk-filter-bar.cjs.entry.js +52 -140
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +8 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +435 -0
- package/dist/cjs/snk-filter-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +66 -0
- package/dist/cjs/snk-filter-modal.cjs.entry.js +72 -49
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +11 -2
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-search.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +2 -0
- package/dist/cjs/snk-grid.cjs.entry.js +3 -2
- package/dist/cjs/{snk-guides-viewer-e6a65393.js → snk-guides-viewer-9784c527.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -2
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +126 -0
- package/dist/cjs/snk-simple-bar_2.cjs.entry.js +2 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -1
- package/dist/cjs/taskbar-elements-bc2598f9.js +118 -0
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/enum/presentationMode.js +5 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +47 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +50 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +19 -0
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +1 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +31 -2
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +116 -156
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.css +4 -0
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +115 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +19 -142
- package/dist/collection/components/snk-filter-bar/types/filter-type.enum.js +7 -0
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +36 -0
- package/dist/collection/components/snk-filter-bar/utils/filters-mock.js +315 -0
- package/dist/collection/components/snk-filter-field-search/snk-filter-field-search.js +62 -69
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.css +4 -0
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +87 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.js +34 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.css +97 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.js +298 -0
- package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js +2 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +63 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +2 -0
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +9 -1
- package/dist/collection/lib/message/resources/snk-personalized-filter.msg.js +12 -0
- package/dist/collection/lib/store/index.js +2 -1
- package/dist/components/SnkMessageBuilder.js +23 -1
- package/dist/components/filter-item-type.enum.js +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index2.js +1 -1
- package/dist/components/index3.js +199 -0
- package/dist/components/presentationMode.js +7 -0
- package/dist/components/snk-crud.js +22 -34
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-detail-view2.js +24 -46
- package/dist/components/snk-expression-item.d.ts +11 -0
- package/dist/components/snk-expression-item.js +6 -0
- package/dist/components/snk-expression-item2.js +241 -0
- package/dist/components/snk-filter-bar2.js +57 -157
- package/dist/components/snk-filter-binary-select.js +9 -1
- package/dist/components/snk-filter-field-search.js +1 -200
- package/dist/{esm/snk-filter-field-search.entry.js → components/snk-filter-field-search2.js} +65 -38
- package/dist/components/snk-filter-list.js +171 -1
- package/dist/components/snk-filter-modal-item.d.ts +11 -0
- package/dist/components/snk-filter-modal-item.js +6 -0
- package/dist/components/snk-filter-modal-item2.js +85 -0
- package/dist/components/snk-filter-modal.js +118 -1
- package/dist/components/snk-filter-multi-select.js +3 -1
- package/dist/components/snk-filter-number.js +3 -1
- package/dist/components/snk-filter-param-config.js +1 -273
- package/dist/{esm/snk-filter-param-config.entry.js → components/snk-filter-param-config2.js} +35 -11
- package/dist/components/snk-filter-period.js +12 -2
- package/dist/components/snk-filter-personalized.js +3 -1
- package/dist/components/snk-filter-search.js +3 -1
- package/dist/components/snk-filter-text.js +3 -1
- package/dist/components/snk-grid2.js +12 -23
- package/dist/components/snk-personalized-filter.d.ts +11 -0
- package/dist/components/snk-personalized-filter.js +158 -0
- package/dist/components/snk-taskbar2.js +3 -197
- package/dist/esm/{SnkMessageBuilder-7a9392e6.js → SnkMessageBuilder-23272e07.js} +23 -1
- package/dist/esm/{filter-item-type.enum-a79b2fa8.js → filter-item-type.enum-5028ed3f.js} +1 -0
- package/dist/esm/filter-type.enum-a80c1b6b.js +9 -0
- package/dist/esm/{index-6519a79e.js → index-507e19ec.js} +1 -1
- package/dist/esm/index-620ac460.js +7 -0
- package/dist/esm/index-8efbf198.js +199 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/presentationMode-783bbf9d.js +7 -0
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-attach.entry.js +3 -2
- package/dist/esm/snk-crud.entry.js +3 -2
- package/dist/esm/snk-data-exporter.entry.js +3 -3
- package/dist/esm/{snk-data-unit-f9e4c694.js → snk-data-unit-34dc5371.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +5 -4
- package/dist/esm/snk-expression-item.entry.js +209 -0
- package/dist/esm/snk-filter-bar.entry.js +53 -141
- package/dist/esm/snk-filter-binary-select.entry.js +9 -2
- package/dist/esm/snk-filter-detail.entry.js +1 -1
- package/dist/esm/snk-filter-field-search_2.entry.js +430 -0
- package/dist/esm/snk-filter-item.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +62 -0
- package/dist/esm/snk-filter-modal.entry.js +73 -50
- package/dist/esm/snk-filter-multi-select.entry.js +4 -2
- package/dist/esm/snk-filter-number.entry.js +4 -2
- package/dist/esm/snk-filter-period.entry.js +12 -3
- package/dist/esm/snk-filter-personalized.entry.js +4 -2
- package/dist/esm/snk-filter-search.entry.js +4 -2
- package/dist/esm/snk-filter-text.entry.js +3 -1
- package/dist/esm/snk-grid.entry.js +3 -2
- package/dist/esm/{snk-guides-viewer-62a9f74d.js → snk-guides-viewer-4d12f268.js} +2 -2
- package/dist/esm/snk-guides-viewer.entry.js +4 -3
- package/dist/esm/snk-personalized-filter.entry.js +122 -0
- package/dist/esm/snk-simple-bar_2.entry.js +3 -2
- package/dist/esm/snk-taskbar.entry.js +3 -2
- package/dist/esm/taskbar-elements-e6af3e93.js +115 -0
- package/dist/sankhyablocks/p-0110b7da.entry.js +1 -0
- package/dist/sankhyablocks/p-1a68fb59.js +1 -0
- package/dist/sankhyablocks/p-27e264d9.entry.js +1 -0
- package/dist/sankhyablocks/p-343699ad.entry.js +1 -0
- package/dist/sankhyablocks/{p-f2223502.js → p-3db1d3de.js} +1 -1
- package/dist/sankhyablocks/p-433dfa63.entry.js +1 -0
- package/dist/sankhyablocks/p-45ee8b22.entry.js +1 -0
- package/dist/sankhyablocks/{p-f132e371.js → p-4c2015a9.js} +1 -1
- package/dist/sankhyablocks/p-4ce96831.entry.js +1 -0
- package/dist/sankhyablocks/p-4eefe631.entry.js +1 -0
- package/dist/sankhyablocks/{p-9dd2b8cb.js → p-584d7212.js} +1 -1
- package/dist/sankhyablocks/{p-a412992c.entry.js → p-64b03506.entry.js} +1 -1
- package/dist/sankhyablocks/p-6a02e236.js +1 -0
- package/dist/sankhyablocks/p-7695c404.entry.js +1 -0
- package/dist/sankhyablocks/p-786ae316.entry.js +1 -0
- package/dist/sankhyablocks/p-82bc97da.entry.js +1 -0
- package/dist/sankhyablocks/p-8bdf5e57.entry.js +1 -0
- package/dist/sankhyablocks/p-8efb0f47.entry.js +1 -0
- package/dist/sankhyablocks/p-9af04fc7.entry.js +1 -0
- package/dist/sankhyablocks/{p-3a2ce158.entry.js → p-a1c58536.entry.js} +1 -1
- package/dist/sankhyablocks/{p-afba9bbe.entry.js → p-bdbb2672.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b2523981.entry.js → p-c1ab16d0.entry.js} +2 -2
- package/dist/sankhyablocks/{p-aeffd219.js → p-ccd26e3a.js} +1 -1
- package/dist/sankhyablocks/p-d410f45a.js +1 -0
- package/dist/sankhyablocks/p-d9804798.js +1 -0
- package/dist/sankhyablocks/p-df8f13b4.entry.js +1 -0
- package/dist/sankhyablocks/p-e2bb9c9a.entry.js +1 -0
- package/dist/sankhyablocks/p-e9f42525.entry.js +1 -0
- package/dist/sankhyablocks/p-ed3d6ab4.entry.js +1 -0
- package/dist/sankhyablocks/p-ee1381f4.entry.js +1 -0
- package/dist/sankhyablocks/p-f4184ce7.js +1 -0
- package/dist/sankhyablocks/p-f5f36fbb.js +1 -0
- package/dist/sankhyablocks/p-fd4ed40a.entry.js +1 -0
- package/dist/sankhyablocks/p-ff96b509.entry.js +27 -0
- package/dist/sankhyablocks/p-ffac37d5.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/editors/enum/presentationMode.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +5 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +2 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +3 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +37 -0
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +17 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +2 -11
- package/dist/types/components/snk-filter-bar/types/filter-type.enum.d.ts +6 -0
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +20 -0
- package/dist/types/components/snk-filter-bar/utils/filters-mock.d.ts +186 -0
- package/dist/types/components/snk-filter-field-search/interfaces/index.d.ts +14 -4
- package/dist/types/components/snk-filter-field-search/snk-filter-field-search.d.ts +13 -10
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +20 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/filter-operands/filter-operands.d.ts +9 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-expression-item/snk-expression-item.d.ts +54 -0
- package/dist/types/components/snk-personalized-filter/subcomponents/snk-filter-param-config/interfaces/IExpressionItem.d.ts +4 -2
- package/dist/types/components.d.ts +196 -63
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +7 -0
- package/dist/types/lib/message/resources/snk-personalized-filter.msg.d.ts +1 -0
- package/dist/types/lib/store/index.d.ts +1 -0
- package/package.json +1 -1
- package/react/components.d.ts +3 -0
- package/react/components.js +3 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/snk-filter-field-search.cjs.entry.js +0 -185
- package/dist/cjs/snk-filter-param-config.cjs.entry.js +0 -256
- package/dist/cjs/taskbar-elements-80285601.js +0 -313
- package/dist/components/snk-filter-list2.js +0 -173
- package/dist/components/snk-filter-modal2.js +0 -97
- package/dist/esm/taskbar-elements-055ba1ad.js +0 -309
- package/dist/sankhyablocks/p-4512cc6c.entry.js +0 -1
- package/dist/sankhyablocks/p-5cbbe1f7.entry.js +0 -1
- package/dist/sankhyablocks/p-5e62a17b.entry.js +0 -1
- package/dist/sankhyablocks/p-5fc55684.entry.js +0 -1
- package/dist/sankhyablocks/p-63d01871.entry.js +0 -1
- package/dist/sankhyablocks/p-73e830cf.entry.js +0 -1
- package/dist/sankhyablocks/p-741b00ef.entry.js +0 -1
- package/dist/sankhyablocks/p-79d22df0.entry.js +0 -1
- package/dist/sankhyablocks/p-86d29b6f.entry.js +0 -1
- package/dist/sankhyablocks/p-92a0fca4.js +0 -1
- package/dist/sankhyablocks/p-93d8fe00.entry.js +0 -1
- package/dist/sankhyablocks/p-999d1953.entry.js +0 -1
- package/dist/sankhyablocks/p-ad51bf1c.entry.js +0 -1
- package/dist/sankhyablocks/p-c336170d.entry.js +0 -1
- package/dist/sankhyablocks/p-c3efd4eb.entry.js +0 -1
- package/dist/sankhyablocks/p-d5c9c1f8.entry.js +0 -1
- package/dist/sankhyablocks/p-ebe876f5.entry.js +0 -1
- package/dist/sankhyablocks/p-ed438690.js +0 -1
- package/dist/sankhyablocks/p-ee82c157.entry.js +0 -1
- package/dist/sankhyablocks/p-f3d0c744.entry.js +0 -1
- package/dist/sankhyablocks/p-fac37198.entry.js +0 -1
@@ -0,0 +1,213 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index$1 = require('./index-21bd01e1.js');
|
6
|
+
const core = require('@sankhyalabs/core');
|
7
|
+
const index$3 = require('./index-8d94b7e0.js');
|
8
|
+
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
9
|
+
const FieldBuilder = require('@sankhyalabs/ezui/dist/collection/components/ez-form-view/fieldbuilder/FieldBuilder');
|
10
|
+
const index = require('./index-f400b1d6.js');
|
11
|
+
const index$2 = require('./index-de79181a.js');
|
12
|
+
|
13
|
+
const FilterOperandDefault = [
|
14
|
+
{ value: index.FilterOperand.EQUAL, label: "Igual (=)" },
|
15
|
+
{ value: index.FilterOperand.DIFFERENT, label: "Diferente (<>)" },
|
16
|
+
{ value: index.FilterOperand.LIKE, label: "Contendo (LIKE)" },
|
17
|
+
{ value: index.FilterOperand.IN, label: "Contido em (IN)" },
|
18
|
+
{ value: index.FilterOperand.START_WITH, label: "Iniciado com (%?)" },
|
19
|
+
{ value: index.FilterOperand.FINISHED_WITH, label: "Terminado com (?%)" },
|
20
|
+
{ value: index.FilterOperand.NULL, label: "Vazio (NULL)" },
|
21
|
+
{ value: index.FilterOperand.NOT_NULL, label: "Não Vazio (NOT NULL)" },
|
22
|
+
{ value: index.FilterOperand.LARGER, label: "Maior (>)" },
|
23
|
+
{ value: index.FilterOperand.LARGER_EQUAL, label: "Maior ou Igual (>=)" },
|
24
|
+
{ value: index.FilterOperand.SMALLER, label: "Menor (<)" },
|
25
|
+
{ value: index.FilterOperand.SMALLER_EQUAL, label: "Menor ou Igual (<=)" }
|
26
|
+
];
|
27
|
+
const FilterOperandTypeTextSearch = [
|
28
|
+
{ value: index.FilterOperand.EQUAL, label: "Igual (=)" },
|
29
|
+
{ value: index.FilterOperand.DIFFERENT, label: "Diferente (<>)" },
|
30
|
+
{ value: index.FilterOperand.LIKE, label: "Contendo (LIKE)" },
|
31
|
+
{ value: index.FilterOperand.IN, label: "Contido em (IN)" },
|
32
|
+
{ value: index.FilterOperand.START_WITH, label: "Iniciado com (%?)" },
|
33
|
+
{ value: index.FilterOperand.FINISHED_WITH, label: "Terminado com (?%)" },
|
34
|
+
{ value: index.FilterOperand.NULL, label: "Vazio (NULL)" },
|
35
|
+
{ value: index.FilterOperand.NOT_NULL, label: "Não Vazio (NOT NULL)" }
|
36
|
+
];
|
37
|
+
const FIELD_TYPE_SEARCH_AND_TEXT = [
|
38
|
+
core.UserInterface.SEARCH,
|
39
|
+
core.UserInterface.SHORTTEXT,
|
40
|
+
core.UserInterface.PASSWORD,
|
41
|
+
core.UserInterface.MASKEDTEXT,
|
42
|
+
core.UserInterface.LONGTEXT,
|
43
|
+
core.UserInterface.HTML
|
44
|
+
];
|
45
|
+
|
46
|
+
const snkExpressionItemCss = ".sc-snk-expression-item-h{display:flex;width:100%;--snk-expression-item--background-color:var(--background--xlight, #fff);--snk-expression-item__itens--padding:var(--space--small, 6px);--snk-expression-item__width--input-operator:220px;--snk-expression-item__width--input-value:240px;--snk-expression-item__width--input-value-variable:176px;--snk-expression-item--border-radius:var(--border--radius-medium, 12px);--snk-expression-item--border-color:var(--color--strokes, #DCE0E8);--snk-expression-item--border-style:var(--border--small, 1px solid)}.box.sc-snk-expression-item{width:100%;height:100%;background:var(--snk-expression-item--background-color);margin:var(--space--small, 6px);border:var(--snk-expression-item--border-color) var(--snk-expression-item--border-style);border-radius:var(--snk-expression-item--border-radius)}.box__container.sc-snk-expression-item{display:flex;align-items:center;justify-content:space-between;white-space:nowrap;margin:var(--space--small, 6px)}.box__container--input-filter.sc-snk-expression-item{width:100%}.box__container--input-operator.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-operator);min-width:var(--snk-expression-item__width--input-operator)}.box__container--input-value.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-value);min-width:var(--snk-expression-item__width--input-value)}.box__container--input-value-variable.sc-snk-expression-item{display:flex;width:var(--snk-expression-item__width--input-value-variable);min-width:var(--snk-expression-item__width--input-value-variable)}.box__container--button-delete.sc-snk-expression-item{display:flex}.box__container.sc-snk-expression-item>div.sc-snk-expression-item{padding-left:var(--snk-expression-item__itens--padding);padding-right:var(--snk-expression-item__itens--padding)}.box__container--button-delete--icon.sc-snk-expression-item{width:42px;min-width:42px}.box__container--input-value-variable--icon.sc-snk-expression-item{cursor:pointer}";
|
47
|
+
|
48
|
+
const SnkExpressionItem = class {
|
49
|
+
constructor(hostRef) {
|
50
|
+
index$1.registerInstance(this, hostRef);
|
51
|
+
this.ezFilterItemChange = index$1.createEvent(this, "ezFilterItemChange", 7);
|
52
|
+
this.ezFilterItemRemove = index$1.createEvent(this, "ezFilterItemRemove", 7);
|
53
|
+
this.application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
54
|
+
this.filterOperandDefault = FilterOperandDefault;
|
55
|
+
this.filterOperandTypeTextSearch = FilterOperandTypeTextSearch;
|
56
|
+
this._showValueVariable = false;
|
57
|
+
this._fieldSelected = undefined;
|
58
|
+
this._optionNotNull = false;
|
59
|
+
this.expression = undefined;
|
60
|
+
this.canRemove = true;
|
61
|
+
this.messagesBuilder = undefined;
|
62
|
+
}
|
63
|
+
expressionChanged(newValue, oldValue) {
|
64
|
+
if (newValue !== oldValue) {
|
65
|
+
this.ezFilterItemChange.emit(newValue);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
componentWillLoad() {
|
69
|
+
this._dataSourceFetcher = index$2.store.get("filterFieldsDataSource");
|
70
|
+
index$2.store.onChange('filterFieldsDataSource', () => {
|
71
|
+
this._dataSourceFetcher = index$2.store.get("filterFieldsDataSource");
|
72
|
+
});
|
73
|
+
}
|
74
|
+
setValueExpression(key, value) {
|
75
|
+
this.expression[key] = value;
|
76
|
+
this.expressionChanged(this.expression);
|
77
|
+
}
|
78
|
+
getMessage(key, params) {
|
79
|
+
return this.application.messagesBuilder.getMessage(key, params);
|
80
|
+
}
|
81
|
+
handleSelectItem(filterField) {
|
82
|
+
if (filterField.type === index$3.SelectedItemType.FIELD) {
|
83
|
+
const field = filterField;
|
84
|
+
this._fieldSelected = field;
|
85
|
+
this.setValueExpression("fieldName", field.name);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
handleFocus() {
|
89
|
+
if (this._elFilterFieldSearch)
|
90
|
+
this._elFilterFieldSearch.show();
|
91
|
+
}
|
92
|
+
handleChangeFilterInput(evt) {
|
93
|
+
this._elFilterFieldSearch.applyFilter(evt.detail);
|
94
|
+
}
|
95
|
+
handleChangeValueVariable(showValueVariable) {
|
96
|
+
this._showValueVariable = showValueVariable;
|
97
|
+
if (this._elFieldDynamic) {
|
98
|
+
this._elFieldDynamic.value = undefined;
|
99
|
+
this._elFieldDynamic.enabled = !showValueVariable;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
openSnkFilterParamConfig() {
|
103
|
+
var _a;
|
104
|
+
(_a = this._elFilterParamConfigRef) === null || _a === void 0 ? void 0 : _a.open(this.expression).then(this.onOpenPromiseReady.bind(this)).catch(error => {
|
105
|
+
console.error(error);
|
106
|
+
});
|
107
|
+
}
|
108
|
+
onOpenPromiseReady(changes) {
|
109
|
+
this.expression = changes;
|
110
|
+
}
|
111
|
+
buildOptionsOperator() {
|
112
|
+
var _a;
|
113
|
+
if (FIELD_TYPE_SEARCH_AND_TEXT.includes((_a = this._fieldSelected) === null || _a === void 0 ? void 0 : _a.userInterface)) {
|
114
|
+
return this.filterOperandTypeTextSearch;
|
115
|
+
}
|
116
|
+
else {
|
117
|
+
return this.filterOperandDefault;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
handleChangeOperator(optionSelected) {
|
121
|
+
this.checkOptionIsNull(optionSelected);
|
122
|
+
this.setValueExpression("operand", optionSelected);
|
123
|
+
}
|
124
|
+
checkOptionIsNull(optionSelected) {
|
125
|
+
if (optionSelected === index.FilterOperand.NULL || optionSelected === index.FilterOperand.NOT_NULL) {
|
126
|
+
this._optionNotNull = true;
|
127
|
+
if (this._elFieldDynamic) {
|
128
|
+
this._elFieldDynamic.enabled = false;
|
129
|
+
this._elFieldDynamic.value = undefined;
|
130
|
+
}
|
131
|
+
}
|
132
|
+
else {
|
133
|
+
this._optionNotNull = false;
|
134
|
+
if (this._elFieldDynamic) {
|
135
|
+
this._elFieldDynamic.enabled = this._showValueVariable ? false : true;
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}
|
139
|
+
confirmRemove(evt) {
|
140
|
+
evt.preventDefault();
|
141
|
+
evt.stopPropagation();
|
142
|
+
utils.ApplicationUtils.confirm(this.getMessage("snkPersonalizedFilter.confirm.title"), this.getMessage("snkPersonalizedFilter.confirm.description"))
|
143
|
+
.then((canRemove) => {
|
144
|
+
if (canRemove) {
|
145
|
+
this.ezFilterItemRemove.emit(this.expression);
|
146
|
+
}
|
147
|
+
});
|
148
|
+
}
|
149
|
+
buildFieldByType() {
|
150
|
+
var _a, _b;
|
151
|
+
if (!this._fieldSelected)
|
152
|
+
return;
|
153
|
+
const inputFieldData = (_a = FieldBuilder.fieldBuilder(this.configureFieldByType())) === null || _a === void 0 ? void 0 : _a.$children$.shift();
|
154
|
+
if (this._optionNotNull && inputFieldData || ((_b = this._elValueVariable) === null || _b === void 0 ? void 0 : _b.value) && inputFieldData) {
|
155
|
+
inputFieldData.$attrs$.enabled = false;
|
156
|
+
}
|
157
|
+
return index$1.h(inputFieldData.$tag$, Object.assign(Object.assign({}, inputFieldData.$attrs$), { ref: (el) => {
|
158
|
+
this._elFieldDynamic = el;
|
159
|
+
} }));
|
160
|
+
}
|
161
|
+
configureFieldByType() {
|
162
|
+
const field = {
|
163
|
+
userInterface: this._fieldSelected.userInterface,
|
164
|
+
name: this._fieldSelected.name,
|
165
|
+
label: this._fieldSelected.label,
|
166
|
+
canShowError: false
|
167
|
+
};
|
168
|
+
switch (field.userInterface) {
|
169
|
+
case core.UserInterface.OPTIONSELECTOR:
|
170
|
+
field.props = {
|
171
|
+
options: this._fieldSelected.properties.map(option => ({
|
172
|
+
value: option.value,
|
173
|
+
label: option.name,
|
174
|
+
})),
|
175
|
+
};
|
176
|
+
break;
|
177
|
+
case core.UserInterface.LONGTEXT:
|
178
|
+
field.rows = 1;
|
179
|
+
break;
|
180
|
+
case core.UserInterface.SEARCH:
|
181
|
+
field.optionLoader = searchArgument => this.setCriteriaSearch(searchArgument, this.application);
|
182
|
+
break;
|
183
|
+
}
|
184
|
+
return field;
|
185
|
+
}
|
186
|
+
setCriteriaSearch({ mode, argument }, application) {
|
187
|
+
if (application == undefined)
|
188
|
+
return;
|
189
|
+
const searchOptions = {
|
190
|
+
showInactives: false
|
191
|
+
};
|
192
|
+
const options = {
|
193
|
+
entity: this._fieldSelected.properties.ENTITYNAME,
|
194
|
+
searchOptions: searchOptions,
|
195
|
+
entityDescription: this._fieldSelected.label
|
196
|
+
};
|
197
|
+
return application.executePreparedSearch(mode, argument, options);
|
198
|
+
}
|
199
|
+
render() {
|
200
|
+
var _a;
|
201
|
+
return (index$1.h(index$1.Host, null, index$1.h("div", { class: "box" }, index$1.h("div", { class: "box__container" }, index$1.h("div", { class: "box__container--input-filter" }, index$1.h("ez-filter-input", { value: (_a = this._fieldSelected) === null || _a === void 0 ? void 0 : _a.path, label: this.getMessage("snkPersonalizedFilter.info.labelSearchField"), canShowError: false, onEzChange: (evt) => this.handleChangeFilterInput(evt), onFocus: () => this.handleFocus() }), index$1.h("snk-filter-field-search", { ref: ref => this._elFilterFieldSearch = ref, searchable: false, onEzSelectFilterItem: (ev) => this.handleSelectItem(ev.detail), fieldsDataSource: this._dataSourceFetcher })), index$1.h("div", { class: "box__container--input-operator" }, index$1.h("ez-combo-box", { label: this.getMessage("snkPersonalizedFilter.info.labelOperator"), canShowError: false, options: this.buildOptionsOperator(), onEzChange: (evt) => this.handleChangeOperator(evt.detail.value), suppressEmptyOption: true })), index$1.h("div", { class: "box__container--input-value" }, !this._fieldSelected ?
|
202
|
+
index$1.h("ez-number-input", { label: "Valor", canShowError: false, enabled: (!this._showValueVariable && !this._optionNotNull) }) :
|
203
|
+
this.buildFieldByType()), index$1.h("div", { class: "box__container--input-value-variable", title: this.getMessage("snkPersonalizedFilter.info.titleTooltip") }, !this._optionNotNull &&
|
204
|
+
index$1.h("ez-check", { ref: ref => this._elValueVariable = ref, label: this.getMessage("snkPersonalizedFilter.info.labelValueVarible"), mode: utils.CheckMode.SWITCH, onEzChange: (evt) => this.handleChangeValueVariable(evt.detail) }), (this._showValueVariable && !this._optionNotNull) &&
|
205
|
+
index$1.h("ez-icon", { class: "box__container--input-value-variable--icon", size: "large", iconName: "settings-inverted", onClick: () => this.openSnkFilterParamConfig() }), index$1.h("snk-filter-param-config", { ref: (el) => this._elFilterParamConfigRef = el, messagesBuilder: this.messagesBuilder })), index$1.h("div", { class: "box__container--button-delete" }, index$1.h("div", { class: "box__container--button-delete--icon" }, this.canRemove && index$1.h("ez-button", { mode: "icon", iconName: "delete", onClick: (evt) => this.confirmRemove(evt) })))))));
|
206
|
+
}
|
207
|
+
static get watchers() { return {
|
208
|
+
"expression": ["expressionChanged"]
|
209
|
+
}; }
|
210
|
+
};
|
211
|
+
SnkExpressionItem.style = snkExpressionItemCss;
|
212
|
+
|
213
|
+
exports.snk_expression_item = SnkExpressionItem;
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
|
8
|
-
const filterItemType_enum = require('./filter-item-type.enum-3daf58d3.js');
|
9
|
-
const ezModalContainer = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container');
|
10
|
-
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
11
8
|
const ConfigStorage = require('./ConfigStorage-91adf3fe.js');
|
9
|
+
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
10
|
+
const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
|
11
|
+
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
12
12
|
require('./form-config-fetcher-fa19680a.js');
|
13
13
|
require('./DataFetcher-a9d0228f.js');
|
14
14
|
require('./_commonjsHelpers-537d719a.js');
|
@@ -110,13 +110,43 @@ function buildPersonalized(item) {
|
|
110
110
|
};
|
111
111
|
}
|
112
112
|
|
113
|
+
class SnkFilterModalFactory {
|
114
|
+
constructor({ filterConfig, onComplete, getMessage }) {
|
115
|
+
this._filterConfig = filterConfig;
|
116
|
+
this._onComplete = onComplete;
|
117
|
+
this._getMessage = getMessage;
|
118
|
+
}
|
119
|
+
applyFilters(newFilterConfig) {
|
120
|
+
this._onComplete(newFilterConfig);
|
121
|
+
this._closeModal();
|
122
|
+
}
|
123
|
+
clearAll(filterConfigSnapshot) {
|
124
|
+
return filterConfigSnapshot.map(filterItem => (Object.assign(Object.assign({}, filterItem), { value: undefined })));
|
125
|
+
}
|
126
|
+
buildFilterModal() {
|
127
|
+
const filterModal = document.createElement("snk-filter-modal");
|
128
|
+
filterModal.filters = this._filterConfig;
|
129
|
+
filterModal.getMessage = this._getMessage.bind(this);
|
130
|
+
filterModal.applyFilters = this.applyFilters.bind(this);
|
131
|
+
filterModal.clearAll = this.clearAll.bind(this);
|
132
|
+
filterModal.closeModal = () => this._closeModal();
|
133
|
+
return filterModal;
|
134
|
+
}
|
135
|
+
async showModal() {
|
136
|
+
const filterModal = this.buildFilterModal();
|
137
|
+
const modalProps = {
|
138
|
+
content: filterModal,
|
139
|
+
position: 'left',
|
140
|
+
heightMode: 'full',
|
141
|
+
closeOutsideClick: false,
|
142
|
+
useScrimLight: true
|
143
|
+
};
|
144
|
+
this._closeModal = await utils.ApplicationUtils.showModal(modalProps);
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
113
148
|
const snkFilterBarCss = ".sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--most-visible, 3);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:\"\";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}";
|
114
149
|
|
115
|
-
const PERSONALIZED_FILTER = "PERSONALIZED_FILTER";
|
116
|
-
const DEFAULT_FILTER = "DEFAULT_FILTER";
|
117
|
-
const CLEAR_ALL_FILTERS = "CLEAR_ALL_FILTERS";
|
118
|
-
const ADD_FILTER = "ADD_FILTER";
|
119
|
-
const APPLIED_FILTERS = "APPLIED_FILTERS";
|
120
150
|
const SnkFilterBar = class {
|
121
151
|
constructor(hostRef) {
|
122
152
|
index.registerInstance(this, hostRef);
|
@@ -204,9 +234,9 @@ const SnkFilterBar = class {
|
|
204
234
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
205
235
|
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-filter-bar.msg.ts"
|
206
236
|
*/
|
207
|
-
getMessage(key, params) {
|
237
|
+
getMessage(key, params, defaultValue) {
|
208
238
|
var _a;
|
209
|
-
return (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params);
|
239
|
+
return ((_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, params)) || defaultValue;
|
210
240
|
}
|
211
241
|
getFilter(_dataUnit) {
|
212
242
|
var _a;
|
@@ -295,110 +325,6 @@ const SnkFilterBar = class {
|
|
295
325
|
return item;
|
296
326
|
}).sort((a, b) => this._filtersComparator(a, b));
|
297
327
|
}
|
298
|
-
getAddListItems() {
|
299
|
-
const hiddenItems = this.filterConfig
|
300
|
-
.filter(item => !item.visible && this.isListable(item));
|
301
|
-
const footerItems = [{ name: PERSONALIZED_FILTER, label: this.getMessage("snkFilterBar.customFilter"), iconName: "tune", kind: "FOOTER" }];
|
302
|
-
if (this.allowDefault) {
|
303
|
-
footerItems.push({ name: DEFAULT_FILTER, label: this.getMessage("snkFilterBar.defaultFilter"), iconName: "configuration", kind: "FOOTER" });
|
304
|
-
}
|
305
|
-
return hiddenItems.map(filter => { return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null }; })
|
306
|
-
.concat(footerItems);
|
307
|
-
}
|
308
|
-
getActiveClass() {
|
309
|
-
const filterApplied = this.filterConfig.filter(item => item.value != undefined).length > 0;
|
310
|
-
return filterApplied ? "sc-snk-filter-bar snk-filter-bar__filter-list-items-button--active" : "";
|
311
|
-
}
|
312
|
-
isListable(item, allowPersonalized = false) {
|
313
|
-
return item.type !== filterItemType_enum.FilterItemType.DEFAULT_FILTER && (allowPersonalized || item.type !== filterItemType_enum.FilterItemType.PERSONALIZED);
|
314
|
-
}
|
315
|
-
getAppliedListItems() {
|
316
|
-
const appliedItems = this.filterConfig
|
317
|
-
.filter(item => this.isActiveFilter(item) && this.isListable(item, true));
|
318
|
-
return appliedItems.map(filter => {
|
319
|
-
return { name: filter.id, label: filter.label, kind: "FILTER", iconName: null };
|
320
|
-
}).concat([
|
321
|
-
{ name: CLEAR_ALL_FILTERS, label: this.getMessage("snkFilterBar.clearAllFilters"), iconName: "cleaning", kind: "FOOTER" }
|
322
|
-
]);
|
323
|
-
}
|
324
|
-
addPersonalizedFilters(personalizedItems) {
|
325
|
-
const activeFilters = {};
|
326
|
-
personalizedItems.forEach(item => {
|
327
|
-
if (item.active) {
|
328
|
-
activeFilters[item.id] = true;
|
329
|
-
}
|
330
|
-
});
|
331
|
-
this.filterConfig = this.filterConfig.map(item => {
|
332
|
-
var _a, _b;
|
333
|
-
if (item.type === filterItemType_enum.FilterItemType.PERSONALIZED) {
|
334
|
-
const visible = activeFilters[item.id];
|
335
|
-
if (!item.visible && visible) {
|
336
|
-
this.calculateUpdateSequence(item);
|
337
|
-
if (((_b = (_a = item.props) === null || _a === void 0 ? void 0 : _a.personalizedFilter) === null || _b === void 0 ? void 0 : _b.parameters) != undefined) {
|
338
|
-
this._pendingFilters.push(item.id);
|
339
|
-
}
|
340
|
-
}
|
341
|
-
return this.normalizeItem(visible ? Object.assign(Object.assign({}, item), { visible }) : Object.assign(Object.assign({}, item), { visible, value: undefined, fixed: undefined }));
|
342
|
-
}
|
343
|
-
return item;
|
344
|
-
}).sort((a, b) => this._filtersComparator(a, b));
|
345
|
-
}
|
346
|
-
openDefaultFilterModal() {
|
347
|
-
const filterModal = document.createElement("snk-filter-modal");
|
348
|
-
const defaultFilter = this.filterConfig.filter(item => item.type === filterItemType_enum.FilterItemType.DEFAULT_FILTER);
|
349
|
-
filterModal.getMessage = (key, props) => this.getMessage(key, props);
|
350
|
-
filterModal.modalTitle = this.getMessage("snkFilterBar.modalDefaultFilterTitle");
|
351
|
-
filterModal.infoText = this.getMessage(defaultFilter.length == 0 ? "snkFilterBar.modalInfoTextCreateDefault" : "snkFilterBar.modalInfoTextEditDefault");
|
352
|
-
filterModal.items = defaultFilter.map(item => {
|
353
|
-
return { id: item.id, active: true, enabled: false, label: item.label };
|
354
|
-
});
|
355
|
-
filterModal.processModalAction = (_action) => {
|
356
|
-
this._application.closeModal();
|
357
|
-
};
|
358
|
-
this._application.showModal(filterModal);
|
359
|
-
}
|
360
|
-
openPersonalizedModal() {
|
361
|
-
const filterModal = document.createElement("snk-filter-modal");
|
362
|
-
const personalizedFilter = this.filterConfig
|
363
|
-
.filter(item => item.type === filterItemType_enum.FilterItemType.PERSONALIZED)
|
364
|
-
.sort((itemA, itemB) => core.StringUtils.compare(itemA.label, itemB.label));
|
365
|
-
filterModal.getMessage = (key, props) => this.getMessage(key, props);
|
366
|
-
filterModal.modalTitle = this.getMessage("snkFilterBar.modalPersonalizedFilterTitle");
|
367
|
-
filterModal.modalSubTitle = this.getMessage("snkFilterBar.modalPersonalizedFilterSubTitle");
|
368
|
-
filterModal.okButtonLabel = this.getMessage("snkFilterBar.modalOkButtonLabel");
|
369
|
-
filterModal.cancelButtonLabel = this.getMessage("snkFilterBar.modalCancelButtonLabel");
|
370
|
-
filterModal.infoText = this.getMessage("snkFilterBar.modalInfoTextCreateEditPersonalized");
|
371
|
-
filterModal.useSearch = true;
|
372
|
-
filterModal.items = personalizedFilter.map(item => {
|
373
|
-
return { id: item.id, active: item.visible, enabled: true, label: item.label };
|
374
|
-
});
|
375
|
-
filterModal.processModalAction = (action) => {
|
376
|
-
if (action === ezModalContainer.ModalAction.CANCEL) {
|
377
|
-
// O Botão de cancelar, tem efeito específico:
|
378
|
-
// - Desmarcar todos os filtros personalizados.
|
379
|
-
filterModal.items = filterModal.items.map(item => {
|
380
|
-
return Object.assign(Object.assign({}, item), { active: false });
|
381
|
-
});
|
382
|
-
}
|
383
|
-
else {
|
384
|
-
if (action === ezModalContainer.ModalAction.OK) {
|
385
|
-
this.addPersonalizedFilters(filterModal.items);
|
386
|
-
}
|
387
|
-
this._application.closeModal();
|
388
|
-
}
|
389
|
-
};
|
390
|
-
this._application.showModal(filterModal);
|
391
|
-
}
|
392
|
-
clearFilters() {
|
393
|
-
let changed = false;
|
394
|
-
this.filterConfig = this.filterConfig.map(item => {
|
395
|
-
if (item.value != undefined) {
|
396
|
-
changed = true;
|
397
|
-
}
|
398
|
-
return Object.assign(Object.assign({}, item), { value: undefined });
|
399
|
-
}).sort((a, b) => this._filtersComparator(a, b));
|
400
|
-
return changed;
|
401
|
-
}
|
402
328
|
loadPermitions() {
|
403
329
|
this._application.isUserSup().then(value => this.allowDefault = value);
|
404
330
|
}
|
@@ -447,31 +373,17 @@ const SnkFilterBar = class {
|
|
447
373
|
filterChangeListener(evt) {
|
448
374
|
this.updateFilter(evt.detail);
|
449
375
|
}
|
450
|
-
|
451
|
-
const
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
}
|
462
|
-
}
|
463
|
-
appliedFilterHandler(itemName) {
|
464
|
-
if (itemName === CLEAR_ALL_FILTERS) {
|
465
|
-
if (this.clearFilters()) {
|
466
|
-
this._application.info(this.getMessage("snkFilterBar.successfullyCleaned"), { iconName: "check" });
|
467
|
-
}
|
468
|
-
}
|
469
|
-
else {
|
470
|
-
const filterItemElement = this._element.querySelector("#filter-" + itemName);
|
471
|
-
if (filterItemElement) {
|
472
|
-
filterItemElement.showUp(true);
|
473
|
-
}
|
474
|
-
}
|
376
|
+
async showFilterModal() {
|
377
|
+
const callbackOnApplyFilter = (filters) => {
|
378
|
+
this.filterConfig = filters.map(this.normalizeItem);
|
379
|
+
};
|
380
|
+
const factoryParams = {
|
381
|
+
filterConfig: this.filterConfig,
|
382
|
+
onComplete: callbackOnApplyFilter,
|
383
|
+
getMessage: (key, props) => this.getMessage(key, props)
|
384
|
+
};
|
385
|
+
const factory = new SnkFilterModalFactory(factoryParams);
|
386
|
+
await factory.showModal();
|
475
387
|
}
|
476
388
|
componentWillLoad() {
|
477
389
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
@@ -488,7 +400,7 @@ const SnkFilterBar = class {
|
|
488
400
|
if (!this.dataUnit || !this.filterConfig || this.filterConfig.length === 0) {
|
489
401
|
return undefined;
|
490
402
|
}
|
491
|
-
return (index.h(index.Host, null, index.h("ez-scroller", { direction: EzScrollDirection.EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, this.getFilterItems()), index.h("
|
403
|
+
return (index.h(index.Host, null, index.h("ez-scroller", { direction: EzScrollDirection.EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, this.getFilterItems()), index.h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, index.h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
|
492
404
|
}
|
493
405
|
get _element() { return index.getElement(this); }
|
494
406
|
static get watchers() { return {
|
@@ -4,13 +4,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const filterItemType_enum = require('./filter-item-type.enum-
|
7
|
+
const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
|
8
|
+
const presentationMode = require('./presentationMode-52ec3bdd.js');
|
8
9
|
|
9
10
|
const SnkFilterBinarySelect = class {
|
10
11
|
constructor(hostRef) {
|
11
12
|
index.registerInstance(this, hostRef);
|
13
|
+
this.valueChanged = index.createEvent(this, "valueChanged", 7);
|
12
14
|
this.value = undefined;
|
13
15
|
this.config = undefined;
|
16
|
+
this.presentationMode = presentationMode.EPresentationMode.CHIP;
|
14
17
|
}
|
15
18
|
isSelected(option) {
|
16
19
|
return this.value == undefined || this.value === option;
|
@@ -45,6 +48,7 @@ const SnkFilterBinarySelect = class {
|
|
45
48
|
else {
|
46
49
|
this.value = undefined;
|
47
50
|
}
|
51
|
+
this.valueChanged.emit(this.value);
|
48
52
|
}
|
49
53
|
/**
|
50
54
|
* Exibe o componente snk-filter-binary-select
|
@@ -57,6 +61,9 @@ const SnkFilterBinarySelect = class {
|
|
57
61
|
return undefined;
|
58
62
|
}
|
59
63
|
const [optOne, optTwo] = this.config.props.options;
|
64
|
+
if (this.presentationMode === presentationMode.EPresentationMode.MODAL) {
|
65
|
+
return (index.h(index.Host, null, index.h("div", { class: "ez-flex ez-flex--row ez-flex--align-items-center" }, index.h("label", { class: "ez-text ez-text--medium ez-text--primary", style: { flex: '1 1 0', width: '0px' } }, this.config.detailModal), index.h("ez-check", { compact: true, style: { flex: '1 1 0', width: '0px' }, id: `${this.config.id}_${optOne.name || "option1"}`, label: optOne.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkOne = ref, value: this.isSelected(optOne.name) }), index.h("ez-check", { compact: true, style: { flex: '1 1 0', width: '0px' }, id: `${this.config.id}_${optTwo.name || "option2"}`, label: optTwo.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkTwo = ref, value: this.isSelected(optTwo.name) }))));
|
66
|
+
}
|
60
67
|
return (index.h(index.Host, null, index.h("ez-check", { id: `${this.config.id}_${optOne.name || "option1"}`, label: optOne.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkOne = ref, value: this.isSelected(optOne.name) }), index.h("ez-check", { id: `${this.config.id}_${optTwo.name || "option2"}`, label: optTwo.label, class: "sc-snk-filter-bar editor__ez-check", ref: (ref) => this._checkTwo = ref, value: this.isSelected(optTwo.name) })));
|
61
68
|
}
|
62
69
|
get _element() { return index.getElement(this); }
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-21bd01e1.js');
|
6
6
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
7
|
-
const filterItemType_enum = require('./filter-item-type.enum-
|
7
|
+
const filterItemType_enum = require('./filter-item-type.enum-aa823a00.js');
|
8
8
|
const core = require('@sankhyalabs/core');
|
9
9
|
|
10
10
|
const SnkFilterDetail = class {
|