@sankhyalabs/sankhyablocks 10.1.0-dev.13 → 10.1.0-dev.15
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/{ConfigStorage-5c0590b3.js → ConfigStorage-a4e1e518.js} +2 -2
- package/dist/cjs/{DataFetcher-5181a917.js → DataFetcher-0b6aa084.js} +11 -22
- package/dist/cjs/{ISave-0f98a457.js → ISave-2c455a77.js} +1 -1
- package/dist/cjs/{SnkFormConfigManager-1907ffed.js → SnkFormConfigManager-b8c81493.js} +2 -2
- package/dist/cjs/{SnkMultiSelectionListDataSource-e4e38139.js → SnkMultiSelectionListDataSource-72925620.js} +5 -5
- package/dist/cjs/{auth-fetcher-cff55b1f.js → auth-fetcher-7e7796c9.js} +1 -1
- package/dist/cjs/config-header.cjs.entry.js +1 -1
- package/dist/cjs/configs-button.cjs.entry.js +1 -1
- package/dist/cjs/{dataunit-fetcher-1ba5e2cc.js → dataunit-fetcher-8dffbcdf.js} +1 -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 +1 -1
- package/dist/cjs/{form-config-fetcher-4a679e23.js → form-config-fetcher-5516d68a.js} +1 -1
- package/dist/cjs/guides-configurator.cjs.entry.js +1 -1
- package/dist/cjs/{index-13d05f03.js → index-516250fa.js} +1 -1
- package/dist/cjs/{index-1cf293c1.js → index-dc83c596.js} +0 -17
- 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_9.cjs.entry.js +6 -6
- package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +7 -7
- package/dist/cjs/snk-attach.cjs.entry.js +8 -8
- package/dist/cjs/snk-client-confirm.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +8 -8
- package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +1 -1
- package/dist/cjs/snk-custom-slot-guide.cjs.entry.js +1 -1
- package/dist/cjs/snk-data-exporter.cjs.entry.js +6 -6
- package/dist/cjs/{snk-data-unit-061487a8.js → snk-data-unit-47f02b9e.js} +3 -3
- package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
- package/dist/cjs/snk-default-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +10 -10
- package/dist/cjs/snk-entity-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/snk-expression-group_2.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +4 -4
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-detail.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +4 -4
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-number.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-period.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-search.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-view.cjs.entry.js +1 -1
- package/dist/cjs/snk-form_2.cjs.entry.js +5 -5
- package/dist/cjs/snk-grid.cjs.entry.js +20 -14
- package/dist/cjs/{snk-guides-viewer-2efe60a7.js → snk-guides-viewer-41c22d96.js} +7 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +10 -10
- package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +1 -1
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +5 -5
- package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
- package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +10 -10
- package/dist/cjs/snk-taskbar.cjs.entry.js +3 -3
- package/dist/cjs/{taskbar-elements-fb5d1e08.js → taskbar-elements-756fcbe7.js} +2 -2
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/components/snk-grid/snk-grid.js +12 -7
- package/dist/collection/lib/message/SnkMessageBuilder.js +11 -2
- package/dist/components/DataFetcher.js +11 -2
- package/dist/components/snk-grid2.js +12 -6
- package/dist/esm/{ConfigStorage-bd096633.js → ConfigStorage-39ac8fef.js} +2 -2
- package/dist/esm/{DataFetcher-5780ad39.js → DataFetcher-0b9da57d.js} +11 -2
- package/dist/esm/{ISave-8a22ec18.js → ISave-f1c9269b.js} +1 -1
- package/dist/esm/{SnkFormConfigManager-437e98bb.js → SnkFormConfigManager-a87566c8.js} +2 -2
- package/dist/esm/{SnkMultiSelectionListDataSource-42125ef4.js → SnkMultiSelectionListDataSource-493ae8c8.js} +5 -5
- package/dist/esm/{auth-fetcher-28b9d0db.js → auth-fetcher-acdc1cb4.js} +1 -1
- package/dist/esm/config-header.entry.js +1 -1
- package/dist/esm/configs-button.entry.js +1 -1
- package/dist/esm/{dataunit-fetcher-c4251d80.js → dataunit-fetcher-4c312b43.js} +1 -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 +1 -1
- package/dist/esm/{form-config-fetcher-d0536a71.js → form-config-fetcher-7cda6254.js} +1 -1
- package/dist/esm/guides-configurator.entry.js +1 -1
- package/dist/esm/{index-446f9341.js → index-3355bd17.js} +1 -1
- package/dist/esm/{index-479e1293.js → index-7fd74680.js} +0 -17
- package/dist/esm/loader.js +2 -2
- package/dist/esm/pesquisa-grid_2.entry.js +5 -5
- package/dist/esm/sankhyablocks.js +2 -2
- package/dist/esm/snk-actions-button_9.entry.js +6 -6
- package/dist/esm/snk-actions-form.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +7 -7
- package/dist/esm/snk-attach.entry.js +8 -8
- package/dist/esm/snk-client-confirm.entry.js +1 -1
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +8 -8
- package/dist/esm/snk-custom-slot-elements.entry.js +1 -1
- package/dist/esm/snk-custom-slot-guide.entry.js +1 -1
- package/dist/esm/snk-data-exporter.entry.js +6 -6
- package/dist/esm/{snk-data-unit-4a1ef77f.js → snk-data-unit-9e9d9d46.js} +3 -3
- package/dist/esm/snk-data-unit.entry.js +4 -4
- package/dist/esm/snk-default-filter.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +10 -10
- package/dist/esm/snk-entity-list.entry.js +1 -1
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-expression-group_2.entry.js +2 -2
- package/dist/esm/snk-filter-advanced-mode_2.entry.js +1 -1
- package/dist/esm/snk-filter-bar_4.entry.js +4 -4
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
- package/dist/esm/snk-filter-detail.entry.js +1 -1
- package/dist/esm/snk-filter-field-search_2.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +4 -4
- package/dist/esm/snk-filter-multi-select.entry.js +1 -1
- package/dist/esm/snk-filter-number.entry.js +1 -1
- package/dist/esm/snk-filter-period.entry.js +1 -1
- package/dist/esm/snk-filter-search.entry.js +1 -1
- package/dist/esm/snk-filter-text.entry.js +1 -1
- package/dist/esm/snk-form-summary.entry.js +1 -1
- package/dist/esm/snk-form-view.entry.js +1 -1
- package/dist/esm/snk-form_2.entry.js +5 -5
- package/dist/esm/snk-grid.entry.js +20 -14
- package/dist/esm/{snk-guides-viewer-c182d058.js → snk-guides-viewer-31ef5fc6.js} +7 -7
- package/dist/esm/snk-guides-viewer.entry.js +10 -10
- package/dist/esm/snk-personalized-filter-editor.entry.js +1 -1
- package/dist/esm/snk-personalized-filter.entry.js +5 -5
- package/dist/esm/snk-pesquisa.entry.js +5 -5
- package/dist/esm/snk-print-selector.entry.js +1 -1
- package/dist/esm/snk-simple-bar.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +10 -10
- package/dist/esm/snk-taskbar.entry.js +3 -3
- package/dist/esm/{taskbar-elements-faaf5d8f.js → taskbar-elements-bf5b73f1.js} +2 -2
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/p-02cb4829.entry.js +1 -0
- package/dist/sankhyablocks/{p-78d4b3e3.entry.js → p-0893a694.entry.js} +1 -1
- package/dist/sankhyablocks/{p-5d408e7e.entry.js → p-0da30fd9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-55d7abe7.js → p-156c9f38.js} +1 -1
- package/dist/sankhyablocks/{p-f35f2eb3.entry.js → p-17856827.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b987e15d.js → p-1be69fd4.js} +1 -1
- package/dist/sankhyablocks/{p-e679c75a.entry.js → p-1dba30c9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-21107f0d.entry.js → p-1e469905.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0e4f8b86.js → p-1f310bc6.js} +1 -1
- package/dist/sankhyablocks/{p-96d45943.entry.js → p-227e82b2.entry.js} +1 -1
- package/dist/sankhyablocks/p-2624dfd2.entry.js +1 -0
- package/dist/sankhyablocks/{p-aca74b21.js → p-2ac55a5d.js} +1 -1
- package/dist/sankhyablocks/{p-99a11017.entry.js → p-301baf9c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2e882241.entry.js → p-357e10e0.entry.js} +1 -1
- package/dist/sankhyablocks/{p-987cd79d.entry.js → p-35a26068.entry.js} +1 -1
- package/dist/sankhyablocks/{p-180716b2.entry.js → p-3671cdd4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-27482793.entry.js → p-4575c4aa.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3c046287.js → p-48a5c311.js} +2 -2
- package/dist/sankhyablocks/{p-3d41f5a8.entry.js → p-497ece60.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6e5af618.entry.js → p-4deb7f46.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9f16d33e.entry.js → p-4e9e570c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3b167a03.entry.js → p-516411de.entry.js} +1 -1
- package/dist/sankhyablocks/{p-162bddae.entry.js → p-522d36aa.entry.js} +1 -1
- package/dist/sankhyablocks/p-52691b42.js +1 -0
- package/dist/sankhyablocks/{p-825098c1.entry.js → p-56b1b397.entry.js} +1 -1
- package/dist/sankhyablocks/{p-d3534985.js → p-59158ba4.js} +1 -1
- package/dist/sankhyablocks/{p-c98c79c3.entry.js → p-5c9bea92.entry.js} +1 -1
- package/dist/sankhyablocks/{p-91a9abb6.entry.js → p-613eb22e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-49ddc27a.entry.js → p-670b8802.entry.js} +1 -1
- package/dist/sankhyablocks/{p-60dd1d27.entry.js → p-67137d7c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1b1373b6.js → p-6768f176.js} +1 -1
- package/dist/sankhyablocks/{p-03f02b12.entry.js → p-7375bf6a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b7e891cc.entry.js → p-7961c550.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4db9dbf8.js → p-7ee6b1bf.js} +1 -1
- package/dist/sankhyablocks/{p-75af335e.entry.js → p-82b59a45.entry.js} +1 -1
- package/dist/sankhyablocks/p-82bb3eda.js +2 -0
- package/dist/sankhyablocks/{p-55798617.js → p-8336900b.js} +1 -1
- package/dist/sankhyablocks/{p-d2ec9a24.entry.js → p-8488fa7e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-cb4343c4.entry.js → p-8783d550.entry.js} +1 -1
- package/dist/sankhyablocks/{p-471b34f4.entry.js → p-8d76a0ca.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9a63f3f7.entry.js → p-8d84d6ab.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a1d23fef.js → p-907e96eb.js} +1 -1
- package/dist/sankhyablocks/{p-e258de96.entry.js → p-939523b3.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a9b16874.entry.js → p-959fe522.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7e250432.entry.js → p-98c70173.entry.js} +1 -1
- package/dist/sankhyablocks/{p-82a3d522.entry.js → p-98e3d0a1.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9ab6ae1e.js → p-9e4555ab.js} +2 -2
- package/dist/sankhyablocks/{p-2fdac5e6.entry.js → p-abfc9880.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1037ea7b.entry.js → p-b5832fa0.entry.js} +1 -1
- package/dist/sankhyablocks/{p-01ca59fc.entry.js → p-c2bb0659.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7f7fe6c4.entry.js → p-c60d864f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-028fb380.entry.js → p-cb7c592f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f3027bc9.entry.js → p-cc68a0c1.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c3dbf441.entry.js → p-ce207f2a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c4fcf1fb.entry.js → p-cfa4c183.entry.js} +1 -1
- package/dist/sankhyablocks/{p-42272de8.entry.js → p-d5d7fe52.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b04db4ac.entry.js → p-dd89bc02.entry.js} +1 -1
- package/dist/sankhyablocks/{p-667cab42.entry.js → p-def17f0e.entry.js} +1 -1
- package/dist/sankhyablocks/p-e41c86b2.entry.js +1 -0
- package/dist/sankhyablocks/{p-4c2e2767.entry.js → p-e47d6f17.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7345782c.entry.js → p-fd1a5a61.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +1 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-30a58e29.entry.js +0 -1
- package/dist/sankhyablocks/p-903fa0b4.entry.js +0 -1
- package/dist/sankhyablocks/p-b9699067.js +0 -1
- package/dist/sankhyablocks/p-d8d8169b.js +0 -2
- package/dist/sankhyablocks/p-fd05e31d.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-2db38ff2.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, r as registerInstance, c as createEvent, g as getElement } from './index-
|
|
1
|
+
import { h, r as registerInstance, c as createEvent, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { S as SelectedItemType } from './index-620ac460.js';
|
|
3
3
|
import { UserInterface, JSUtils, ElementIDUtils, ApplicationContext, StringUtils, DataType } from '@sankhyalabs/core';
|
|
4
4
|
import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
|
3
|
+
import { C as ConfigStorage } from './ConfigStorage-39ac8fef.js';
|
|
4
4
|
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
|
5
5
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
|
6
6
|
import { F as FilterType } from './filter-type.enum-f6a8fe23.js';
|
|
7
|
-
import './form-config-fetcher-
|
|
8
|
-
import './DataFetcher-
|
|
7
|
+
import './form-config-fetcher-7cda6254.js';
|
|
8
|
+
import './DataFetcher-0b9da57d.js';
|
|
9
9
|
import './PrintUtils-3e4ff0f5.js';
|
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
11
11
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
|
4
4
|
import { F as FilterNumberVariation } from './filterNumberVariation-8cee02ea.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
|
4
4
|
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
4
|
const SnkFilterText = class {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
4
|
const BOUNDARY_FALSE_POSITIVE_VALUE = 14;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-7fd74680.js';
|
|
2
2
|
import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { DataBinder } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
|
4
4
|
import { focusOnFieldSerch, SEARCH_FIELD_FULL_WIDTH, FormLayout } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-7fd74680.js';
|
|
2
2
|
import { ElementIDUtils, ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-a87566c8.js';
|
|
4
4
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
|
5
5
|
import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
|
6
6
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
7
|
-
import { U as UserConfigType } from './form-config-fetcher-
|
|
7
|
+
import { U as UserConfigType } from './form-config-fetcher-7cda6254.js';
|
|
8
8
|
import { a as TAB_NAMES, G as GROUP_NAMES } from './constants-7b422de0.js';
|
|
9
9
|
import { b as buildGuides, a as buildChildrenGuides, c as buildCustomGuides, d as buildGuidesMap, g as getFieldsToSave, u as updateTabInFieldsFromGroupList, e as buildNewGuideName } from './FormConfigHelper-d09669f3.js';
|
|
10
|
-
import './ConfigStorage-
|
|
11
|
-
import './DataFetcher-
|
|
10
|
+
import './ConfigStorage-39ac8fef.js';
|
|
11
|
+
import './DataFetcher-0b9da57d.js';
|
|
12
12
|
import './PrintUtils-3e4ff0f5.js';
|
|
13
13
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
14
14
|
import './filter-item-type.enum-d45e026f.js';
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { KeyboardManager, Action, ElementIDUtils, ApplicationContext, StringUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
4
4
|
import { buildFieldSearch } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
-
import './DataFetcher-
|
|
6
|
-
import './ISave-
|
|
7
|
-
import { C as CommonsExporter,
|
|
5
|
+
import './DataFetcher-0b9da57d.js';
|
|
6
|
+
import './ISave-f1c9269b.js';
|
|
7
|
+
import { C as CommonsExporter, a as CrudUtils, S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, c as ClientSideExporterProvider } from './SnkMultiSelectionListDataSource-493ae8c8.js';
|
|
8
8
|
import { P as PresentationMode, E as ExporterStrategy } from './index-b40568ff.js';
|
|
9
9
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
11
|
-
import './dataunit-fetcher-
|
|
11
|
+
import './dataunit-fetcher-4c312b43.js';
|
|
12
12
|
import './filter-item-type.enum-d45e026f.js';
|
|
13
|
-
import './form-config-fetcher-
|
|
13
|
+
import './form-config-fetcher-7cda6254.js';
|
|
14
14
|
import './constants-7b422de0.js';
|
|
15
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
|
16
|
-
import { s as store } from './index-
|
|
15
|
+
import { C as ConfigStorage } from './ConfigStorage-39ac8fef.js';
|
|
16
|
+
import { s as store } from './index-3355bd17.js';
|
|
17
17
|
import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
|
|
18
18
|
import { v as validateFilters } from './filter-validate-faf51fa9.js';
|
|
19
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
|
19
|
+
import { T as TaskbarElement } from './taskbar-elements-bf5b73f1.js';
|
|
20
20
|
import { T as TaskbarProcessor } from './taskbar-processor-3436124c.js';
|
|
21
21
|
import './PrintUtils-3e4ff0f5.js';
|
|
22
22
|
import './IFetchDataExporterParams-d73bed3d.js';
|
|
@@ -127,7 +127,7 @@ const SnkGrid = class {
|
|
|
127
127
|
this._showSnkFilterBar = true;
|
|
128
128
|
this._enableContinuousInsert = false;
|
|
129
129
|
this._filterMode = 'regular';
|
|
130
|
-
this.columnFilterDataSource =
|
|
130
|
+
this.columnFilterDataSource = undefined;
|
|
131
131
|
this.enableLockManagerLoadingComp = false;
|
|
132
132
|
this.enableLockManagerTaskbarClick = false;
|
|
133
133
|
this.configName = undefined;
|
|
@@ -454,14 +454,20 @@ const SnkGrid = class {
|
|
|
454
454
|
}
|
|
455
455
|
return action;
|
|
456
456
|
}
|
|
457
|
+
initializeColumnFilterDataSource() {
|
|
458
|
+
var _a, _b, _c;
|
|
459
|
+
const isInMemoryDataUnit = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.name.includes("InMemoryDataUnit");
|
|
460
|
+
if (!this.columnFilterDataSource && !isInMemoryDataUnit) {
|
|
461
|
+
this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
|
|
462
|
+
}
|
|
463
|
+
(_b = this.columnFilterDataSource) === null || _b === void 0 ? void 0 : _b.setApplication(this._application);
|
|
464
|
+
(_c = this.columnFilterDataSource) === null || _c === void 0 ? void 0 : _c.setDataUnit(this._dataUnit);
|
|
465
|
+
}
|
|
457
466
|
finishLoading() {
|
|
458
467
|
this._dataUnit.addInterceptor(this.dataUnitInterceptor);
|
|
459
468
|
CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
|
460
469
|
this.addElementID();
|
|
461
|
-
|
|
462
|
-
this.columnFilterDataSource.setApplication(this._application);
|
|
463
|
-
this.columnFilterDataSource.setDataUnit(this._dataUnit);
|
|
464
|
-
}
|
|
470
|
+
this.initializeColumnFilterDataSource();
|
|
465
471
|
}
|
|
466
472
|
setCustomRenders() {
|
|
467
473
|
if (!this._grid) {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { ObjectUtils, StringUtils, Action, KeyboardManager, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
4
4
|
import { buildFieldSearch, SHORTCUT_SEARCH_FIELD } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
5
|
import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
|
6
|
-
import './DataFetcher-
|
|
7
|
-
import './ISave-
|
|
6
|
+
import './DataFetcher-0b9da57d.js';
|
|
7
|
+
import './ISave-f1c9269b.js';
|
|
8
8
|
import { P as PresentationMode } from './index-b40568ff.js';
|
|
9
9
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
11
|
-
import './dataunit-fetcher-
|
|
11
|
+
import './dataunit-fetcher-4c312b43.js';
|
|
12
12
|
import './filter-item-type.enum-d45e026f.js';
|
|
13
|
-
import './form-config-fetcher-
|
|
13
|
+
import './form-config-fetcher-7cda6254.js';
|
|
14
14
|
import { V as VIEW_MODE } from './constants-7b422de0.js';
|
|
15
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
|
16
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
|
15
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-a87566c8.js';
|
|
16
|
+
import { T as TaskbarElement } from './taskbar-elements-bf5b73f1.js';
|
|
17
17
|
import { T as TaskbarProcessor } from './taskbar-processor-3436124c.js';
|
|
18
18
|
|
|
19
19
|
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-small);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-small));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-small))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export { S as snk_guides_viewer } from './snk-guides-viewer-
|
|
2
|
-
import './index-
|
|
1
|
+
export { S as snk_guides_viewer } from './snk-guides-viewer-31ef5fc6.js';
|
|
2
|
+
import './index-7fd74680.js';
|
|
3
3
|
import '@sankhyalabs/core';
|
|
4
4
|
import '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
5
5
|
import '@sankhyalabs/ezui/dist/collection/utils';
|
|
6
6
|
import '@sankhyalabs/ezui/dist/collection/utils/form';
|
|
7
|
-
import './DataFetcher-
|
|
7
|
+
import './DataFetcher-0b9da57d.js';
|
|
8
8
|
import './PrintUtils-3e4ff0f5.js';
|
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
10
|
-
import './ISave-
|
|
10
|
+
import './ISave-f1c9269b.js';
|
|
11
11
|
import './index-b40568ff.js';
|
|
12
12
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
13
|
-
import './dataunit-fetcher-
|
|
13
|
+
import './dataunit-fetcher-4c312b43.js';
|
|
14
14
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
|
15
15
|
import '@sankhyalabs/core/dist/utils/SortingUtils';
|
|
16
16
|
import './ResourceIDUtils-a114189a.js';
|
|
17
17
|
import './filter-item-type.enum-d45e026f.js';
|
|
18
|
-
import './form-config-fetcher-
|
|
18
|
+
import './form-config-fetcher-7cda6254.js';
|
|
19
19
|
import './constants-7b422de0.js';
|
|
20
|
-
import './SnkFormConfigManager-
|
|
21
|
-
import './ConfigStorage-
|
|
22
|
-
import './taskbar-elements-
|
|
23
|
-
import './index-
|
|
20
|
+
import './SnkFormConfigManager-a87566c8.js';
|
|
21
|
+
import './ConfigStorage-39ac8fef.js';
|
|
22
|
+
import './taskbar-elements-bf5b73f1.js';
|
|
23
|
+
import './index-3355bd17.js';
|
|
24
24
|
import './taskbar-processor-3436124c.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { ElementIDUtils, UserInterface, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
|
4
4
|
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-7fd74680.js';
|
|
2
2
|
import { StringUtils, ObjectUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-2db38ff2.js';
|
|
4
|
-
import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-
|
|
4
|
+
import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-39ac8fef.js';
|
|
5
5
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
6
6
|
import { a as FilterGroupCondition, D as DefaultFilter } from './index-8acbae97.js';
|
|
7
|
-
import { s as store } from './index-
|
|
7
|
+
import { s as store } from './index-3355bd17.js';
|
|
8
8
|
import './filter-item-type.enum-d45e026f.js';
|
|
9
|
-
import './form-config-fetcher-
|
|
10
|
-
import './DataFetcher-
|
|
9
|
+
import './form-config-fetcher-7cda6254.js';
|
|
10
|
+
import './DataFetcher-0b9da57d.js';
|
|
11
11
|
import './PrintUtils-3e4ff0f5.js';
|
|
12
12
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
13
13
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { ObjectUtils, StringUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
|
-
import { P as PesquisaFetcher, b as buildGridMetadata, a as PESQUISA_VIEW_MODE } from './ISave-
|
|
4
|
-
import './DataFetcher-
|
|
3
|
+
import { P as PesquisaFetcher, b as buildGridMetadata, a as PESQUISA_VIEW_MODE } from './ISave-f1c9269b.js';
|
|
4
|
+
import './DataFetcher-0b9da57d.js';
|
|
5
5
|
import './index-b40568ff.js';
|
|
6
6
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
7
7
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
8
|
-
import './dataunit-fetcher-
|
|
8
|
+
import './dataunit-fetcher-4c312b43.js';
|
|
9
9
|
import './filter-item-type.enum-d45e026f.js';
|
|
10
|
-
import './form-config-fetcher-
|
|
10
|
+
import './form-config-fetcher-7cda6254.js';
|
|
11
11
|
import './constants-7b422de0.js';
|
|
12
12
|
import './PrintUtils-3e4ff0f5.js';
|
|
13
13
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { P as PrintUtils } from './PrintUtils-3e4ff0f5.js';
|
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
|
|
4
4
|
const snkSimpleBarCss = ".sc-snk-simple-bar-h{display:flex;height:100%;width:100%}.simple-bar__container.sc-snk-simple-bar{flex:1;display:flex;align-items:stretch;gap:var(--space--small)}.simple-bar__left-slot.sc-snk-simple-bar{min-width:280px;flex:1;display:flex;align-items:center}.simple-bar__right-slot.sc-snk-simple-bar{flex:1;display:flex;align-items:center;justify-content:flex-end}.simple-bar__column.sc-snk-simple-bar{flex:1;display:flex;flex-direction:column}";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { StringUtils, ApplicationContext, ObjectUtils, Action, DataType, UserInterface, KeyboardManager, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { CSSVarsUtils, buildFieldSearch } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
import { V as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-7b422de0.js';
|
|
5
|
-
import { T as TaskbarElement } from './taskbar-elements-
|
|
6
|
-
import './DataFetcher-
|
|
7
|
-
import './ISave-
|
|
8
|
-
import { S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, a as CrudUtils, c as ClientSideExporterProvider } from './SnkMultiSelectionListDataSource-
|
|
5
|
+
import { T as TaskbarElement } from './taskbar-elements-bf5b73f1.js';
|
|
6
|
+
import './DataFetcher-0b9da57d.js';
|
|
7
|
+
import './ISave-f1c9269b.js';
|
|
8
|
+
import { S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, a as CrudUtils, c as ClientSideExporterProvider } from './SnkMultiSelectionListDataSource-493ae8c8.js';
|
|
9
9
|
import { P as PresentationMode } from './index-b40568ff.js';
|
|
10
10
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
11
11
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
12
|
-
import { I as InMemoryLoader } from './dataunit-fetcher-
|
|
12
|
+
import { I as InMemoryLoader } from './dataunit-fetcher-4c312b43.js';
|
|
13
13
|
import './filter-item-type.enum-d45e026f.js';
|
|
14
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
|
14
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-7cda6254.js';
|
|
15
15
|
import { T as TaskbarProcessor } from './taskbar-processor-3436124c.js';
|
|
16
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
|
17
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
|
18
|
-
import { s as store } from './index-
|
|
16
|
+
import { C as ConfigStorage } from './ConfigStorage-39ac8fef.js';
|
|
17
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-a87566c8.js';
|
|
18
|
+
import { s as store } from './index-3355bd17.js';
|
|
19
19
|
import './PrintUtils-3e4ff0f5.js';
|
|
20
20
|
import './GetSelectedRecordsIDsInfo-9fa41508.js';
|
|
21
21
|
import './IFetchDataExporterParams-d73bed3d.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-7fd74680.js';
|
|
2
2
|
import { Action, ElementIDUtils, LockManager, LockManagerOperation, SilentException, StringUtils, ApplicationContext, OVERFLOWED_CLASS_NAME, OverflowWatcher, OverflowDirection } from '@sankhyalabs/core';
|
|
3
3
|
import { P as PresentationMode } from './index-b40568ff.js';
|
|
4
4
|
import { A as AuthorizationConfig } from './AuthorizationConfig-dcbd207a.js';
|
|
5
|
-
import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-
|
|
6
|
-
import './index-
|
|
5
|
+
import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-bf5b73f1.js';
|
|
6
|
+
import './index-3355bd17.js';
|
|
7
7
|
|
|
8
8
|
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex;flex-wrap:wrap}.no-wrap.sc-snk-taskbar-h{flex-wrap:nowrap}.full-width.sc-snk-taskbar-h{width:100%}.align-right.sc-snk-taskbar-h{justify-content:flex-end}.overflowed.sc-snk-taskbar{display:none}";
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h } from './index-
|
|
1
|
+
import { h } from './index-7fd74680.js';
|
|
2
2
|
import { P as PresentationMode } from './index-b40568ff.js';
|
|
3
|
-
import { s as store } from './index-
|
|
3
|
+
import { s as store } from './index-3355bd17.js';
|
|
4
4
|
|
|
5
5
|
var TaskbarElement;
|
|
6
6
|
(function (TaskbarElement) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{S as snk_data_unit}from"./p-156c9f38.js";import"./p-82bb3eda.js";import"@sankhyalabs/core";import"@sankhyalabs/ezui/dist/collection/utils";import"./p-6768f176.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-9e4555ab.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"./p-7dd49d15.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,f as s,h as e,H as a,g as o}from"./p-d8d8169b.js";import{Action as h,StringUtils as n,KeyboardManager as r}from"@sankhyalabs/core";import{S as d}from"./p-aca74b21.js";import{FormMetadata as l,buildFormMetadata as c}from"@sankhyalabs/ezui/dist/collection/utils/form";import{S as u}from"./p-1b1373b6.js";import"./p-3c046287.js";import{P as m}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-9ab6ae1e.js";import"./p-ff1990ad.js";import"./p-4db9dbf8.js";import{V as v}from"./p-9019a32f.js";import{T as p}from"./p-b987e15d.js";import{S as g}from"./p-a1d23fef.js";import{buildFieldSearch as f,SHORTCUT_SEARCH_FIELD as b}from"@sankhyalabs/ezui/dist/collection/utils";import"./p-0e4f8b86.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-55798617.js";import"@sankhyalabs/core/dist/dataunit/DataUnit";import"./p-1a0caadb.js";class k{constructor(t,i,s,e){this._parentGuide=t,this._formMetadata=i,this._dataUnit=s,this._messageBuilder=e,this._messageBuilder||(this._messageBuilder=new u)}get id(){return this._parentGuide.id}getMessage(t,i){return this._messageBuilder.getMessage(t,i)}buildGuideItem(t){const i=Object.assign({},this._parentGuide);delete i.expanded,delete i.children;const s=this._dataUnit.getSelectedRecord();if(!s)return i;const e=this._dataUnit.isNewRecord(s.__record__id__),a=Array.from(this._formMetadata.getAllSheets().values()).map((i=>{const{name:s,label:a}=i,o=null!=l.getDetailName(s.split("::").pop()),h=o&&e,n=this._parentGuide.id,r=o?`${n}::${s}`:`${n}__FORM:${s}`;return o&&t.has(r)&&!h?t.get(r).buildGuideItem(t):{id:r,label:a,disabled:h,tooltip:h?this.getMessage("snkCrud.guide.tooltip.disabledDetail"):void 0}})),o=a.shift();return o.label=e?this.getMessage("snkCrud.title.newRecord"):s.__record__label__,o.children=a,i.children=[o],i}}const w=class{constructor(s){t(this,s),this.snkDetailGuidesChange=i(this,"snkDetailGuidesChange",7),this.snkSwitchGuide=i(this,"snkSwitchGuide",7),this.formItemsReady=i(this,"formItemsReady",7),this._disabledButtons=void 0,this._currentView=void 0,this.attachmentRegisterKey=void 0,this._fieldToGetFocus=void 0,this._hasToCreateFieldSearch=!0,this.formConfigManager=void 0,this.dataUnitName=void 0,this.resourceID=void 0,this.guideItemPath=void 0,this.entityName=void 0,this.label=void 0,this.dataUnit=void 0,this.selectedForm=void 0,this.dataState=void 0,this.messagesBuilder=void 0,this.branchGuide=void 0,this.canEdit=!0,this.taskbarCustomContainerId=void 0,this.customEditors=void 0,this.customRenders=void 0,this.presentationMode=m.SECONDARY}observeDataUnit(t,i){null==t||t.subscribe(this.dataUnitActionHandler.bind(this)),null==i||i.unsubscribe(this.dataUnitActionHandler)}observerDataState(t,i){const s=!(null==i?void 0:i.insertionMode)&&(null==t?void 0:t.insertionMode),e=(null==i?void 0:i.insertionMode)&&!(null==t?void 0:t.insertionMode);if((s||e)&&this.loadMetadata(),null==this._formMetadata)return;const a=null==t?void 0:t.selectedRecord,o=null==i?void 0:i.selectedRecord;(null==a?void 0:a.__record__id__)!==(null==o?void 0:o.__record__id__)&&this.snkDetailGuidesChange.emit(new k(this.branchGuide,this._formMetadata,this.dataUnit,this.messagesBuilder)),s&&setTimeout((()=>{this.changeViewMode(v.FORM)}),0),e&&this.changeViewMode(v.GRID);const h=[];this.dataState.hasPrevious||h.push(p.PREVIOUS),this.dataState.hasNext||h.push(p.NEXT),this.dataState.insertionMode&&h.push(p.INSERT),this._disabledButtons=h}async changeViewMode(t){this.emitSwitchEvent(t)}async configGrid(){this._snkGrid&&this._snkGrid.showConfig()}async showUp(){this._snkFormView&&this._snkFormView.showUp(),this._snkGrid&&this._snkGrid.scrollIntoView({behavior:"smooth",block:"start"})}async addCustomEditor(t,i){var s;const e=this.normalizeBranchGuideId(null===(s=this.branchGuide)||void 0===s?void 0:s.id);this._snkGrid.addCustomEditor(t,i,e),this._snkFormView.addCustomEditor(t,i,e)}async observerPropsCustomEditor(t){for(const i in t)await this.addCustomEditor(i,t[i])}async addGridCustomRender(t,i){var s;const e=this.normalizeBranchGuideId(null===(s=this.branchGuide)||void 0===s?void 0:s.id);await this._snkGrid.addGridCustomRender(t,i,e)}onContentCardChanged(t){g.updateContentCard(t.detail.formName,t.detail.cardConfig,t.detail.propertyChanged,this.formConfigManager).then((()=>s(this))),t.stopPropagation()}async observeCustomRenders(t){for(const i in t){const s=t[i];await this.addGridCustomRender(i,s)}}updateLabel(){const t=this.guideItemPath?this.guideItemPath.length:0;if(t>0){const i=t>0?this.guideItemPath.map((t=>t.label)):void 0;this.label=i.pop(),this._levelPath=i.length>0?i.join(" / "):void 0}else this.label="",this._levelPath=void 0}getFormGuideId(t){var i;if(!t){if(null==(null===(i=this.dataState)||void 0===i?void 0:i.selectedRecord))return;const s=Array.from(this._formMetadata.getAllSheets().keys());if(!s||0==s.length)return;t=s[0]}return`${this.stripFormPattern(this.branchGuide.id)}__FORM:${t}`}stripFormPattern(t){return t.replace(w.REGEX_FORM_ID,"")}loadMetadata(){if(!this.dataUnit)return;if(!this.formConfigManager.isLoaded)return;const t=this.formConfigManager.getConfig(this.dataUnit);this._formMetadata=c(null==t||0===t.fields.length?void 0:t,this.dataUnit,!0)}dataUnitReadyHandler(t){this.dataUnit=t.detail,this.loadMetadata()}updateViewStack(t){var i,s;this._viewStack=t,this._currentView=this.selectedForm?1:0,null===(s=null===(i=this._viewStack)||void 0===i?void 0:i.show)||void 0===s||s.call(i,this._currentView)}getFormFields(){return this.selectedForm&&this._formMetadata?this._formMetadata.getSheet(this.selectedForm).fields:[]}emitSwitchEvent(t){const i=t===v.GRID?this.stripFormPattern(this.branchGuide.id):this.getFormGuideId();i&&this.snkSwitchGuide.emit(i)}handleAttachBack(){this._viewStack.show(v.GRID)}executeActionHandler(t){t.detail===p.GRID_MODE&&(this.emitSwitchEvent(v.GRID),t.stopPropagation()),t.detail!==p.FORM_MODE&&t.detail!==p.UPDATE||(this.emitSwitchEvent(v.FORM),t.stopPropagation()),t.detail===p.ATTACH&&(this._viewStack.show(v.ATTACHMENT),t.stopPropagation())}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}async handleDataStateChange({detail:t}){this.dataState=t,void 0!==t.selectedRecord&&this._snkDataUnit&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey())}componentWillLoad(){this._configName=`dynaform.${this.entityName}`,this.formConfigManager=new d(this._configName,this.resourceID,(()=>this.loadMetadata()),this.dataUnit),this.formConfigManager.loadConfig(),null==this.messagesBuilder&&(this.messagesBuilder=new u(this.entityName))}async componentDidLoad(){await this.observerPropsCustomEditor(this.customEditors),await this.observeCustomRenders(this.customRenders),this.initKeyboardManager()}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}async dataUnitActionHandler(t){t.type===h.FIELD_INVALIDATED&&this.addErrorBadgeToBranchGuide()}addErrorBadgeToBranchGuide(){this.branchGuide=Object.assign(Object.assign({},this.branchGuide),{badge:"error"}),this.snkDetailGuidesChange.emit(new k(this.branchGuide,this._formMetadata,this.dataUnit,this.messagesBuilder))}normalizeBranchGuideId(t){return null==t?void 0:t.replace(/child\[(.*?)\]/g,"$1").replace(/::/g,">")}getSettingsListForm(){return[{value:n.generateUUID(),label:this.messagesBuilder.getMessage("snkCrud.findColumn",void 0),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(t,i)=>this.getFieldsSearch(i)}]}getFieldsSearch(t){return(null==this._fieldSearch||this._hasToCreateFieldSearch)&&(this._hasToCreateFieldSearch=!1,this._fieldSearch=f(t,(({argument:t})=>this.fieldsOptionLoader(t)),(t=>this.onSelectField(t)))),this._fieldSearch}fieldsOptionLoader(t){const i=null==t?void 0:t.toLowerCase(),s=this.getFormFields().map((t=>{var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getField(t.name)})).filter((t=>{var s,e;return(null===(s=t.name)||void 0===s?void 0:s.toLowerCase().includes(i))||(null===(e=t.label)||void 0===e?void 0:e.toLowerCase().includes(i))})).map((t=>({value:t.name,label:t.label})));return Promise.resolve(s)}onSelectField(t){null!=t&&(this._fieldToGetFocus=t.value)}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}async initKeyboardManager(){this._keyboardManager=new r({propagate:!1,element:this._element}),this._keyboardManager.bind(b,(async()=>{await this._snkFormView.showSearchField()}),{description:this.messagesBuilder.getMessage("snkSimpleCrud.findFields"),element:this._element})}render(){return this.updateLabel(),e(a,null,e("snk-data-unit",{ref:t=>this._snkDataUnit=t,dataUnitName:`${this.dataUnitName}`,onDataUnitReady:t=>this.dataUnitReadyHandler(t),entityName:this.entityName,onDataStateChange:this.handleDataStateChange.bind(this),ignoreSaveMessage:this._currentView===v.GRID,messagesBuilder:this.messagesBuilder,configName:this._configName},e("ez-view-stack",{ref:t=>this.updateViewStack(t)},e("stack-item",null,e("div",{class:"ez-box ez-box--shadow grid-container"},e("div",{class:"ez-title--primary ez-size-width--full ez-padding--large detail-header"},e("div",{class:"ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center"},this._levelPath?e("span",{class:"level-path"},this._levelPath+" /"):void 0,this.label)),e("snk-grid",{class:"ez-size-width--full",ref:t=>this._snkGrid=t,configName:this._configName,messagesBuilder:this.messagesBuilder,onGridDoubleClick:()=>this.emitSwitchEvent(v.FORM),onActionClick:t=>this.executeActionHandler(t),presentationMode:this.presentationMode,canEdit:this.canEdit,isDetail:!0,taskbarCustomContainerId:this.taskbarCustomContainerId,gridHeaderCustomSlotId:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS",topTaskbarCustomSlotId:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS",outlineMode:!1}))),e("stack-item",null,e("snk-form-view",{ref:t=>this._snkFormView=t,canExpand:!1,canFix:!1,name:this.selectedForm,formMetadata:this._formMetadata,dataUnit:this.dataUnit,fields:this.getFormFields(),fieldToFocus:this._fieldToGetFocus,label:this.label,levelPath:this._levelPath,onFormItemsReady:({detail:t})=>this.formItemsReady.emit(t),onSnkRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),fieldSearch:this._fieldSearch},e("snk-taskbar",{key:"guideViewerTaskbar",class:"form-taskbar","data-element-id":"guideViewer",configName:this._configName,messagesBuilder:this.messagesBuilder,disabledButtons:this._disabledButtons,buttons:"INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR",primaryButton:"INSERT",presentationMode:this.presentationMode,onActionClick:t=>this.executeActionHandler(t),dataUnit:this.dataUnit,resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:"DETAIL_TASKBAR_CUSTOM_ELEMENTS",actionsSettingsList:this.getSettingsListForm()},e("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})))),e("stack-item",null,e("snk-attach",{registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this.entityName,onBack:this.handleAttachBack.bind(this)})))))}get _element(){return o(this)}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observerDataState"],customEditors:["observerPropsCustomEditor"],customRenders:["observeCustomRenders"]}}};w.REGEX_FORM_ID=/__FORM:[^:]+/g,w.style=".sc-snk-detail-view-h{display:flex;row-gap:24px;flex-direction:column;width:100%;height:100%}.level-path.sc-snk-detail-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.form-taskbar.sc-snk-detail-view{padding-bottom:var(--space--medium)}.grid-container.sc-snk-detail-view{background-color:#FFF;min-height:100px;height:100%}.detail-header.sc-snk-detail-view{padding-bottom:0}snk-data-unit.sc-snk-detail-view{flex:1}snk-grid.sc-snk-detail-view{height:calc(100% - 43px)}";export{w as snk_detail_view}
|
|
1
|
+
import{r as t,c as i,f as s,h as e,H as a,g as o}from"./p-82bb3eda.js";import{Action as h,StringUtils as n,KeyboardManager as r}from"@sankhyalabs/core";import{S as d}from"./p-2ac55a5d.js";import{FormMetadata as l,buildFormMetadata as c}from"@sankhyalabs/ezui/dist/collection/utils/form";import{S as u}from"./p-6768f176.js";import"./p-48a5c311.js";import{P as m}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-9e4555ab.js";import"./p-ff1990ad.js";import"./p-7ee6b1bf.js";import{V as v}from"./p-9019a32f.js";import{T as p}from"./p-1be69fd4.js";import{S as g}from"./p-907e96eb.js";import{buildFieldSearch as f,SHORTCUT_SEARCH_FIELD as b}from"@sankhyalabs/ezui/dist/collection/utils";import"./p-1f310bc6.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-8336900b.js";import"@sankhyalabs/core/dist/dataunit/DataUnit";import"./p-1a0caadb.js";class k{constructor(t,i,s,e){this._parentGuide=t,this._formMetadata=i,this._dataUnit=s,this._messageBuilder=e,this._messageBuilder||(this._messageBuilder=new u)}get id(){return this._parentGuide.id}getMessage(t,i){return this._messageBuilder.getMessage(t,i)}buildGuideItem(t){const i=Object.assign({},this._parentGuide);delete i.expanded,delete i.children;const s=this._dataUnit.getSelectedRecord();if(!s)return i;const e=this._dataUnit.isNewRecord(s.__record__id__),a=Array.from(this._formMetadata.getAllSheets().values()).map((i=>{const{name:s,label:a}=i,o=null!=l.getDetailName(s.split("::").pop()),h=o&&e,n=this._parentGuide.id,r=o?`${n}::${s}`:`${n}__FORM:${s}`;return o&&t.has(r)&&!h?t.get(r).buildGuideItem(t):{id:r,label:a,disabled:h,tooltip:h?this.getMessage("snkCrud.guide.tooltip.disabledDetail"):void 0}})),o=a.shift();return o.label=e?this.getMessage("snkCrud.title.newRecord"):s.__record__label__,o.children=a,i.children=[o],i}}const w=class{constructor(s){t(this,s),this.snkDetailGuidesChange=i(this,"snkDetailGuidesChange",7),this.snkSwitchGuide=i(this,"snkSwitchGuide",7),this.formItemsReady=i(this,"formItemsReady",7),this._disabledButtons=void 0,this._currentView=void 0,this.attachmentRegisterKey=void 0,this._fieldToGetFocus=void 0,this._hasToCreateFieldSearch=!0,this.formConfigManager=void 0,this.dataUnitName=void 0,this.resourceID=void 0,this.guideItemPath=void 0,this.entityName=void 0,this.label=void 0,this.dataUnit=void 0,this.selectedForm=void 0,this.dataState=void 0,this.messagesBuilder=void 0,this.branchGuide=void 0,this.canEdit=!0,this.taskbarCustomContainerId=void 0,this.customEditors=void 0,this.customRenders=void 0,this.presentationMode=m.SECONDARY}observeDataUnit(t,i){null==t||t.subscribe(this.dataUnitActionHandler.bind(this)),null==i||i.unsubscribe(this.dataUnitActionHandler)}observerDataState(t,i){const s=!(null==i?void 0:i.insertionMode)&&(null==t?void 0:t.insertionMode),e=(null==i?void 0:i.insertionMode)&&!(null==t?void 0:t.insertionMode);if((s||e)&&this.loadMetadata(),null==this._formMetadata)return;const a=null==t?void 0:t.selectedRecord,o=null==i?void 0:i.selectedRecord;(null==a?void 0:a.__record__id__)!==(null==o?void 0:o.__record__id__)&&this.snkDetailGuidesChange.emit(new k(this.branchGuide,this._formMetadata,this.dataUnit,this.messagesBuilder)),s&&setTimeout((()=>{this.changeViewMode(v.FORM)}),0),e&&this.changeViewMode(v.GRID);const h=[];this.dataState.hasPrevious||h.push(p.PREVIOUS),this.dataState.hasNext||h.push(p.NEXT),this.dataState.insertionMode&&h.push(p.INSERT),this._disabledButtons=h}async changeViewMode(t){this.emitSwitchEvent(t)}async configGrid(){this._snkGrid&&this._snkGrid.showConfig()}async showUp(){this._snkFormView&&this._snkFormView.showUp(),this._snkGrid&&this._snkGrid.scrollIntoView({behavior:"smooth",block:"start"})}async addCustomEditor(t,i){var s;const e=this.normalizeBranchGuideId(null===(s=this.branchGuide)||void 0===s?void 0:s.id);this._snkGrid.addCustomEditor(t,i,e),this._snkFormView.addCustomEditor(t,i,e)}async observerPropsCustomEditor(t){for(const i in t)await this.addCustomEditor(i,t[i])}async addGridCustomRender(t,i){var s;const e=this.normalizeBranchGuideId(null===(s=this.branchGuide)||void 0===s?void 0:s.id);await this._snkGrid.addGridCustomRender(t,i,e)}onContentCardChanged(t){g.updateContentCard(t.detail.formName,t.detail.cardConfig,t.detail.propertyChanged,this.formConfigManager).then((()=>s(this))),t.stopPropagation()}async observeCustomRenders(t){for(const i in t){const s=t[i];await this.addGridCustomRender(i,s)}}updateLabel(){const t=this.guideItemPath?this.guideItemPath.length:0;if(t>0){const i=t>0?this.guideItemPath.map((t=>t.label)):void 0;this.label=i.pop(),this._levelPath=i.length>0?i.join(" / "):void 0}else this.label="",this._levelPath=void 0}getFormGuideId(t){var i;if(!t){if(null==(null===(i=this.dataState)||void 0===i?void 0:i.selectedRecord))return;const s=Array.from(this._formMetadata.getAllSheets().keys());if(!s||0==s.length)return;t=s[0]}return`${this.stripFormPattern(this.branchGuide.id)}__FORM:${t}`}stripFormPattern(t){return t.replace(w.REGEX_FORM_ID,"")}loadMetadata(){if(!this.dataUnit)return;if(!this.formConfigManager.isLoaded)return;const t=this.formConfigManager.getConfig(this.dataUnit);this._formMetadata=c(null==t||0===t.fields.length?void 0:t,this.dataUnit,!0)}dataUnitReadyHandler(t){this.dataUnit=t.detail,this.loadMetadata()}updateViewStack(t){var i,s;this._viewStack=t,this._currentView=this.selectedForm?1:0,null===(s=null===(i=this._viewStack)||void 0===i?void 0:i.show)||void 0===s||s.call(i,this._currentView)}getFormFields(){return this.selectedForm&&this._formMetadata?this._formMetadata.getSheet(this.selectedForm).fields:[]}emitSwitchEvent(t){const i=t===v.GRID?this.stripFormPattern(this.branchGuide.id):this.getFormGuideId();i&&this.snkSwitchGuide.emit(i)}handleAttachBack(){this._viewStack.show(v.GRID)}executeActionHandler(t){t.detail===p.GRID_MODE&&(this.emitSwitchEvent(v.GRID),t.stopPropagation()),t.detail!==p.FORM_MODE&&t.detail!==p.UPDATE||(this.emitSwitchEvent(v.FORM),t.stopPropagation()),t.detail===p.ATTACH&&(this._viewStack.show(v.ATTACHMENT),t.stopPropagation())}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}async handleDataStateChange({detail:t}){this.dataState=t,void 0!==t.selectedRecord&&this._snkDataUnit&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey())}componentWillLoad(){this._configName=`dynaform.${this.entityName}`,this.formConfigManager=new d(this._configName,this.resourceID,(()=>this.loadMetadata()),this.dataUnit),this.formConfigManager.loadConfig(),null==this.messagesBuilder&&(this.messagesBuilder=new u(this.entityName))}async componentDidLoad(){await this.observerPropsCustomEditor(this.customEditors),await this.observeCustomRenders(this.customRenders),this.initKeyboardManager()}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}async dataUnitActionHandler(t){t.type===h.FIELD_INVALIDATED&&this.addErrorBadgeToBranchGuide()}addErrorBadgeToBranchGuide(){this.branchGuide=Object.assign(Object.assign({},this.branchGuide),{badge:"error"}),this.snkDetailGuidesChange.emit(new k(this.branchGuide,this._formMetadata,this.dataUnit,this.messagesBuilder))}normalizeBranchGuideId(t){return null==t?void 0:t.replace(/child\[(.*?)\]/g,"$1").replace(/::/g,">")}getSettingsListForm(){return[{value:n.generateUUID(),label:this.messagesBuilder.getMessage("snkCrud.findColumn",void 0),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(t,i)=>this.getFieldsSearch(i)}]}getFieldsSearch(t){return(null==this._fieldSearch||this._hasToCreateFieldSearch)&&(this._hasToCreateFieldSearch=!1,this._fieldSearch=f(t,(({argument:t})=>this.fieldsOptionLoader(t)),(t=>this.onSelectField(t)))),this._fieldSearch}fieldsOptionLoader(t){const i=null==t?void 0:t.toLowerCase(),s=this.getFormFields().map((t=>{var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getField(t.name)})).filter((t=>{var s,e;return(null===(s=t.name)||void 0===s?void 0:s.toLowerCase().includes(i))||(null===(e=t.label)||void 0===e?void 0:e.toLowerCase().includes(i))})).map((t=>({value:t.name,label:t.label})));return Promise.resolve(s)}onSelectField(t){null!=t&&(this._fieldToGetFocus=t.value)}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}async initKeyboardManager(){this._keyboardManager=new r({propagate:!1,element:this._element}),this._keyboardManager.bind(b,(async()=>{await this._snkFormView.showSearchField()}),{description:this.messagesBuilder.getMessage("snkSimpleCrud.findFields"),element:this._element})}render(){return this.updateLabel(),e(a,null,e("snk-data-unit",{ref:t=>this._snkDataUnit=t,dataUnitName:`${this.dataUnitName}`,onDataUnitReady:t=>this.dataUnitReadyHandler(t),entityName:this.entityName,onDataStateChange:this.handleDataStateChange.bind(this),ignoreSaveMessage:this._currentView===v.GRID,messagesBuilder:this.messagesBuilder,configName:this._configName},e("ez-view-stack",{ref:t=>this.updateViewStack(t)},e("stack-item",null,e("div",{class:"ez-box ez-box--shadow grid-container"},e("div",{class:"ez-title--primary ez-size-width--full ez-padding--large detail-header"},e("div",{class:"ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center"},this._levelPath?e("span",{class:"level-path"},this._levelPath+" /"):void 0,this.label)),e("snk-grid",{class:"ez-size-width--full",ref:t=>this._snkGrid=t,configName:this._configName,messagesBuilder:this.messagesBuilder,onGridDoubleClick:()=>this.emitSwitchEvent(v.FORM),onActionClick:t=>this.executeActionHandler(t),presentationMode:this.presentationMode,canEdit:this.canEdit,isDetail:!0,taskbarCustomContainerId:this.taskbarCustomContainerId,gridHeaderCustomSlotId:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS",topTaskbarCustomSlotId:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS",outlineMode:!1}))),e("stack-item",null,e("snk-form-view",{ref:t=>this._snkFormView=t,canExpand:!1,canFix:!1,name:this.selectedForm,formMetadata:this._formMetadata,dataUnit:this.dataUnit,fields:this.getFormFields(),fieldToFocus:this._fieldToGetFocus,label:this.label,levelPath:this._levelPath,onFormItemsReady:({detail:t})=>this.formItemsReady.emit(t),onSnkRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),fieldSearch:this._fieldSearch},e("snk-taskbar",{key:"guideViewerTaskbar",class:"form-taskbar","data-element-id":"guideViewer",configName:this._configName,messagesBuilder:this.messagesBuilder,disabledButtons:this._disabledButtons,buttons:"INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR",primaryButton:"INSERT",presentationMode:this.presentationMode,onActionClick:t=>this.executeActionHandler(t),dataUnit:this.dataUnit,resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:"DETAIL_TASKBAR_CUSTOM_ELEMENTS",actionsSettingsList:this.getSettingsListForm()},e("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})))),e("stack-item",null,e("snk-attach",{registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this.entityName,onBack:this.handleAttachBack.bind(this)})))))}get _element(){return o(this)}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observerDataState"],customEditors:["observerPropsCustomEditor"],customRenders:["observeCustomRenders"]}}};w.REGEX_FORM_ID=/__FORM:[^:]+/g,w.style=".sc-snk-detail-view-h{display:flex;row-gap:24px;flex-direction:column;width:100%;height:100%}.level-path.sc-snk-detail-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.form-taskbar.sc-snk-detail-view{padding-bottom:var(--space--medium)}.grid-container.sc-snk-detail-view{background-color:#FFF;min-height:100px;height:100%}.detail-header.sc-snk-detail-view{padding-bottom:0}snk-data-unit.sc-snk-detail-view{flex:1}snk-grid.sc-snk-detail-view{height:calc(100% - 43px)}";export{w as snk_detail_view}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,h as i,H as e,g as t}from"./p-d8d8169b.js";import{ObjectUtils as a,StringUtils as r,ApplicationContext as n,ElementIDUtils as o}from"@sankhyalabs/core";import{P as l,b as c,a as h}from"./p-3c046287.js";import"./p-1b1373b6.js";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-9ab6ae1e.js";import"./p-ff1990ad.js";import"./p-4db9dbf8.js";import"./p-9019a32f.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const u=class{constructor(i){s(this,i),this._mdByName={},this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._specialCharsRegex=/[[.\-\$\+\*,_\&\(\)%\/\\#@!:\|\=\'\"]/gim,this._charsWithAccentuation="ÁÉÍÓÚ_ÃÕ_ÂÊÎÔÛ_ÀÈÌÒÙ_Ü_Ç_áéíóú_ãõ_âêîôû_àèìòù_ü_ç",this._charsWithoutAccentuation="AEIOU_AO_AEIOU_AEIOU_U_C_aeiou_ao_aeiou_aeiou_u_c",this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=450,this._gridDataSource=[],this.pesquisaFetcher=new l,this._itemList=void 0,this._startLoading=!1,this._presentationMode="list",this._currentView=void 0,this._valideDataSource=!1,this.searchLoader=void 0,this.treeLoader=void 0,this.selectItem=void 0,this.entityName=void 0,this.argument=void 0,this.isHierarchyEntity=!1,this.allowsNonAnalytic=!1}observeArgument(){this._textInput&&(this._textInput.value=this.argument)}async executeSearch(s){this.argument=s,this.onChangeValue({detail:s})}clearSearch(){this.argument="",this._itemList=void 0}buildDetails(s,i){let e={};for(let t=0;t<s.length;t++){const a=s[t],r=i[a.fieldName];e[a.description]=this.highlightValue(i.__matchFields,a.options&&a.options[r]||r,s,!0)}return e}buildFirstFields(s,i,e=6){return s&&Array.isArray(s)&&s.forEach((s=>{let e=this.removeReference(i,this._mdByName[s]);e&&i.unshift(e)})),i=i.slice(0,e)}doSearch(s){this.searchLoader&&"function"==typeof this.searchLoader&&(this._startLoading=!0,this.searchLoader(s).then((s=>{s&&this.processSearchResponse(s)})).finally((()=>{this._startLoading=!1})))}processSearchResponse(s){let i=(s=a.stringToObject(s.json.$)).descriptionField,e=s.pkField;e&&(this._gridMetadata=c(s),this._gridDataSource=[...s.data],this._pkField=e,this._descriptionField=i,this._itemList=this.buildCardItemList(s,e,i))}buildCardItemList(s,i,e){var t;return null===(t=s.data)||void 0===t?void 0:t.map((t=>{var a;let r=this.filterFieldsMetadata(s,t),n=this.buildFirstFields(t.__matchFields,r);return{key:this.highlightValue(t.__matchFields,null===(a=t[i])||void 0===a?void 0:a.toString(),n,!0),title:e?this.highlightValue(t.__matchFields,t[e],n,!0):"",details:this.buildDetails(n,t)}}))}filterFieldsMetadata(s,i){return s.fieldsMetadata.filter((e=>{let t=!r.isEmpty(i[e.fieldName])&&!1!==e.visible&&"B"!==e.type&&s.pkField!==e.fieldName&&s.descriptionField!==e.fieldName&&(e.isPrimaryKey||!e.isLinkField)&&!("S"===e.type&&"H"===e.presentationType);return t&&(this._mdByName[e.fieldName]=e),("string"!=typeof i[e.fieldName]||!(i[e.fieldName].indexOf("<img")>-1||i[e.fieldName].indexOf("<svg")>-1))&&t}))}removeAtIndex(s,i){if(i>=0&&i<s.length)return s.splice(i,1)[0]}removeReference(s,i){let e=this.indexOf(s,i);return this.removeAtIndex(s,e)}indexOf(s,i){let e=-1;return Array.isArray(s)&&this.find(s,((s,t)=>(e=t,this.equals(i,s)))),e}equals(s,i){return a.objectToString(s)===a.objectToString(i)}find(s,i){if(s)for(let e=0,t=s.length;e<t;e++)if(i(s[e],e,s))return s[e]}highlightValue(s,i,e,t){let a=this.replaceHtmlEntities(i);if(this.argument&&(t||this.isIn(s,e.fieldName))){const s=this.getArgumentNumber();let i=(isNaN(s)?this.argument:s.toString()).split(/%|,|\s+/),t=0,r=this.replaceAccentuatedChars(a);i.forEach((s=>{if(s){s=this.replaceAccentuatedChars(s);let i=this.getSpecialCharacters(s);null!=i&&i.length>0&&(s=this.removeSpecialCharacters(s)),(e.mask||"CGC_CPF"===e.uiType||"Phone"===e.uiType)&&(s=s.split("").join("\\.?\\-?\\/?\\(?\\)?"));let n=new RegExp(s,"ig");n.lastIndex=t;let o=n.exec(r);if(o&&o.length>0){t=o.index;let s=o[0].length,i=a.substring(t,t+s),e=(null==i?void 0:i.trim())?this._startHighlightTag+i+this._endHighlightTag:"",n=a.substring(0,t),l=a.substring(t+s);a=n+e+l,t+=e.length,r=this.replaceAccentuatedChars(a)}}}))}return a}replaceHtmlEntities(s){return null==s?s:String(s).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}replaceAccentuatedChars(s){return null==s?s:this.replaceToSpace(s,["&","<",">","""]).replace(/[^\w ]/g,(s=>{let i=this._charsWithAccentuation.indexOf(s);return i>-1&&(s=this._charsWithoutAccentuation.charAt(i)),s||""}))}replaceToSpace(s,i=[]){return null==s||i.forEach((i=>{const e=new RegExp(i,"g");let t="";for(let s=0;s<i.length;s++)t+=" ";s=String(s).replace(e,t)})),s}isIn(s,i){return this.indexOf(s,i)>-1}getSpecialCharacters(s){let i,e=[];for(;i=this._specialCharsRegex.exec(s);)e.push(s[i.index]);return e}removeSpecialCharacters(s){return this.getSpecialCharacters(s).forEach((i=>{s=this.replaceAll(s,i,"")})),s}replaceAll(s,i,e){let t=(null!=s?s:"").indexOf(i);for(;t>-1;)t=(s=s.replace(i,e)).indexOf(i);return s}getArgumentNumber(){return Number(this.argument||void 0)}createOption(s){let{key:i,title:e}=s;const t=new RegExp(this._startHighlightTag,"g"),a=new RegExp(this._endHighlightTag,"g");e=r.decodeHtmlEntities(e);const n={value:null==i?void 0:i.replace(t,"").replace(a,""),label:null==e?void 0:e.replace(t,"").replace(a,"")};this.selectItem(n)}onChangeValue(s){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=setTimeout((()=>{this.onChangeValue(s)}),this._deboucingTime));if(this.argument=(s.detail||"").trim(),this.isHierarchyEntity&&"list"===this._presentationMode)return void(null===(i=this._pesquisaTree)||void 0===i||i.applyFilter());const e=this.getArgumentNumber();this.argument&&(!isNaN(e)||this.argument.length>=this._limitCharsToSearch)?this._changeDeboucingTimeout=setTimeout((()=>{this.doSearch(this.argument),this._valideDataSource=!0}),this._deboucingTime):(this._itemList=void 0,this._gridDataSource=[],this._valideDataSource=!1)}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=void 0)}onClickSearch(){this.doSearch((this.argument||"").trim()),this._valideDataSource=!0}getMessageView(){if(this._startLoading)return this.getMessage("snkPesquisa.search.waitMessage");if(!this._itemList)return this.getMessage("snkPesquisa.search.initialMessage");const s=this._itemList.length;return s<1?this.getMessage("snkPesquisa.search.noResultsMessage"):1===s?this.getMessage("snkPesquisa.search.resultsFoundSingular"):this.getMessage("snkPesquisa.search.resultsFoundPlural",{COUNT:s})}async componentWillLoad(){var s;this._application=n.getContextValue("__SNK__APPLICATION__"),this._messagesBuilder=null===(s=this._application)||void 0===s?void 0:s.messagesBuilder;const i=await this.pesquisaFetcher.loadPresentationConfig(this.entityName);this._presentationMode="list"===i?"list":"table"}async componentDidLoad(){o.addIDInfo(this._element),await this.chooseViewMode()}getMessage(s,i){return this._messagesBuilder.getMessage(s,i)}async handleChangeViewMode(){this._presentationMode="list"===this._presentationMode?"table":"list",await this.chooseViewMode(),await this.pesquisaFetcher.savePresentationConfig(this.entityName,this._presentationMode)}async chooseViewMode(){var s,i;if("list"!==this._presentationMode)return await(null===(s=this._viewStack)||void 0===s?void 0:s.show(h.GRID)),void(this._currentView=h.GRID);const e=this.isHierarchyEntity?h.TREE:h.CARDS;await(null===(i=this._viewStack)||void 0===i?void 0:i.show(e)),this._currentView=e}hideLimitMessage(){return!this._itemList||this._itemList.length<100}hideRecordsMessage(){return"list"===this._presentationMode&&this.isHierarchyEntity}getButtonModeInfo(){return"list"===this._presentationMode?{iconName:"table",title:this.getMessage("snkPesquisa.viewMode.tableMode")}:this.isHierarchyEntity?{iconName:"hierarchical-tree",title:this.getMessage("snkPesquisa.viewMode.tableMode")}:{iconName:"list",title:this.getMessage("snkPesquisa.viewMode.listMode")}}render(){var s,t;return i(e,null,i("div",{class:"snk-pesquisa"},i("div",{class:"snk-pesquisa__input"},i("ez-text-input",{label:this.getMessage("snkPesquisa.search.label"),class:"ez-margin-right--medium",canShowError:!1,ref:s=>this._textInput=s,onEzChange:s=>this.onChangeValue(s),value:this.argument,"data-element-id":"searchInput"},i("ez-icon",{slot:"leftIcon",iconName:"search"}),this.argument&&(null===(s=this._textInput)||void 0===s?void 0:s.value)?i("button",{slot:"rightIcon",class:"snk-pesquisa__btn",onClick:()=>this.clearSearch()},i("ez-icon",{iconName:"close"})):void 0),i("ez-button",{class:"ez-button--primary",label:this.getMessage("snkPesquisa.search.button"),onClick:()=>this.onClickSearch()}),i("ez-button",{class:"ez-margin-left--medium",mode:"icon",iconName:this.getButtonModeInfo().iconName,title:this.getButtonModeInfo().title,onClick:async()=>await this.handleChangeViewMode()})),i("div",{class:"snk-pesquisa__records-label "+(this._currentView===h.TREE?"hidden":"")},i("label",{class:"snk-pesquisa__records "+(this.hideRecordsMessage()?"hidden":"")},this.getMessageView()),i("label",{class:"snk-pesquisa__records-limit "+(this.hideLimitMessage()?"hidden":"")},this.getMessage("snkPesquisa.search.limitMessage"))),i("div",{class:"snk-pesquisa__content"},i("ez-view-stack",{ref:s=>this._viewStack=s,"data-element-id":"simple-crud"},i("stack-item",null,this._valideDataSource&&i("pesquisa-grid",{metadata:this._gridMetadata,dataSource:this._gridDataSource,pkField:this._pkField,descriptionField:this._descriptionField,entityName:this.entityName,shouldLoadConfig:this._currentView===h.GRID,onPesquisaGridSelectItem:({detail:s})=>this.selectItem(s)})),i("stack-item",null,i("div",{class:"snk-pesquisa__cards-container"},null===(t=this._itemList)||void 0===t?void 0:t.map((s=>i("ez-card-item",{onEzClick:s=>this.createOption(s.detail),item:s}))))),i("stack-item",null,i("pesquisa-tree",{ref:s=>this._pesquisaTree=s,argument:this.argument,treeLoader:this.treeLoader,allowsNonAnalytic:this.allowsNonAnalytic,shouldLoadTree:this._currentView===h.TREE,onPesquisaTreeSelectItem:({detail:s})=>this.selectItem(s),messagesBuilder:this._messagesBuilder}))))))}get _element(){return t(this)}static get watchers(){return{argument:["observeArgument"]}}};u.style=".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--color-secondary:var(--text--secondary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--small, 6px);--snk-pesquisa__scrollable-content--height:calc(100vh - 300px);height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);padding-right:var(--snk-pesquisa__content--padding-right);height:var(--snk-pesquisa__scrollable-content--height)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__scrollbar--color-background);width:var(--snk-pesquisa__scrollbar--width);max-width:var(--snk-pesquisa__scrollbar--width);min-width:var(--snk-pesquisa__scrollbar--width)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__scrollbar--color-background);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__scrollbar--color-default);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:hover,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-pesquisa__scrollbar--color-hover)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:active,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-pesquisa__scrollbar--color-clicked)}.snk-pesquisa__records-label.sc-snk-pesquisa{display:flex;flex-direction:row;justify-content:space-between;font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__records-label.hidden.sc-snk-pesquisa{display:none}.snk-pesquisa__records.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color)}.snk-pesquisa__records-limit.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color-secondary)}.snk-pesquisa__records-limit.hidden.sc-snk-pesquisa,.snk-pesquisa__records.hidden.sc-snk-pesquisa{visibility:hidden}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}.snk-pesquisa__cards-container.sc-snk-pesquisa{height:100%;overflow-y:auto}";export{u as snk_pesquisa}
|
|
1
|
+
import{r as s,h as i,H as e,g as t}from"./p-82bb3eda.js";import{ObjectUtils as a,StringUtils as r,ApplicationContext as n,ElementIDUtils as o}from"@sankhyalabs/core";import{P as l,b as c,a as h}from"./p-48a5c311.js";import"./p-6768f176.js";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-9e4555ab.js";import"./p-ff1990ad.js";import"./p-7ee6b1bf.js";import"./p-9019a32f.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const u=class{constructor(i){s(this,i),this._mdByName={},this._startHighlightTag="<span class='card-item__highlight'>",this._endHighlightTag="</span>",this._specialCharsRegex=/[[.\-\$\+\*,_\&\(\)%\/\\#@!:\|\=\'\"]/gim,this._charsWithAccentuation="ÁÉÍÓÚ_ÃÕ_ÂÊÎÔÛ_ÀÈÌÒÙ_Ü_Ç_áéíóú_ãõ_âêîôû_àèìòù_ü_ç",this._charsWithoutAccentuation="AEIOU_AO_AEIOU_AEIOU_U_C_aeiou_ao_aeiou_aeiou_u_c",this._changeDeboucingTimeout=null,this._limitCharsToSearch=3,this._deboucingTime=450,this._gridDataSource=[],this.pesquisaFetcher=new l,this._itemList=void 0,this._startLoading=!1,this._presentationMode="list",this._currentView=void 0,this._valideDataSource=!1,this.searchLoader=void 0,this.treeLoader=void 0,this.selectItem=void 0,this.entityName=void 0,this.argument=void 0,this.isHierarchyEntity=!1,this.allowsNonAnalytic=!1}observeArgument(){this._textInput&&(this._textInput.value=this.argument)}async executeSearch(s){this.argument=s,this.onChangeValue({detail:s})}clearSearch(){this.argument="",this._itemList=void 0}buildDetails(s,i){let e={};for(let t=0;t<s.length;t++){const a=s[t],r=i[a.fieldName];e[a.description]=this.highlightValue(i.__matchFields,a.options&&a.options[r]||r,s,!0)}return e}buildFirstFields(s,i,e=6){return s&&Array.isArray(s)&&s.forEach((s=>{let e=this.removeReference(i,this._mdByName[s]);e&&i.unshift(e)})),i=i.slice(0,e)}doSearch(s){this.searchLoader&&"function"==typeof this.searchLoader&&(this._startLoading=!0,this.searchLoader(s).then((s=>{s&&this.processSearchResponse(s)})).finally((()=>{this._startLoading=!1})))}processSearchResponse(s){let i=(s=a.stringToObject(s.json.$)).descriptionField,e=s.pkField;e&&(this._gridMetadata=c(s),this._gridDataSource=[...s.data],this._pkField=e,this._descriptionField=i,this._itemList=this.buildCardItemList(s,e,i))}buildCardItemList(s,i,e){var t;return null===(t=s.data)||void 0===t?void 0:t.map((t=>{var a;let r=this.filterFieldsMetadata(s,t),n=this.buildFirstFields(t.__matchFields,r);return{key:this.highlightValue(t.__matchFields,null===(a=t[i])||void 0===a?void 0:a.toString(),n,!0),title:e?this.highlightValue(t.__matchFields,t[e],n,!0):"",details:this.buildDetails(n,t)}}))}filterFieldsMetadata(s,i){return s.fieldsMetadata.filter((e=>{let t=!r.isEmpty(i[e.fieldName])&&!1!==e.visible&&"B"!==e.type&&s.pkField!==e.fieldName&&s.descriptionField!==e.fieldName&&(e.isPrimaryKey||!e.isLinkField)&&!("S"===e.type&&"H"===e.presentationType);return t&&(this._mdByName[e.fieldName]=e),("string"!=typeof i[e.fieldName]||!(i[e.fieldName].indexOf("<img")>-1||i[e.fieldName].indexOf("<svg")>-1))&&t}))}removeAtIndex(s,i){if(i>=0&&i<s.length)return s.splice(i,1)[0]}removeReference(s,i){let e=this.indexOf(s,i);return this.removeAtIndex(s,e)}indexOf(s,i){let e=-1;return Array.isArray(s)&&this.find(s,((s,t)=>(e=t,this.equals(i,s)))),e}equals(s,i){return a.objectToString(s)===a.objectToString(i)}find(s,i){if(s)for(let e=0,t=s.length;e<t;e++)if(i(s[e],e,s))return s[e]}highlightValue(s,i,e,t){let a=this.replaceHtmlEntities(i);if(this.argument&&(t||this.isIn(s,e.fieldName))){const s=this.getArgumentNumber();let i=(isNaN(s)?this.argument:s.toString()).split(/%|,|\s+/),t=0,r=this.replaceAccentuatedChars(a);i.forEach((s=>{if(s){s=this.replaceAccentuatedChars(s);let i=this.getSpecialCharacters(s);null!=i&&i.length>0&&(s=this.removeSpecialCharacters(s)),(e.mask||"CGC_CPF"===e.uiType||"Phone"===e.uiType)&&(s=s.split("").join("\\.?\\-?\\/?\\(?\\)?"));let n=new RegExp(s,"ig");n.lastIndex=t;let o=n.exec(r);if(o&&o.length>0){t=o.index;let s=o[0].length,i=a.substring(t,t+s),e=(null==i?void 0:i.trim())?this._startHighlightTag+i+this._endHighlightTag:"",n=a.substring(0,t),l=a.substring(t+s);a=n+e+l,t+=e.length,r=this.replaceAccentuatedChars(a)}}}))}return a}replaceHtmlEntities(s){return null==s?s:String(s).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}replaceAccentuatedChars(s){return null==s?s:this.replaceToSpace(s,["&","<",">","""]).replace(/[^\w ]/g,(s=>{let i=this._charsWithAccentuation.indexOf(s);return i>-1&&(s=this._charsWithoutAccentuation.charAt(i)),s||""}))}replaceToSpace(s,i=[]){return null==s||i.forEach((i=>{const e=new RegExp(i,"g");let t="";for(let s=0;s<i.length;s++)t+=" ";s=String(s).replace(e,t)})),s}isIn(s,i){return this.indexOf(s,i)>-1}getSpecialCharacters(s){let i,e=[];for(;i=this._specialCharsRegex.exec(s);)e.push(s[i.index]);return e}removeSpecialCharacters(s){return this.getSpecialCharacters(s).forEach((i=>{s=this.replaceAll(s,i,"")})),s}replaceAll(s,i,e){let t=(null!=s?s:"").indexOf(i);for(;t>-1;)t=(s=s.replace(i,e)).indexOf(i);return s}getArgumentNumber(){return Number(this.argument||void 0)}createOption(s){let{key:i,title:e}=s;const t=new RegExp(this._startHighlightTag,"g"),a=new RegExp(this._endHighlightTag,"g");e=r.decodeHtmlEntities(e);const n={value:null==i?void 0:i.replace(t,"").replace(a,""),label:null==e?void 0:e.replace(t,"").replace(a,"")};this.selectItem(n)}onChangeValue(s){var i;if(this.clearDeboucingTimeout(),this._startLoading)return void(this._changeDeboucingTimeout=setTimeout((()=>{this.onChangeValue(s)}),this._deboucingTime));if(this.argument=(s.detail||"").trim(),this.isHierarchyEntity&&"list"===this._presentationMode)return void(null===(i=this._pesquisaTree)||void 0===i||i.applyFilter());const e=this.getArgumentNumber();this.argument&&(!isNaN(e)||this.argument.length>=this._limitCharsToSearch)?this._changeDeboucingTimeout=setTimeout((()=>{this.doSearch(this.argument),this._valideDataSource=!0}),this._deboucingTime):(this._itemList=void 0,this._gridDataSource=[],this._valideDataSource=!1)}clearDeboucingTimeout(){this._changeDeboucingTimeout&&(clearTimeout(this._changeDeboucingTimeout),this._changeDeboucingTimeout=void 0)}onClickSearch(){this.doSearch((this.argument||"").trim()),this._valideDataSource=!0}getMessageView(){if(this._startLoading)return this.getMessage("snkPesquisa.search.waitMessage");if(!this._itemList)return this.getMessage("snkPesquisa.search.initialMessage");const s=this._itemList.length;return s<1?this.getMessage("snkPesquisa.search.noResultsMessage"):1===s?this.getMessage("snkPesquisa.search.resultsFoundSingular"):this.getMessage("snkPesquisa.search.resultsFoundPlural",{COUNT:s})}async componentWillLoad(){var s;this._application=n.getContextValue("__SNK__APPLICATION__"),this._messagesBuilder=null===(s=this._application)||void 0===s?void 0:s.messagesBuilder;const i=await this.pesquisaFetcher.loadPresentationConfig(this.entityName);this._presentationMode="list"===i?"list":"table"}async componentDidLoad(){o.addIDInfo(this._element),await this.chooseViewMode()}getMessage(s,i){return this._messagesBuilder.getMessage(s,i)}async handleChangeViewMode(){this._presentationMode="list"===this._presentationMode?"table":"list",await this.chooseViewMode(),await this.pesquisaFetcher.savePresentationConfig(this.entityName,this._presentationMode)}async chooseViewMode(){var s,i;if("list"!==this._presentationMode)return await(null===(s=this._viewStack)||void 0===s?void 0:s.show(h.GRID)),void(this._currentView=h.GRID);const e=this.isHierarchyEntity?h.TREE:h.CARDS;await(null===(i=this._viewStack)||void 0===i?void 0:i.show(e)),this._currentView=e}hideLimitMessage(){return!this._itemList||this._itemList.length<100}hideRecordsMessage(){return"list"===this._presentationMode&&this.isHierarchyEntity}getButtonModeInfo(){return"list"===this._presentationMode?{iconName:"table",title:this.getMessage("snkPesquisa.viewMode.tableMode")}:this.isHierarchyEntity?{iconName:"hierarchical-tree",title:this.getMessage("snkPesquisa.viewMode.tableMode")}:{iconName:"list",title:this.getMessage("snkPesquisa.viewMode.listMode")}}render(){var s,t;return i(e,null,i("div",{class:"snk-pesquisa"},i("div",{class:"snk-pesquisa__input"},i("ez-text-input",{label:this.getMessage("snkPesquisa.search.label"),class:"ez-margin-right--medium",canShowError:!1,ref:s=>this._textInput=s,onEzChange:s=>this.onChangeValue(s),value:this.argument,"data-element-id":"searchInput"},i("ez-icon",{slot:"leftIcon",iconName:"search"}),this.argument&&(null===(s=this._textInput)||void 0===s?void 0:s.value)?i("button",{slot:"rightIcon",class:"snk-pesquisa__btn",onClick:()=>this.clearSearch()},i("ez-icon",{iconName:"close"})):void 0),i("ez-button",{class:"ez-button--primary",label:this.getMessage("snkPesquisa.search.button"),onClick:()=>this.onClickSearch()}),i("ez-button",{class:"ez-margin-left--medium",mode:"icon",iconName:this.getButtonModeInfo().iconName,title:this.getButtonModeInfo().title,onClick:async()=>await this.handleChangeViewMode()})),i("div",{class:"snk-pesquisa__records-label "+(this._currentView===h.TREE?"hidden":"")},i("label",{class:"snk-pesquisa__records "+(this.hideRecordsMessage()?"hidden":"")},this.getMessageView()),i("label",{class:"snk-pesquisa__records-limit "+(this.hideLimitMessage()?"hidden":"")},this.getMessage("snkPesquisa.search.limitMessage"))),i("div",{class:"snk-pesquisa__content"},i("ez-view-stack",{ref:s=>this._viewStack=s,"data-element-id":"simple-crud"},i("stack-item",null,this._valideDataSource&&i("pesquisa-grid",{metadata:this._gridMetadata,dataSource:this._gridDataSource,pkField:this._pkField,descriptionField:this._descriptionField,entityName:this.entityName,shouldLoadConfig:this._currentView===h.GRID,onPesquisaGridSelectItem:({detail:s})=>this.selectItem(s)})),i("stack-item",null,i("div",{class:"snk-pesquisa__cards-container"},null===(t=this._itemList)||void 0===t?void 0:t.map((s=>i("ez-card-item",{onEzClick:s=>this.createOption(s.detail),item:s}))))),i("stack-item",null,i("pesquisa-tree",{ref:s=>this._pesquisaTree=s,argument:this.argument,treeLoader:this.treeLoader,allowsNonAnalytic:this.allowsNonAnalytic,shouldLoadTree:this._currentView===h.TREE,onPesquisaTreeSelectItem:({detail:s})=>this.selectItem(s),messagesBuilder:this._messagesBuilder}))))))}get _element(){return t(this)}static get watchers(){return{argument:["observeArgument"]}}};u.style=".sc-snk-pesquisa-h{--snk-pesquisa--font-size:var(--text--medium, 14px);--snk-pesquisa--font-family:var(--font-pattern, Arial);--snk-pesquisa--font-weight:var(--text-weight--medium, 400);--snk-pesquisa__records--color:var(--text--primary, #626e82);--snk-pesquisa__records--color-secondary:var(--text--secondary, #626e82);--snk-pesquisa__records--padding-vertical:var(--space--medium, 12px);--snk-pesquisa__content--padding-right:var(--space--small, 6px);--snk-pesquisa__btn--color:var(--title--primary, #2B3A54);--snk-pesquisa__btn-disabled--color:var(--text--disable, #AFB6C0);--snk-pesquisa__btn-hover--color:var(--color--primary, #4e4e4e);--snk-pesquisa__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-pesquisa__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-pesquisa__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-pesquisa__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-pesquisa__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-pesquisa__scrollbar--width:var(--space--small, 6px);--snk-pesquisa__scrollable-content--height:calc(100vh - 300px);height:100%;display:flex;flex-direction:column;overflow-y:auto}.snk-pesquisa.sc-snk-pesquisa{display:flex;flex-direction:column;height:100%}.snk-pesquisa__input.sc-snk-pesquisa{display:flex;width:100%;box-sizing:border-box;padding-top:4px;padding-right:4px}.snk-pesquisa__input.sc-snk-pesquisa ez-icon.sc-snk-pesquisa{--ez-icon--color:inherit;font-weight:var(--text-weight--large, 600)}.snk-pesquisa__content.sc-snk-pesquisa{display:flex;flex-direction:column;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:var(--snk-pesquisa__scrollbar--color-clicked) var(--snk-pesquisa__scrollbar--color-background);padding-right:var(--snk-pesquisa__content--padding-right);height:var(--snk-pesquisa__scrollable-content--height)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar{background-color:var(--snk-pesquisa__scrollbar--color-background);width:var(--snk-pesquisa__scrollbar--width);max-width:var(--snk-pesquisa__scrollbar--width);min-width:var(--snk-pesquisa__scrollbar--width)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-track{background-color:var(--snk-pesquisa__scrollbar--color-background);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb{background-color:var(--snk-pesquisa__scrollbar--color-default);border-radius:var(--snk-pesquisa__scrollbar--border-radius)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:hover,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-pesquisa__scrollbar--color-hover)}.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:vertical:active,.snk-pesquisa__content.sc-snk-pesquisa::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-pesquisa__scrollbar--color-clicked)}.snk-pesquisa__records-label.sc-snk-pesquisa{display:flex;flex-direction:row;justify-content:space-between;font-family:var(--snk-pesquisa--font-family);font-weight:var(--snk-pesquisa--font-weight);font-size:var(--snk-pesquisa--font-size);padding-bottom:var(--snk-pesquisa__records--padding-vertical);padding-top:var(--snk-pesquisa__records--padding-vertical)}.snk-pesquisa__records-label.hidden.sc-snk-pesquisa{display:none}.snk-pesquisa__records.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color)}.snk-pesquisa__records-limit.sc-snk-pesquisa{color:var(--snk-pesquisa__records--color-secondary)}.snk-pesquisa__records-limit.hidden.sc-snk-pesquisa,.snk-pesquisa__records.hidden.sc-snk-pesquisa{visibility:hidden}.snk-pesquisa__btn.sc-snk-pesquisa{outline:none;border:none;background:none;cursor:pointer;color:var(--snk-pesquisa__btn--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:disabled:hover{cursor:unset;color:var(--snk-pesquisa__btn-disabled--color)}.snk-pesquisa__btn.sc-snk-pesquisa:hover{color:var(--snk-pesquisa__btn-hover--color)}.snk-pesquisa__cards-container.sc-snk-pesquisa{height:100%;overflow-y:auto}";export{u as snk_pesquisa}
|