@sankhyalabs/sankhyablocks 8.15.2 → 8.15.4

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.
Files changed (73) hide show
  1. package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-0a690675.js} +2 -2
  2. package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-77729a93.js} +7 -2
  3. package/dist/cjs/{SnkFormConfigManager-f9dc0d28.js → SnkFormConfigManager-d6d5db6d.js} +2 -2
  4. package/dist/cjs/{SnkMultiSelectionListDataSource-9f62b63b.js → SnkMultiSelectionListDataSource-f79d220c.js} +3 -3
  5. package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-29bb791c.js} +1 -1
  6. package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-feb08214.js} +1 -1
  7. package/dist/cjs/{pesquisa-fetcher-d15a2108.js → pesquisa-fetcher-cba1b3d0.js} +2 -1
  8. package/dist/cjs/snk-actions-button_4.cjs.entry.js +4 -4
  9. package/dist/cjs/snk-application.cjs.entry.js +5 -5
  10. package/dist/cjs/snk-attach.cjs.entry.js +4 -4
  11. package/dist/cjs/snk-crud.cjs.entry.js +4 -4
  12. package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
  13. package/dist/cjs/snk-detail-view.cjs.entry.js +6 -6
  14. package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
  15. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  16. package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
  17. package/dist/cjs/snk-form.cjs.entry.js +4 -4
  18. package/dist/cjs/snk-grid.cjs.entry.js +5 -5
  19. package/dist/cjs/{snk-guides-viewer-c5ce7434.js → snk-guides-viewer-bfcad2d6.js} +4 -4
  20. package/dist/cjs/snk-guides-viewer.cjs.entry.js +6 -6
  21. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  22. package/dist/cjs/snk-simple-crud.cjs.entry.js +6 -6
  23. package/dist/collection/lib/dataUnit/InMemoryLoader.js +1 -0
  24. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +8 -3
  25. package/dist/components/DataFetcher.js +8 -3
  26. package/dist/components/dataunit-fetcher.js +1 -0
  27. package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-8c2ddac8.js} +2 -2
  28. package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-773a3e4b.js} +8 -3
  29. package/dist/esm/{SnkFormConfigManager-f53f9f87.js → SnkFormConfigManager-c01b9d9d.js} +2 -2
  30. package/dist/esm/{SnkMultiSelectionListDataSource-5f01e941.js → SnkMultiSelectionListDataSource-a4805051.js} +3 -3
  31. package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-a411f73c.js} +1 -1
  32. package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-e0382e5a.js} +1 -1
  33. package/dist/esm/{pesquisa-fetcher-84e4a922.js → pesquisa-fetcher-34a8b8be.js} +2 -1
  34. package/dist/esm/snk-actions-button_4.entry.js +4 -4
  35. package/dist/esm/snk-application.entry.js +5 -5
  36. package/dist/esm/snk-attach.entry.js +4 -4
  37. package/dist/esm/snk-crud.entry.js +4 -4
  38. package/dist/esm/snk-data-exporter.entry.js +1 -1
  39. package/dist/esm/snk-detail-view.entry.js +6 -6
  40. package/dist/esm/snk-filter-bar.entry.js +3 -3
  41. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  42. package/dist/esm/snk-form-config.entry.js +2 -2
  43. package/dist/esm/snk-form.entry.js +4 -4
  44. package/dist/esm/snk-grid.entry.js +5 -5
  45. package/dist/esm/{snk-guides-viewer-19856c01.js → snk-guides-viewer-edeac29f.js} +4 -4
  46. package/dist/esm/snk-guides-viewer.entry.js +6 -6
  47. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  48. package/dist/esm/snk-simple-crud.entry.js +6 -6
  49. package/dist/sankhyablocks/{p-913a9979.js → p-0cd3c0a9.js} +1 -1
  50. package/dist/sankhyablocks/{p-df5451c7.js → p-181975f1.js} +1 -1
  51. package/dist/sankhyablocks/{p-d5241a42.entry.js → p-2088e7e8.entry.js} +1 -1
  52. package/dist/sankhyablocks/{p-c96824b7.js → p-37e5d563.js} +1 -1
  53. package/dist/sankhyablocks/{p-a1d72395.entry.js → p-41c2c191.entry.js} +1 -1
  54. package/dist/sankhyablocks/{p-60849ead.entry.js → p-46e55a95.entry.js} +1 -1
  55. package/dist/sankhyablocks/{p-5715bfb3.js → p-5630574e.js} +1 -1
  56. package/dist/sankhyablocks/p-594bc21d.js +1 -0
  57. package/dist/sankhyablocks/{p-1131a554.entry.js → p-80c64add.entry.js} +1 -1
  58. package/dist/sankhyablocks/{p-c452687f.js → p-86af4cc2.js} +1 -1
  59. package/dist/sankhyablocks/{p-aff76a53.js → p-96621231.js} +1 -1
  60. package/dist/sankhyablocks/{p-ee9536bc.entry.js → p-a07dbd48.entry.js} +1 -1
  61. package/dist/sankhyablocks/{p-c603bec4.entry.js → p-a1832166.entry.js} +1 -1
  62. package/dist/sankhyablocks/{p-a5505ac7.entry.js → p-a809d944.entry.js} +1 -1
  63. package/dist/sankhyablocks/{p-78d250a2.entry.js → p-a89153ea.entry.js} +1 -1
  64. package/dist/sankhyablocks/{p-1fc3fb4b.entry.js → p-a97226f6.entry.js} +1 -1
  65. package/dist/sankhyablocks/{p-eae7a817.entry.js → p-c2ae0fab.entry.js} +1 -1
  66. package/dist/sankhyablocks/{p-74d349c3.entry.js → p-c5a9a5d9.entry.js} +1 -1
  67. package/dist/sankhyablocks/{p-15802c59.entry.js → p-ca14e305.entry.js} +1 -1
  68. package/dist/sankhyablocks/{p-21e46a3e.entry.js → p-cb0147ab.entry.js} +1 -1
  69. package/dist/sankhyablocks/{p-032fe52e.js → p-f0145e3b.js} +1 -1
  70. package/dist/sankhyablocks/{p-14a08904.entry.js → p-f03e4199.entry.js} +1 -1
  71. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  72. package/package.json +1 -1
  73. package/dist/sankhyablocks/p-dc7c9047.js +0 -1
@@ -1,12 +1,12 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
- import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
5
- import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-c1baf61d.js';
6
- import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-039abba3.js';
7
- import { D as DataUnitFetcher, P as PesquisaFetcher } from './pesquisa-fetcher-84e4a922.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-8c2ddac8.js';
5
+ import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-773a3e4b.js';
6
+ import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-a411f73c.js';
7
+ import { D as DataUnitFetcher, P as PesquisaFetcher } from './pesquisa-fetcher-34a8b8be.js';
8
8
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-0a4becdd.js';
9
- import './form-config-fetcher-30fb808f.js';
9
+ import './form-config-fetcher-e0382e5a.js';
10
10
  import './filter-item-type.enum-d45e026f.js';
11
11
  import './PrintUtils-3e4ff0f5.js';
12
12
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -1,13 +1,13 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
2
2
  import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnit } from '@sankhyalabs/core';
3
- import { D as DataFetcher } from './DataFetcher-c1baf61d.js';
4
- import { a as PreloadManager, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './pesquisa-fetcher-84e4a922.js';
3
+ import { D as DataFetcher } from './DataFetcher-773a3e4b.js';
4
+ import { a as PreloadManager, b as applyFilter, c as applySorting, d as buildPaginationInfo, D as DataUnitFetcher, I as InMemoryLoader } from './pesquisa-fetcher-34a8b8be.js';
5
5
  import './index-0ece87a6.js';
6
6
  import { S as SaveErrorsEnum } from './ISave-d8c8bc59.js';
7
7
  import './filter-item-type.enum-d45e026f.js';
8
- import './form-config-fetcher-30fb808f.js';
8
+ import './form-config-fetcher-e0382e5a.js';
9
9
  import { d as VIEW_MODE } from './constants-8457af36.js';
10
- import { A as AutorizationType } from './auth-fetcher-039abba3.js';
10
+ import { A as AutorizationType } from './auth-fetcher-a411f73c.js';
11
11
  import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
12
12
  import './PrintUtils-3e4ff0f5.js';
13
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -1,16 +1,16 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ElementIDUtils, ApplicationContext, JSUtils, FloatingManager } from '@sankhyalabs/core';
3
3
  import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
4
- import './DataFetcher-c1baf61d.js';
5
- import './pesquisa-fetcher-84e4a922.js';
4
+ import './DataFetcher-773a3e4b.js';
5
+ import './pesquisa-fetcher-34a8b8be.js';
6
6
  import { P as PresentationMode } from './index-0ece87a6.js';
7
7
  import './ISave-d8c8bc59.js';
8
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import './filter-item-type.enum-d45e026f.js';
11
- import './form-config-fetcher-30fb808f.js';
11
+ import './form-config-fetcher-e0382e5a.js';
12
12
  import { d as VIEW_MODE } from './constants-8457af36.js';
13
- import { A as AutorizationType } from './auth-fetcher-039abba3.js';
13
+ import { A as AutorizationType } from './auth-fetcher-a411f73c.js';
14
14
  import './index-bdf75557.js';
15
15
  import './PrintUtils-3e4ff0f5.js';
16
16
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
@@ -3,7 +3,7 @@ import { ApplicationContext, ObjectUtils, DataType, ElementIDUtils } from '@sank
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { D as DataExporterOption, a as DataExporterFormat, b as DataExporterType } from './index-0ece87a6.js';
5
5
  import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-8457af36.js';
6
- import { D as DataFetcher } from './DataFetcher-c1baf61d.js';
6
+ import { D as DataFetcher } from './DataFetcher-773a3e4b.js';
7
7
  import { S as SnkDataUnit } from './snk-data-unit-de1d140d.js';
8
8
  import './PrintUtils-3e4ff0f5.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -1,20 +1,20 @@
1
1
  import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
2
2
  import { Action } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-f53f9f87.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-c01b9d9d.js';
4
4
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
- import './DataFetcher-c1baf61d.js';
6
- import './pesquisa-fetcher-84e4a922.js';
5
+ import './DataFetcher-773a3e4b.js';
6
+ import './pesquisa-fetcher-34a8b8be.js';
7
7
  import { P as PresentationMode } from './index-0ece87a6.js';
8
8
  import './ISave-d8c8bc59.js';
9
9
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
- import './form-config-fetcher-30fb808f.js';
12
+ import './form-config-fetcher-e0382e5a.js';
13
13
  import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
14
14
  import { d as VIEW_MODE } from './constants-8457af36.js';
15
- import { S as SnkGuidesViewer } from './snk-guides-viewer-19856c01.js';
15
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-edeac29f.js';
16
16
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-0a4becdd.js';
17
- import './ConfigStorage-86187da3.js';
17
+ import './ConfigStorage-8c2ddac8.js';
18
18
  import './PrintUtils-3e4ff0f5.js';
19
19
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
20
20
  import './ResourceIDUtils-a114189a.js';
@@ -1,15 +1,15 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
4
- import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-8c2ddac8.js';
5
5
  import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
6
6
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
7
7
  import { F as FilterOperand } from './index-ae591a44.js';
8
8
  import { F as FilterNumberVariation } from './filterNumberVariation-8cee02ea.js';
9
9
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
10
10
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-e2b38ef7.js';
11
- import './form-config-fetcher-30fb808f.js';
12
- import './DataFetcher-c1baf61d.js';
11
+ import './form-config-fetcher-e0382e5a.js';
12
+ import './DataFetcher-773a3e4b.js';
13
13
  import './PrintUtils-3e4ff0f5.js';
14
14
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
15
15
 
@@ -2,10 +2,10 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
2
2
  import { ElementIDUtils, ObjectUtils } 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';
5
- import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
5
+ import { C as ConfigStorage } from './ConfigStorage-8c2ddac8.js';
6
6
  import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
7
- import './form-config-fetcher-30fb808f.js';
8
- import './DataFetcher-c1baf61d.js';
7
+ import './form-config-fetcher-e0382e5a.js';
8
+ import './DataFetcher-773a3e4b.js';
9
9
  import './PrintUtils-3e4ff0f5.js';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
11
 
@@ -3,9 +3,9 @@ import { S as Sortable } from './Sortable-83960219.js';
3
3
  import { ObjectUtils, ElementIDUtils, ArrayUtils, ApplicationContext } from '@sankhyalabs/core';
4
4
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import { C as CONFIG_EVENTS, a as CONFIG_SORTABLE_EVENTS, T as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants-8457af36.js';
6
- import { U as UserConfigType } from './form-config-fetcher-30fb808f.js';
6
+ import { U as UserConfigType } from './form-config-fetcher-e0382e5a.js';
7
7
  import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
8
- import './DataFetcher-c1baf61d.js';
8
+ import './DataFetcher-773a3e4b.js';
9
9
  import './PrintUtils-3e4ff0f5.js';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
11
 
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
2
2
  import { ElementIDUtils } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-f53f9f87.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-c01b9d9d.js';
4
4
  import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
5
- import './ConfigStorage-86187da3.js';
6
- import './form-config-fetcher-30fb808f.js';
7
- import './DataFetcher-c1baf61d.js';
5
+ import './ConfigStorage-8c2ddac8.js';
6
+ import './form-config-fetcher-e0382e5a.js';
7
+ import './DataFetcher-773a3e4b.js';
8
8
  import './PrintUtils-3e4ff0f5.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import './filter-item-type.enum-d45e026f.js';
@@ -2,18 +2,18 @@ import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElem
2
2
  import { ElementIDUtils, ApplicationContext, StringUtils, DataType } from '@sankhyalabs/core';
3
3
  import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
4
4
  import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
5
- import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
5
+ import { C as ConfigStorage } from './ConfigStorage-8c2ddac8.js';
6
6
  import { P as PresentationMode } from './index-0ece87a6.js';
7
7
  import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-efbe307f.js';
8
8
  import { s as store } from './index-bdf75557.js';
9
- import { S as SnkMultiSelectionListDataSource, C as CrudUtils } from './SnkMultiSelectionListDataSource-5f01e941.js';
9
+ import { S as SnkMultiSelectionListDataSource, C as CrudUtils } from './SnkMultiSelectionListDataSource-a4805051.js';
10
10
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
11
- import './DataFetcher-c1baf61d.js';
12
- import './pesquisa-fetcher-84e4a922.js';
11
+ import './DataFetcher-773a3e4b.js';
12
+ import './pesquisa-fetcher-34a8b8be.js';
13
13
  import './ISave-d8c8bc59.js';
14
14
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
15
15
  import './filter-item-type.enum-d45e026f.js';
16
- import './form-config-fetcher-30fb808f.js';
16
+ import './form-config-fetcher-e0382e5a.js';
17
17
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
18
18
  import './PrintUtils-3e4ff0f5.js';
19
19
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
@@ -1,18 +1,18 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-a7d3d3f1.js';
2
2
  import { Action, ElementIDUtils } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-f53f9f87.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-c01b9d9d.js';
4
4
  import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
5
  import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } from './field-search-efbe307f.js';
6
6
  import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
7
7
  import { d as VIEW_MODE } from './constants-8457af36.js';
8
- import './DataFetcher-c1baf61d.js';
9
- import './pesquisa-fetcher-84e4a922.js';
8
+ import './DataFetcher-773a3e4b.js';
9
+ import './pesquisa-fetcher-34a8b8be.js';
10
10
  import { P as PresentationMode } from './index-0ece87a6.js';
11
11
  import './ISave-d8c8bc59.js';
12
12
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
13
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
14
14
  import './filter-item-type.enum-d45e026f.js';
15
- import './form-config-fetcher-30fb808f.js';
15
+ import './form-config-fetcher-e0382e5a.js';
16
16
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
17
17
 
18
18
  const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--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-medium);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-medium)}.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-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.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,10 +1,10 @@
1
- export { S as snk_guides_viewer } from './snk-guides-viewer-19856c01.js';
1
+ export { S as snk_guides_viewer } from './snk-guides-viewer-edeac29f.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
- import './SnkFormConfigManager-f53f9f87.js';
5
- import './ConfigStorage-86187da3.js';
6
- import './form-config-fetcher-30fb808f.js';
7
- import './DataFetcher-c1baf61d.js';
4
+ import './SnkFormConfigManager-c01b9d9d.js';
5
+ import './ConfigStorage-8c2ddac8.js';
6
+ import './form-config-fetcher-e0382e5a.js';
7
+ import './DataFetcher-773a3e4b.js';
8
8
  import './PrintUtils-3e4ff0f5.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
10
  import './filter-item-type.enum-d45e026f.js';
@@ -14,7 +14,7 @@ import './taskbar-elements-2473c8ac.js';
14
14
  import './index-0ece87a6.js';
15
15
  import './index-bdf75557.js';
16
16
  import './constants-8457af36.js';
17
- import './pesquisa-fetcher-84e4a922.js';
17
+ import './pesquisa-fetcher-34a8b8be.js';
18
18
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
19
19
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
20
20
  import './ResourceIDUtils-a114189a.js';
@@ -1,13 +1,13 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-a7d3d3f1.js';
2
2
  import { StringUtils, ObjectUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-e2b38ef7.js';
4
- import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-86187da3.js';
4
+ import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-8c2ddac8.js';
5
5
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
6
6
  import { a as FilterGroupCondition } from './index-ae591a44.js';
7
7
  import { s as store } from './index-bdf75557.js';
8
8
  import './filter-item-type.enum-d45e026f.js';
9
- import './form-config-fetcher-30fb808f.js';
10
- import './DataFetcher-c1baf61d.js';
9
+ import './form-config-fetcher-e0382e5a.js';
10
+ import './DataFetcher-773a3e4b.js';
11
11
  import './PrintUtils-3e4ff0f5.js';
12
12
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
13
13
 
@@ -3,18 +3,18 @@ import { StringUtils, ApplicationContext, ObjectUtils, DataType, UserInterface,
3
3
  import { CSSVarsUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { d as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-8457af36.js';
5
5
  import { T as TaskbarElement } from './taskbar-elements-2473c8ac.js';
6
- import './DataFetcher-c1baf61d.js';
7
- import { I as InMemoryLoader } from './pesquisa-fetcher-84e4a922.js';
8
- import { S as SnkMultiSelectionListDataSource, C as CrudUtils } from './SnkMultiSelectionListDataSource-5f01e941.js';
6
+ import './DataFetcher-773a3e4b.js';
7
+ import { I as InMemoryLoader } from './pesquisa-fetcher-34a8b8be.js';
8
+ import { S as SnkMultiSelectionListDataSource, C as CrudUtils } from './SnkMultiSelectionListDataSource-a4805051.js';
9
9
  import { P as PresentationMode } from './index-0ece87a6.js';
10
10
  import './ISave-d8c8bc59.js';
11
11
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
12
12
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
13
13
  import './filter-item-type.enum-d45e026f.js';
14
- import { F as FormConfigFetcher } from './form-config-fetcher-30fb808f.js';
14
+ import { F as FormConfigFetcher } from './form-config-fetcher-e0382e5a.js';
15
15
  import { T as TaskbarProcessor, b as buildFieldSearch, o as openFieldSearch } from './field-search-efbe307f.js';
16
- import { C as ConfigStorage } from './ConfigStorage-86187da3.js';
17
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-f53f9f87.js';
16
+ import { C as ConfigStorage } from './ConfigStorage-8c2ddac8.js';
17
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-c01b9d9d.js';
18
18
  import './index-bdf75557.js';
19
19
  import './PrintUtils-3e4ff0f5.js';
20
20
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
@@ -1 +1 @@
1
- import{ObjectUtils as t}from"@sankhyalabs/core";import{R as a}from"./p-df5451c7.js";class s extends a{getData(a){const s=`cfg://auth/${a}`;return new Promise(((a,e)=>{this.loadResource(s).then((s=>{let e=t.stringToObject(s);e&&"object"==typeof e&&a(e)})).catch((t=>{e(t)}))}))}}var e;!function(t){t.INSERT="I",t.UPDATE="A",t.REMOVE="E",t.SHOW="C",t.CONFIG="F",t.CONFIG_NUMBER="N",t.CLONE="D",t.CONFIG_GRID="G"}(e||(e={}));export{e as A,s as a}
1
+ import{ObjectUtils as t}from"@sankhyalabs/core";import{R as a}from"./p-181975f1.js";class s extends a{getData(a){const s=`cfg://auth/${a}`;return new Promise(((a,e)=>{this.loadResource(s).then((s=>{let e=t.stringToObject(s);e&&"object"==typeof e&&a(e)})).catch((t=>{e(t)}))}))}}var e;!function(t){t.INSERT="I",t.UPDATE="A",t.REMOVE="E",t.SHOW="C",t.CONFIG="F",t.CONFIG_NUMBER="N",t.CLONE="D",t.CONFIG_GRID="G"}(e||(e={}));export{e as A,s as a}
@@ -1,4 +1,4 @@
1
- import{d as e,D as t}from"./p-dc7c9047.js";import{ObjectUtils as r}from"@sankhyalabs/core";class s{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchResource",e.gql`query($name: String!) {
1
+ import{d as e,D as t}from"./p-594bc21d.js";import{ObjectUtils as r}from"@sankhyalabs/core";class s{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchResource",e.gql`query($name: String!) {
2
2
  $queryAlias$: fetchResource(name: $name){
3
3
  resource
4
4
  }
@@ -1,4 +1,4 @@
1
- import{r as t,c as s,h as e,g as i}from"./p-d2d301a6.js";import{DateUtils as n,StringUtils as r,ObjectUtils as o,WaitingChangeException as a,WarningException as c,ErrorException as h,KeyboardManager as u,OnboardingUtils as l,DependencyType as p,ArrayUtils as d,SearchUtils as m,ElementIDUtils as w,ApplicationContext as y,DataType as f,ErrorTracking as P}from"@sankhyalabs/core";import{ApplicationUtils as v}from"@sankhyalabs/ezui/dist/collection/utils";import{C as g}from"./p-aff76a53.js";import{d as _,D as A,U as I}from"./p-dc7c9047.js";import{A as S,a as C}from"./p-913a9979.js";import{D as N,P as b}from"./p-c96824b7.js";import{S as L}from"./p-32556aa6.js";import"./p-df5451c7.js";import"./p-ff1990ad.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"./p-688dcb4c.js";class T{static webConnectionCaller(t,s,e){var i;null===(i=window.AppletCaller)||void 0===i||i.webConnectionCaller(t,s,e)}}const D=E;function E(t,s){const e=k();return(E=function(t){return e[t-=378]})(t,s)}function k(){const t=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return(k=function(){return t})()}!function(){const t=E,s=k();for(;;)try{if(281287==parseInt(t(399))/1*(-parseInt(t(387))/2)+-parseInt(t(401))/3+parseInt(t(381))/4*(-parseInt(t(389))/5)+parseInt(t(388))/6*(-parseInt(t(386))/7)+parseInt(t(379))/8+parseInt(t(396))/9+parseInt(t(383))/10)break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class O{[D(397)](t){const s=D;if(typeof(t=utxt(t[s(390)]))==s(392)&&(t=JSON[s(400)](t)),null==t)throw Error(s(395));const e=new U("S"===t[s(402)]||!0===t[s(402)]);return Array[s(394)](t[s(391)])&&t[s(391)][s(385)]((t=>e.putAccess(t[s(382)],String(t.status)==s(398)))),e}}class U{constructor(t){const s=D;this.isSup=t,this[s(384)]={}}[D(378)](t,s){this[D(384)][t]=s}[D(393)](t){const s=D;if(this[s(402)])return!0;let e=!0;return this[s(384)][s(380)](t)&&(e=this.actions[t]),e}isUserSup(){return this.isSup}}class F{constructor(){this._embeddedParams=new Map,this.templateByQuery=new Map;try{if(null!=window.MGE_PARAMS){atob(window.MGE_PARAMS).split("__;__").forEach((t=>{const[s,e]=t.split("__=__");this._embeddedParams.set(s,e)}))}}catch(t){console.error("Problemas ao obter parâmetros embarcados"),console.error(t)}this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",_.gql`query($name: String!) {
1
+ import{r as t,c as s,h as e,g as i}from"./p-d2d301a6.js";import{DateUtils as n,StringUtils as r,ObjectUtils as o,WaitingChangeException as a,WarningException as c,ErrorException as h,KeyboardManager as u,OnboardingUtils as l,DependencyType as p,ArrayUtils as d,SearchUtils as m,ElementIDUtils as w,ApplicationContext as y,DataType as f,ErrorTracking as P}from"@sankhyalabs/core";import{ApplicationUtils as v}from"@sankhyalabs/ezui/dist/collection/utils";import{C as g}from"./p-96621231.js";import{d as _,D as A,U as I}from"./p-594bc21d.js";import{A as S,a as C}from"./p-0cd3c0a9.js";import{D as N,P as b}from"./p-37e5d563.js";import{S as L}from"./p-32556aa6.js";import"./p-181975f1.js";import"./p-ff1990ad.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"./p-688dcb4c.js";class T{static webConnectionCaller(t,s,e){var i;null===(i=window.AppletCaller)||void 0===i||i.webConnectionCaller(t,s,e)}}const D=E;function E(t,s){const e=k();return(E=function(t){return e[t-=378]})(t,s)}function k(){const t=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return(k=function(){return t})()}!function(){const t=E,s=k();for(;;)try{if(281287==parseInt(t(399))/1*(-parseInt(t(387))/2)+-parseInt(t(401))/3+parseInt(t(381))/4*(-parseInt(t(389))/5)+parseInt(t(388))/6*(-parseInt(t(386))/7)+parseInt(t(379))/8+parseInt(t(396))/9+parseInt(t(383))/10)break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class O{[D(397)](t){const s=D;if(typeof(t=utxt(t[s(390)]))==s(392)&&(t=JSON[s(400)](t)),null==t)throw Error(s(395));const e=new U("S"===t[s(402)]||!0===t[s(402)]);return Array[s(394)](t[s(391)])&&t[s(391)][s(385)]((t=>e.putAccess(t[s(382)],String(t.status)==s(398)))),e}}class U{constructor(t){const s=D;this.isSup=t,this[s(384)]={}}[D(378)](t,s){this[D(384)][t]=s}[D(393)](t){const s=D;if(this[s(402)])return!0;let e=!0;return this[s(384)][s(380)](t)&&(e=this.actions[t]),e}isUserSup(){return this.isSup}}class F{constructor(){this._embeddedParams=new Map,this.templateByQuery=new Map;try{if(null!=window.MGE_PARAMS){atob(window.MGE_PARAMS).split("__;__").forEach((t=>{const[s,e]=t.split("__=__");this._embeddedParams.set(s,e)}))}}catch(t){console.error("Problemas ao obter parâmetros embarcados"),console.error(t)}this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",_.gql`query($name: String!) {
2
2
  $queryAlias$: fetchResource(name: $name){
3
3
  name
4
4
  resource
@@ -1,4 +1,4 @@
1
- import{FieldComparator as t,SortMode as e,DataUnit as r,DataType as n,DateUtils as i,StringUtils as s,ChangeOperation as a,ApplicationContext as o,UserInterface as l,DataUnitStorage as c}from"@sankhyalabs/core";import{D as u,d}from"./p-dc7c9047.js";import{DISTINCT_FILTER_NAME_PREFIX as h}from"@sankhyalabs/ezui/dist/collection/utils/constants";import{DataUnitTransient as m}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{ColumnFilterManager as f}from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import{R as p}from"./p-688dcb4c.js";class _{constructor(t){this._list=[],this._equalsFunction=t}async load(t,e,r,n){let i=[].concat(this._list);null!=t&&(i=this._list.filter((e=>t(e)))),null!=e&&(i=i.sort(e));const s=i.length;if(null!=n){const t=r||0;i=i.slice(t,n?t+n:i.length)}return Promise.resolve({result:i,count:s})}async distict(t){const e=[];let r=!1;for(const n of this._list){const i=t(n);null!=i&&(null!=i.value?e.push(i):r=!0)}return r&&e.push({key:"",value:null}),Promise.resolve(new Map(e.map((t=>[t.key,t.value]))))}async push(t){this._list.push(...t)}async clear(){this._list=[]}async delete(t){this._list=this._list.filter((e=>{for(const r of t)if(this._equalsFunction(e,r))return!1;return!0}))}async update(t){this._list=this._list.map((e=>{const r=t.find((t=>this._equalsFunction(e,t)));return null==r?e:r}))}async insert(t,e){const r=this._list.indexOf(t);-1!=r?this._list=this._list.slice(0,r).concat(e).concat(this._list.slice(r)):this._list.push(...e)}isOperating(){return!0}async isEmpty(){return Promise.resolve(0===this._list.length)}async count(){return Promise.resolve(this._list.length)}}class v{static setLoadingStatus(t,e){this._loadingStatus.set(t.name,e)}static isCacheEnabled(t){return!0}static cacheRecords(t,e,r,n){v.setLoadingStatus(t,n),v.isCacheEnabled(t)?this.getRepository(t).push(e):r&&this._repositories.delete(t.name)}static getSortingFunction(r,n){if(null!=n&&0!=n.length)return(i,s)=>{for(const a of n){const n=t.compare(r.getField(a.field),i,s,a.mode===e.ASC);if(0!=n)return n}}}static async getDistinct(t,e){if(!v.isCacheEnabled(t))return Promise.resolve(f.compileDistinct(e,t));let r;const n=t.getLastLoadRequest();if(null!=n){const i=f.getColumnFilters(n.filters,e);r=f.getFilterFunction(t,Array.from(i.values()))}return new Promise(((n,i)=>{v.getRepository(t).distict((n=>{if(null!=r&&!r(n))return;const i=n[e];if(null==i)return{key:null,value:null};const s=null!=i.value?i.value:i;return{key:t.getFormattedValue(e,i),value:s}})).then((t=>{n(null!=t?Array.from(t.entries()).map((([t,e])=>({label:t,value:e,check:!0}))):void 0)})).catch((t=>i(t)))}))}static async loadData(t,e,n){try{if(v.isCacheEnabled(t)){if(("EZ_GRID_LOADING_SOURCE"===e.source||e.source===r.CHANGING_PAGE_LOADING_SOURCE)&&!await v.getRepository(t).isEmpty())return v.loadFromCache(t,e);v.getRepository(t).clear().catch((()=>{}))}return n(t,e)}catch(t){return console.error(t),Promise.reject(t)}}static insertRecords(t,e,r){v.isCacheEnabled(t)&&v.getRepository(t).insert(e,r)}static updateRecords(t,e){v.isCacheEnabled(t)&&v.getRepository(t).update(e)}static removeRecords(t,e){v.isCacheEnabled(t)&&v.getRepository(t).delete(e)}static async countRecords(t){return v.isCacheEnabled(t)?v.getRepository(t).count():Promise.resolve(0)}static getRepository(t){const e=t.name;return v._repositories.has(e)||v._repositories.set(e,new _(((t,e)=>t.__record__id__===e.__record__id__))),v._repositories.get(e)}static async loadFromCache(t,e){return new Promise(((r,n)=>{const i=f.getColumnFilters(e.filters,""),{limit:s,offset:a,sort:o}=e;v.getRepository(t).load(f.getFilterFunction(t,Array.from(i.values())),v.getSortingFunction(t,o),a,s).then((e=>{const n=v._loadingStatus.get(t.name),{count:i,result:o}=e,l=0==i?0:a+1,c=a+Math.min(o.length,s);r({records:o,paginationInfo:{count:i,currentPage:a/s,firstRecord:l,lastRecord:c,hasMore:n||c<i,total:n?void 0:i}})})).catch((t=>n(t)))}))}}function g(t,e,r){const n=f.getColumnFilters(r,"");if(!(null==n?void 0:n.size))return t;const i=f.getFilterFunction(e,Array.from(n.values()));return null==i?t:t.filter(i)}function y(t,e,r){if(null==r||0==r.length)return t;const n=v.getSortingFunction(e,r);return null==n?t:t.sort(n)}function b(t,e=0,r=0){if(void 0===t)return;const n=(null==t?void 0:t.length)||0,i=Math.min(e+r,n);return{currentPage:0===r?0:Math.ceil(e/r),firstRecord:e,lastRecord:i,total:n,hasMore:!!(n-i)}}v._repositories=new Map,v._loadingStatus=new Map;class O{constructor(t,e){this.metadata=t,this.records=e,this._dataUnit=new r(O.IN_MEMORY_DATA_UNIT_NAME),this._dataUnit.metadataLoader=()=>this.metadaLoader(),this._dataUnit.dataLoader=(t,e)=>this.inMemoryLoader(t,e,this.getRecordsToLoad()),this._dataUnit.saveLoader=(t,e)=>this.saveLoader(t,e),this._dataUnit.removeLoader=(t,e)=>this.removeLoader(t,e),this.dataUnit.loadMetadata().then((()=>this.dataUnit.loadData()))}getRecordsToLoad(){null==this._initialRecords&&this.dataUnit.records.length>0&&(this._initialRecords=this.dataUnit.records);const t=this.dataUnit.getAddedRecords();return t?[...this._initialRecords,...t]:this._initialRecords}get dataUnit(){return this._dataUnit}get records(){return this.dataUnit.records}static getConvertedValue(t,e){return t.dataType===n.BOOLEAN?"S"===e:t.dataType===n.NUMBER?Number(e):t.dataType===n.DATE?i.strToDate(e,!0):t.dataType===n.OBJECT?JSON.parse(e):e}set records(t){const e=this._metadata?new Map(this._metadata.fields.map((t=>[t.name,t]))):void 0,r=null==t?void 0:t.map((t=>{if(t.__record__id__||(t.__record__id__=this.generateUniqueId()),null!=e)for(const r in t){const n=t[r];"string"==typeof n&&e.has(r)&&(t[r]=O.getConvertedValue(e.get(r),n))}return t}));this._initialRecords=r,this._dataUnit&&this._dataUnit.gotoPage(0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t,this._dataUnit&&(this._dataUnit.metadata=this._metadata)}generateUniqueId(){return s.generateUUID()}inMemoryLoader(t,e,r){let n=g(r,t,e.filters);return n=y(n,t,e.sort),Promise.resolve({records:n,paginationInfo:b(n,e.offset,e.limit)})}metadaLoader(){return Promise.resolve(this._metadata)}saveLoader(t,e){return new Promise((t=>{let r=[];e.forEach((t=>{let{record:e,updatingFields:n,operation:i}=t;const s=Object.assign(Object.assign({},e),n);if(i===a.INSERT||i===a.COPY)s.__old__id__=e.__record__id__,s.__record__id__=this.generateUniqueId(),this.records.push(s);else{const t=this.records.findIndex((t=>t.__record__id__==s.__record__id__));this.records[t]=s}r.push(s)})),t(r)}))}removeLoader(t,e){return new Promise((t=>{t(e)}))}}O.IN_MEMORY_DATA_UNIT_NAME="InMemoryDataUnit";class P{canSlice(){return!1}processSortingSide(t,e,r){const n=[],i=[];if(null!=t.sort){if(0===r.length)return{localSorting:t.sort,serverSorting:[]};for(const r of t.sort){const t=e.getField(r.field);null!=t&&null!=t.properties&&"true"===t.properties.calculated?n.push(r):i.push(r)}}return{localSorting:n,serverSorting:i}}async load(t,e,r){var n,i;if(null==t.metadata)return Promise.resolve({records:[],loadingInfo:r});try{const s=null!==(i=null===(n=e.filters)||void 0===n?void 0:n.filter((t=>!t.name.startsWith("FILTRO_COLUNA_"))))&&void 0!==i?i:[],{localSorting:a,serverSorting:o}=this.processSortingSide(e,t,s),l=this.getFieldsList(t),c="DatasetSP.loadRecords",d=this.buildRequestBody(c,l,t,e,r,o,s),h=r.quiet?{urlParams:{quietMode:"true"}}:void 0,{result:m,pagerID:f}=await u.get().callServiceBroker(c,d,h),p=this.processRecords(t,l,m),_=null!=f,v=r.count+p.length,g=!_&&a.length>0;return Promise.resolve({records:p,loadingInfo:Object.assign(Object.assign({},r),{pagerId:f,loadingInProgress:_,total:_?void 0:v,count:v,needReload:g})})}catch(t){return console.error(t),Promise.reject(t)}}getFieldsList(t){let e=["__record__id__","__record__label__"];return t.metadata.fields.forEach((t=>{t.standAlone||(e=e.concat(this.getFieldNames(t)))})),e}getStandAloneFieldsList(t){let e={};return t.metadata.fields.forEach((t=>{t.standAlone&&(e=Object.assign(Object.assign({},e),{[t.name]:{fieldType:t.dataType,userType:t.userInterface}}))})),e}getFieldNames(t){const e=this.getSearchDescriptionField(t);return null==e?t.name:[t.name,e]}buildRequestBody(t,e,r,n,i,s,a){const o=r.dataUnitId,l=N.parseDataUnitName(r.name).entityName,c=!(!n.limit&&!n.offset),u={serviceName:t,requestBody:{dataSetID:o,fields:e,entityName:l,pageNumber:i.pageNumber,totalRecordsCount:i.count,pagerID:i.pagerId,standAlone:!1,standAloneFieldsMD:Object.assign({__record__id__:{fieldType:"S",userType:"P"},__record__label__:{fieldType:"S",userType:"P"}},this.getStandAloneFieldsList(r)),tryJoinedFields:!0,parallelLoader:c,crudListener:`br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,txProperties:this.getTxProperties(r,n,s,a),useDefaultRowsLimit:!1}};return JSON.stringify(u)}getModuleName(){return o.getContextValue("__SNK__APPLICATION__").getModuleName().replace("-bff","")}getTxProperties(t,e,r,n){const i={"__DATA_UNIT_ADAPTER__[dataUnitName]":t.name};0!==n.length&&(i["__DATA_UNIT_ADAPTER__[criteria]"]=JSON.stringify(n)),null!=r&&0!==r.length&&(i["__DATA_UNIT_ADAPTER__[sorting]"]=JSON.stringify(r)),null!=e.parentRecordId&&(i["__DATA_UNIT_ADAPTER__[parentRecordId]"]=e.parentRecordId);const s=t.getGlobalLoaderProps();return null==s||0===s.size||Array.from(s.entries()).forEach((([t,e])=>{i[t]=e})),i}processRecords(t,e,r){return r.map((r=>{const n={__record__id__:r[0],__record__label__:r[1]};return t.metadata.fields.forEach((t=>{n[t.name]=this.buildFieldValue(t,e,r)})),n}))}buildFieldValue(t,e,r){const n=e.indexOf(t.name);if(n<0)return null;const i=r[n];if(s.isEmpty(i))return null;const a=this.getSearchDescriptionField(t);if(null!=a){const t=e.indexOf(a);if(t>=0)return{value:i,label:r[t]}}return t.userInterface===l.SEARCH?isNaN(Number(i))?i:Number(i):O.getConvertedValue(t,i)}getSearchDescriptionField(t){if(t.userInterface===l.SEARCH){const{ENTITYNAME:e,mergedFrom:r,DESCRIPTIONFIELD:n}=t.properties;if(!s.isEmpty(n))return null!=r?`${r}.${e}.${n}`:`${e}.${n}`}}}class ${static async debounce(t,e){const r=t.name;$._debouncingTimeouts[r]&&(clearTimeout($._debouncingTimeouts[r]),delete $._debouncingTimeouts[r]),$._debouncingTimeouts[r]=setTimeout((()=>{delete $._debouncingTimeouts[r],e()}),100)}static async loadData(t,e){return new Promise(((r,n)=>{$.debounce(t,(()=>{v.loadData(t,e,this.loadFromServer).then((t=>r(t))).catch((t=>n(t)))}))}))}static async loadFromServer(t,e,r){try{r=$.registryLoading(t,r);const n=await $.callLoader(t,e,r);if(null==n)return;const i=n.records,s=$.buildPaginationInfo(i.length,e,n.loadingInfo),a=null==s?i:i.slice(0,s.lastRecord);return Promise.resolve({records:a,paginationInfo:s})}catch(t){return console.error(t),Promise.reject(t)}}static async callLoader(t,e,r,n){null==n&&(n=new P);const i=await n.load(t,e,r),{records:s,loadingInfo:a}=i;if($.isOldRequest(t,a))return Promise.resolve(void 0);const o=!n.canSlice()||0===a.count;if(v.cacheRecords(t,s,o,a.loadingInProgress),v.isCacheEnabled(t)&&a.loadingInProgress){const r=Object.assign(Object.assign({},e),{offset:a.count}),i=Object.assign(Object.assign({},a),{pageNumber:(a.pageNumber||0)+1,quiet:!0});this.callLoader(t,r,i,n).then((e=>$.afterLoadingPage(t,e.loadingInfo))).catch((t=>console.error(t)))}return Promise.resolve(i)}static afterLoadingPage(t,e){v.setLoadingStatus(t,e.loadingInProgress);const r=t.getPaginationInfo();if(null==r)return;const n=e.count;e.loadingInProgress?t.updatePagination(Object.assign(Object.assign({},r),{count:n})):e.needReload?t.gotoPage(0):t.updatePagination(Object.assign(Object.assign({},r),{total:n,count:n}))}static registryLoading(t,e){return null==e&&(e={requestTime:(new Date).getTime(),count:0}),$._requestTimeByDataUnit.set(t.name,e.requestTime),e}static isOldRequest(t,e){return $._requestTimeByDataUnit.get(t.name)>e.requestTime}static buildPaginationInfo(t,e,r){let{limit:n,offset:i}=e;if(!n)return;1===r.pageNumber&&(i=0);const{total:s,count:a,loadingInProgress:o}=r,l=0===a||0===t?0:i+1,c=i+Math.min(t,n);return{total:s,count:a,lastRecord:c,firstRecord:l,currentPage:i/n,hasMore:c<a||o}}}$._requestTimeByDataUnit=new Map,$._debouncingTimeouts={};const S=/dd:\/\/([^/]+)\/([^/?]+)/;class N{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",d.gql`query($name: String!) {
1
+ import{FieldComparator as t,SortMode as e,DataUnit as r,DataType as n,DateUtils as i,StringUtils as s,ChangeOperation as a,ApplicationContext as o,UserInterface as l,DataUnitStorage as c}from"@sankhyalabs/core";import{D as u,d}from"./p-594bc21d.js";import{DISTINCT_FILTER_NAME_PREFIX as h}from"@sankhyalabs/ezui/dist/collection/utils/constants";import{DataUnitTransient as m}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{ColumnFilterManager as f}from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import{R as p}from"./p-688dcb4c.js";class _{constructor(t){this._list=[],this._equalsFunction=t}async load(t,e,r,n){let i=[].concat(this._list);null!=t&&(i=this._list.filter((e=>t(e)))),null!=e&&(i=i.sort(e));const s=i.length;if(null!=n){const t=r||0;i=i.slice(t,n?t+n:i.length)}return Promise.resolve({result:i,count:s})}async distict(t){const e=[];let r=!1;for(const n of this._list){const i=t(n);null!=i&&(null!=i.value?e.push(i):r=!0)}return r&&e.push({key:"",value:null}),Promise.resolve(new Map(e.map((t=>[t.key,t.value]))))}async push(t){this._list.push(...t)}async clear(){this._list=[]}async delete(t){this._list=this._list.filter((e=>{for(const r of t)if(this._equalsFunction(e,r))return!1;return!0}))}async update(t){this._list=this._list.map((e=>{const r=t.find((t=>this._equalsFunction(e,t)));return null==r?e:r}))}async insert(t,e){const r=this._list.indexOf(t);-1!=r?this._list=this._list.slice(0,r).concat(e).concat(this._list.slice(r)):this._list.push(...e)}isOperating(){return!0}async isEmpty(){return Promise.resolve(0===this._list.length)}async count(){return Promise.resolve(this._list.length)}}class v{static setLoadingStatus(t,e){this._loadingStatus.set(t.name,e)}static isCacheEnabled(t){return!0}static cacheRecords(t,e,r,n){v.setLoadingStatus(t,n),v.isCacheEnabled(t)?this.getRepository(t).push(e):r&&this._repositories.delete(t.name)}static getSortingFunction(r,n){if(null!=n&&0!=n.length)return(i,s)=>{for(const a of n){const n=t.compare(r.getField(a.field),i,s,a.mode===e.ASC);if(0!=n)return n}}}static async getDistinct(t,e){if(!v.isCacheEnabled(t))return Promise.resolve(f.compileDistinct(e,t));let r;const n=t.getLastLoadRequest();if(null!=n){const i=f.getColumnFilters(n.filters,e);r=f.getFilterFunction(t,Array.from(i.values()))}return new Promise(((n,i)=>{v.getRepository(t).distict((n=>{if(null!=r&&!r(n))return;const i=n[e];if(null==i)return{key:null,value:null};const s=null!=i.value?i.value:i;return{key:t.getFormattedValue(e,i),value:s}})).then((t=>{n(null!=t?Array.from(t.entries()).map((([t,e])=>({label:t,value:e,check:!0}))):void 0)})).catch((t=>i(t)))}))}static async loadData(t,e,n){try{if(v.isCacheEnabled(t)){if(("EZ_GRID_LOADING_SOURCE"===e.source||e.source===r.CHANGING_PAGE_LOADING_SOURCE)&&!await v.getRepository(t).isEmpty())return v.loadFromCache(t,e);v.getRepository(t).clear().catch((()=>{}))}return n(t,e)}catch(t){return console.error(t),Promise.reject(t)}}static insertRecords(t,e,r){v.isCacheEnabled(t)&&v.getRepository(t).insert(e,r)}static updateRecords(t,e){v.isCacheEnabled(t)&&v.getRepository(t).update(e)}static removeRecords(t,e){v.isCacheEnabled(t)&&v.getRepository(t).delete(e)}static async countRecords(t){return v.isCacheEnabled(t)?v.getRepository(t).count():Promise.resolve(0)}static getRepository(t){const e=t.name;return v._repositories.has(e)||v._repositories.set(e,new _(((t,e)=>t.__record__id__===e.__record__id__))),v._repositories.get(e)}static async loadFromCache(t,e){return new Promise(((r,n)=>{const i=f.getColumnFilters(e.filters,""),{limit:s,offset:a,sort:o}=e;v.getRepository(t).load(f.getFilterFunction(t,Array.from(i.values())),v.getSortingFunction(t,o),a,s).then((e=>{const n=v._loadingStatus.get(t.name),{count:i,result:o}=e,l=0==i?0:a+1,c=a+Math.min(o.length,s);r({records:o,paginationInfo:{count:i,currentPage:a/s,firstRecord:l,lastRecord:c,hasMore:n||c<i,total:n?void 0:i}})})).catch((t=>n(t)))}))}}function g(t,e,r){const n=f.getColumnFilters(r,"");if(!(null==n?void 0:n.size))return t;const i=f.getFilterFunction(e,Array.from(n.values()));return null==i?t:t.filter(i)}function y(t,e,r){if(null==r||0==r.length)return t;const n=v.getSortingFunction(e,r);return null==n?t:t.sort(n)}function b(t,e=0,r=0){if(void 0===t)return;const n=(null==t?void 0:t.length)||0,i=Math.min(e+r,n);return{currentPage:0===r?0:Math.ceil(e/r),firstRecord:e,lastRecord:i,total:n,hasMore:!!(n-i)}}v._repositories=new Map,v._loadingStatus=new Map;class O{constructor(t,e){this.metadata=t,this.records=e,this._dataUnit=new r(O.IN_MEMORY_DATA_UNIT_NAME),this._dataUnit.pageSize=150,this._dataUnit.metadataLoader=()=>this.metadaLoader(),this._dataUnit.dataLoader=(t,e)=>this.inMemoryLoader(t,e,this.getRecordsToLoad()),this._dataUnit.saveLoader=(t,e)=>this.saveLoader(t,e),this._dataUnit.removeLoader=(t,e)=>this.removeLoader(t,e),this.dataUnit.loadMetadata().then((()=>this.dataUnit.loadData()))}getRecordsToLoad(){null==this._initialRecords&&this.dataUnit.records.length>0&&(this._initialRecords=this.dataUnit.records);const t=this.dataUnit.getAddedRecords();return t?[...this._initialRecords,...t]:this._initialRecords}get dataUnit(){return this._dataUnit}get records(){return this.dataUnit.records}static getConvertedValue(t,e){return t.dataType===n.BOOLEAN?"S"===e:t.dataType===n.NUMBER?Number(e):t.dataType===n.DATE?i.strToDate(e,!0):t.dataType===n.OBJECT?JSON.parse(e):e}set records(t){const e=this._metadata?new Map(this._metadata.fields.map((t=>[t.name,t]))):void 0,r=null==t?void 0:t.map((t=>{if(t.__record__id__||(t.__record__id__=this.generateUniqueId()),null!=e)for(const r in t){const n=t[r];"string"==typeof n&&e.has(r)&&(t[r]=O.getConvertedValue(e.get(r),n))}return t}));this._initialRecords=r,this._dataUnit&&this._dataUnit.gotoPage(0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t,this._dataUnit&&(this._dataUnit.metadata=this._metadata)}generateUniqueId(){return s.generateUUID()}inMemoryLoader(t,e,r){let n=g(r,t,e.filters);return n=y(n,t,e.sort),Promise.resolve({records:n,paginationInfo:b(n,e.offset,e.limit)})}metadaLoader(){return Promise.resolve(this._metadata)}saveLoader(t,e){return new Promise((t=>{let r=[];e.forEach((t=>{let{record:e,updatingFields:n,operation:i}=t;const s=Object.assign(Object.assign({},e),n);if(i===a.INSERT||i===a.COPY)s.__old__id__=e.__record__id__,s.__record__id__=this.generateUniqueId(),this.records.push(s);else{const t=this.records.findIndex((t=>t.__record__id__==s.__record__id__));this.records[t]=s}r.push(s)})),t(r)}))}removeLoader(t,e){return new Promise((t=>{t(e)}))}}O.IN_MEMORY_DATA_UNIT_NAME="InMemoryDataUnit";class P{canSlice(){return!1}processSortingSide(t,e,r){const n=[],i=[];if(null!=t.sort){if(0===r.length)return{localSorting:t.sort,serverSorting:[]};for(const r of t.sort){const t=e.getField(r.field);null!=t&&null!=t.properties&&"true"===t.properties.calculated?n.push(r):i.push(r)}}return{localSorting:n,serverSorting:i}}async load(t,e,r){var n,i;if(null==t.metadata)return Promise.resolve({records:[],loadingInfo:r});try{const s=null!==(i=null===(n=e.filters)||void 0===n?void 0:n.filter((t=>!t.name.startsWith("FILTRO_COLUNA_"))))&&void 0!==i?i:[],{localSorting:a,serverSorting:o}=this.processSortingSide(e,t,s),l=this.getFieldsList(t),c="DatasetSP.loadRecords",d=this.buildRequestBody(c,l,t,e,r,o,s),h=r.quiet?{urlParams:{quietMode:"true"}}:void 0,{result:m,pagerID:f}=await u.get().callServiceBroker(c,d,h),p=this.processRecords(t,l,m),_=null!=f,v=r.count+p.length,g=!_&&a.length>0;return Promise.resolve({records:p,loadingInfo:Object.assign(Object.assign({},r),{pagerId:f,loadingInProgress:_,total:_?void 0:v,count:v,needReload:g})})}catch(t){return console.error(t),Promise.reject(t)}}getFieldsList(t){let e=["__record__id__","__record__label__"];return t.metadata.fields.forEach((t=>{t.standAlone||(e=e.concat(this.getFieldNames(t)))})),e}getStandAloneFieldsList(t){let e={};return t.metadata.fields.forEach((t=>{t.standAlone&&(e=Object.assign(Object.assign({},e),{[t.name]:{fieldType:t.dataType,userType:t.userInterface}}))})),e}getFieldNames(t){const e=this.getSearchDescriptionField(t);return null==e?t.name:[t.name,e]}buildRequestBody(t,e,r,n,i,s,a){const o=r.dataUnitId,l=N.parseDataUnitName(r.name).entityName,c=!(!n.limit&&!n.offset),u={serviceName:t,requestBody:{dataSetID:o,fields:e,entityName:l,pageNumber:i.pageNumber,totalRecordsCount:i.count,pagerID:i.pagerId,standAlone:!1,standAloneFieldsMD:Object.assign({__record__id__:{fieldType:"S",userType:"P"},__record__label__:{fieldType:"S",userType:"P"}},this.getStandAloneFieldsList(r)),tryJoinedFields:!0,parallelLoader:c,crudListener:`br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,txProperties:this.getTxProperties(r,n,s,a),useDefaultRowsLimit:!1}};return JSON.stringify(u)}getModuleName(){return o.getContextValue("__SNK__APPLICATION__").getModuleName().replace("-bff","")}getTxProperties(t,e,r,n){const i={"__DATA_UNIT_ADAPTER__[dataUnitName]":t.name};0!==n.length&&(i["__DATA_UNIT_ADAPTER__[criteria]"]=JSON.stringify(n)),null!=r&&0!==r.length&&(i["__DATA_UNIT_ADAPTER__[sorting]"]=JSON.stringify(r)),null!=e.parentRecordId&&(i["__DATA_UNIT_ADAPTER__[parentRecordId]"]=e.parentRecordId);const s=t.getGlobalLoaderProps();return null==s||0===s.size||Array.from(s.entries()).forEach((([t,e])=>{i[t]=e})),i}processRecords(t,e,r){return r.map((r=>{const n={__record__id__:r[0],__record__label__:r[1]};return t.metadata.fields.forEach((t=>{n[t.name]=this.buildFieldValue(t,e,r)})),n}))}buildFieldValue(t,e,r){const n=e.indexOf(t.name);if(n<0)return null;const i=r[n];if(s.isEmpty(i))return null;const a=this.getSearchDescriptionField(t);if(null!=a){const t=e.indexOf(a);if(t>=0)return{value:i,label:r[t]}}return t.userInterface===l.SEARCH?isNaN(Number(i))?i:Number(i):O.getConvertedValue(t,i)}getSearchDescriptionField(t){if(t.userInterface===l.SEARCH){const{ENTITYNAME:e,mergedFrom:r,DESCRIPTIONFIELD:n}=t.properties;if(!s.isEmpty(n))return null!=r?`${r}.${e}.${n}`:`${e}.${n}`}}}class ${static async debounce(t,e){const r=t.name;$._debouncingTimeouts[r]&&(clearTimeout($._debouncingTimeouts[r]),delete $._debouncingTimeouts[r]),$._debouncingTimeouts[r]=setTimeout((()=>{delete $._debouncingTimeouts[r],e()}),100)}static async loadData(t,e){return new Promise(((r,n)=>{$.debounce(t,(()=>{v.loadData(t,e,this.loadFromServer).then((t=>r(t))).catch((t=>n(t)))}))}))}static async loadFromServer(t,e,r){try{r=$.registryLoading(t,r);const n=await $.callLoader(t,e,r);if(null==n)return;const i=n.records,s=$.buildPaginationInfo(i.length,e,n.loadingInfo),a=null==s?i:i.slice(0,s.lastRecord);return Promise.resolve({records:a,paginationInfo:s})}catch(t){return console.error(t),Promise.reject(t)}}static async callLoader(t,e,r,n){null==n&&(n=new P);const i=await n.load(t,e,r),{records:s,loadingInfo:a}=i;if($.isOldRequest(t,a))return Promise.resolve(void 0);const o=!n.canSlice()||0===a.count;if(v.cacheRecords(t,s,o,a.loadingInProgress),v.isCacheEnabled(t)&&a.loadingInProgress){const r=Object.assign(Object.assign({},e),{offset:a.count}),i=Object.assign(Object.assign({},a),{pageNumber:(a.pageNumber||0)+1,quiet:!0});this.callLoader(t,r,i,n).then((e=>$.afterLoadingPage(t,e.loadingInfo))).catch((t=>console.error(t)))}return Promise.resolve(i)}static afterLoadingPage(t,e){v.setLoadingStatus(t,e.loadingInProgress);const r=t.getPaginationInfo();if(null==r)return;const n=e.count;e.loadingInProgress?t.updatePagination(Object.assign(Object.assign({},r),{count:n})):e.needReload?t.gotoPage(0):t.updatePagination(Object.assign(Object.assign({},r),{total:n,count:n}))}static registryLoading(t,e){return null==e&&(e={requestTime:(new Date).getTime(),count:0}),$._requestTimeByDataUnit.set(t.name,e.requestTime),e}static isOldRequest(t,e){return $._requestTimeByDataUnit.get(t.name)>e.requestTime}static buildPaginationInfo(t,e,r){let{limit:n,offset:i}=e;if(!n)return;1===r.pageNumber&&(i=0);const{total:s,count:a,loadingInProgress:o}=r,l=0===a||0===t?0:i+1,c=i+Math.min(t,n);return{total:s,count:a,lastRecord:c,firstRecord:l,currentPage:i/n,hasMore:c<a||o}}}$._requestTimeByDataUnit=new Map,$._debouncingTimeouts={};const S=/dd:\/\/([^/]+)\/([^/?]+)/;class N{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchDataUnit",d.gql`query($name: String!) {
2
2
  $queryAlias$: fetchDataUnit(name: $name){
3
3
  name
4
4
  fields{
@@ -1 +1 @@
1
- import{r as t,c as i,h as e,H as s,g as r}from"./p-d2d301a6.js";import{ElementIDUtils as o,ObjectUtils as l}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";import{E as n}from"./p-1a68fb59.js";import{C as d}from"./p-aff76a53.js";import{F as h}from"./p-d9804798.js";import"./p-df5451c7.js";import"./p-dc7c9047.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";const c=class{constructor(e){t(this,e),this.filterChange=i(this,"filterChange",7),this.editPersonalizedFilter=i(this,"editPersonalizedFilter",7),this.addPersonalizedFilter=i(this,"addPersonalizedFilter",7),this.filterItem=void 0,this.configName=void 0,this.resourceID=void 0}observeFilterItem(t){var i,e;this._editor&&(this._editor.config=t),null===(e=null===(i=this._editor)||void 0===i?void 0:i.reloadList)||void 0===e||e.call(i),this.filterChange.emit(t)}getContentEditorConfig(){const t={presentationMode:n.MODAL};switch(this.filterItem.type){case a.BINARY_SELECT:return{tag:"snk-filter-binary-select",props:t};case a.MULTI_SELECT:return{tag:"snk-filter-multi-select"};case a.PERIOD:return{tag:"snk-filter-period",props:t};case a.SEARCH:return{tag:"snk-filter-search"};case a.NUMBER:return{tag:"snk-filter-number",props:t};case a.PERSONALIZED:return this.buildSnkFilterPersonalizedProps();case a.CHECK_BOX_LIST:return{tag:"snk-filter-checkbox-list",props:t};case a.MULTI_LIST:return{tag:"snk-entity-list",props:{maxHeightList:"640px",rightListSlotBuilder:t=>this.buildRightSlot(t)}}}return{tag:"snk-filter-text"}}buildSnkFilterPersonalizedProps(){return{tag:"snk-personalized-filter-editor",props:{onEditFilter:t=>this.editPersonalizedFilter.emit(t.detail),onAddFilter:()=>this.addPersonalizedFilter.emit()}}}isVisible(t){return!!this.filterItem.visible||void 0!==t}updateFilterValue(t){const i=void 0!==(null==t?void 0:t.value)?t.value:t;this.filterItem=Object.assign(Object.assign({},this.filterItem),null!=this.filterItem.groupedItems?{visible:i>0,value:i,groupedItems:t.items}:{value:this.filterItem.type===(a.SEARCH||a.CHECK_BOX_LIST)?t:i,visible:this.isVisible(i)})}handleDeleteFilter(t,i){i===a.PERSONALIZED&&d.removePersonalizedFilter(t,this.resourceID,this.configName)}componentDidLoad(){if(this._element){o.addIDInfo(this._element);const t=this._element.getAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME);this._idContentEditor=`${t}_${this.filterItem.id}`}}buildRightSlot(t){return e("ez-icon",{iconName:"delete",onClick:()=>this.removeValueFromConfig(t)})}removeValueFromConfig(t){var i,e,s;const r=null===(e=null===(i=this.filterItem)||void 0===i?void 0:i.value)||void 0===e?void 0:e.findIndex((({id:i})=>i===t.id)),o=l.copy(this.filterItem);null===(s=null==o?void 0:o.value)||void 0===s||s.splice(r,1),this.updateFilterValue(o.value)}canShowDetailModal(){const{CUSTOM_FILTER:t,OTHER_FILTERS:i}=h;return![t,i].includes(this.filterItem.filterType)&&this.filterItem.type!==a.BINARY_SELECT}render(){const{tag:t,props:i}=this.getContentEditorConfig();return e(s,null,e("div",{class:"ez-flex ez-flex--column grow"},this.canShowDetailModal()&&e("div",{class:"col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center"},e("div",{class:"ez-title ez-title--small ez-title--primary grow"},this.filterItem.detailModal)),e(t,Object.assign({ref:t=>this._editor=t,config:this.filterItem,value:this.filterItem.value,onValueChanged:t=>this.updateFilterValue(t.detail),"data-element-id":this._idContentEditor},i))))}get _element(){return r(this)}static get watchers(){return{filterItem:["observeFilterItem"]}}};c.style=".grow{flex-grow:1}.gap{gap:4px}";export{c as snk_filter_modal_item}
1
+ import{r as t,c as i,h as e,H as s,g as r}from"./p-d2d301a6.js";import{ElementIDUtils as o,ObjectUtils as l}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";import{E as n}from"./p-1a68fb59.js";import{C as d}from"./p-96621231.js";import{F as h}from"./p-d9804798.js";import"./p-181975f1.js";import"./p-594bc21d.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";const c=class{constructor(e){t(this,e),this.filterChange=i(this,"filterChange",7),this.editPersonalizedFilter=i(this,"editPersonalizedFilter",7),this.addPersonalizedFilter=i(this,"addPersonalizedFilter",7),this.filterItem=void 0,this.configName=void 0,this.resourceID=void 0}observeFilterItem(t){var i,e;this._editor&&(this._editor.config=t),null===(e=null===(i=this._editor)||void 0===i?void 0:i.reloadList)||void 0===e||e.call(i),this.filterChange.emit(t)}getContentEditorConfig(){const t={presentationMode:n.MODAL};switch(this.filterItem.type){case a.BINARY_SELECT:return{tag:"snk-filter-binary-select",props:t};case a.MULTI_SELECT:return{tag:"snk-filter-multi-select"};case a.PERIOD:return{tag:"snk-filter-period",props:t};case a.SEARCH:return{tag:"snk-filter-search"};case a.NUMBER:return{tag:"snk-filter-number",props:t};case a.PERSONALIZED:return this.buildSnkFilterPersonalizedProps();case a.CHECK_BOX_LIST:return{tag:"snk-filter-checkbox-list",props:t};case a.MULTI_LIST:return{tag:"snk-entity-list",props:{maxHeightList:"640px",rightListSlotBuilder:t=>this.buildRightSlot(t)}}}return{tag:"snk-filter-text"}}buildSnkFilterPersonalizedProps(){return{tag:"snk-personalized-filter-editor",props:{onEditFilter:t=>this.editPersonalizedFilter.emit(t.detail),onAddFilter:()=>this.addPersonalizedFilter.emit()}}}isVisible(t){return!!this.filterItem.visible||void 0!==t}updateFilterValue(t){const i=void 0!==(null==t?void 0:t.value)?t.value:t;this.filterItem=Object.assign(Object.assign({},this.filterItem),null!=this.filterItem.groupedItems?{visible:i>0,value:i,groupedItems:t.items}:{value:this.filterItem.type===(a.SEARCH||a.CHECK_BOX_LIST)?t:i,visible:this.isVisible(i)})}handleDeleteFilter(t,i){i===a.PERSONALIZED&&d.removePersonalizedFilter(t,this.resourceID,this.configName)}componentDidLoad(){if(this._element){o.addIDInfo(this._element);const t=this._element.getAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME);this._idContentEditor=`${t}_${this.filterItem.id}`}}buildRightSlot(t){return e("ez-icon",{iconName:"delete",onClick:()=>this.removeValueFromConfig(t)})}removeValueFromConfig(t){var i,e,s;const r=null===(e=null===(i=this.filterItem)||void 0===i?void 0:i.value)||void 0===e?void 0:e.findIndex((({id:i})=>i===t.id)),o=l.copy(this.filterItem);null===(s=null==o?void 0:o.value)||void 0===s||s.splice(r,1),this.updateFilterValue(o.value)}canShowDetailModal(){const{CUSTOM_FILTER:t,OTHER_FILTERS:i}=h;return![t,i].includes(this.filterItem.filterType)&&this.filterItem.type!==a.BINARY_SELECT}render(){const{tag:t,props:i}=this.getContentEditorConfig();return e(s,null,e("div",{class:"ez-flex ez-flex--column grow"},this.canShowDetailModal()&&e("div",{class:"col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center"},e("div",{class:"ez-title ez-title--small ez-title--primary grow"},this.filterItem.detailModal)),e(t,Object.assign({ref:t=>this._editor=t,config:this.filterItem,value:this.filterItem.value,onValueChanged:t=>this.updateFilterValue(t.detail),"data-element-id":this._idContentEditor},i))))}get _element(){return r(this)}static get watchers(){return{filterItem:["observeFilterItem"]}}};c.style=".grow{flex-grow:1}.gap{gap:4px}";export{c as snk_filter_modal_item}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s,H as e,g as a}from"./p-d2d301a6.js";import{StringUtils as o,ElementIDUtils as n,ApplicationContext as h,JSUtils as r,FloatingManager as d}from"@sankhyalabs/core";import{T as c}from"./p-ae4fc9a9.js";import"./p-dc7c9047.js";import"./p-c96824b7.js";import{P as l}from"./p-38289a55.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-df5451c7.js";import{d as m}from"./p-b0ef4383.js";import{A as u}from"./p-913a9979.js";import"./p-6dc031de.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"./p-688dcb4c.js";const p=class{constructor(s){t(this,s),this.actionClick=i(this,"actionClick",7),this.configuratorSave=i(this,"configuratorSave",7),this.configuratorCancel=i(this,"configuratorCancel",7),this.formItemsReady=i(this,"formItemsReady",7),this._keyDownHandler=async t=>this.keyDownListener(t),this._viewHistory=[],this._dataUnit=void 0,this._dataState=void 0,this.attachmentRegisterKey=void 0,this._currentViewMode=m.GRID,this._canEdit=void 0,this._resourceID=void 0,this.configName=void 0,this.filterBarTitle=void 0,this.selectionToastConfig=void 0,this.showActionButtons=!1,this.actionsList=void 0,this.taskbarManager=void 0,this.recordsValidator=void 0,this.statusResolver=void 0,this.multipleSelection=!0,this.presentationMode=l.PRIMARY,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.gridLegacyConfigName=void 0,this.filterBarLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.disablePersonalizedFilter=void 0,this.customContainerId=`SNK-CRUD-CUSTOM-CONTAINER-${o.generateUUID()}`}async goToView(t){this.executeAction(t)}async openConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.open()}async closeConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.close()}async reloadFilterBar(){var t;null===(t=this._snkGrid)||void 0===t||t.reloadFilterBar()}async getFilterBar(){return await this._snkGrid.getFilterBar()}currentViewModeWatcher(t){this._viewHistory=[...this._viewHistory.slice(-1),t]}async gridToForm(t=!1){this._backToGrid=!t&&await this._viewStack.getSelectedIndex()===m.GRID,this.setViewMode(m.FORM)}async executeAction(t){return t===c.GRID_MODE?this.setViewMode(m.GRID):t===c.FORM_MODE||t===c.UPDATE?this.gridToForm(t!==c.UPDATE):t===c.CONFIGURATOR?this._snkConfigurator.open():"ATTACH"===t?this.setViewMode(m.ATTACHMENT):void 0}backView(){const t=this._viewHistory.at(-2)||m.GRID;this.setViewMode(t)}setViewMode(t){this._viewStack.show(t),this._currentViewMode=t,t===m.GRID?this._snkGrid.setFocus():t===m.FORM&&this._guidesViewer.setFocus()}openConfig(t){this._snkConfigurator.close(),t===m.GRID?this._snkGrid.showConfig():t===m.FORM&&this._guidesViewer.showFormConfig()}addDataElementID(){n.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}insertionModeHandler(){this.gridToForm()}cancelHandler(){this._backToGrid&&this.setViewMode(m.GRID)}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}componentWillLoad(){this._application=h.getContextValue("__SNK__APPLICATION__");let t=this._element.parentElement;for(this._application.hasAccess(u.UPDATE,this._resourceID).then((t=>this._canEdit=t));t;){if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){this._snkDataUnit=t,this._snkDataUnit.addEventListener("insertionMode",(()=>this.insertionModeHandler())),this._snkDataUnit.addEventListener("cancelEdition",(()=>this.cancelHandler())),this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.initDataUnit():this._snkDataUnit.addEventListener("dataUnitReady",(t=>{this._dataUnit=t.detail,this.initDataUnit()})),this._snkDataUnit.addEventListener("dataStateChange",(async({detail:t})=>{this._dataState=t,void 0!==t.selectedRecord&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey())}));break}t=t.parentElement}this.configName||(this.configName=this._application.configName)}componentDidLoad(){this.initKeyboardManager()}disconnectedCallback(){this.removeShortcuts(),window.removeEventListener("keydown",this._keyDownHandler)}async initKeyboardManager(){var t;const i=await(null===(t=this._application)||void 0===t?void 0:t.getKeyboardManager());if(i){const s=this._dataUnit||await this._snkDataUnit.getDataUnit();async function e(){const t=document.activeElement,i=t==document.body;i||t.blur(),await s.saveData(),i||null==t.setFocus?i||t.focus():t.setFocus()}i.bind("F6",this.toggleView.bind(this),{description:"Alterna entre modo formulário e grade.",element:this._element}).bind("F7",e.bind(this),{description:"Salva os dados.",element:this._element}).bind("ctrl + \\",e.bind(this),{description:"Salva os dados.",element:this._element}).bind("F8",s.addRecord.bind(s),{description:"Adiciona um novo registro.",element:this._element}).bind("F9",s.removeSelectedRecords.bind(s),{description:"Remove o registro selecionado.",element:this._element}).bind("ctrl + F9",s.removeSelectedRecords.bind(s),{description:"Remove o registro selecionado.",element:this._element}).bind("ctrl + .",(()=>0===s.getSelectionInfo().records.length?s.selectFirst():s.nextRecord()),{description:"Avança para o próximo registro.",element:this._element}).bind("ctrl + ,",s.previousRecord.bind(s),{description:"Retorna ao registro anterior.",element:this._element}).bind("F5",(async()=>{const t=await this._viewStack.getSelectedIndex();m.GRID===t&&s.loadData()}),{description:"Atualiza os dados.",element:this._element}).bind("Escape",(()=>{s.isDirty()&&s.cancelEdition()}),{debounceTime:1e3,description:"Cancela uma ação.",element:this._element})}}async removeShortcuts(){var t;const i=await(null===(t=this._application)||void 0===t?void 0:t.getKeyboardManager());i&&i.unbind("F6").unbind("F7").unbind("ctrl + \\").unbind("F8").unbind("F9").unbind("ctrl + F9").unbind("ctrl + .").unbind("ctrl + ,").unbind("F5").unbind("Escape")}async toggleView(){const t=await this._viewStack.getSelectedIndex();this.setViewMode(m.GRID===t?m.FORM:m.GRID)}async initDataUnit(){this.addDataElementID(),this.messagesBuilder||(this.messagesBuilder=this._snkDataUnit.messagesBuilder),null==this._resourceID&&(this._resourceID=this._snkDataUnit.resourceID,null==this._resourceID&&(this._resourceID=await this._application.getResourceID()))}handleConfiguratorEvent(t,i){t.stopImmediatePropagation(),"SAVE"!==i?this.configuratorCancel.emit():this.configuratorSave.emit()}async keyDownListener(t){t.ctrlKey&&null!=t.key&&"F"===t.key.toUpperCase()&&null!=this._element&&(r.isHiddenElement(this._element)||(d.closeAll(),this._currentViewMode===m.GRID?await this._snkGrid.findColumn():await this._guidesViewer.findField(),t.preventDefault()))}connectedCallback(){window.addEventListener("keydown",this._keyDownHandler,{capture:!0})}render(){if(null!=this._resourceID)return this._snkDataUnit.ignoreSaveMessage=this._currentViewMode===m.GRID,s(e,null,s("ez-view-stack",{ref:t=>this._viewStack=t,"data-element-id":"crud"},s("stack-item",null,s("snk-grid",{ref:t=>this._snkGrid=t,filterBarTitle:this.filterBarTitle,"data-element-id":"crud_grid",configName:this.configName,onGridDoubleClick:()=>this.gridToForm(!0),taskbarManager:this.taskbarManager,onActionClick:t=>this.executeAction(t.detail),messagesBuilder:this.messagesBuilder,actionsList:this.actionsList,statusResolver:this.statusResolver,multipleSelection:this.multipleSelection,presentationMode:this.presentationMode,recordsValidator:this.recordsValidator,selectionToastConfig:this.selectionToastConfig,useEnterLikeTab:this.useEnterLikeTab,canEdit:this._canEdit,resourceID:this._resourceID,disablePersonalizedFilter:this.disablePersonalizedFilter,gridLegacyConfigName:this.gridLegacyConfigName,filterBarLegacyConfigName:this.filterBarLegacyConfigName},s("slot",{name:"GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"SnkGridHeader"}),s("slot",{name:"SnkGridFooter"}),s("slot",{name:"SnkGridTaskBar"}))),s("stack-item",null,s("snk-guides-viewer",{ref:t=>this._guidesViewer=t,entityPath:this._snkDataUnit.entityName,messagesBuilder:this.messagesBuilder,onExit:()=>this.setViewMode(m.GRID),dataState:this._dataState,dataUnit:this._dataUnit,actionsList:this.actionsList,taskbarManager:this.taskbarManager,configName:this.configName,onActionClick:t=>this.executeAction(t.detail),presentationMode:this.presentationMode,"data-element-id":"crud_form",canEdit:this._canEdit,recordsValidator:this.recordsValidator,resourceID:this._resourceID,detailTaskbarCustomContainerId:this.customContainerId,formLegacyConfigName:this.formLegacyConfigName},s("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"SnkFormTaskBar"}))),s("stack-item",null,s("snk-attach",{registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this._snkDataUnit.entityName,onBack:this.backView.bind(this)})),s("snk-configurator",{ref:t=>this._snkConfigurator=t,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:t=>this.setViewMode(t.detail),onOpenConfig:t=>this.openConfig(t.detail),showActionButtons:this.showActionButtons,onSave:t=>this.handleConfiguratorEvent(t,"SAVE"),onCancel:t=>this.handleConfiguratorEvent(t,"CANCEL"),resourceID:this._resourceID,customContainerId:this.customContainerId})),s("div",{id:`${this.customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}),s("slot",{name:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})))}get _element(){return a(this)}static get watchers(){return{_currentViewMode:["currentViewModeWatcher"]}}};p.style=".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";export{p as snk_crud}
1
+ import{r as t,c as i,h as s,H as e,g as a}from"./p-d2d301a6.js";import{StringUtils as o,ElementIDUtils as n,ApplicationContext as h,JSUtils as r,FloatingManager as d}from"@sankhyalabs/core";import{T as c}from"./p-ae4fc9a9.js";import"./p-594bc21d.js";import"./p-37e5d563.js";import{P as l}from"./p-38289a55.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-181975f1.js";import{d as m}from"./p-b0ef4383.js";import{A as u}from"./p-0cd3c0a9.js";import"./p-6dc031de.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"./p-688dcb4c.js";const p=class{constructor(s){t(this,s),this.actionClick=i(this,"actionClick",7),this.configuratorSave=i(this,"configuratorSave",7),this.configuratorCancel=i(this,"configuratorCancel",7),this.formItemsReady=i(this,"formItemsReady",7),this._keyDownHandler=async t=>this.keyDownListener(t),this._viewHistory=[],this._dataUnit=void 0,this._dataState=void 0,this.attachmentRegisterKey=void 0,this._currentViewMode=m.GRID,this._canEdit=void 0,this._resourceID=void 0,this.configName=void 0,this.filterBarTitle=void 0,this.selectionToastConfig=void 0,this.showActionButtons=!1,this.actionsList=void 0,this.taskbarManager=void 0,this.recordsValidator=void 0,this.statusResolver=void 0,this.multipleSelection=!0,this.presentationMode=l.PRIMARY,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.gridLegacyConfigName=void 0,this.filterBarLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.disablePersonalizedFilter=void 0,this.customContainerId=`SNK-CRUD-CUSTOM-CONTAINER-${o.generateUUID()}`}async goToView(t){this.executeAction(t)}async openConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.open()}async closeConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.close()}async reloadFilterBar(){var t;null===(t=this._snkGrid)||void 0===t||t.reloadFilterBar()}async getFilterBar(){return await this._snkGrid.getFilterBar()}currentViewModeWatcher(t){this._viewHistory=[...this._viewHistory.slice(-1),t]}async gridToForm(t=!1){this._backToGrid=!t&&await this._viewStack.getSelectedIndex()===m.GRID,this.setViewMode(m.FORM)}async executeAction(t){return t===c.GRID_MODE?this.setViewMode(m.GRID):t===c.FORM_MODE||t===c.UPDATE?this.gridToForm(t!==c.UPDATE):t===c.CONFIGURATOR?this._snkConfigurator.open():"ATTACH"===t?this.setViewMode(m.ATTACHMENT):void 0}backView(){const t=this._viewHistory.at(-2)||m.GRID;this.setViewMode(t)}setViewMode(t){this._viewStack.show(t),this._currentViewMode=t,t===m.GRID?this._snkGrid.setFocus():t===m.FORM&&this._guidesViewer.setFocus()}openConfig(t){this._snkConfigurator.close(),t===m.GRID?this._snkGrid.showConfig():t===m.FORM&&this._guidesViewer.showFormConfig()}addDataElementID(){n.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}insertionModeHandler(){this.gridToForm()}cancelHandler(){this._backToGrid&&this.setViewMode(m.GRID)}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}componentWillLoad(){this._application=h.getContextValue("__SNK__APPLICATION__");let t=this._element.parentElement;for(this._application.hasAccess(u.UPDATE,this._resourceID).then((t=>this._canEdit=t));t;){if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){this._snkDataUnit=t,this._snkDataUnit.addEventListener("insertionMode",(()=>this.insertionModeHandler())),this._snkDataUnit.addEventListener("cancelEdition",(()=>this.cancelHandler())),this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.initDataUnit():this._snkDataUnit.addEventListener("dataUnitReady",(t=>{this._dataUnit=t.detail,this.initDataUnit()})),this._snkDataUnit.addEventListener("dataStateChange",(async({detail:t})=>{this._dataState=t,void 0!==t.selectedRecord&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey())}));break}t=t.parentElement}this.configName||(this.configName=this._application.configName)}componentDidLoad(){this.initKeyboardManager()}disconnectedCallback(){this.removeShortcuts(),window.removeEventListener("keydown",this._keyDownHandler)}async initKeyboardManager(){var t;const i=await(null===(t=this._application)||void 0===t?void 0:t.getKeyboardManager());if(i){const s=this._dataUnit||await this._snkDataUnit.getDataUnit();async function e(){const t=document.activeElement,i=t==document.body;i||t.blur(),await s.saveData(),i||null==t.setFocus?i||t.focus():t.setFocus()}i.bind("F6",this.toggleView.bind(this),{description:"Alterna entre modo formulário e grade.",element:this._element}).bind("F7",e.bind(this),{description:"Salva os dados.",element:this._element}).bind("ctrl + \\",e.bind(this),{description:"Salva os dados.",element:this._element}).bind("F8",s.addRecord.bind(s),{description:"Adiciona um novo registro.",element:this._element}).bind("F9",s.removeSelectedRecords.bind(s),{description:"Remove o registro selecionado.",element:this._element}).bind("ctrl + F9",s.removeSelectedRecords.bind(s),{description:"Remove o registro selecionado.",element:this._element}).bind("ctrl + .",(()=>0===s.getSelectionInfo().records.length?s.selectFirst():s.nextRecord()),{description:"Avança para o próximo registro.",element:this._element}).bind("ctrl + ,",s.previousRecord.bind(s),{description:"Retorna ao registro anterior.",element:this._element}).bind("F5",(async()=>{const t=await this._viewStack.getSelectedIndex();m.GRID===t&&s.loadData()}),{description:"Atualiza os dados.",element:this._element}).bind("Escape",(()=>{s.isDirty()&&s.cancelEdition()}),{debounceTime:1e3,description:"Cancela uma ação.",element:this._element})}}async removeShortcuts(){var t;const i=await(null===(t=this._application)||void 0===t?void 0:t.getKeyboardManager());i&&i.unbind("F6").unbind("F7").unbind("ctrl + \\").unbind("F8").unbind("F9").unbind("ctrl + F9").unbind("ctrl + .").unbind("ctrl + ,").unbind("F5").unbind("Escape")}async toggleView(){const t=await this._viewStack.getSelectedIndex();this.setViewMode(m.GRID===t?m.FORM:m.GRID)}async initDataUnit(){this.addDataElementID(),this.messagesBuilder||(this.messagesBuilder=this._snkDataUnit.messagesBuilder),null==this._resourceID&&(this._resourceID=this._snkDataUnit.resourceID,null==this._resourceID&&(this._resourceID=await this._application.getResourceID()))}handleConfiguratorEvent(t,i){t.stopImmediatePropagation(),"SAVE"!==i?this.configuratorCancel.emit():this.configuratorSave.emit()}async keyDownListener(t){t.ctrlKey&&null!=t.key&&"F"===t.key.toUpperCase()&&null!=this._element&&(r.isHiddenElement(this._element)||(d.closeAll(),this._currentViewMode===m.GRID?await this._snkGrid.findColumn():await this._guidesViewer.findField(),t.preventDefault()))}connectedCallback(){window.addEventListener("keydown",this._keyDownHandler,{capture:!0})}render(){if(null!=this._resourceID)return this._snkDataUnit.ignoreSaveMessage=this._currentViewMode===m.GRID,s(e,null,s("ez-view-stack",{ref:t=>this._viewStack=t,"data-element-id":"crud"},s("stack-item",null,s("snk-grid",{ref:t=>this._snkGrid=t,filterBarTitle:this.filterBarTitle,"data-element-id":"crud_grid",configName:this.configName,onGridDoubleClick:()=>this.gridToForm(!0),taskbarManager:this.taskbarManager,onActionClick:t=>this.executeAction(t.detail),messagesBuilder:this.messagesBuilder,actionsList:this.actionsList,statusResolver:this.statusResolver,multipleSelection:this.multipleSelection,presentationMode:this.presentationMode,recordsValidator:this.recordsValidator,selectionToastConfig:this.selectionToastConfig,useEnterLikeTab:this.useEnterLikeTab,canEdit:this._canEdit,resourceID:this._resourceID,disablePersonalizedFilter:this.disablePersonalizedFilter,gridLegacyConfigName:this.gridLegacyConfigName,filterBarLegacyConfigName:this.filterBarLegacyConfigName},s("slot",{name:"GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"SnkGridHeader"}),s("slot",{name:"SnkGridFooter"}),s("slot",{name:"SnkGridTaskBar"}))),s("stack-item",null,s("snk-guides-viewer",{ref:t=>this._guidesViewer=t,entityPath:this._snkDataUnit.entityName,messagesBuilder:this.messagesBuilder,onExit:()=>this.setViewMode(m.GRID),dataState:this._dataState,dataUnit:this._dataUnit,actionsList:this.actionsList,taskbarManager:this.taskbarManager,configName:this.configName,onActionClick:t=>this.executeAction(t.detail),presentationMode:this.presentationMode,"data-element-id":"crud_form",canEdit:this._canEdit,recordsValidator:this.recordsValidator,resourceID:this._resourceID,detailTaskbarCustomContainerId:this.customContainerId,formLegacyConfigName:this.formLegacyConfigName},s("slot",{name:"GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"SnkFormTaskBar"}))),s("stack-item",null,s("snk-attach",{registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this._snkDataUnit.entityName,onBack:this.backView.bind(this)})),s("snk-configurator",{ref:t=>this._snkConfigurator=t,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:t=>this.setViewMode(t.detail),onOpenConfig:t=>this.openConfig(t.detail),showActionButtons:this.showActionButtons,onSave:t=>this.handleConfiguratorEvent(t,"SAVE"),onCancel:t=>this.handleConfiguratorEvent(t,"CANCEL"),resourceID:this._resourceID,customContainerId:this.customContainerId})),s("div",{id:`${this.customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}),s("slot",{name:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS"}),s("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})))}get _element(){return a(this)}static get watchers(){return{_currentViewMode:["currentViewModeWatcher"]}}};p.style=".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";export{p as snk_crud}
@@ -1 +1 @@
1
- import{D as t}from"./p-dc7c9047.js";import{a as e}from"./p-c96824b7.js";import{SortMode as i,ApplicationContext as r,UserInterface as a,DateUtils as s}from"@sankhyalabs/core";import"./p-38289a55.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-df5451c7.js";import o from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";class n{static assertDefaultSorting(t,e){t&&e&&(e.defaultSorting=t.columns.filter((t=>null!=t.ascending)).sort(((t,e)=>t.orderIndex-e.orderIndex)).map((({name:t,ascending:r})=>{const{dataType:a}=e.getField(t);return{field:t,dataType:a,mode:r?i.ASC:i.DESC}})))}static find(e,i,a,s=!0,o,n){let l=[],c=[],m={},d=r.getContextValue("__SNK__APPLICATION__");if(i){if(!Array.isArray(i))throw new Error(d.messagesBuilder.getMessage("crudUtils.errorArray",null));i.forEach((t=>{l.push({name:t})}))}if(a)for(const t in a)a.hasOwnProperty(t)&&c.push({nome:t,valor:a[t]});o&&(m={expression:{$:o}});let p={requestBody:{entity:{name:e,criterio:c,fields:{field:l},literalCriteria:m,orderby:n}}};return new Promise((e=>{t.get().callServiceBroker("mge@crud.find",JSON.stringify(p)).then((t=>{var i;let r=null===(i=t.entidades)||void 0===i?void 0:i.entidade;if(null!=r){let t={fields:new Map};for(let e in r){let i=r[e];if(i.hasOwnProperty("$")&&t.fields.set(e,i.$),s)break}e(t)}else e(null)}))}))}}class l{setDataUnit(t){this._dataUnit=t}setApplication(t){this._application=t}formatLabel(t,e){const{userInterface:i}=this._dataUnit.getField(t);return i===a.DATETIME?s.formatDate(this._dataUnit.valueFromString(t,e)):String(this._dataUnit.getFormattedValue(t,e))}async getStaticOptions(t){return Promise.resolve(null==t?void 0:await e.getDistinct(this._dataUnit,t))}fetchData(t,e){return new Promise((i=>{this._application.executeSelectDistinct(this._dataUnit,e,t).then((t=>{i(t.map((t=>this._dataUnit.getField(e).userInterface===a.SEARCH?Object.assign(Object.assign({},JSON.parse(t)),{check:!0}):{value:t,label:this.formatLabel(e,t),check:!0})))}))}))}sortItems(t,e){return o.defaultSorterMultSelectionOption(this._dataUnit,t,e)}}export{n as C,l as S}
1
+ import{D as t}from"./p-594bc21d.js";import{a as e}from"./p-37e5d563.js";import{SortMode as i,ApplicationContext as r,UserInterface as a,DateUtils as s}from"@sankhyalabs/core";import"./p-38289a55.js";import"./p-21749402.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-181975f1.js";import o from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";class n{static assertDefaultSorting(t,e){t&&e&&(e.defaultSorting=t.columns.filter((t=>null!=t.ascending)).sort(((t,e)=>t.orderIndex-e.orderIndex)).map((({name:t,ascending:r})=>{const{dataType:a}=e.getField(t);return{field:t,dataType:a,mode:r?i.ASC:i.DESC}})))}static find(e,i,a,s=!0,o,n){let l=[],c=[],m={},d=r.getContextValue("__SNK__APPLICATION__");if(i){if(!Array.isArray(i))throw new Error(d.messagesBuilder.getMessage("crudUtils.errorArray",null));i.forEach((t=>{l.push({name:t})}))}if(a)for(const t in a)a.hasOwnProperty(t)&&c.push({nome:t,valor:a[t]});o&&(m={expression:{$:o}});let p={requestBody:{entity:{name:e,criterio:c,fields:{field:l},literalCriteria:m,orderby:n}}};return new Promise((e=>{t.get().callServiceBroker("mge@crud.find",JSON.stringify(p)).then((t=>{var i;let r=null===(i=t.entidades)||void 0===i?void 0:i.entidade;if(null!=r){let t={fields:new Map};for(let e in r){let i=r[e];if(i.hasOwnProperty("$")&&t.fields.set(e,i.$),s)break}e(t)}else e(null)}))}))}}class l{setDataUnit(t){this._dataUnit=t}setApplication(t){this._application=t}formatLabel(t,e){const{userInterface:i}=this._dataUnit.getField(t);return i===a.DATETIME?s.formatDate(this._dataUnit.valueFromString(t,e)):String(this._dataUnit.getFormattedValue(t,e))}async getStaticOptions(t){return Promise.resolve(null==t?void 0:await e.getDistinct(this._dataUnit,t))}fetchData(t,e){return new Promise((i=>{this._application.executeSelectDistinct(this._dataUnit,e,t).then((t=>{i(t.map((t=>this._dataUnit.getField(e).userInterface===a.SEARCH?Object.assign(Object.assign({},JSON.parse(t)),{check:!0}):{value:t,label:this.formatLabel(e,t),check:!0})))}))}))}sortItems(t,e){return o.defaultSorterMultSelectionOption(this._dataUnit,t,e)}}export{n as C,l as S}