@sankhyalabs/sankhyablocks 8.8.0-rc.1 → 8.8.0-rc.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/cjs/{ConfigStorage-a97ca159.js → ConfigStorage-c15716fd.js} +5 -2
  2. package/dist/cjs/{DataFetcher-2a99283c.js → DataFetcher-713f0749.js} +32 -32
  3. package/dist/cjs/PreloadManager-e26d237f.js +224 -0
  4. package/dist/cjs/{SnkFormConfigManager-f641f502.js → SnkFormConfigManager-29101e20.js} +2 -2
  5. package/dist/cjs/{SnkMultiSelectionListDataSource-56db34ee.js → SnkMultiSelectionListDataSource-d74d2336.js} +10 -6
  6. package/dist/cjs/{auth-fetcher-78231356.js → auth-fetcher-555ff856.js} +1 -1
  7. package/dist/cjs/{dataunit-fetcher-4f7d4ee7.js → dataunit-fetcher-66c0b7af.js} +48 -248
  8. package/dist/cjs/{form-config-fetcher-a322a522.js → form-config-fetcher-17775a75.js} +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{pesquisa-fetcher-7ef61508.js → pesquisa-fetcher-34922b83.js} +1 -1
  11. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  12. package/dist/cjs/snk-actions-button.cjs.entry.js +93 -86
  13. package/dist/cjs/snk-application.cjs.entry.js +16 -6
  14. package/dist/cjs/snk-attach.cjs.entry.js +4 -2
  15. package/dist/cjs/snk-crud.cjs.entry.js +7 -5
  16. package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
  17. package/dist/cjs/snk-detail-view.cjs.entry.js +24 -8
  18. package/dist/cjs/snk-filter-bar.cjs.entry.js +19 -4
  19. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
  20. package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
  21. package/dist/cjs/snk-form.cjs.entry.js +4 -4
  22. package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
  23. package/dist/cjs/snk-grid.cjs.entry.js +8 -7
  24. package/dist/cjs/{snk-guides-viewer-aab80f66.js → snk-guides-viewer-b173ce35.js} +78 -5
  25. package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -7
  26. package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
  27. package/dist/cjs/snk-simple-crud.cjs.entry.js +8 -5
  28. package/dist/collection/components/snk-actions-button/actions/executor/java.executor.js +2 -2
  29. package/dist/collection/components/snk-actions-button/actions/executor/javascript.executor.js +2 -2
  30. package/dist/collection/components/snk-actions-button/actions/executor/procedure.executor.js +2 -2
  31. package/dist/collection/components/snk-actions-button/clientEvent/index.js +81 -76
  32. package/dist/collection/components/snk-application/snk-application.js +1 -0
  33. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +18 -1
  34. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +80 -8
  35. package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +17 -2
  36. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js +5 -5
  37. package/dist/collection/components/snk-grid/snk-grid.js +1 -0
  38. package/dist/collection/lib/http/data-fetcher/DataFetcher.js +33 -34
  39. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +7 -2
  40. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +25 -4
  41. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +25 -55
  42. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +1 -0
  43. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +29 -8
  44. package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +3 -0
  45. package/dist/collection/lib/workspace/workspace.js +7 -0
  46. package/dist/components/ConfigStorage.js +3 -0
  47. package/dist/components/DataFetcher.js +32 -32
  48. package/dist/components/SnkMultiSelectionListDataSource.js +5 -5
  49. package/dist/components/dataunit-fetcher.js +87 -68
  50. package/dist/components/snk-actions-button2.js +87 -82
  51. package/dist/components/snk-application2.js +8 -0
  52. package/dist/components/snk-detail-view2.js +88 -2
  53. package/dist/components/snk-filter-bar2.js +17 -2
  54. package/dist/components/snk-grid2.js +1 -0
  55. package/dist/esm/{ConfigStorage-26f89143.js → ConfigStorage-79c81f36.js} +5 -2
  56. package/dist/esm/{DataFetcher-90e91631.js → DataFetcher-79f78222.js} +32 -32
  57. package/dist/esm/PreloadManager-8826b96a.js +222 -0
  58. package/dist/esm/{SnkFormConfigManager-18948123.js → SnkFormConfigManager-7723f3ec.js} +2 -2
  59. package/dist/esm/{SnkMultiSelectionListDataSource-b9410c72.js → SnkMultiSelectionListDataSource-27572f47.js} +6 -6
  60. package/dist/esm/{auth-fetcher-a8c8ee7e.js → auth-fetcher-e260d0cd.js} +1 -1
  61. package/dist/esm/{dataunit-fetcher-1c2ccae2.js → dataunit-fetcher-831feb12.js} +41 -240
  62. package/dist/esm/{form-config-fetcher-7c3b6273.js → form-config-fetcher-e1603e66.js} +1 -1
  63. package/dist/esm/loader.js +1 -1
  64. package/dist/esm/{pesquisa-fetcher-90d6853b.js → pesquisa-fetcher-8e922c9d.js} +1 -1
  65. package/dist/esm/sankhyablocks.js +1 -1
  66. package/dist/esm/snk-actions-button.entry.js +93 -86
  67. package/dist/esm/snk-application.entry.js +16 -6
  68. package/dist/esm/snk-attach.entry.js +4 -2
  69. package/dist/esm/snk-crud.entry.js +7 -5
  70. package/dist/esm/snk-data-exporter.entry.js +1 -1
  71. package/dist/esm/snk-detail-view.entry.js +24 -8
  72. package/dist/esm/snk-filter-bar.entry.js +20 -5
  73. package/dist/esm/snk-filter-modal-item.entry.js +3 -3
  74. package/dist/esm/snk-form-config.entry.js +2 -2
  75. package/dist/esm/snk-form.entry.js +4 -4
  76. package/dist/esm/snk-grid-config.entry.js +3 -3
  77. package/dist/esm/snk-grid.entry.js +8 -7
  78. package/dist/esm/{snk-guides-viewer-62b0fa69.js → snk-guides-viewer-e62e0edc.js} +79 -6
  79. package/dist/esm/snk-guides-viewer.entry.js +9 -7
  80. package/dist/esm/snk-personalized-filter.entry.js +3 -3
  81. package/dist/esm/snk-simple-crud.entry.js +8 -5
  82. package/dist/sankhyablocks/{p-ebfa6460.entry.js → p-06e76ed2.entry.js} +1 -1
  83. package/dist/sankhyablocks/p-29176742.js +56 -0
  84. package/dist/sankhyablocks/p-2e6f1666.js +1 -0
  85. package/dist/sankhyablocks/{p-d563e451.entry.js → p-3bf4df20.entry.js} +1 -1
  86. package/dist/sankhyablocks/p-3c4f0354.js +1 -0
  87. package/dist/sankhyablocks/p-3ccb321d.entry.js +1 -0
  88. package/dist/sankhyablocks/{p-240f5892.js → p-41d156dd.js} +1 -1
  89. package/dist/sankhyablocks/{p-d47bbee3.js → p-4651b43f.js} +1 -1
  90. package/dist/sankhyablocks/{p-8652f90b.entry.js → p-47e4b6c9.entry.js} +1 -1
  91. package/dist/sankhyablocks/{p-68fbd480.entry.js → p-4f5b995d.entry.js} +1 -1
  92. package/dist/sankhyablocks/p-5f6113c8.js +60 -0
  93. package/dist/sankhyablocks/p-72b32e25.entry.js +11 -0
  94. package/dist/sankhyablocks/{p-57550ddc.entry.js → p-747043a5.entry.js} +1 -1
  95. package/dist/sankhyablocks/p-77756526.js +1 -0
  96. package/dist/sankhyablocks/{p-e74e2153.entry.js → p-80692cbd.entry.js} +1 -1
  97. package/dist/sankhyablocks/p-848b2e3b.entry.js +1 -0
  98. package/dist/sankhyablocks/p-862e5bf6.entry.js +1 -0
  99. package/dist/sankhyablocks/p-95b05e58.entry.js +1 -0
  100. package/dist/sankhyablocks/p-a1cce4f5.entry.js +1 -0
  101. package/dist/sankhyablocks/{p-5d51bff4.js → p-c9399ce6.js} +1 -1
  102. package/dist/sankhyablocks/p-d0b36421.js +1 -0
  103. package/dist/sankhyablocks/p-d32fe25e.js +1 -0
  104. package/dist/sankhyablocks/p-eb1561bf.entry.js +1 -0
  105. package/dist/sankhyablocks/p-f1743d68.entry.js +1 -0
  106. package/dist/sankhyablocks/p-f2e798f1.entry.js +1 -0
  107. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  108. package/dist/types/components/snk-actions-button/clientEvent/index.d.ts +1 -1
  109. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +3 -0
  110. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +22 -11
  111. package/dist/types/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.d.ts +1 -0
  112. package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +5 -2
  113. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +3 -6
  114. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.d.ts +2 -0
  115. package/dist/types/lib/workspace/workspace.d.ts +1 -0
  116. package/package.json +1 -1
  117. package/dist/sankhyablocks/p-193971ad.js +0 -1
  118. package/dist/sankhyablocks/p-19cbe6e2.entry.js +0 -11
  119. package/dist/sankhyablocks/p-2c7c1323.entry.js +0 -1
  120. package/dist/sankhyablocks/p-3253e7f2.entry.js +0 -1
  121. package/dist/sankhyablocks/p-5dd52ec5.entry.js +0 -1
  122. package/dist/sankhyablocks/p-6541f0df.js +0 -1
  123. package/dist/sankhyablocks/p-910af03c.js +0 -56
  124. package/dist/sankhyablocks/p-992a9d0f.js +0 -1
  125. package/dist/sankhyablocks/p-acb1374c.entry.js +0 -1
  126. package/dist/sankhyablocks/p-b36053da.entry.js +0 -1
  127. package/dist/sankhyablocks/p-b481e5ad.js +0 -1
  128. package/dist/sankhyablocks/p-d264da22.entry.js +0 -1
  129. package/dist/sankhyablocks/p-d56b65e3.entry.js +0 -1
  130. package/dist/sankhyablocks/p-e473ca13.entry.js +0 -1
  131. package/dist/sankhyablocks/p-e86d4a53.js +0 -59
@@ -2,20 +2,21 @@
2
2
 
3
3
  const index = require('./index-f9e81701.js');
4
4
  const core = require('@sankhyalabs/core');
5
- const SnkFormConfigManager = require('./SnkFormConfigManager-f641f502.js');
5
+ const SnkFormConfigManager = require('./SnkFormConfigManager-29101e20.js');
6
6
  const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
7
7
  const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
8
8
  const taskbarElements = require('./taskbar-elements-39949c7a.js');
9
9
  const constants = require('./constants-d187e03e.js');
10
- require('./DataFetcher-2a99283c.js');
11
- require('./pesquisa-fetcher-7ef61508.js');
10
+ require('./DataFetcher-713f0749.js');
11
+ require('./pesquisa-fetcher-34922b83.js');
12
12
  const index$1 = require('./index-0e663819.js');
13
13
  require('./ISave-d68ce3cd.js');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
15
15
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
16
- require('./dataunit-fetcher-4f7d4ee7.js');
16
+ require('./dataunit-fetcher-66c0b7af.js');
17
+ require('./PreloadManager-e26d237f.js');
17
18
  require('./filter-item-type.enum-aa823a00.js');
18
- require('./form-config-fetcher-a322a522.js');
19
+ require('./form-config-fetcher-17775a75.js');
19
20
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
20
21
 
21
22
  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__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}";
@@ -140,6 +141,12 @@ const SnkGuidesViewer = class {
140
141
  this._breadcrumbItems = breadcrumbs;
141
142
  });
142
143
  });
144
+ this._guides = this._guides.map(guide => {
145
+ if (guide.id === guideItem.id) {
146
+ return Object.assign(Object.assign({}, guide), guideItem);
147
+ }
148
+ return guide;
149
+ });
143
150
  }
144
151
  }
145
152
  loadTaskbarProcessor() {
@@ -267,6 +274,28 @@ const SnkGuidesViewer = class {
267
274
  this._guideNavigator.getCurrentPath().then(breadcrumbs => {
268
275
  this._breadcrumbItems = breadcrumbs;
269
276
  });
277
+ this.resetGuideBadge(currentItem);
278
+ }
279
+ resetGuideBadge(selectedGuide) {
280
+ var _a;
281
+ this._guides = [...(_a = this._guides) === null || _a === void 0 ? void 0 : _a.map(guide => {
282
+ if (this.canClearGuideBadge(guide, selectedGuide.id)) {
283
+ return Object.assign(Object.assign({}, guide), { badge: null });
284
+ }
285
+ return guide;
286
+ })];
287
+ }
288
+ canClearGuideBadge(guide, idToCheck) {
289
+ return (guide.id === idToCheck) || this.isIncludedInChildrenList(guide, idToCheck);
290
+ }
291
+ isIncludedInChildrenList(guide, guideId) {
292
+ return this.hasChildren(guide) && this.getChildrenIdList(guide).includes(guideId);
293
+ }
294
+ hasChildren(guide) {
295
+ return guide.children && Array.isArray(guide.children);
296
+ }
297
+ getChildrenIdList(guide) {
298
+ return (guide.children).map(guideChild => guideChild.id);
270
299
  }
271
300
  getConfigViewMode() {
272
301
  return constants.VIEW_MODE.GRID;
@@ -316,6 +345,50 @@ const SnkGuidesViewer = class {
316
345
  var _a;
317
346
  return index.h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != index$1.PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, index.h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
318
347
  }
348
+ async dataUnitActionHandler(action) {
349
+ var _a;
350
+ if (action.type === core.Action.FIELD_INVALIDATED) {
351
+ const guideName = this.getGuideName((_a = action.payload) === null || _a === void 0 ? void 0 : _a.fieldName);
352
+ await this.addErrorBadgeToGuide(guideName);
353
+ await this.openGuideNavigator(guideName);
354
+ }
355
+ }
356
+ async addErrorBadgeToGuide(guideName) {
357
+ var _a;
358
+ this._guides = [...(_a = this._guides) === null || _a === void 0 ? void 0 : _a.map(guide => {
359
+ return Object.assign(Object.assign({}, guide), { badge: this.getBadge(guide, guideName) });
360
+ })];
361
+ }
362
+ async openGuideNavigator(guideName) {
363
+ if (this.selectedGuide.id !== guideName) {
364
+ await this._guideNavigator.openGuideNavidator();
365
+ }
366
+ }
367
+ getBadge(guide, tabName) {
368
+ var _a;
369
+ if (this.selectedGuide.id === tabName) {
370
+ return null;
371
+ }
372
+ if (tabName === guide.id) {
373
+ return "error";
374
+ }
375
+ return (_a = guide.badge) !== null && _a !== void 0 ? _a : null;
376
+ }
377
+ getGuideName(fieldName) {
378
+ var _a;
379
+ for (const sheet of this._masterFormMetadata.getAllSheets()) {
380
+ const formFields = (_a = sheet[1]) === null || _a === void 0 ? void 0 : _a.fields;
381
+ for (const field of formFields) {
382
+ if (field.name === fieldName) {
383
+ return sheet[0];
384
+ }
385
+ }
386
+ }
387
+ return "";
388
+ }
389
+ componentDidLoad() {
390
+ this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
391
+ }
319
392
  render() {
320
393
  var _a, _b;
321
394
  if (this._formEditorConfigManager != undefined) {
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const snkGuidesViewer = require('./snk-guides-viewer-aab80f66.js');
5
+ const snkGuidesViewer = require('./snk-guides-viewer-b173ce35.js');
6
6
  require('./index-f9e81701.js');
7
7
  require('@sankhyalabs/core');
8
- require('./SnkFormConfigManager-f641f502.js');
9
- require('./ConfigStorage-a97ca159.js');
10
- require('./form-config-fetcher-a322a522.js');
11
- require('./DataFetcher-2a99283c.js');
8
+ require('./SnkFormConfigManager-29101e20.js');
9
+ require('./ConfigStorage-c15716fd.js');
10
+ require('./form-config-fetcher-17775a75.js');
11
+ require('./DataFetcher-713f0749.js');
12
12
  require('./_commonjsHelpers-537d719a.js');
13
13
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
14
14
  require('./PrintUtils-bcaeb82f.js');
@@ -19,10 +19,12 @@ require('./taskbar-elements-39949c7a.js');
19
19
  require('./index-0e663819.js');
20
20
  require('./index-102ba62d.js');
21
21
  require('./constants-d187e03e.js');
22
- require('./pesquisa-fetcher-7ef61508.js');
22
+ require('./pesquisa-fetcher-34922b83.js');
23
23
  require('./ISave-d68ce3cd.js');
24
24
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
25
- require('./dataunit-fetcher-4f7d4ee7.js');
25
+ require('./dataunit-fetcher-66c0b7af.js');
26
+ require('./PreloadManager-e26d237f.js');
27
+ require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
26
28
  require('./ResourceIDUtils-5ff86aa7.js');
27
29
  require('@sankhyalabs/core/dist/dataunit/DataUnit');
28
30
 
@@ -5,13 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-1aeb625d.js');
8
- const ConfigStorage = require('./ConfigStorage-a97ca159.js');
8
+ const ConfigStorage = require('./ConfigStorage-c15716fd.js');
9
9
  const utils = require('@sankhyalabs/ezui/dist/collection/utils');
10
10
  const index$1 = require('./index-c5771aba.js');
11
11
  const index$2 = require('./index-102ba62d.js');
12
12
  require('./filter-item-type.enum-aa823a00.js');
13
- require('./form-config-fetcher-a322a522.js');
14
- require('./DataFetcher-2a99283c.js');
13
+ require('./form-config-fetcher-17775a75.js');
14
+ require('./DataFetcher-713f0749.js');
15
15
  require('./_commonjsHelpers-537d719a.js');
16
16
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
17
17
  require('./PrintUtils-bcaeb82f.js');
@@ -6,21 +6,24 @@ const index = require('./index-f9e81701.js');
6
6
  const core = require('@sankhyalabs/core');
7
7
  const constants = require('./constants-d187e03e.js');
8
8
  const taskbarElements = require('./taskbar-elements-39949c7a.js');
9
- require('./DataFetcher-2a99283c.js');
10
- require('./pesquisa-fetcher-7ef61508.js');
9
+ require('./DataFetcher-713f0749.js');
10
+ require('./pesquisa-fetcher-34922b83.js');
11
11
  const index$1 = require('./index-0e663819.js');
12
12
  require('./ISave-d68ce3cd.js');
13
13
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
14
14
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
15
- const dataunitFetcher = require('./dataunit-fetcher-4f7d4ee7.js');
15
+ const dataunitFetcher = require('./dataunit-fetcher-66c0b7af.js');
16
+ require('./PreloadManager-e26d237f.js');
16
17
  require('./filter-item-type.enum-aa823a00.js');
17
- require('./form-config-fetcher-a322a522.js');
18
+ require('./form-config-fetcher-17775a75.js');
18
19
  const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
19
- const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-56db34ee.js');
20
+ const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-d74d2336.js');
20
21
  require('./index-102ba62d.js');
21
22
  require('./_commonjsHelpers-537d719a.js');
22
23
  require('./PrintUtils-bcaeb82f.js');
23
24
  require('./ResourceIDUtils-5ff86aa7.js');
25
+ require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
26
+ require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
24
27
 
25
28
  const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:max-content;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
26
29
 
@@ -11,12 +11,12 @@ export default class JavaExecutor {
11
11
  resolve({ execSource, callback: this.callExecJava });
12
12
  });
13
13
  }
14
- callExecJava(execSource) {
14
+ async callExecJava(execSource) {
15
15
  const request = {
16
16
  requestBody: {
17
17
  javaCall: execSource
18
18
  }
19
19
  };
20
- DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_JAVA, JSON.stringify(request));
20
+ await DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_JAVA, JSON.stringify(request));
21
21
  }
22
22
  }
@@ -11,10 +11,10 @@ export default class JavascriptExecutor {
11
11
  resolve({ execSource, callback: this.callExecScript });
12
12
  });
13
13
  }
14
- callExecScript(execSource) {
14
+ async callExecScript(execSource) {
15
15
  const request = {
16
16
  runScript: execSource
17
17
  };
18
- DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_SCRIPT, request);
18
+ await DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_SCRIPT, request);
19
19
  }
20
20
  }
@@ -15,12 +15,12 @@ export default class ProcedureExecutor {
15
15
  resolve({ execSource, callback: this.callExecProcedure });
16
16
  });
17
17
  }
18
- callExecProcedure(execSource) {
18
+ async callExecProcedure(execSource) {
19
19
  const request = {
20
20
  requestBody: {
21
21
  stpCall: execSource
22
22
  }
23
23
  };
24
- DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_STP, JSON.stringify(request));
24
+ await DataFetcher.get().callServiceBroker(SERVICE_ACTION_EXECUTE_STP, JSON.stringify(request));
25
25
  }
26
26
  }
@@ -3,85 +3,90 @@ import { ActionsType } from "../actions/enum/ActionsType";
3
3
  const CONFIRMACAO = "__CONFIRMACAO__";
4
4
  const ESCOLHA_SIM_NAO = "__ESCOLHA_SIMNAO__";
5
5
  export default class ClientEventConfirm {
6
- clientConfirm(clientEvent, recaller) {
7
- const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
8
- let actionType = "";
9
- if (clientEvent.content.event.hasOwnProperty('stpCall')) {
10
- recaller.requestBody = clientEvent.content.event.stpCall;
11
- actionType = ActionsType.PROCEDURE;
12
- }
13
- else if (clientEvent.content.event.hasOwnProperty('runScript')) {
14
- recaller.requestBody = clientEvent.content.event.runScript;
15
- actionType = ActionsType.JAVASCRIPT;
16
- }
17
- else if (clientEvent.content.event.hasOwnProperty('javaCall')) {
18
- recaller.requestBody = clientEvent.content.event.javaCall;
19
- actionType = ActionsType.JAVA;
20
- }
21
- let param = {
22
- type: 'S',
23
- sequence: clientEvent.content.event.sequence
24
- };
25
- if (!recaller.requestBody.params) {
26
- recaller.requestBody.params = {
27
- param: []
6
+ async clientConfirm(clientEvent, recaller) {
7
+ return new Promise((resolve) => {
8
+ const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
9
+ let actionType = "";
10
+ if (clientEvent.content.event.hasOwnProperty('stpCall')) {
11
+ recaller.requestBody = clientEvent.content.event.stpCall;
12
+ actionType = ActionsType.PROCEDURE;
13
+ }
14
+ else if (clientEvent.content.event.hasOwnProperty('runScript')) {
15
+ recaller.requestBody = clientEvent.content.event.runScript;
16
+ actionType = ActionsType.JAVASCRIPT;
17
+ }
18
+ else if (clientEvent.content.event.hasOwnProperty('javaCall')) {
19
+ recaller.requestBody = clientEvent.content.event.javaCall;
20
+ actionType = ActionsType.JAVA;
21
+ }
22
+ let param = {
23
+ type: 'S',
24
+ sequence: clientEvent.content.event.sequence
28
25
  };
29
- }
30
- else {
31
- if (!Array.isArray(recaller.requestBody.params.param)) {
32
- recaller.requestBody.params.param = [recaller.requestBody.params.param];
26
+ if (!recaller.requestBody.params) {
27
+ recaller.requestBody.params = {
28
+ param: []
29
+ };
33
30
  }
34
- }
35
- recaller.requestBody.params.param.push(param);
36
- const title = clientEvent.content.event.title.$;
37
- const message = clientEvent.content.event.message.$;
38
- let requestBody;
39
- switch (actionType) {
40
- case ActionsType.JAVASCRIPT:
41
- requestBody = { runScript: recaller.requestBody };
42
- break;
43
- case ActionsType.PROCEDURE:
44
- requestBody = {
45
- requestBody: {
46
- stpCall: recaller.requestBody
47
- }
31
+ else {
32
+ if (!Array.isArray(recaller.requestBody.params.param)) {
33
+ recaller.requestBody.params.param = [recaller.requestBody.params.param];
34
+ }
35
+ }
36
+ recaller.requestBody.params.param.push(param);
37
+ const title = clientEvent.content.event.title.$;
38
+ const message = clientEvent.content.event.message.$;
39
+ let requestBody;
40
+ switch (actionType) {
41
+ case ActionsType.JAVASCRIPT:
42
+ requestBody = { runScript: recaller.requestBody };
43
+ break;
44
+ case ActionsType.PROCEDURE:
45
+ requestBody = {
46
+ requestBody: {
47
+ stpCall: recaller.requestBody
48
+ }
49
+ };
50
+ break;
51
+ case ActionsType.JAVA:
52
+ requestBody = {
53
+ requestBody: {
54
+ javaCall: recaller.requestBody
55
+ }
56
+ };
57
+ break;
58
+ }
59
+ if (clientEvent.content.event.showNoOption == 'S') {
60
+ param.paramName = ESCOLHA_SIM_NAO;
61
+ const form = document.createElement("snk-client-confirm");
62
+ window.document.body.appendChild(form);
63
+ form.titleMessage = title;
64
+ form.message = message;
65
+ form.accept = async () => {
66
+ param.$ = 'S';
67
+ await recaller.reCall(requestBody);
68
+ resolve();
48
69
  };
49
- break;
50
- case ActionsType.JAVA:
51
- requestBody = {
52
- requestBody: {
53
- javaCall: recaller.requestBody
54
- }
70
+ form.cancel = async () => {
71
+ param.$ = 'N';
72
+ await recaller.reCall(requestBody);
73
+ resolve();
55
74
  };
56
- break;
57
- }
58
- if (clientEvent.content.event.showNoOption == 'S') {
59
- param.paramName = ESCOLHA_SIM_NAO;
60
- const form = document.createElement("snk-client-confirm");
61
- window.document.body.appendChild(form);
62
- form.titleMessage = title;
63
- form.message = message;
64
- form.accept = () => {
65
- param.$ = 'S';
66
- recaller.reCall(requestBody);
67
- };
68
- form.cancel = () => {
69
- param.$ = 'N';
70
- recaller.reCall(requestBody);
71
- };
72
- form.openPopup();
73
- }
74
- else {
75
- application.confirm(title, message, null, 'warn', {
76
- labelCancel: "Cancelar",
77
- labelConfirm: "Sim"
78
- }).then((confirmResult) => {
79
- if (confirmResult) {
80
- param.paramName = CONFIRMACAO;
81
- param.$ = 'S';
82
- recaller.reCall(requestBody);
83
- }
84
- });
85
- }
75
+ form.openPopup();
76
+ }
77
+ else {
78
+ application.confirm(title, message, null, 'warn', {
79
+ labelCancel: "Cancelar",
80
+ labelConfirm: "Sim"
81
+ }).then(async (confirmResult) => {
82
+ if (confirmResult) {
83
+ param.paramName = CONFIRMACAO;
84
+ param.$ = 'S';
85
+ await recaller.reCall(requestBody);
86
+ resolve();
87
+ }
88
+ });
89
+ }
90
+ });
86
91
  }
87
92
  }
@@ -830,6 +830,7 @@ export class SnkApplication {
830
830
  }, 100);
831
831
  ErrorTracking.init();
832
832
  ConfigStorage.preload(this.applicationResourceID, this.configName);
833
+ document.addEventListener("click", () => Workspace.applicationClick());
833
834
  }
834
835
  connectedCallback() {
835
836
  ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
@@ -1,3 +1,4 @@
1
+ import { Action } from '@sankhyalabs/core';
1
2
  import { Host, forceUpdate, h } from '@stencil/core';
2
3
  import { SnkFormConfigManager } from '../../../snk-form/SnkFormConfigManager';
3
4
  import { buildFormMetadata } from "@sankhyalabs/ezui/dist/collection/utils/form";
@@ -26,6 +27,10 @@ export class SnkDetailView {
26
27
  this.canEdit = true;
27
28
  this.taskbarCustomContainerId = undefined;
28
29
  }
30
+ observeDataUnit(newDataUnit, oldDataUnit) {
31
+ newDataUnit === null || newDataUnit === void 0 ? void 0 : newDataUnit.subscribe(this.dataUnitActionHandler.bind(this));
32
+ oldDataUnit === null || oldDataUnit === void 0 ? void 0 : oldDataUnit.unsubscribe(this.dataUnitActionHandler);
33
+ }
29
34
  observerDataState(newValue, oldValue) {
30
35
  const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
31
36
  const closeInsertion = (oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && !(newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
@@ -191,6 +196,15 @@ export class SnkDetailView {
191
196
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
192
197
  }
193
198
  }
199
+ async dataUnitActionHandler(action) {
200
+ if (action.type === Action.FIELD_INVALIDATED) {
201
+ this.addErrorBadgeToBranchGuide();
202
+ }
203
+ }
204
+ addErrorBadgeToBranchGuide() {
205
+ this.branchGuide = Object.assign(Object.assign({}, this.branchGuide), { badge: 'error' });
206
+ this.snkDetailGuidesChange.emit(new GuideBuilder(this.branchGuide, this._formMetadata, this.dataUnit));
207
+ }
194
208
  render() {
195
209
  this.updateLabel();
196
210
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
@@ -400,7 +414,7 @@ export class SnkDetailView {
400
414
  },
401
415
  "branchGuide": {
402
416
  "type": "unknown",
403
- "mutable": false,
417
+ "mutable": true,
404
418
  "complexType": {
405
419
  "original": "IGuideItem",
406
420
  "resolved": "IGuideItem",
@@ -589,6 +603,9 @@ export class SnkDetailView {
589
603
  }
590
604
  static get watchers() {
591
605
  return [{
606
+ "propName": "dataUnit",
607
+ "methodName": "observeDataUnit"
608
+ }, {
592
609
  "propName": "dataState",
593
610
  "methodName": "observerDataState"
594
611
  }];
@@ -1,11 +1,11 @@
1
- import { ElementIDUtils } from "@sankhyalabs/core";
2
- import { Fragment, h } from "@stencil/core";
3
- import { SnkFormConfigManager } from "../../snk-form/SnkFormConfigManager";
4
- import { FormMetadata, buildFormMetadata } from "@sankhyalabs/ezui/dist/collection/utils/form";
5
- import TaskbarProcessor from "../../snk-taskbar/processor/taskbar-processor";
6
- import { TaskbarElement } from "../../snk-taskbar/elements/taskbar-elements";
7
- import { VIEW_MODE } from "../../../lib/utils/constants";
8
- import { PresentationMode } from "../../../lib";
1
+ import { Action as DUAction, ElementIDUtils } from '@sankhyalabs/core';
2
+ import { Fragment, h } from '@stencil/core';
3
+ import { SnkFormConfigManager } from '../../snk-form/SnkFormConfigManager';
4
+ import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
+ import TaskbarProcessor from '../../snk-taskbar/processor/taskbar-processor';
6
+ import { TaskbarElement } from '../../snk-taskbar/elements/taskbar-elements';
7
+ import { VIEW_MODE } from '../../../lib/utils/constants';
8
+ import { PresentationMode } from '../../../lib';
9
9
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
10
10
  const FORM_NAME_PREFIX = "__FORM:";
11
11
  export class SnkGuidesViewer {
@@ -123,6 +123,12 @@ export class SnkGuidesViewer {
123
123
  this._breadcrumbItems = breadcrumbs;
124
124
  });
125
125
  });
126
+ this._guides = this._guides.map(guide => {
127
+ if (guide.id === guideItem.id) {
128
+ return Object.assign(Object.assign({}, guide), guideItem);
129
+ }
130
+ return guide;
131
+ });
126
132
  }
127
133
  }
128
134
  loadTaskbarProcessor() {
@@ -250,6 +256,28 @@ export class SnkGuidesViewer {
250
256
  this._guideNavigator.getCurrentPath().then(breadcrumbs => {
251
257
  this._breadcrumbItems = breadcrumbs;
252
258
  });
259
+ this.resetGuideBadge(currentItem);
260
+ }
261
+ resetGuideBadge(selectedGuide) {
262
+ var _a;
263
+ this._guides = [...(_a = this._guides) === null || _a === void 0 ? void 0 : _a.map(guide => {
264
+ if (this.canClearGuideBadge(guide, selectedGuide.id)) {
265
+ return Object.assign(Object.assign({}, guide), { badge: null });
266
+ }
267
+ return guide;
268
+ })];
269
+ }
270
+ canClearGuideBadge(guide, idToCheck) {
271
+ return (guide.id === idToCheck) || this.isIncludedInChildrenList(guide, idToCheck);
272
+ }
273
+ isIncludedInChildrenList(guide, guideId) {
274
+ return this.hasChildren(guide) && this.getChildrenIdList(guide).includes(guideId);
275
+ }
276
+ hasChildren(guide) {
277
+ return guide.children && Array.isArray(guide.children);
278
+ }
279
+ getChildrenIdList(guide) {
280
+ return (guide.children).map(guideChild => guideChild.id);
253
281
  }
254
282
  getConfigViewMode() {
255
283
  return VIEW_MODE.GRID;
@@ -299,6 +327,50 @@ export class SnkGuidesViewer {
299
327
  var _a;
300
328
  return h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
301
329
  }
330
+ async dataUnitActionHandler(action) {
331
+ var _a;
332
+ if (action.type === DUAction.FIELD_INVALIDATED) {
333
+ const guideName = this.getGuideName((_a = action.payload) === null || _a === void 0 ? void 0 : _a.fieldName);
334
+ await this.addErrorBadgeToGuide(guideName);
335
+ await this.openGuideNavigator(guideName);
336
+ }
337
+ }
338
+ async addErrorBadgeToGuide(guideName) {
339
+ var _a;
340
+ this._guides = [...(_a = this._guides) === null || _a === void 0 ? void 0 : _a.map(guide => {
341
+ return Object.assign(Object.assign({}, guide), { badge: this.getBadge(guide, guideName) });
342
+ })];
343
+ }
344
+ async openGuideNavigator(guideName) {
345
+ if (this.selectedGuide.id !== guideName) {
346
+ await this._guideNavigator.openGuideNavidator();
347
+ }
348
+ }
349
+ getBadge(guide, tabName) {
350
+ var _a;
351
+ if (this.selectedGuide.id === tabName) {
352
+ return null;
353
+ }
354
+ if (tabName === guide.id) {
355
+ return "error";
356
+ }
357
+ return (_a = guide.badge) !== null && _a !== void 0 ? _a : null;
358
+ }
359
+ getGuideName(fieldName) {
360
+ var _a;
361
+ for (const sheet of this._masterFormMetadata.getAllSheets()) {
362
+ const formFields = (_a = sheet[1]) === null || _a === void 0 ? void 0 : _a.fields;
363
+ for (const field of formFields) {
364
+ if (field.name === fieldName) {
365
+ return sheet[0];
366
+ }
367
+ }
368
+ }
369
+ return "";
370
+ }
371
+ componentDidLoad() {
372
+ this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
373
+ }
302
374
  render() {
303
375
  var _a, _b;
304
376
  if (this._formEditorConfigManager != undefined) {
@@ -1,4 +1,4 @@
1
- import { DataType } from "@sankhyalabs/core";
1
+ import { DataType, StringUtils } from "@sankhyalabs/core";
2
2
  import { toString } from "@sankhyalabs/core/dist/dataunit/metadata/DataType";
3
3
  import FilterItemType from "../filter-item-type.enum";
4
4
  import { FilterOperand } from "../../../snk-personalized-filter/interfaces/index";
@@ -93,8 +93,11 @@ function buildSearch(item) {
93
93
  return { name: id, expression, params: [{ name: id, dataType: DataType.TEXT, value: toString(DataType.TEXT, value.value) }] };
94
94
  }
95
95
  function buildText(item) {
96
- const { id, value, props } = item;
96
+ let { id, value, props } = item;
97
97
  const expression = props.expression;
98
+ if (!StringUtils.isEmpty(props.likeAs)) {
99
+ value = buildLikeValue(value, props.likeAs);
100
+ }
98
101
  return { name: id, expression, params: [{ name: id, dataType: DataType.TEXT, value: toString(DataType.TEXT, value) }] };
99
102
  }
100
103
  function buildNumber(item) {
@@ -102,6 +105,18 @@ function buildNumber(item) {
102
105
  const expression = props.expression;
103
106
  return { name: id, expression, params: [{ name: id, dataType: DataType.NUMBER, value: toString(DataType.NUMBER, value) }] };
104
107
  }
108
+ function buildLikeValue(valueAsString, likeAs) {
109
+ if (likeAs === "CONTANIS") {
110
+ return `%${valueAsString}%`;
111
+ }
112
+ else if (likeAs === "STARTS_WITH") {
113
+ return `${valueAsString}%`;
114
+ }
115
+ else if (likeAs === "ENDS_WITH") {
116
+ return `%${valueAsString}`;
117
+ }
118
+ return valueAsString;
119
+ }
105
120
  function buildPersonalized(item) {
106
121
  const { id, groupedItems = [] } = item;
107
122
  const activeFilters = groupedItems.filter(groupItem => !!groupItem.visible);
@@ -1,4 +1,5 @@
1
1
  import { DateUtils, UserInterface } from '@sankhyalabs/core';
2
+ import { default as InMemoryFilterColumnDataSource } from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
2
3
  import PreloadManager from '../../../lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager';
3
4
  export default class SnkMultiSelectionListDataSource {
4
5
  setDataUnit(dataUnit) {
@@ -18,11 +19,7 @@ export default class SnkMultiSelectionListDataSource {
18
19
  if (fieldName == undefined) {
19
20
  return Promise.resolve(undefined);
20
21
  }
21
- const result = await PreloadManager.getDistinct(this._dataUnit, fieldName);
22
- if (result == undefined) {
23
- return Promise.resolve(undefined);
24
- }
25
- return Promise.resolve(Array.from(result.entries()).map(([label, value]) => ({ label: String(label), value, check: true })));
22
+ return Promise.resolve(await PreloadManager.getDistinct(this._dataUnit, fieldName));
26
23
  }
27
24
  fetchData(filterTerm, fieldName) {
28
25
  return new Promise(resolve => {
@@ -37,4 +34,7 @@ export default class SnkMultiSelectionListDataSource {
37
34
  });
38
35
  });
39
36
  }
37
+ sortItems(fieldName, items) {
38
+ return InMemoryFilterColumnDataSource.defaultSorterMultSelectionOption(this._dataUnit, fieldName, items);
39
+ }
40
40
  }