@sankhyalabs/sankhyablocks 9.1.0-dev.1 → 9.1.0-dev.11
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/{ClientSideExporterProvider-0ce2bcd9.js → ClientSideExporterProvider-6a4108c9.js} +4 -4
- package/dist/cjs/{ConfigStorage-48ba265b.js → ConfigStorage-34aa43d8.js} +2 -2
- package/dist/cjs/{DataFetcher-1afdb18e.js → DataFetcher-e23a263b.js} +6 -1
- package/dist/cjs/{ISave-c76e2c51.js → ISave-e0be2362.js} +1 -1
- package/dist/cjs/{SnkFormConfigManager-aa4631bd.js → SnkFormConfigManager-61bf3266.js} +2 -2
- package/dist/cjs/{SnkMessageBuilder-e3b7850b.js → SnkMessageBuilder-221cc88d.js} +10 -2
- package/dist/cjs/{auth-fetcher-1687ac0a.js → auth-fetcher-8670a38f.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-a723f0dc.js → dataunit-fetcher-c34a8217.js} +4 -1
- package/dist/cjs/field-config_2.cjs.entry.js +1 -1
- package/dist/cjs/fields-layout.cjs.entry.js +1 -1
- package/dist/cjs/fields-selector.cjs.entry.js +2 -2
- package/dist/cjs/{form-config-fetcher-40d3f752.js → form-config-fetcher-d8b78403.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +5 -5
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_8.cjs.entry.js +63 -203
- package/dist/cjs/snk-application.cjs.entry.js +7 -7
- package/dist/cjs/snk-attach.cjs.entry.js +33 -16
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +6 -5
- package/dist/cjs/snk-data-exporter.cjs.entry.js +6 -6
- package/dist/cjs/{snk-data-unit-3684c96e.js → snk-data-unit-a4f9287b.js} +2 -2
- package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -8
- package/dist/cjs/snk-entity-list.cjs.entry.js +20 -14
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +44 -112
- package/dist/cjs/snk-filter-detail.cjs.entry.js +3 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form_2.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid.cjs.entry.js +9 -8
- package/dist/cjs/{snk-guides-viewer-edc0a00a.js → snk-guides-viewer-29298823.js} +5 -5
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
- package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +6 -4
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -4
- package/dist/cjs/snk-simple-crud.cjs.entry.js +15 -15
- package/dist/collection/components/snk-attach/snk-attach.js +45 -11
- package/dist/collection/components/snk-configurator/snk-configurator.js +1 -1
- package/dist/collection/components/snk-crud/snk-crud.js +19 -0
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +40 -15
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +6 -4
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +3 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css +4 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +49 -121
- package/dist/collection/components/snk-form-config/field-item/field-item.css +3 -23
- package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css +4 -12
- package/dist/collection/components/snk-form-config/fields-selector/fields-selector.css +4 -0
- package/dist/collection/components/snk-form-config/fields-selector/fields-selector.js +1 -1
- package/dist/collection/components/snk-grid/snk-grid.js +37 -2
- package/dist/collection/components/snk-grid-config/snk-grid-config.css +7 -41
- package/dist/collection/components/snk-grid-config/snk-grid-config.js +58 -193
- package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.css +1 -0
- package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.js +20 -1
- package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.js +1 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +9 -9
- package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.css +1 -0
- package/dist/collection/components/snk-simple-form-config/snk-simple-form-config.js +1 -1
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +6 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +3 -0
- package/dist/collection/lib/message/resources/snk-grid.msg.js +10 -2
- package/dist/components/DataFetcher.js +6 -1
- package/dist/components/SnkMessageBuilder.js +10 -2
- package/dist/components/dataunit-fetcher.js +3 -0
- package/dist/components/field-item2.js +1 -1
- package/dist/components/fields-layout2.js +1 -1
- package/dist/components/fields-selector2.js +2 -2
- package/dist/components/pesquisa-grid2.js +1 -1
- package/dist/components/snk-attach2.js +29 -11
- package/dist/components/snk-configurator2.js +1 -1
- package/dist/components/snk-crud.js +1 -0
- package/dist/components/snk-entity-list.js +21 -15
- package/dist/components/snk-filter-detail2.js +3 -1
- package/dist/components/snk-filter-item2.js +43 -111
- package/dist/components/snk-grid-config2.js +56 -195
- package/dist/components/snk-grid2.js +5 -2
- package/dist/components/snk-personalized-filter-editor.js +6 -4
- package/dist/components/snk-select-box2.js +5 -3
- package/dist/components/snk-simple-crud2.js +8 -8
- package/dist/components/snk-simple-form-config2.js +2 -2
- package/dist/esm/{ClientSideExporterProvider-3ed744fd.js → ClientSideExporterProvider-09dee1a3.js} +4 -4
- package/dist/esm/{ConfigStorage-79b9e180.js → ConfigStorage-89154c4e.js} +2 -2
- package/dist/esm/{DataFetcher-88e56266.js → DataFetcher-db08cad0.js} +6 -1
- package/dist/esm/{ISave-5efafc97.js → ISave-da565824.js} +1 -1
- package/dist/esm/{SnkFormConfigManager-b4b93298.js → SnkFormConfigManager-d64d62d6.js} +2 -2
- package/dist/esm/{SnkMessageBuilder-9c269caf.js → SnkMessageBuilder-da87a821.js} +10 -2
- package/dist/esm/{auth-fetcher-3510520e.js → auth-fetcher-43c8d76b.js} +1 -1
- package/dist/esm/{dataunit-fetcher-0e025732.js → dataunit-fetcher-1b78797a.js} +4 -1
- package/dist/esm/field-config_2.entry.js +1 -1
- package/dist/esm/fields-layout.entry.js +1 -1
- package/dist/esm/fields-selector.entry.js +2 -2
- package/dist/esm/{form-config-fetcher-fa208a6c.js → form-config-fetcher-e623539b.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +5 -5
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_8.entry.js +63 -203
- package/dist/esm/snk-application.entry.js +7 -7
- package/dist/esm/snk-attach.entry.js +33 -16
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +6 -5
- package/dist/esm/snk-data-exporter.entry.js +6 -6
- package/dist/esm/{snk-data-unit-027bca56.js → snk-data-unit-330db397.js} +2 -2
- package/dist/esm/snk-data-unit.entry.js +4 -4
- package/dist/esm/snk-detail-view.entry.js +8 -8
- package/dist/esm/snk-entity-list.entry.js +20 -14
- package/dist/esm/snk-filter-bar_4.entry.js +45 -113
- package/dist/esm/snk-filter-detail.entry.js +3 -1
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form_2.entry.js +4 -4
- package/dist/esm/snk-grid.entry.js +9 -8
- package/dist/esm/{snk-guides-viewer-32f3d3ab.js → snk-guides-viewer-9335318d.js} +5 -5
- package/dist/esm/snk-guides-viewer.entry.js +7 -7
- package/dist/esm/snk-personalized-filter-editor.entry.js +6 -4
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-pesquisa.entry.js +4 -4
- package/dist/esm/snk-simple-crud.entry.js +15 -15
- package/dist/sankhyablocks/p-02480593.entry.js +1 -0
- package/dist/sankhyablocks/{p-09e60995.entry.js → p-1079e61b.entry.js} +1 -1
- package/dist/sankhyablocks/p-162bddae.entry.js +1 -0
- package/dist/sankhyablocks/{p-1456d7cb.entry.js → p-1c69a957.entry.js} +1 -1
- package/dist/sankhyablocks/p-22a8656b.entry.js +1 -0
- package/dist/sankhyablocks/{p-349d1968.entry.js → p-23b20add.entry.js} +1 -1
- package/dist/sankhyablocks/p-25209340.entry.js +1 -0
- package/dist/sankhyablocks/p-295b83ae.entry.js +1 -0
- package/dist/sankhyablocks/{p-a5bb2f93.entry.js → p-2d58f98e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9751c42f.entry.js → p-31193a60.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7993b2e3.js → p-37b4f642.js} +1 -1
- package/dist/sankhyablocks/{p-2bde486e.js → p-3b1d73f9.js} +1 -1
- package/dist/sankhyablocks/{p-a6513fcb.js → p-412e06e9.js} +1 -1
- package/dist/sankhyablocks/p-5126b34e.entry.js +1 -0
- package/dist/sankhyablocks/{p-e3521eae.entry.js → p-5b31b239.entry.js} +1 -1
- package/dist/sankhyablocks/{p-bd665460.entry.js → p-60d3abf6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0cb295c1.entry.js → p-7c9815ea.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a06bf7b9.entry.js → p-7ced2cf4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6416975c.js → p-8758404f.js} +1 -1
- package/dist/sankhyablocks/{p-65c5d430.entry.js → p-9a6fbf3d.entry.js} +1 -1
- package/dist/sankhyablocks/p-a2c6944d.entry.js +1 -0
- package/dist/sankhyablocks/{p-601b252b.js → p-b21d32f6.js} +1 -1
- package/dist/sankhyablocks/{p-c926cf6b.entry.js → p-b2946adb.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6dd38d7b.js → p-c9657baa.js} +1 -1
- package/dist/sankhyablocks/p-cb2a4613.entry.js +1 -0
- package/dist/sankhyablocks/{p-fbba7e3d.js → p-cd1a5b6a.js} +1 -1
- package/dist/sankhyablocks/p-cfc219f6.entry.js +1 -0
- package/dist/sankhyablocks/{p-73285a8a.js → p-e25412da.js} +1 -1
- package/dist/sankhyablocks/p-e56eb36b.entry.js +1 -0
- package/dist/sankhyablocks/p-f442c8f6.entry.js +1 -0
- package/dist/sankhyablocks/{p-763b04fa.js → p-fa591f6f.js} +1 -1
- package/dist/sankhyablocks/p-fc4eac32.js +1 -0
- package/dist/sankhyablocks/{p-fc0b609e.js → p-fc87708a.js} +1 -1
- package/dist/sankhyablocks/p-fd571197.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-attach/interfaces/ICrudConfig.d.ts +1 -1
- package/dist/types/components/snk-attach/snk-attach.d.ts +5 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -0
- package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +8 -4
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +10 -20
- package/dist/types/components/snk-grid/snk-grid.d.ts +8 -0
- package/dist/types/components/snk-grid-config/snk-grid-config.d.ts +7 -20
- package/dist/types/components/snk-grid-config/snk-select-box/snk-select-box.d.ts +4 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -1
- package/dist/types/components.d.ts +41 -1
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-19156e59.entry.js +0 -1
- package/dist/sankhyablocks/p-3a48bff3.entry.js +0 -1
- package/dist/sankhyablocks/p-3f24c9b2.js +0 -1
- package/dist/sankhyablocks/p-67d6d0c8.entry.js +0 -1
- package/dist/sankhyablocks/p-83c100f2.entry.js +0 -1
- package/dist/sankhyablocks/p-90805683.entry.js +0 -1
- package/dist/sankhyablocks/p-9ad3557c.entry.js +0 -1
- package/dist/sankhyablocks/p-c3324d79.entry.js +0 -1
- package/dist/sankhyablocks/p-cfd0a4c6.entry.js +0 -1
- package/dist/sankhyablocks/p-d9491f6f.entry.js +0 -1
- package/dist/sankhyablocks/p-e7cccc45.entry.js +0 -1
- package/dist/sankhyablocks/p-e824d565.entry.js +0 -1
- package/dist/sankhyablocks/p-ff7060bc.entry.js +0 -1
- /package/dist/collection/components/snk-simple-crud/{regular-buttons.js → snk-simple-crud.constants.js} +0 -0
- /package/dist/types/components/snk-simple-crud/{regular-buttons.d.ts → snk-simple-crud.constants.d.ts} +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, forceUpdate, Host } from '@stencil/core/internal/client';
|
2
2
|
import { g as getIconName, d as defineCustomElement$1 } from './field-config2.js';
|
3
3
|
|
4
|
-
const fieldItemCss = ".sc-field-item-h
|
4
|
+
const fieldItemCss = ".sc-field-item-h{width:100%;display:flex;padding:12px 8px;border-radius:var(--border--radius-small, 4px);border:1px solid #dce0e8;cursor:grab;align-items:center;height:42px;max-height:42px;background:#FAFCFF}.full-width.sc-field-item-h{width:100%}ez-icon.sc-field-item{--ez-icon--color:#A2ABB9}.icons.sc-field-item{display:flex}.label.sc-field-item{display:flex;flex-grow:1;padding-left:8px;font-size:14px;align-items:center;gap:4px;height:22px}.label-text.sc-field-item{overflow:hidden;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;height:auto;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;display:-webkit-box;-o-text-overflow:ellipsis;text-overflow:ellipsis;word-break:break-word}.required-mark.sc-field-item{color:#cf3105;background:#F7E0E5;width:12px;height:12px;border-radius:50%;display:flex;align-items:center;justify-content:center;padding-top:5px;font-size:16px;align-self:self-start}.actions.sc-field-item{display:flex;flex-direction:row;align-content:center;gap:4px}ez-button.sc-field-item{width:24px;align-items:center;justify-content:center;display:flex}.sc-field-item-h .hiddeble.sc-field-item{transition:0.2s ease-in-out;visibility:hidden;opacity:0}.sc-field-item-h:hover .hiddeble.sc-field-item{visibility:visible;opacity:1}";
|
5
5
|
|
6
6
|
const FieldItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
7
7
|
constructor() {
|
@@ -6,7 +6,7 @@ import { T as TAB_NAMES, G as GROUP_NAMES } from './constants.js';
|
|
6
6
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
7
7
|
import { d as defineCustomElement$1 } from './field-item2.js';
|
8
8
|
|
9
|
-
const fieldsLayoutCss = ".sc-fields-layout-h{display:flex;padding:12px;box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));border-radius:var(--border--radius-medium, 6px);height:var(--snk-form-config-container-height);flex-direction:column}.layout-container.sc-fields-layout{container-type:inline-size;display:flex;flex-direction:column;overflow:auto;height:calc(100vh - 225px)}.guide-header.sc-fields-layout{display:flex;width:100%;font-size:20px;border-bottom:1px solid #dce0e8;margin-bottom:6px;align-items:center;height:45px}.guide-header.sc-fields-layout ez-button.sc-fields-layout{transition:all 0.2s ease-in-out;visibility:hidden;opacity:0}.guide-header.sc-fields-layout:hover ez-button.sc-fields-layout{visibility:visible;opacity:1}.guide-header-label.sc-fields-layout{display:block;padding:10px 0}.group-config.sc-fields-layout{padding:12px 0;display:flex;flex-direction:column;width:100%}.group-content.sc-fields-layout{display:
|
9
|
+
const fieldsLayoutCss = ".sc-fields-layout-h{display:flex;padding:12px;box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));border-radius:var(--border--radius-medium, 6px);height:var(--snk-form-config-container-height);flex-direction:column}.layout-container.sc-fields-layout{container-type:inline-size;display:flex;flex-direction:column;overflow:auto;height:calc(100vh - 225px)}.guide-header.sc-fields-layout{display:flex;width:100%;font-size:20px;border-bottom:1px solid #dce0e8;margin-bottom:6px;align-items:center;height:45px}.guide-header.sc-fields-layout ez-button.sc-fields-layout{transition:all 0.2s ease-in-out;visibility:hidden;opacity:0}.guide-header.sc-fields-layout:hover ez-button.sc-fields-layout{visibility:visible;opacity:1}.guide-header-label.sc-fields-layout{display:block;padding:10px 0}.group-config.sc-fields-layout{padding:12px 0;display:flex;flex-direction:column;width:100%}.group-content.sc-fields-layout{display:grid;gap:12px;min-height:65px;width:100%;padding:6px 0;grid-template-columns:repeat(auto-fill, minmax(250px, 1fr))}.group-content.empty-content.sc-fields-layout{position:relative}.group-content.empty-content.sc-fields-layout::before{content:\"Arraste e solte um campo aqui\";color:#cbcfd7;font-size:16px;font-weight:500;text-align:center;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;transition:opacity 0.3s;height:100%;box-sizing:border-box;padding:10px;background:#f9f9f9;border:1px dashed #dce0e8;border-radius:6px}.no-group-container.sc-fields-layout{padding:12px 0;width:100%;border-bottom:1px solid #dce0e8}.no-group-container.sc-fields-layout::before{content:\"Inclua estes campos nos grupos ou deixe-os separados no topo do formulário\";width:100%;display:block;font-size:16px;font-weight:400;color:#AFB6C0;padding-bottom:12px}.add-group-container.sc-fields-layout{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;padding-bottom:12px;gap:6px;cursor:pointer;justify-content:center;width:100%;height:55px}.no-guide-selected.sc-fields-layout{display:block;margin:auto;font-size:24px;color:#AFB6C0;font-weight:500}.ghost.sc-fields-layout{opacity:.5;background:#c8fbe2}";
|
10
10
|
|
11
11
|
const FieldLayoutComponent = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
12
12
|
constructor() {
|
@@ -4,7 +4,7 @@ import { I as ID_AVAILABLE_FIELDS, d as defineCustomElement$2 } from './field-co
|
|
4
4
|
import { ArrayUtils } from '@sankhyalabs/core';
|
5
5
|
import { d as defineCustomElement$1 } from './field-item2.js';
|
6
6
|
|
7
|
-
const fieldsSelectorCss = ".sc-fields-selector-h{width:33.33333%;display:flex;box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));border-radius:var(--border--radius-medium, 6px);height:var(--snk-form-config-container-height);max-width:260px}.fields-label.sc-fields-selector{display:block;font-size:16px;font-weight:500;width:100%}.fields-count.sc-fields-selector{display:block;color:#AFB6C0;font-size:14px;padding:12px 0;font-weight:400;width:100%}.fields-container.sc-fields-selector{display:flex;flex-direction:column;gap:12px;height:calc(100vh - 220px);width:100%}.ghost.sc-fields-selector{opacity:.5;background:#c8fbe2}";
|
7
|
+
const fieldsSelectorCss = ".sc-fields-selector-h{width:33.33333%;display:flex;box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));border-radius:var(--border--radius-medium, 6px);height:var(--snk-form-config-container-height);max-width:260px}.fields-label.sc-fields-selector{display:block;font-size:16px;font-weight:500;width:100%}.fields-count.sc-fields-selector{display:block;color:#AFB6C0;font-size:14px;padding:12px 0;font-weight:400;width:100%}.fields-container.sc-fields-selector{display:flex;flex-direction:column;gap:12px;height:calc(100vh - 220px);width:100%}.ghost.sc-fields-selector{opacity:.5;background:#c8fbe2}.filter-input.sc-fields-selector{padding-right:var(--space--2xs, 8px)}";
|
8
8
|
|
9
9
|
const FieldsSelector = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
10
10
|
constructor() {
|
@@ -62,7 +62,7 @@ const FieldsSelector = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
62
62
|
this.initializeDraggableContainer();
|
63
63
|
}
|
64
64
|
render() {
|
65
|
-
return (h(Host, { class: 'ez-col ez-col--sd-4 ez-col--tb-4 ez-padding--medium' }, h("span", { class: 'fields-label ez-padding-bottom--small' }, "Campos dispon\u00EDveis"), h("ez-filter-input", { slot: "content", mode: "slim", label: "Buscar campo", onEzChange: evt => this.filterTerm = evt.detail }), h("span", { class: 'fields-count' }, this.getCountText()), h("ez-scroller", { direction: 'vertical', activeShadow: true }, h("div", { id: ID_AVAILABLE_FIELDS, class: 'fields-container' }, this.renderFields()))));
|
65
|
+
return (h(Host, { class: 'ez-col ez-col--sd-4 ez-col--tb-4 ez-padding--medium' }, h("span", { class: 'fields-label ez-padding-bottom--small' }, "Campos dispon\u00EDveis"), h("ez-filter-input", { class: 'filter-input', slot: "content", mode: "slim", label: "Buscar campo", onEzChange: evt => this.filterTerm = evt.detail }), h("span", { class: 'fields-count' }, this.getCountText()), h("ez-scroller", { direction: 'vertical', activeShadow: true }, h("div", { id: ID_AVAILABLE_FIELDS, class: 'fields-container' }, this.renderFields()))));
|
66
66
|
}
|
67
67
|
get el() { return this; }
|
68
68
|
static get style() { return fieldsSelectorCss; }
|
@@ -66,7 +66,7 @@ const PesquisaGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
66
66
|
render() {
|
67
67
|
if (!this.metadata || !this._dataunit)
|
68
68
|
return;
|
69
|
-
return (h(Host, null, h("ez-grid", { dataUnit: this._dataunit, config: this._gridConfig,
|
69
|
+
return (h(Host, null, h("ez-grid", { dataUnit: this._dataunit, config: this._gridConfig, mode: "simple", autoFocus: false, onEzDoubleClick: ({ detail }) => this.handleDbClick(detail), onConfigChange: async (event) => this.handleConfigChanged(event) })));
|
70
70
|
}
|
71
71
|
static get watchers() { return {
|
72
72
|
"dataSource": ["observeDataSource"],
|
@@ -627,6 +627,8 @@ const snkAttachCss = ".snk-attach__header.sc-snk-attach,.snk-attach__crud-sectio
|
|
627
627
|
|
628
628
|
const RESOURCE_ID = 'AnexoSistema';
|
629
629
|
const DATA_UNIT_NAME = 'br.com.sankhya.core.v3.anexoSistema';
|
630
|
+
const GRID_LEGACY_CONFIG_NAME = 'GrdCfgHtml5:grdcfg.dynaform.anexo';
|
631
|
+
const LINKORFILE_COLUMN_NAME = "ARQUIVOOULINK";
|
630
632
|
const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
631
633
|
constructor() {
|
632
634
|
super();
|
@@ -656,6 +658,7 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
656
658
|
this.back.emit();
|
657
659
|
});
|
658
660
|
};
|
661
|
+
this.gridLegacyConfigName = undefined;
|
659
662
|
this.fetcherType = undefined;
|
660
663
|
this.fetcher = undefined;
|
661
664
|
this.dataUnit = undefined;
|
@@ -767,9 +770,11 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
767
770
|
var _a, _b;
|
768
771
|
this._currentDataUnit = new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
|
769
772
|
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
773
|
+
let gridValidateForm;
|
770
774
|
if (!this._currentDataUnit.metadata) {
|
771
775
|
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
|
772
|
-
this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
|
776
|
+
this.crudConfig = this.entityName ? { form: anexoSistemaCrudConfig === null || anexoSistemaCrudConfig === void 0 ? void 0 : anexoSistemaCrudConfig.form } : Object.assign({}, anexoSistemaCrudConfig);
|
777
|
+
gridValidateForm = { grid: anexoSistemaCrudConfig === null || anexoSistemaCrudConfig === void 0 ? void 0 : anexoSistemaCrudConfig.grid };
|
773
778
|
}
|
774
779
|
this.initDataUnitLoaders();
|
775
780
|
this._currentDataUnit.addFilterProvider({
|
@@ -779,19 +784,21 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
779
784
|
interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
|
780
785
|
});
|
781
786
|
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
|
782
|
-
this.disableEditFieldsNotInForm();
|
787
|
+
this.disableEditFieldsNotInForm(gridValidateForm);
|
783
788
|
}
|
784
789
|
async loadAttach() {
|
785
790
|
var _a, _b;
|
786
791
|
this._currentFetcher = new AttachFetcher();
|
787
792
|
this._currentDataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
788
793
|
this._currentDataUnit.pageSize = 150;
|
794
|
+
let gridValidateForm;
|
789
795
|
this.initDataUnitLoaders();
|
790
796
|
this._currentDataUnit.addInterceptor({
|
791
797
|
interceptAction: (action) => {
|
792
798
|
var _a;
|
793
799
|
if (action.type === Action.METADATA_LOADED) {
|
794
|
-
this.crudConfig = Object.assign({}, attachCrudConfig);
|
800
|
+
this.crudConfig = this.entityName ? { form: attachCrudConfig === null || attachCrudConfig === void 0 ? void 0 : attachCrudConfig.form } : Object.assign({}, attachCrudConfig);
|
801
|
+
gridValidateForm = { grid: attachCrudConfig === null || attachCrudConfig === void 0 ? void 0 : attachCrudConfig.grid };
|
795
802
|
(_a = this._crudElement) === null || _a === void 0 ? void 0 : _a.updateConfig();
|
796
803
|
}
|
797
804
|
return this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement);
|
@@ -799,9 +806,10 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
799
806
|
});
|
800
807
|
if (!this._currentDataUnit.metadata) {
|
801
808
|
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
|
802
|
-
this.crudConfig = Object.assign({}, attachCrudConfig);
|
809
|
+
this.crudConfig = this.entityName ? { form: attachCrudConfig === null || attachCrudConfig === void 0 ? void 0 : attachCrudConfig.form } : Object.assign({}, attachCrudConfig);
|
810
|
+
gridValidateForm = { grid: attachCrudConfig === null || attachCrudConfig === void 0 ? void 0 : attachCrudConfig.grid };
|
803
811
|
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData(undefined, undefined, true, this.registerKey));
|
804
|
-
this.disableEditFieldsNotInForm();
|
812
|
+
this.disableEditFieldsNotInForm(gridValidateForm);
|
805
813
|
}
|
806
814
|
}
|
807
815
|
initDataUnitLoaders() {
|
@@ -820,12 +828,16 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
820
828
|
});
|
821
829
|
}
|
822
830
|
}
|
823
|
-
disableEditFieldsNotInForm() {
|
824
|
-
var _a;
|
825
|
-
(_a = this.
|
826
|
-
|
831
|
+
disableEditFieldsNotInForm(gridValidateForm) {
|
832
|
+
var _a, _b, _c, _d, _e;
|
833
|
+
const gridColumns = ((_b = (_a = this._crudElement) === null || _a === void 0 ? void 0 : _a.gridConfig) === null || _b === void 0 ? void 0 : _b.columns) || ((_c = gridValidateForm === null || gridValidateForm === void 0 ? void 0 : gridValidateForm.grid) === null || _c === void 0 ? void 0 : _c.columns) || ((_e = (_d = this.crudConfig) === null || _d === void 0 ? void 0 : _d.grid) === null || _e === void 0 ? void 0 : _e.columns);
|
834
|
+
if (!!this.getGridLegacyConfigName()) {
|
835
|
+
this._currentDataUnit.disableField(LINKORFILE_COLUMN_NAME);
|
836
|
+
}
|
837
|
+
gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach(column => {
|
838
|
+
var _a, _b;
|
827
839
|
const fieldName = column.name;
|
828
|
-
if (!((_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form.fields.some(field => field.name === fieldName))) {
|
840
|
+
if (!((_b = (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form) === null || _b === void 0 ? void 0 : _b.fields.some(field => (field === null || field === void 0 ? void 0 : field.name) === fieldName))) {
|
829
841
|
this._currentDataUnit.disableField(fieldName);
|
830
842
|
}
|
831
843
|
});
|
@@ -875,17 +887,23 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
875
887
|
await this._currentDataUnit.loadMetadata();
|
876
888
|
}
|
877
889
|
;
|
890
|
+
getGridLegacyConfigName() {
|
891
|
+
if (this.gridLegacyConfigName)
|
892
|
+
return this.gridLegacyConfigName;
|
893
|
+
return this.entityName ? GRID_LEGACY_CONFIG_NAME + "." + this.entityName : this.entityName;
|
894
|
+
}
|
878
895
|
render() {
|
879
896
|
var _a, _b;
|
880
897
|
if (!this._currentDataUnit)
|
881
898
|
return null;
|
882
|
-
return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder, onDataStateChange: this.handleOnDataStateChange.bind(this), multipleSelection: true }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary ez-padding-bottom--medium" }, this.getMessage("snkAttach.description")))))))));
|
899
|
+
return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder, onDataStateChange: this.handleOnDataStateChange.bind(this), multipleSelection: true, configName: this.entityName, ignoreReadOnlyFormFields: this.entityName ? true : false, gridLegacyConfigName: this.getGridLegacyConfigName() }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary ez-padding-bottom--medium" }, this.getMessage("snkAttach.description")))))))));
|
883
900
|
}
|
884
901
|
static get watchers() { return {
|
885
902
|
"registerKey": ["registerKeyWatcher"]
|
886
903
|
}; }
|
887
904
|
static get style() { return snkAttachCss; }
|
888
905
|
}, [2, "snk-attach", {
|
906
|
+
"gridLegacyConfigName": [1, "grid-legacy-config-name"],
|
889
907
|
"fetcherType": [1, "fetcher-type"],
|
890
908
|
"fetcher": [16],
|
891
909
|
"dataUnit": [16],
|
@@ -112,7 +112,7 @@ const SnkConfigurator = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
112
112
|
insideCustomElementsContainer === null || insideCustomElementsContainer === void 0 ? void 0 : insideCustomElementsContainer.appendChild(configuratorCustomElement);
|
113
113
|
}
|
114
114
|
render() {
|
115
|
-
return (h("ez-modal", { ref: (element) => (this.modal = element), opened: this._opened, "close-esc": false, "close-outside-click": false, "modal-size": "small", scrim: "light" }, h("div", { class: "snk-configurator" }, h("div", { class: "snk-configurator__header" }, h("label", { class: "snk-configurator__title" }, this.getMessage('snkConfigurator.titleConfigurations')), h("div", { class: "snk-configurator__button-close" }, h("ez-button", { mode: "icon", iconName: "close", size: "medium", onClick: () => this.closeConfig() }))), h("div", { class: "snk-configurator__main" }, h("ez-collapsible-box", { boxBordered: true, label: "Modo de visualiza\u00E7\u00E3o ", headerSize: "medium", class: "snk-configurator__collapsable-box" }, h("ez-radio-button", { value: this.getViewModeValue().toString(), onEzChange: (evt) => this.onViewModeChanged(evt), enabled: this.enableModeConfig() }, h("ez-radio-button-option", { label: this.getMessage('snkConfigurator.labelGrid'), value: VIEW_MODE.GRID }), h("ez-radio-button-option", { label: this.getMessage('snkConfigurator.labelForm'), value: VIEW_MODE.FORM })), h("div", { class: "snk-configurator__collsable-box-action" }, h("ez-button", { label: this.viewMode === VIEW_MODE.GRID ? this.getMessage('snkConfigurator.labelConfigGrid') : this.getMessage('snkConfigurator.labelConfigForm'), class: "snk-configurator__button-config ez-button--secondary", onClick: () => this.onClickOpenConfig(), id: "openConfigurator" }))), this.layoutFormConfig && h("ez-collapsible-box", { boxBordered: true, value: true, label: "Layout do formul\u00E1rio", headerSize: "medium", class: "snk-configurator__collapsable-box ez-margin-top--medium" }, h("div", { class: 'ez-flex ez-flex--column ez-size-width--full' }, h("snk-layout-form-config", { ref: (ref) => this._snkLayoutFormConfig = ref }))), h("div", { id: "slotContainer", class: "snk-configurator__outline" })), this.showActionButtons && (h("div", { class: "snk-configurator__action-buttons" }, h("ez-button", { label: "Cancelar", onClick: () => this.cancel.emit() }), h("ez-button", { label: "Salvar", onClick: () => this.handleSave(), class: "ez-button--primary" }))))));
|
115
|
+
return (h("ez-modal", { ref: (element) => (this.modal = element), opened: this._opened, "close-esc": false, "close-outside-click": false, "modal-size": "small", scrim: "light", onEzCloseModal: () => this.closeConfig() }, h("div", { class: "snk-configurator" }, h("div", { class: "snk-configurator__header" }, h("label", { class: "snk-configurator__title" }, this.getMessage('snkConfigurator.titleConfigurations')), h("div", { class: "snk-configurator__button-close" }, h("ez-button", { mode: "icon", iconName: "close", size: "medium", onClick: () => this.closeConfig() }))), h("div", { class: "snk-configurator__main" }, h("ez-collapsible-box", { boxBordered: true, label: "Modo de visualiza\u00E7\u00E3o ", headerSize: "medium", class: "snk-configurator__collapsable-box" }, h("ez-radio-button", { value: this.getViewModeValue().toString(), onEzChange: (evt) => this.onViewModeChanged(evt), enabled: this.enableModeConfig() }, h("ez-radio-button-option", { label: this.getMessage('snkConfigurator.labelGrid'), value: VIEW_MODE.GRID }), h("ez-radio-button-option", { label: this.getMessage('snkConfigurator.labelForm'), value: VIEW_MODE.FORM })), h("div", { class: "snk-configurator__collsable-box-action" }, h("ez-button", { label: this.viewMode === VIEW_MODE.GRID ? this.getMessage('snkConfigurator.labelConfigGrid') : this.getMessage('snkConfigurator.labelConfigForm'), class: "snk-configurator__button-config ez-button--secondary", onClick: () => this.onClickOpenConfig(), id: "openConfigurator" }))), this.layoutFormConfig && h("ez-collapsible-box", { boxBordered: true, value: true, label: "Layout do formul\u00E1rio", headerSize: "medium", class: "snk-configurator__collapsable-box ez-margin-top--medium" }, h("div", { class: 'ez-flex ez-flex--column ez-size-width--full' }, h("snk-layout-form-config", { ref: (ref) => this._snkLayoutFormConfig = ref }))), h("div", { id: "slotContainer", class: "snk-configurator__outline" })), this.showActionButtons && (h("div", { class: "snk-configurator__action-buttons" }, h("ez-button", { label: "Cancelar", onClick: () => this.cancel.emit() }), h("ez-button", { label: "Salvar", onClick: () => this.handleSave(), class: "ez-button--primary" }))))));
|
116
116
|
}
|
117
117
|
get _element() { return this; }
|
118
118
|
static get style() { return snkConfiguratorCss; }
|
@@ -96,6 +96,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
96
96
|
this.layoutFormConfig = false;
|
97
97
|
this.multipleEditionEnabled = true;
|
98
98
|
this.paginationCounterMode = 'auto';
|
99
|
+
this.layoutFormConfig = false;
|
99
100
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
100
101
|
}
|
101
102
|
/**
|
@@ -8,11 +8,11 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
8
8
|
super();
|
9
9
|
this.__registerHost();
|
10
10
|
this.valueChanged = createEvent(this, "valueChanged", 7);
|
11
|
-
this._searchValue = undefined;
|
12
11
|
this._ezListSource = [];
|
13
12
|
this.config = undefined;
|
14
13
|
this.rightListSlotBuilder = undefined;
|
15
14
|
this.maxHeightList = "";
|
15
|
+
this.value = undefined;
|
16
16
|
}
|
17
17
|
async reloadList() {
|
18
18
|
this.loadListSource();
|
@@ -74,18 +74,22 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
74
74
|
}
|
75
75
|
onEzSearchChange(evt) {
|
76
76
|
var _a, _b, _c, _d;
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
id: evt.detail.value,
|
82
|
-
check: true,
|
83
|
-
label: evt.detail.label
|
84
|
-
}
|
85
|
-
] });
|
86
|
-
this.loadListSource();
|
87
|
-
this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
|
77
|
+
const newValueIsEmpty = ObjectUtils.isEmptySafetyCheck(evt.detail);
|
78
|
+
const hasConfingOnList = (_a = this.getListConfigValue(this.config)) === null || _a === void 0 ? void 0 : _a.find((i) => { var _a; return (i === null || i === void 0 ? void 0 : i.id) === ((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); });
|
79
|
+
if (newValueIsEmpty || hasConfingOnList) {
|
80
|
+
return;
|
88
81
|
}
|
82
|
+
this.config = Object.assign(Object.assign({}, this.config), { value: [
|
83
|
+
...((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : []),
|
84
|
+
{
|
85
|
+
id: evt.detail.value,
|
86
|
+
check: true,
|
87
|
+
label: evt.detail.label
|
88
|
+
}
|
89
|
+
] });
|
90
|
+
this.loadListSource();
|
91
|
+
this.value = this.config.value;
|
92
|
+
this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
|
89
93
|
}
|
90
94
|
getMessage(key, params) {
|
91
95
|
var _a;
|
@@ -96,8 +100,10 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
96
100
|
return (_d = (_b = (_a = config.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : (_c = config === null || config === void 0 ? void 0 : config.value) === null || _c === void 0 ? void 0 : _c.members) !== null && _d !== void 0 ? _d : config === null || config === void 0 ? void 0 : config.value;
|
97
101
|
}
|
98
102
|
render() {
|
99
|
-
var _a, _b;
|
100
|
-
|
103
|
+
var _a, _b, _c;
|
104
|
+
const isSearchPlus = ((_a = this.config.props) === null || _a === void 0 ? void 0 : _a["useSearchPlus"]) == true;
|
105
|
+
const TagName = isSearchPlus ? "ez-search-plus" : "ez-search";
|
106
|
+
return (h(Host, null, h(TagName, { ref: elem => this._searchElement = elem, optionLoader: argument => this.optionLoader(argument), label: (_b = this.config) === null || _b === void 0 ? void 0 : _b.label, onEzChange: evt => this.onEzSearchChange(evt), suppressEmptyOption: true, stopPropagateEnterKeyEvent: true }), ((_c = this._ezListSource) === null || _c === void 0 ? void 0 : _c.length) > 0 && (h("label", { class: "label" }, this.getMessage("snkEntityList.selected"))), h("div", { style: this.maxHeightList ? { 'max-height': this.maxHeightList } : {}, class: { "snk-entity-list--overflow": !!this.maxHeightList } }, h("ez-list", { ref: (el) => this._ezList = el, id: "snkEntityList", listMode: "check", dataSource: this._ezListSource, hoverFeedback: true, itemSlotBuilder: this.rightListSlotBuilder, onEzCheckChange: evt => this.ezListChangeListener(evt) }))));
|
101
107
|
}
|
102
108
|
static get watchers() { return {
|
103
109
|
"config": ["observeConfig"]
|
@@ -107,7 +113,7 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
107
113
|
"config": [1040],
|
108
114
|
"rightListSlotBuilder": [1040],
|
109
115
|
"maxHeightList": [1, "max-height-list"],
|
110
|
-
"
|
116
|
+
"value": [1040],
|
111
117
|
"_ezListSource": [32],
|
112
118
|
"reloadList": [64]
|
113
119
|
}]);
|
@@ -25,6 +25,7 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
25
25
|
var _a, _b;
|
26
26
|
this._editor && (this._editor["config"] = newValue);
|
27
27
|
(_b = (_a = this._editor) === null || _a === void 0 ? void 0 : _a["reloadList"]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
28
|
+
this._customElementObject = this.getContentEditor();
|
28
29
|
}
|
29
30
|
componentDidLoad() {
|
30
31
|
if (this._element) {
|
@@ -161,9 +162,10 @@ const SnkFilterDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
161
162
|
}
|
162
163
|
componentWillLoad() {
|
163
164
|
this.originalConfig = ObjectUtils.copy(this.config);
|
165
|
+
this._customElementObject = this.getContentEditor();
|
164
166
|
}
|
165
167
|
render() {
|
166
|
-
const { tag: CustomElement, props } = this.
|
168
|
+
const { tag: CustomElement, props } = this._customElementObject;
|
167
169
|
return (h(Host, null, h("div", { class: "col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center" }, h("div", { class: "ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header" }, this.config.detailTitle), this.getPopUpHeaderButtons()), h(CustomElement, Object.assign({ maxHeightList: '240px', ref: ref => this._editor = ref, value: this.config.value, config: this.config, onKeyDown: evt => this.onKeyDonwListener(evt), "data-element-id": this._idContentEditor, getMessage: this.getMessage, rightListSlotBuilder: item => this.buildRightSlot(item) }, props)), h("hr", { class: "sc-snk-filter-bar snk-filter__popover-rule" }), h("div", { class: "ez-col ez-col--sd-12 ez-align--right" }, this.filterCanBeCleared() && (h("ez-button", { label: this.getMessage("snkFilterBar.cleanFilter"), onClick: () => this.clear(), size: "small" })), h("ez-button", { ref: ref => this._applyButton = ref, label: this.getMessage("snkFilterBar.applyFilter"), onClick: () => this.apply(), size: "small", class: "ez-button--primary ez-padding-left--medium" }))));
|
168
170
|
}
|
169
171
|
get _element() { return this; }
|
@@ -1,22 +1,17 @@
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
2
|
-
import {
|
2
|
+
import { DateUtils, MaskFormatter, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
4
4
|
import { F as FilterNumberVariation } from './filterNumberVariation.js';
|
5
5
|
import { d as defineCustomElement$1 } from './snk-filter-detail2.js';
|
6
6
|
|
7
|
+
const snkFilterItemCss = "ez-popover-core.sc-snk-filter-item{--ez-popover__box--z-index:var(--elevation--20, 20);--ez-popover__box--overlay-z-index:var(--elevation--16, 16)}";
|
8
|
+
|
7
9
|
const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
8
10
|
constructor() {
|
9
11
|
super();
|
10
12
|
this.__registerHost();
|
11
13
|
this.visibleChanged = createEvent(this, "visibleChanged", 7);
|
12
14
|
this.filterChange = createEvent(this, "filterChange", 3);
|
13
|
-
this.innerClickCheck = (_floatingContainer, node) => {
|
14
|
-
if (node.id != FloatingManager.MODAL_ELEMENT_ID) {
|
15
|
-
return true;
|
16
|
-
}
|
17
|
-
this.detailIsVisible = false;
|
18
|
-
return false;
|
19
|
-
};
|
20
15
|
this.detailIsVisible = undefined;
|
21
16
|
this.config = undefined;
|
22
17
|
this.getMessage = undefined;
|
@@ -25,57 +20,28 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
25
20
|
observeDetailIsVisible(value) {
|
26
21
|
this.visibleChanged.emit(value);
|
27
22
|
}
|
23
|
+
/**
|
24
|
+
* Emitido quando o estado do filtro é alterado.
|
25
|
+
*/
|
26
|
+
filterChangeListener() {
|
27
|
+
this.hideDetail();
|
28
|
+
}
|
28
29
|
/**
|
29
30
|
* Exibe os detalhes de um item da lista.
|
30
31
|
*/
|
31
32
|
async showUp(open = false) {
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
(_a = this._chipElement) === null || _a === void 0 ? void 0 : _a.blur();
|
38
|
-
window.requestAnimationFrame(() => {
|
39
|
-
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, this.getFloatOptions());
|
40
|
-
this._popover.show();
|
41
|
-
this.detailIsVisible = true;
|
42
|
-
});
|
43
|
-
}
|
44
|
-
});
|
45
|
-
}
|
46
|
-
updatePosition() {
|
47
|
-
if (this._floatingID == undefined) {
|
48
|
-
return;
|
33
|
+
var _a;
|
34
|
+
this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
|
35
|
+
if (open) {
|
36
|
+
await ((_a = this._chipElement) === null || _a === void 0 ? void 0 : _a.setBlur());
|
37
|
+
await this._popover.showUnder(this._chipElement);
|
49
38
|
}
|
50
|
-
FloatingManager.updateFloatPosition(this._popover, this._popoverContainer, this.getFloatOptions());
|
51
39
|
}
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
left: this.getOffsetLeft(),
|
58
|
-
top: this.getOffsetTop(),
|
59
|
-
useOverlay: true,
|
60
|
-
overlayClassName: 'ez-scrim ez-scrim--light',
|
61
|
-
isFixed: true
|
62
|
-
};
|
63
|
-
}
|
64
|
-
getOffsetLeft() {
|
65
|
-
const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
|
66
|
-
const rect = this._filterItemElement.getBoundingClientRect();
|
67
|
-
// Width baseado no conteudo do snk-filter-detail. Nesse momento ele retorna 0px pois ainda não foi criado em tela.
|
68
|
-
const filterDetailWidth = 430;
|
69
|
-
const adjustRightPosition = filterDetailWidth - (document.body.clientWidth - rect.left);
|
70
|
-
return `calc(${rect.x}px + ${padding} - ${adjustRightPosition > 0 ? adjustRightPosition : 0}px)`;
|
71
|
-
}
|
72
|
-
getOffsetTop() {
|
73
|
-
const rect = this._filterItemElement.getBoundingClientRect();
|
74
|
-
return (rect.y + rect.height) + "px";
|
75
|
-
}
|
76
|
-
controlScrollPage() {
|
77
|
-
window.removeEventListener("scroll", this.updatePosition.bind(this));
|
78
|
-
window.addEventListener("scroll", this.updatePosition.bind(this));
|
40
|
+
/**
|
41
|
+
* Oculta os detalhes de um item da lista.
|
42
|
+
*/
|
43
|
+
async hideDetail() {
|
44
|
+
await this._popover.hide();
|
79
45
|
}
|
80
46
|
getConfigChanges() {
|
81
47
|
var _a;
|
@@ -88,51 +54,24 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
88
54
|
const newValue = hasMultiValues ? configToBeCleared.value.map((valueItem) => (Object.assign(Object.assign({}, valueItem), { check: false }))) : undefined;
|
89
55
|
return Object.assign(Object.assign({}, configToBeCleared), { value: newValue });
|
90
56
|
}
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
if (this._floatingID != undefined) {
|
97
|
-
FloatingManager.close(this._floatingID);
|
98
|
-
}
|
57
|
+
clearFilter(event) {
|
58
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
59
|
+
if (this.canClearFilter()) {
|
60
|
+
const configChanged = this.getConfigChanges();
|
61
|
+
this.filterChange.emit(configChanged);
|
99
62
|
}
|
100
|
-
|
101
|
-
|
102
|
-
this._floatingID = undefined;
|
103
|
-
this.detailIsVisible = false;
|
104
|
-
if (this._closeCallback) {
|
105
|
-
this._closeCallback();
|
106
|
-
this._closeCallback = undefined;
|
63
|
+
else {
|
64
|
+
this.togglePopover();
|
107
65
|
}
|
108
66
|
}
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
if (evt.target === this._rightIconElement && this.canClearFilter()) {
|
115
|
-
const configChanged = this.getConfigChanges();
|
116
|
-
this.filterChange.emit(configChanged);
|
117
|
-
}
|
118
|
-
else {
|
119
|
-
if (this.detailIsVisible) {
|
120
|
-
this.hideDetail();
|
121
|
-
}
|
122
|
-
else {
|
123
|
-
this.showUp(true);
|
124
|
-
}
|
125
|
-
}
|
126
|
-
evt.preventDefault();
|
127
|
-
evt.stopImmediatePropagation();
|
128
|
-
evt.stopPropagation();
|
67
|
+
async togglePopover(event) {
|
68
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
69
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
70
|
+
if (this.detailIsVisible) {
|
71
|
+
await this.hideDetail();
|
129
72
|
}
|
130
|
-
|
131
|
-
|
132
|
-
if (this.detailIsVisible && [this._chipElement, this._leftIconElement, this._rightIconElement].includes(evt.target)) {
|
133
|
-
evt.preventDefault();
|
134
|
-
evt.stopImmediatePropagation();
|
135
|
-
evt.stopPropagation();
|
73
|
+
else {
|
74
|
+
await this.showUp(true);
|
136
75
|
}
|
137
76
|
}
|
138
77
|
getLabel(isTooltipLabel = false) {
|
@@ -253,20 +192,6 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
253
192
|
ElementIDUtils.addIDInfo(this._filterItemElement);
|
254
193
|
this._idSnkFilterDetail = `filterDetail_${this.config.id}`;
|
255
194
|
}
|
256
|
-
this.controlScrollPage();
|
257
|
-
}
|
258
|
-
componentDidRender() {
|
259
|
-
if (this._floatingID == undefined) {
|
260
|
-
if (this._popover) {
|
261
|
-
this._popover.remove();
|
262
|
-
}
|
263
|
-
}
|
264
|
-
}
|
265
|
-
/**
|
266
|
-
* Emitido quando o estado do filtro é alterado.
|
267
|
-
*/
|
268
|
-
filterChangeListener() {
|
269
|
-
this.hideDetail();
|
270
195
|
}
|
271
196
|
canClearFilter() {
|
272
197
|
const { value, groupedItems = [] } = this.config;
|
@@ -297,28 +222,35 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
297
222
|
return (config.type !== FilterItemType.MULTI_LIST && config.value !== undefined) || this.hasActiveElements(config.value);
|
298
223
|
}
|
299
224
|
getEnabledChip() {
|
225
|
+
if (this.detailIsVisible) {
|
226
|
+
return true;
|
227
|
+
}
|
300
228
|
if (this.config.type === FilterItemType.PERSONALIZED) {
|
301
229
|
const { groupedItems = [] } = this.config;
|
302
230
|
return groupedItems.some(item => item.visible);
|
303
231
|
}
|
304
232
|
return this.hasActiveValue(this.config);
|
305
233
|
}
|
234
|
+
handleVisibilityPopover(event) {
|
235
|
+
this.detailIsVisible = event.detail;
|
236
|
+
}
|
306
237
|
render() {
|
307
238
|
const leftIcon = this.getLeftIconName();
|
308
|
-
return (h(Host, null, this.showChips && (h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon && (h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" })), h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" }))), h("
|
239
|
+
return (h(Host, null, this.showChips && (h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip(), onClick: (event) => this.togglePopover(event), disableAutoUpdateValue: true }, leftIcon && (h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" })), h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter", onClick: (event) => this.clearFilter(event) }))), h("ez-popover-core", { ref: elem => this._popover = elem, onEzVisibilityChange: (event) => this.handleVisibilityPopover(event) }, h("snk-filter-detail", { key: this.config.id, config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", "data-element-id": this._idSnkFilterDetail, showHardFixed: this.showChips }))));
|
309
240
|
}
|
310
241
|
get _filterItemElement() { return this; }
|
311
242
|
static get watchers() { return {
|
312
243
|
"detailIsVisible": ["observeDetailIsVisible"]
|
313
244
|
}; }
|
314
|
-
|
245
|
+
static get style() { return snkFilterItemCss; }
|
246
|
+
}, [2, "snk-filter-item", {
|
315
247
|
"config": [1040],
|
316
248
|
"getMessage": [16],
|
317
249
|
"showChips": [4, "show-chips"],
|
318
250
|
"detailIsVisible": [32],
|
319
251
|
"showUp": [64],
|
320
252
|
"hideDetail": [64]
|
321
|
-
}, [[
|
253
|
+
}, [[0, "filterChange", "filterChangeListener"]]]);
|
322
254
|
function defineCustomElement() {
|
323
255
|
if (typeof customElements === "undefined") {
|
324
256
|
return;
|