@sankhyalabs/sankhyablocks 10.1.0-dev.22 → 10.1.0-dev.24

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 (160) hide show
  1. package/dist/cjs/{ConfigStorage-a4e1e518.js → ConfigStorage-f61eedd2.js} +2 -2
  2. package/dist/cjs/{DataFetcher-0b6aa084.js → DataFetcher-0c830777.js} +2 -2743
  3. package/dist/cjs/{ISave-2c455a77.js → ISave-e1e8ec96.js} +1 -1
  4. package/dist/cjs/ImageUtils-5e3f406b.js +142 -0
  5. package/dist/cjs/{SnkFormConfigManager-b8c81493.js → SnkFormConfigManager-421f3581.js} +2 -2
  6. package/dist/cjs/SnkMessageBuilder-32950342.js +2785 -0
  7. package/dist/cjs/{SnkMultiSelectionListDataSource-03b58f5a.js → SnkMultiSelectionListDataSource-d30a96ef.js} +4 -4
  8. package/dist/cjs/{auth-fetcher-7e7796c9.js → auth-fetcher-761d54c4.js} +1 -1
  9. package/dist/cjs/{dataunit-fetcher-8dffbcdf.js → dataunit-fetcher-86e286bb.js} +3 -2
  10. package/dist/cjs/{form-config-fetcher-5516d68a.js → form-config-fetcher-227b2db2.js} +1 -1
  11. package/dist/cjs/index-1894343a.js +4 -0
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +5 -4
  14. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  15. package/dist/cjs/snk-actions-button_9.cjs.entry.js +6 -5
  16. package/dist/cjs/snk-application.cjs.entry.js +9 -7
  17. package/dist/cjs/snk-attach.cjs.entry.js +7 -6
  18. package/dist/cjs/snk-crud.cjs.entry.js +6 -5
  19. package/dist/cjs/snk-data-exporter.cjs.entry.js +6 -5
  20. package/dist/cjs/{snk-data-unit-036ce58c.js → snk-data-unit-c06263da.js} +11 -11
  21. package/dist/cjs/snk-data-unit.cjs.entry.js +4 -3
  22. package/dist/cjs/snk-detail-view.cjs.entry.js +11 -10
  23. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +4 -3
  24. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +4 -3
  25. package/dist/cjs/snk-form-view.cjs.entry.js +56 -2
  26. package/dist/cjs/snk-form_2.cjs.entry.js +5 -4
  27. package/dist/cjs/snk-grid.cjs.entry.js +7 -6
  28. package/dist/cjs/{snk-guides-viewer-164c063e.js → snk-guides-viewer-92dadfa6.js} +9 -8
  29. package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -7
  30. package/dist/cjs/snk-image-input.cjs.entry.js +148 -0
  31. package/dist/cjs/snk-personalized-filter.cjs.entry.js +4 -3
  32. package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -4
  33. package/dist/cjs/snk-simple-crud.cjs.entry.js +8 -7
  34. package/dist/collection/collection-manifest.json +1 -0
  35. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +1 -0
  36. package/dist/collection/components/snk-application/snk-application.js +1 -1
  37. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +1 -1
  38. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +75 -2
  39. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +4 -3
  40. package/dist/collection/components/snk-image-input/snk-image-input.css +3 -0
  41. package/dist/collection/components/snk-image-input/snk-image-input.js +326 -0
  42. package/dist/collection/components/snk-image-input/utils/ImageUtils.js +133 -0
  43. package/dist/collection/lib/message/messageResourceEnUSUtils.js +2 -0
  44. package/dist/collection/lib/message/messageResourceEsESUtils.js +2 -0
  45. package/dist/collection/lib/message/messageResourcePtBRUtils.js +2 -0
  46. package/dist/collection/lib/message/resources/en-us/snk-image-input.msg.js +11 -0
  47. package/dist/collection/lib/message/resources/es-es/snk-image-input.msg.js +11 -0
  48. package/dist/collection/lib/message/resources/pt-br/snk-image-input.msg.js +11 -0
  49. package/dist/components/DataFetcher.js +3 -2743
  50. package/dist/components/SnkMessageBuilder.js +2783 -0
  51. package/dist/components/dataunit-fetcher.js +2 -1
  52. package/dist/components/index.d.ts +1 -0
  53. package/dist/components/index.js +1 -0
  54. package/dist/components/snk-application2.js +3 -1
  55. package/dist/components/snk-attach2.js +2 -1
  56. package/dist/components/snk-crud.js +69 -63
  57. package/dist/components/snk-data-unit2.js +1 -1
  58. package/dist/components/snk-detail-view2.js +100 -87
  59. package/dist/components/snk-form-view2.js +65 -5
  60. package/dist/components/snk-image-input.d.ts +11 -0
  61. package/dist/components/snk-image-input.js +6 -0
  62. package/dist/components/snk-image-input2.js +302 -0
  63. package/dist/esm/{ConfigStorage-39ac8fef.js → ConfigStorage-175813dc.js} +2 -2
  64. package/dist/esm/{DataFetcher-0b9da57d.js → DataFetcher-49594174.js} +3 -2743
  65. package/dist/esm/{ISave-f1c9269b.js → ISave-4bdffce4.js} +1 -1
  66. package/dist/esm/ImageUtils-8fc8d905.js +136 -0
  67. package/dist/esm/{SnkFormConfigManager-a87566c8.js → SnkFormConfigManager-0bda2ef5.js} +2 -2
  68. package/dist/esm/SnkMessageBuilder-1c0fada0.js +2783 -0
  69. package/dist/esm/{SnkMultiSelectionListDataSource-01b3744b.js → SnkMultiSelectionListDataSource-e13b72f7.js} +4 -4
  70. package/dist/esm/{auth-fetcher-acdc1cb4.js → auth-fetcher-62c5abf1.js} +1 -1
  71. package/dist/esm/{dataunit-fetcher-4c312b43.js → dataunit-fetcher-b7a9ef67.js} +2 -1
  72. package/dist/esm/{form-config-fetcher-7cda6254.js → form-config-fetcher-5e29a152.js} +1 -1
  73. package/dist/esm/index-04f73a26.js +4 -0
  74. package/dist/esm/loader.js +1 -1
  75. package/dist/esm/pesquisa-grid_2.entry.js +5 -4
  76. package/dist/esm/sankhyablocks.js +1 -1
  77. package/dist/esm/snk-actions-button_9.entry.js +6 -5
  78. package/dist/esm/snk-application.entry.js +8 -6
  79. package/dist/esm/snk-attach.entry.js +6 -5
  80. package/dist/esm/snk-crud.entry.js +6 -5
  81. package/dist/esm/snk-data-exporter.entry.js +6 -5
  82. package/dist/esm/{snk-data-unit-130021b3.js → snk-data-unit-865a1e27.js} +2 -2
  83. package/dist/esm/snk-data-unit.entry.js +4 -3
  84. package/dist/esm/snk-detail-view.entry.js +9 -8
  85. package/dist/esm/snk-filter-bar_4.entry.js +4 -3
  86. package/dist/esm/snk-filter-modal-item.entry.js +4 -3
  87. package/dist/esm/snk-form-view.entry.js +57 -3
  88. package/dist/esm/snk-form_2.entry.js +5 -4
  89. package/dist/esm/snk-grid.entry.js +7 -6
  90. package/dist/esm/{snk-guides-viewer-3fd18298.js → snk-guides-viewer-2e2f48af.js} +9 -8
  91. package/dist/esm/snk-guides-viewer.entry.js +8 -7
  92. package/dist/esm/snk-image-input.entry.js +144 -0
  93. package/dist/esm/snk-personalized-filter.entry.js +4 -3
  94. package/dist/esm/snk-pesquisa.entry.js +5 -4
  95. package/dist/esm/snk-simple-crud.entry.js +8 -7
  96. package/dist/sankhyablocks/p-0fbd3f2f.entry.js +1 -0
  97. package/dist/sankhyablocks/p-164721f4.entry.js +1 -0
  98. package/dist/sankhyablocks/{p-2ac55a5d.js → p-1d0e4e8f.js} +1 -1
  99. package/dist/sankhyablocks/p-3448ebdc.js +60 -0
  100. package/dist/sankhyablocks/{p-7ee6b1bf.js → p-34d56802.js} +1 -1
  101. package/dist/sankhyablocks/p-36a82166.entry.js +1 -0
  102. package/dist/sankhyablocks/p-3f762af3.entry.js +1 -0
  103. package/dist/sankhyablocks/p-4005bd63.entry.js +1 -0
  104. package/dist/sankhyablocks/p-4ff3b494.js +1 -0
  105. package/dist/sankhyablocks/p-71ea8d08.entry.js +11 -0
  106. package/dist/sankhyablocks/p-8bf2a358.entry.js +1 -0
  107. package/dist/sankhyablocks/{p-d714b6ca.js → p-8e5f4851.js} +1 -1
  108. package/dist/sankhyablocks/{p-1f310bc6.js → p-93f4104a.js} +1 -1
  109. package/dist/sankhyablocks/p-abcfff93.entry.js +1 -0
  110. package/dist/sankhyablocks/p-b10e79bb.js +1 -0
  111. package/dist/sankhyablocks/p-bafeda2d.entry.js +1 -0
  112. package/dist/sankhyablocks/{p-48a5c311.js → p-bf37b0e2.js} +2 -2
  113. package/dist/sankhyablocks/p-c5d6717d.entry.js +1 -0
  114. package/dist/sankhyablocks/p-d2581c6b.entry.js +1 -0
  115. package/dist/sankhyablocks/p-d4e3e549.js +1 -0
  116. package/dist/sankhyablocks/p-ddb20d9e.entry.js +1 -0
  117. package/dist/sankhyablocks/p-e19a65a2.js +1 -0
  118. package/dist/sankhyablocks/p-e892ae6c.entry.js +1 -0
  119. package/dist/sankhyablocks/p-e9bbd66b.js +1 -0
  120. package/dist/sankhyablocks/p-e9e9ff1c.entry.js +1 -0
  121. package/dist/sankhyablocks/p-f21109d6.entry.js +1 -0
  122. package/dist/sankhyablocks/p-f455a553.entry.js +1 -0
  123. package/dist/sankhyablocks/p-f61fef9a.entry.js +1 -0
  124. package/dist/sankhyablocks/{p-998a9d6f.js → p-f63e1093.js} +1 -1
  125. package/dist/sankhyablocks/p-fc0736ad.entry.js +1 -0
  126. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  127. package/dist/types/components/snk-application/snk-application.d.ts +1 -1
  128. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +9 -0
  129. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +1 -0
  130. package/dist/types/components/snk-image-input/snk-image-input.d.ts +56 -0
  131. package/dist/types/components/snk-image-input/utils/ImageUtils.d.ts +15 -0
  132. package/dist/types/components.d.ts +89 -0
  133. package/dist/types/lib/message/resources/en-us/snk-image-input.msg.d.ts +1 -0
  134. package/dist/types/lib/message/resources/es-es/snk-image-input.msg.d.ts +1 -0
  135. package/dist/types/lib/message/resources/pt-br/snk-image-input.msg.d.ts +1 -0
  136. package/package.json +1 -1
  137. package/react/components.d.ts +1 -0
  138. package/react/components.js +1 -0
  139. package/react/components.js.map +1 -1
  140. package/dist/sankhyablocks/p-12f595a6.entry.js +0 -1
  141. package/dist/sankhyablocks/p-18d66638.entry.js +0 -1
  142. package/dist/sankhyablocks/p-2a33d4cf.entry.js +0 -1
  143. package/dist/sankhyablocks/p-2c6be187.entry.js +0 -1
  144. package/dist/sankhyablocks/p-3a443150.entry.js +0 -1
  145. package/dist/sankhyablocks/p-3b6d8d33.entry.js +0 -1
  146. package/dist/sankhyablocks/p-3db72758.entry.js +0 -1
  147. package/dist/sankhyablocks/p-52691b42.js +0 -1
  148. package/dist/sankhyablocks/p-6768f176.js +0 -1
  149. package/dist/sankhyablocks/p-6d322b0a.js +0 -1
  150. package/dist/sankhyablocks/p-877d9614.entry.js +0 -1
  151. package/dist/sankhyablocks/p-94267a30.entry.js +0 -1
  152. package/dist/sankhyablocks/p-9e4555ab.js +0 -60
  153. package/dist/sankhyablocks/p-acd2ba28.entry.js +0 -1
  154. package/dist/sankhyablocks/p-b533edab.entry.js +0 -1
  155. package/dist/sankhyablocks/p-c2d33fc8.entry.js +0 -1
  156. package/dist/sankhyablocks/p-cd40c8cf.entry.js +0 -1
  157. package/dist/sankhyablocks/p-cd412add.entry.js +0 -1
  158. package/dist/sankhyablocks/p-d6dad5e4.entry.js +0 -1
  159. package/dist/sankhyablocks/p-f8c5395a.entry.js +0 -1
  160. package/dist/sankhyablocks/p-fa087ab2.entry.js +0 -11
@@ -1,11 +1,12 @@
1
- export { S as snk_data_unit } from './snk-data-unit-130021b3.js';
1
+ export { S as snk_data_unit } from './snk-data-unit-865a1e27.js';
2
2
  import './index-04f73a26.js';
3
3
  import '@sankhyalabs/core';
4
4
  import '@sankhyalabs/ezui/dist/collection/utils';
5
- import './DataFetcher-0b9da57d.js';
5
+ import './SnkMessageBuilder-1c0fada0.js';
6
+ import './dataunit-fetcher-b7a9ef67.js';
7
+ import './DataFetcher-49594174.js';
6
8
  import './PrintUtils-3e4ff0f5.js';
7
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
8
- import './dataunit-fetcher-4c312b43.js';
9
10
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
11
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
11
12
  import '@sankhyalabs/core/dist/utils/SortingUtils';
@@ -1,20 +1,21 @@
1
1
  import { r as registerInstance, e as createEvent, i as forceUpdate, h, f as Host, g as getElement } from './index-04f73a26.js';
2
2
  import { Action, StringUtils, KeyboardManager } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-a87566c8.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-0bda2ef5.js';
4
4
  import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
5
- import { S as SnkMessageBuilder } from './DataFetcher-0b9da57d.js';
6
- import './ISave-f1c9269b.js';
5
+ import './DataFetcher-49594174.js';
6
+ import './ISave-4bdffce4.js';
7
7
  import { P as PresentationMode } from './index-b40568ff.js';
8
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
- import './dataunit-fetcher-4c312b43.js';
10
+ import './dataunit-fetcher-b7a9ef67.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
- import './form-config-fetcher-7cda6254.js';
12
+ import './form-config-fetcher-5e29a152.js';
13
13
  import { V as VIEW_MODE } from './constants-7b422de0.js';
14
14
  import { T as TaskbarElement } from './taskbar-elements-d1e63fb2.js';
15
- import { S as SnkGuidesViewer } from './snk-guides-viewer-3fd18298.js';
15
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-2e2f48af.js';
16
+ import { S as SnkMessageBuilder } from './SnkMessageBuilder-1c0fada0.js';
16
17
  import { buildFieldSearch, SHORTCUT_SEARCH_FIELD } from '@sankhyalabs/ezui/dist/collection/utils';
17
- import './ConfigStorage-39ac8fef.js';
18
+ import './ConfigStorage-175813dc.js';
18
19
  import './PrintUtils-3e4ff0f5.js';
19
20
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
20
21
  import '@sankhyalabs/core/dist/utils/SortingUtils';
@@ -369,7 +370,7 @@ const SnkDetailView = class {
369
370
  render() {
370
371
  this.updateLabel();
371
372
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
372
- return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: this.presentationMode, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS", outlineMode: false }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), fieldToFocus: this._fieldToGetFocus, label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems), onSnkRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this), fieldSearch: this._fieldSearch }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: this.presentationMode, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS", actionsSettingsList: this.getSettingsListForm() }, h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
373
+ return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: this.presentationMode, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS", outlineMode: false, enableGridInsert: true }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), fieldToFocus: this._fieldToGetFocus, label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems), onSnkRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this), fieldSearch: this._fieldSearch, entityPath: this.entityName }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: this.presentationMode, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS", actionsSettingsList: this.getSettingsListForm() }, h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
373
374
  }
374
375
  get _element() { return getElement(this); }
375
376
  static get watchers() { return {
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, e as createEvent, h, f as Host, g as getElement, i as forceUpdate } from './index-04f73a26.js';
2
2
  import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext, LockManager, LockManagerOperation, DateUtils, MaskFormatter, KeyboardManager, FloatingManager, ArrayUtils } from '@sankhyalabs/core';
3
3
  import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
4
- import { C as ConfigStorage } from './ConfigStorage-39ac8fef.js';
4
+ import { C as ConfigStorage } from './ConfigStorage-175813dc.js';
5
5
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-d2439a9a.js';
6
6
  import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
7
7
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
@@ -12,9 +12,10 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
12
12
  import { A as ActionDefaultFilter } from './default-filters-50105e43.js';
13
13
  import { F as FilterType } from './filter-type.enum-f6a8fe23.js';
14
14
  import { g as getInvalidFilters } from './filter-validate-faf51fa9.js';
15
- import './form-config-fetcher-7cda6254.js';
16
- import './DataFetcher-0b9da57d.js';
15
+ import './form-config-fetcher-5e29a152.js';
16
+ import './DataFetcher-49594174.js';
17
17
  import './PrintUtils-3e4ff0f5.js';
18
+ import './SnkMessageBuilder-1c0fada0.js';
18
19
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
19
20
 
20
21
  const buildFilter = (item) => {
@@ -1,12 +1,13 @@
1
1
  import { r as registerInstance, e as createEvent, h, f as Host, g as getElement } from './index-04f73a26.js';
2
2
  import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
3
- import { C as ConfigStorage } from './ConfigStorage-39ac8fef.js';
3
+ import { C as ConfigStorage } from './ConfigStorage-175813dc.js';
4
4
  import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
5
5
  import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
6
6
  import { F as FilterType } from './filter-type.enum-f6a8fe23.js';
7
- import './form-config-fetcher-7cda6254.js';
8
- import './DataFetcher-0b9da57d.js';
7
+ import './form-config-fetcher-5e29a152.js';
8
+ import './DataFetcher-49594174.js';
9
9
  import './PrintUtils-3e4ff0f5.js';
10
+ import './SnkMessageBuilder-1c0fada0.js';
10
11
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
12
 
12
13
  const snkFilterModalItemCss = ".grow{flex-grow:1}.gap{gap:4px}";
@@ -1,10 +1,23 @@
1
1
  import { r as registerInstance, e as createEvent, h, f as Host } from './index-04f73a26.js';
2
- import { ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
2
+ import { Action, UserInterface, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { DataBinder } from '@sankhyalabs/ezui/dist/collection/utils/form';
4
4
  import { focusOnFieldSerch, SEARCH_FIELD_FULL_WIDTH, FormLayout } from '@sankhyalabs/ezui/dist/collection/utils';
5
+ import { g as getPKs } from './ImageUtils-8fc8d905.js';
5
6
 
6
7
  const snkFormViewCss = ".sc-snk-form-view-h{display:flex;width:100%;--ez-form-card-summary-field-content-weight:700}.level-path.sc-snk-form-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.summary-wrapper.sc-snk-form-view{display:flex;overflow:hidden}.summary-header.sc-snk-form-view{border-bottom:1px solid var(--color--strokes);margin-bottom:var(--space--medium);padding-bottom:var(--space--medium)}.summary-container.sc-snk-form-view{display:flex;flex-direction:column}.summary-container.sc-snk-form-view{padding-right:calc(var(--space--extra-large) / 1.5)}.summary-field.sc-snk-form-view{min-width:30px;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.summary-field__title.sc-snk-form-view{color:var(--text--primary, #626e82);font-size:var(--title--small);white-space:nowrap;font-weight:var(--text-weight--medium)}.summary-field__content.sc-snk-form-view{color:var(--title--primary, #2b3a54);font-size:var(--text--large);font-weight:var(--ez-form-card-summary-field-content-weight)}";
7
8
 
9
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
10
+ var t = {};
11
+ for (var p in s)
12
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
+ t[p] = s[p];
14
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
+ t[p[i]] = s[p[i]];
18
+ }
19
+ return t;
20
+ };
8
21
  const SnkFormView = class {
9
22
  constructor(hostRef) {
10
23
  registerInstance(this, hostRef);
@@ -13,6 +26,21 @@ const SnkFormView = class {
13
26
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
14
27
  this._customEditors = new Map();
15
28
  this._fieldProps = new Map();
29
+ this.dataUnitObserver = async (action) => {
30
+ if (action.type === Action.RECORDS_COPIED) {
31
+ const sourcePK = this.buildSourceRecordPK(action);
32
+ this.getImageField().forEach(async (field) => {
33
+ this.dataUnit.setFieldValue(field.name, JSON.stringify(sourcePK));
34
+ });
35
+ }
36
+ };
37
+ this.customUiBuilders = new Map([
38
+ [UserInterface.IMAGE, (_a) => {
39
+ var { name } = _a, props = __rest(_a, ["name"]);
40
+ return h("snk-image-input", Object.assign({ dataUnit: this.dataUnit, maxSize: Infinity, fieldName: name, entityName: this.entityPath }, props));
41
+ }
42
+ ]
43
+ ]);
16
44
  this._singleColumn = false;
17
45
  this.levelPath = undefined;
18
46
  this.fieldSearch = undefined;
@@ -30,6 +58,7 @@ const SnkFormView = class {
30
58
  this.fieldToFocus = undefined;
31
59
  this.customEditors = undefined;
32
60
  this.fieldsProps = undefined;
61
+ this.entityPath = undefined;
33
62
  }
34
63
  async showUp() {
35
64
  if (this._formView) {
@@ -79,6 +108,11 @@ const SnkFormView = class {
79
108
  }
80
109
  }
81
110
  }
111
+ async observeDataUnit(newValue, oldValue) {
112
+ if (newValue !== oldValue && newValue) {
113
+ newValue.subscribe(this.dataUnitObserver);
114
+ }
115
+ }
82
116
  changeFix() {
83
117
  this.fixed = !this.fixed;
84
118
  this.emitEvent("fixed");
@@ -136,6 +170,9 @@ const SnkFormView = class {
136
170
  if (this._dataBinder != undefined) {
137
171
  this._dataBinder.onDisconnectedCallback();
138
172
  }
173
+ if (this.dataUnit) {
174
+ this.dataUnit.unsubscribe(this.dataUnitObserver);
175
+ }
139
176
  }
140
177
  componentDidLoad() {
141
178
  this.observePropsCustomEditor(this.customEditors);
@@ -194,6 +231,22 @@ const SnkFormView = class {
194
231
  });
195
232
  }
196
233
  }
234
+ buildSourceRecordPK(action) {
235
+ var _a, _b;
236
+ const currentRecord = ((_a = action.payload) === null || _a === void 0 ? void 0 : _a[0]) || {};
237
+ const sourceBase64 = currentRecord["__record__source__id__"];
238
+ const sourceRecord = JSON.parse(atob(sourceBase64 || ''));
239
+ delete sourceRecord["__DATA_UNIT_NAME__"];
240
+ const pkFields = Object.keys(getPKs(this.dataUnit));
241
+ const filteredSourceRecord = {};
242
+ for (const pkField of pkFields) {
243
+ filteredSourceRecord[pkField] = (_b = sourceRecord[pkField]) === null || _b === void 0 ? void 0 : _b.value;
244
+ }
245
+ return filteredSourceRecord;
246
+ }
247
+ getImageField() {
248
+ return this.dataUnit.metadata.fields.filter(field => field.userInterface === UserInterface.IMAGE);
249
+ }
197
250
  render() {
198
251
  return (h(Host, { class: "ez-box__container" }, h("div", { class: "summary-header ez-flex ez-size-width--full", ref: ref => this._headerContainer = ref }, h("div", { class: "ez-flex ez-text ez-title--primary ez-text--bold ez-flex--justify-start ez-flex--align-items-center ez-col--sd-9" }, this.levelPath ? h("span", { class: "level-path" }, this.levelPath + " /") : undefined, this.label), h("div", { class: "ez-flex ez-flex--justify-end ez-col--sd-3" }, this.canFix &&
199
252
  h("ez-button", { class: "ez-padding-left--medium", mode: "icon", size: "small", iconName: this.fixed ? "un-pin" : "push-pin", "data-element-id": ElementIDUtils.getInternalIDInfo("toggleFixed_ezFormCard"), onClick: () => this.changeFix(), title: this.fixed ? "Desafixar" : "Fixar" }), this.canExpand &&
@@ -201,11 +254,12 @@ const SnkFormView = class {
201
254
  ?
202
255
  h("snk-form-summary", { summary: this.getCardSummary() })
203
256
  :
204
- h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event), singleColumn: this._singleColumn }), this.fieldSearch && h("ez-popover", { ref: elem => (this._ezPopoverFieldColumn = elem), overlayType: "none" }, this.fieldSearch)));
257
+ h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event), singleColumn: this._singleColumn, customUiBuilders: this.customUiBuilders }), this.fieldSearch && h("ez-popover", { ref: elem => (this._ezPopoverFieldColumn = elem), overlayType: "none" }, this.fieldSearch)));
205
258
  }
206
259
  static get watchers() { return {
207
260
  "customEditors": ["observePropsCustomEditor"],
208
- "fieldsProps": ["observeFieldsProps"]
261
+ "fieldsProps": ["observeFieldsProps"],
262
+ "dataUnit": ["observeDataUnit"]
209
263
  }; }
210
264
  };
211
265
  SnkFormView.style = snkFormViewCss;
@@ -1,15 +1,16 @@
1
1
  import { r as registerInstance, e as createEvent, h, g as getElement, f as Host } from './index-04f73a26.js';
2
2
  import { ElementIDUtils, ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
3
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-a87566c8.js';
3
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-0bda2ef5.js';
4
4
  import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
5
5
  import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
6
6
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
7
- import { U as UserConfigType } from './form-config-fetcher-7cda6254.js';
7
+ import { U as UserConfigType } from './form-config-fetcher-5e29a152.js';
8
8
  import { a as TAB_NAMES, G as GROUP_NAMES } from './constants-7b422de0.js';
9
9
  import { b as buildGuides, a as buildChildrenGuides, c as buildCustomGuides, d as buildGuidesMap, g as getFieldsToSave, u as updateTabInFieldsFromGroupList, e as buildNewGuideName } from './FormConfigHelper-d09669f3.js';
10
- import './ConfigStorage-39ac8fef.js';
11
- import './DataFetcher-0b9da57d.js';
10
+ import './ConfigStorage-175813dc.js';
11
+ import './DataFetcher-49594174.js';
12
12
  import './PrintUtils-3e4ff0f5.js';
13
+ import './SnkMessageBuilder-1c0fada0.js';
13
14
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
14
15
  import './filter-item-type.enum-d45e026f.js';
15
16
 
@@ -2,23 +2,24 @@ import { r as registerInstance, e as createEvent, h, F as Fragment, g as getElem
2
2
  import { KeyboardManager, Action, ElementIDUtils, ApplicationContext, StringUtils } from '@sankhyalabs/core';
3
3
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
4
4
  import { buildFieldSearch } from '@sankhyalabs/ezui/dist/collection/utils';
5
- import './DataFetcher-0b9da57d.js';
6
- import './ISave-f1c9269b.js';
7
- import { C as CommonsExporter, a as CrudUtils, S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, c as ClientSideExporterProvider } from './SnkMultiSelectionListDataSource-01b3744b.js';
5
+ import './DataFetcher-49594174.js';
6
+ import './ISave-4bdffce4.js';
7
+ import { C as CommonsExporter, a as CrudUtils, S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, c as ClientSideExporterProvider } from './SnkMultiSelectionListDataSource-e13b72f7.js';
8
8
  import { P as PresentationMode, E as ExporterStrategy } from './index-b40568ff.js';
9
9
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
- import './dataunit-fetcher-4c312b43.js';
11
+ import './dataunit-fetcher-b7a9ef67.js';
12
12
  import './filter-item-type.enum-d45e026f.js';
13
- import './form-config-fetcher-7cda6254.js';
13
+ import './form-config-fetcher-5e29a152.js';
14
14
  import './constants-7b422de0.js';
15
- import { C as ConfigStorage } from './ConfigStorage-39ac8fef.js';
15
+ import { C as ConfigStorage } from './ConfigStorage-175813dc.js';
16
16
  import { s as store } from './index-ea250be6.js';
17
17
  import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
18
18
  import { v as validateFilters } from './filter-validate-faf51fa9.js';
19
19
  import { T as TaskbarElement } from './taskbar-elements-d1e63fb2.js';
20
20
  import { T as TaskbarProcessor } from './taskbar-processor-3436124c.js';
21
21
  import './PrintUtils-3e4ff0f5.js';
22
+ import './SnkMessageBuilder-1c0fada0.js';
22
23
  import './IFetchDataExporterParams-d73bed3d.js';
23
24
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
24
25
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
@@ -3,16 +3,16 @@ import { ObjectUtils, StringUtils, Action, KeyboardManager, ElementIDUtils } fro
3
3
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
4
4
  import { buildFieldSearch, SHORTCUT_SEARCH_FIELD } from '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
6
- import './DataFetcher-0b9da57d.js';
7
- import './ISave-f1c9269b.js';
6
+ import './DataFetcher-49594174.js';
7
+ import './ISave-4bdffce4.js';
8
8
  import { P as PresentationMode } from './index-b40568ff.js';
9
9
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
10
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
11
- import './dataunit-fetcher-4c312b43.js';
11
+ import './dataunit-fetcher-b7a9ef67.js';
12
12
  import './filter-item-type.enum-d45e026f.js';
13
- import './form-config-fetcher-7cda6254.js';
13
+ import './form-config-fetcher-5e29a152.js';
14
14
  import { V as VIEW_MODE } from './constants-7b422de0.js';
15
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-a87566c8.js';
15
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-0bda2ef5.js';
16
16
  import { T as TaskbarElement } from './taskbar-elements-d1e63fb2.js';
17
17
  import { T as TaskbarProcessor } from './taskbar-processor-3436124c.js';
18
18
 
@@ -300,7 +300,7 @@ const SnkGuidesViewer = class {
300
300
  if (sheet == undefined) {
301
301
  return;
302
302
  }
303
- return h("snk-form-view", { levelPath: params.levelPath, label: sheet.label, name: formName, fields: sheet.fields, formMetadata: params.formMetadata, dataUnit: params.dataUnit, recordsValidator: params.recordsValidator, contracted: (cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.presentation) === "CONTRACTED", fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_b = (_a = params.formConfig) === null || _a === void 0 ? void 0 : _a.summary) === null || _b === void 0 ? void 0 : _b.get(formName), fieldToFocus: params.fieldToFocus, key: formName, onSnkRequestClearFieldToFocus: _ => { var _a; return (_a = params.onRequestClearFieldToFocus) === null || _a === void 0 ? void 0 : _a.call(params); }, customEditors: params.propsCustomEditor, fieldsProps: params.fieldsProps });
303
+ return h("snk-form-view", { levelPath: params.levelPath, label: sheet.label, name: formName, fields: sheet.fields, formMetadata: params.formMetadata, dataUnit: params.dataUnit, recordsValidator: params.recordsValidator, contracted: (cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.presentation) === "CONTRACTED", fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_b = (_a = params.formConfig) === null || _a === void 0 ? void 0 : _a.summary) === null || _b === void 0 ? void 0 : _b.get(formName), fieldToFocus: params.fieldToFocus, key: formName, onSnkRequestClearFieldToFocus: _ => { var _a; return (_a = params.onRequestClearFieldToFocus) === null || _a === void 0 ? void 0 : _a.call(params); }, customEditors: params.propsCustomEditor, fieldsProps: params.fieldsProps, entityPath: params.entityPath });
304
304
  })));
305
305
  }
306
306
  wrapDetail(levels, content) {
@@ -345,7 +345,7 @@ const SnkGuidesViewer = class {
345
345
  if (!sheet)
346
346
  return;
347
347
  const cardConfig = (_b = (_a = this.masterFormConfig) === null || _a === void 0 ? void 0 : _a.cardsState) === null || _b === void 0 ? void 0 : _b.get(cardId);
348
- return (h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_d = (_c = this.masterFormConfig) === null || _c === void 0 ? void 0 : _c.summary) === null || _d === void 0 ? void 0 : _d.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: cardId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps, fieldSearch: this._fieldSearch }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar()));
348
+ return (h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_d = (_c = this.masterFormConfig) === null || _c === void 0 ? void 0 : _c.summary) === null || _d === void 0 ? void 0 : _d.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: cardId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps, fieldSearch: this._fieldSearch, entityPath: this.entityPath }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar()));
349
349
  }
350
350
  isDetailGuide(childEntityName, levels) {
351
351
  return childEntityName || levels.length > 0;
@@ -617,7 +617,8 @@ const SnkGuidesViewer = class {
617
617
  fieldToFocus: this._fieldToGetFocus,
618
618
  onRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this),
619
619
  propsCustomEditor: this._customEditors,
620
- fieldsProps: this._fieldsProps
620
+ fieldsProps: this._fieldsProps,
621
+ entityPath: this.entityPath
621
622
  }), this.getContent())), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
622
623
  }
623
624
  render() {
@@ -1,24 +1,25 @@
1
- export { S as snk_guides_viewer } from './snk-guides-viewer-3fd18298.js';
1
+ export { S as snk_guides_viewer } from './snk-guides-viewer-2e2f48af.js';
2
2
  import './index-04f73a26.js';
3
3
  import '@sankhyalabs/core';
4
4
  import '@sankhyalabs/core/dist/dataunit/DataUnit';
5
5
  import '@sankhyalabs/ezui/dist/collection/utils';
6
6
  import '@sankhyalabs/ezui/dist/collection/utils/form';
7
- import './DataFetcher-0b9da57d.js';
7
+ import './DataFetcher-49594174.js';
8
8
  import './PrintUtils-3e4ff0f5.js';
9
+ import './SnkMessageBuilder-1c0fada0.js';
9
10
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
- import './ISave-f1c9269b.js';
11
+ import './ISave-4bdffce4.js';
11
12
  import './index-b40568ff.js';
12
13
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
13
- import './dataunit-fetcher-4c312b43.js';
14
+ import './dataunit-fetcher-b7a9ef67.js';
14
15
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
15
16
  import '@sankhyalabs/core/dist/utils/SortingUtils';
16
17
  import './ResourceIDUtils-a114189a.js';
17
18
  import './filter-item-type.enum-d45e026f.js';
18
- import './form-config-fetcher-7cda6254.js';
19
+ import './form-config-fetcher-5e29a152.js';
19
20
  import './constants-7b422de0.js';
20
- import './SnkFormConfigManager-a87566c8.js';
21
- import './ConfigStorage-39ac8fef.js';
21
+ import './SnkFormConfigManager-0bda2ef5.js';
22
+ import './ConfigStorage-175813dc.js';
22
23
  import './taskbar-elements-d1e63fb2.js';
23
24
  import './index-ea250be6.js';
24
25
  import './taskbar-processor-3436124c.js';
@@ -0,0 +1,144 @@
1
+ import { r as registerInstance, e as createEvent, h, f as Host } from './index-04f73a26.js';
2
+ import { Action, ApplicationContext } from '@sankhyalabs/core';
3
+ import { S as SnkMessageBuilder } from './SnkMessageBuilder-1c0fada0.js';
4
+ import { b as base64ToBlob, s as sessionFileUpload, a as buildFileKey, g as getPKs, d as downloadImage } from './ImageUtils-8fc8d905.js';
5
+
6
+ const snkImageInputCss = ":host{display:block}";
7
+
8
+ const SnkImageInput = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ this.imageError = createEvent(this, "imageError", 7);
12
+ this.dataUnitObserver = async (action) => {
13
+ var _a;
14
+ const actionsMoveSelection = [Action.NEXT_SELECTED, Action.PREVIOUS_SELECTED];
15
+ if (actionsMoveSelection.includes(action.type)) {
16
+ await this.loadImage();
17
+ return;
18
+ }
19
+ const selection = ((_a = action.payload) === null || _a === void 0 ? void 0 : _a.selection) || [];
20
+ if (action.type === Action.SELECTION_CHANGED && selection.length > 0) {
21
+ await this.loadImage();
22
+ return;
23
+ }
24
+ if (action.type === Action.RECORDS_ADDED) {
25
+ await this.clearImage();
26
+ return;
27
+ }
28
+ };
29
+ this.dataUnit = undefined;
30
+ this.fieldName = undefined;
31
+ this.entityName = undefined;
32
+ this.enabled = true;
33
+ this.acceptType = undefined;
34
+ this.maxSize = undefined;
35
+ this.label = undefined;
36
+ this.imageValue = undefined;
37
+ this.loading = true;
38
+ }
39
+ /**
40
+ * Força o reload da imagem
41
+ */
42
+ async reloadImage(pks) {
43
+ await this.loadImage(pks);
44
+ }
45
+ getMessage(key, params) {
46
+ if (!this.messagesBuilder) {
47
+ this.messagesBuilder = new SnkMessageBuilder();
48
+ }
49
+ return this.messagesBuilder.getMessage(key, params);
50
+ }
51
+ async clearImage() {
52
+ this.imageValue = undefined;
53
+ }
54
+ async handleImageChange(event) {
55
+ const base64 = event.detail;
56
+ if (!base64) {
57
+ await this.clearImage();
58
+ await this.updatedataUnitField(true);
59
+ return;
60
+ }
61
+ const blob = await base64ToBlob(base64);
62
+ if (this.maxSize && blob.size > this.maxSize * 1024) {
63
+ const errorMsg = this.getMessage('snkImageInput.errorImageSize') + this.maxSize + '(KB)';
64
+ this.imageError.emit(errorMsg);
65
+ if (this.application) {
66
+ await this.application.error(this.getMessage('snkImageInput.errorTitle'), errorMsg);
67
+ }
68
+ return;
69
+ }
70
+ this.imageValue = base64;
71
+ await sessionFileUpload(blob, this.entityName, this.fieldName);
72
+ await this.updatedataUnitField();
73
+ }
74
+ async updatedataUnitField(deleted = false) {
75
+ if (!this.dataUnit || !this.dataUnit.getSelectedRecord()) {
76
+ return;
77
+ }
78
+ if (deleted) {
79
+ await this.dataUnit.setFieldValue(this.fieldName, 'deletado');
80
+ }
81
+ else {
82
+ await this.dataUnit.setFieldValue(this.fieldName, `$file.session.key{${buildFileKey(this.entityName, this.fieldName)}}`);
83
+ }
84
+ }
85
+ async handleImageError(event) {
86
+ this.imageError.emit(event.detail);
87
+ if (this.application) {
88
+ await this.application.error(this.getMessage('snkImageInput.errorTitle'), event.detail);
89
+ }
90
+ }
91
+ getPksFromDataUnit() {
92
+ if (!this.dataUnit) {
93
+ return undefined;
94
+ }
95
+ const selectedRecord = this.dataUnit.getSelectedRecord();
96
+ if (!selectedRecord) {
97
+ return undefined;
98
+ }
99
+ const fieldValue = selectedRecord[this.fieldName];
100
+ if (!fieldValue) {
101
+ return undefined;
102
+ }
103
+ try {
104
+ const pk = JSON.parse(fieldValue);
105
+ return pk;
106
+ }
107
+ catch (error) {
108
+ console.error('Error parsing PK from data unit field:', error);
109
+ return undefined;
110
+ }
111
+ }
112
+ async loadImage(pks) {
113
+ var _a;
114
+ this.loading = true;
115
+ if (this.dataUnit && this.entityName) {
116
+ pks = (_a = pks !== null && pks !== void 0 ? pks : this.getPksFromDataUnit()) !== null && _a !== void 0 ? _a : getPKs(this.dataUnit);
117
+ this.imageValue = await downloadImage(pks, this.fieldName, this.entityName);
118
+ }
119
+ this.loading = false;
120
+ }
121
+ async componentWillLoad() {
122
+ this.application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
123
+ if (!this.messagesBuilder) {
124
+ this.messagesBuilder = new SnkMessageBuilder();
125
+ }
126
+ if (this.dataUnit) {
127
+ this.dataUnit.subscribe(this.dataUnitObserver);
128
+ }
129
+ }
130
+ disconnectedCallback() {
131
+ if (this.dataUnit) {
132
+ this.dataUnit.unsubscribe(this.dataUnitObserver);
133
+ }
134
+ }
135
+ async componentDidLoad() {
136
+ await this.loadImage();
137
+ }
138
+ render() {
139
+ return (h(Host, null, h("ez-image-input", { enabled: this.enabled, label: this.label, name: this.fieldName, value: this.imageValue, maxFileSize: this.maxSize ? this.maxSize * 1024 : undefined, accept: this.acceptType || 'image/png,image/jpeg,image/gif', onEzChange: (e) => this.handleImageChange(e), onEzError: (e) => this.handleImageError(e), loading: this.loading })));
140
+ }
141
+ };
142
+ SnkImageInput.style = snkImageInputCss;
143
+
144
+ export { SnkImageInput as snk_image_input };
@@ -1,14 +1,15 @@
1
1
  import { r as registerInstance, e as createEvent, h, F as Fragment, f as Host } from './index-04f73a26.js';
2
2
  import { StringUtils, ObjectUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
3
3
  import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-d2439a9a.js';
4
- import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-39ac8fef.js';
4
+ import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-175813dc.js';
5
5
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
6
6
  import { a as FilterGroupCondition, D as DefaultFilter } from './index-8acbae97.js';
7
7
  import { s as store } from './index-ea250be6.js';
8
8
  import './filter-item-type.enum-d45e026f.js';
9
- import './form-config-fetcher-7cda6254.js';
10
- import './DataFetcher-0b9da57d.js';
9
+ import './form-config-fetcher-5e29a152.js';
10
+ import './DataFetcher-49594174.js';
11
11
  import './PrintUtils-3e4ff0f5.js';
12
+ import './SnkMessageBuilder-1c0fada0.js';
12
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
13
14
 
14
15
  const snkPersonalizedFilterCss = ".sc-snk-personalized-filter-h{display:flex;height:100%;padding:var(--space--large, 24px);--snk-personalized-filter--width:100%;--snk-personalized-filter--height:100%;--snk-personalized-filter--background-color-line:var(--color--disable-secondary);--snk-personalized-filter--margin-line:var(--border--radius-medium, 12px)}.snk-personalized-filter.sc-snk-personalized-filter{height:var(--snk-personalized-filter--width);width:var(--snk-personalized-filter--height)}.snk-personalized-filter__header-actions.sc-snk-personalized-filter{display:flex;gap:var(--space--medium)}.snk-personalized-filter__group.sc-snk-personalized-filter{flex:1}.snk-personalized-filter__expression-input--line.sc-snk-personalized-filter{width:100%;height:2px;background-color:var(--snk-personalized-filter--background-color-line);margin-top:var(--snk-personalized-filter--margin-line);margin-bottom:var(--snk-personalized-filter--margin-line)}.ez-box__main.sc-snk-personalized-filter{height:90%}.snk-personalized-filter__button-mode.sc-snk-personalized-filter{height:35px}";
@@ -1,15 +1,16 @@
1
1
  import { r as registerInstance, h, f as Host, g as getElement } from './index-04f73a26.js';
2
2
  import { ObjectUtils, StringUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
3
- import { P as PesquisaFetcher, b as buildGridMetadata, a as PESQUISA_VIEW_MODE } from './ISave-f1c9269b.js';
4
- import './DataFetcher-0b9da57d.js';
3
+ import { P as PesquisaFetcher, b as buildGridMetadata, a as PESQUISA_VIEW_MODE } from './ISave-4bdffce4.js';
4
+ import './DataFetcher-49594174.js';
5
5
  import './index-b40568ff.js';
6
6
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
7
7
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
8
- import './dataunit-fetcher-4c312b43.js';
8
+ import './dataunit-fetcher-b7a9ef67.js';
9
9
  import './filter-item-type.enum-d45e026f.js';
10
- import './form-config-fetcher-7cda6254.js';
10
+ import './form-config-fetcher-5e29a152.js';
11
11
  import './constants-7b422de0.js';
12
12
  import './PrintUtils-3e4ff0f5.js';
13
+ import './SnkMessageBuilder-1c0fada0.js';
13
14
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
14
15
  import '@sankhyalabs/core/dist/utils/SortingUtils';
15
16
  import './ResourceIDUtils-a114189a.js';
@@ -3,20 +3,21 @@ import { StringUtils, ApplicationContext, ObjectUtils, Action, DataType, UserInt
3
3
  import { CSSVarsUtils, buildFieldSearch } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { V as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-7b422de0.js';
5
5
  import { T as TaskbarElement } from './taskbar-elements-d1e63fb2.js';
6
- import './DataFetcher-0b9da57d.js';
7
- import './ISave-f1c9269b.js';
8
- import { S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, a as CrudUtils, c as ClientSideExporterProvider } from './SnkMultiSelectionListDataSource-01b3744b.js';
6
+ import './DataFetcher-49594174.js';
7
+ import './ISave-4bdffce4.js';
8
+ import { S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, a as CrudUtils, c as ClientSideExporterProvider } from './SnkMultiSelectionListDataSource-e13b72f7.js';
9
9
  import { P as PresentationMode } from './index-b40568ff.js';
10
10
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
11
11
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
12
- import { I as InMemoryLoader } from './dataunit-fetcher-4c312b43.js';
12
+ import { I as InMemoryLoader } from './dataunit-fetcher-b7a9ef67.js';
13
13
  import './filter-item-type.enum-d45e026f.js';
14
- import { F as FormConfigFetcher } from './form-config-fetcher-7cda6254.js';
14
+ import { F as FormConfigFetcher } from './form-config-fetcher-5e29a152.js';
15
15
  import { T as TaskbarProcessor } from './taskbar-processor-3436124c.js';
16
- import { C as ConfigStorage } from './ConfigStorage-39ac8fef.js';
17
- import { S as SnkFormConfigManager } from './SnkFormConfigManager-a87566c8.js';
16
+ import { C as ConfigStorage } from './ConfigStorage-175813dc.js';
17
+ import { S as SnkFormConfigManager } from './SnkFormConfigManager-0bda2ef5.js';
18
18
  import { s as store } from './index-ea250be6.js';
19
19
  import './PrintUtils-3e4ff0f5.js';
20
+ import './SnkMessageBuilder-1c0fada0.js';
20
21
  import './GetSelectedRecordsIDsInfo-9fa41508.js';
21
22
  import './IFetchDataExporterParams-d73bed3d.js';
22
23
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
@@ -0,0 +1 @@
1
+ import{r as i,e as t,h as s,g as e,f as h}from"./p-2c9d0870.js";import{ElementIDUtils as o,ObjectUtils as a,ApplicationContext as n}from"@sankhyalabs/core";import{S as d}from"./p-1d0e4e8f.js";import{R as l}from"./p-688dcb4c.js";import{buildFormConfigFromDataUnit as r}from"@sankhyalabs/ezui/dist/collection/utils/form";import{ApplicationUtils as c}from"@sankhyalabs/ezui/dist/collection/utils";import{U as f}from"./p-34d56802.js";import{a as g,G as u}from"./p-9019a32f.js";import{b as m,a as v,c as p,d as C,g as b,u as y,e as k}from"./p-8b4d6719.js";import"./p-93f4104a.js";import"./p-e9bbd66b.js";import"./p-8d884fab.js";import"./p-b10e79bb.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";const w=class{constructor(s){i(this,s),this.exit=t(this,"exit",7),this.actionClick=t(this,"actionClick",7),this.formItemsReady=t(this,"formItemsReady",7),this._customEditors=new Map,this._dataUnit=void 0,this._dataState=void 0,this._showFormConfig=!1,this._configManager=void 0,this.configName=void 0,this.recordsValidator=void 0,this.messagesBuilder=void 0,this.formLegacyConfigName=void 0,this.resourceID=void 0}async showConfig(){this._showFormConfig=!0}async hideConfig(){this._showFormConfig=!1}async addCustomEditor(i,t){if(this._form)return void this._form.addCustomEditor(i,t);const s=new Map(this._customEditors);s.set(i,t),this._customEditors=s}async setFieldProp(i,t,s){await this._form.setFieldProp(i,t,s)}async validate(){await this._form.validate()}closeConfig(){this.hideConfig()}dataunitReady(){o.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}setCustomEditors(){if(this._form)for(const[i,t]of this._customEditors)this._form.addCustomEditor(i,t),this._customEditors.delete(i)}async componentDidRender(){this.setCustomEditors()}async componentWillLoad(){let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.dataunitReady():this._snkDataUnit.addEventListener("dataUnitReady",(i=>{this._dataUnit=i.detail})),this._snkDataUnit.addEventListener("dataStateChange",this.handleDataStateChange.bind(this));break}i=i.parentElement}null==this.resourceID&&(this.resourceID=await l.getResourceID()),this._configManager=new d(this.configName,this.resourceID,void 0,this._dataUnit),this.addFormLegacyConfig(),await this._configManager.loadConfig()}async handleDataStateChange(i){var t;this._dataState=i.detail;const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const i of s||[]){if(!i)continue;const s=null===(t=this._dataState.rowMetadata)||void 0===t?void 0:t.getProp("rm_precision",i);(s||0===s)&&(await this.setFieldProp(i,"precision",s),await this.setFieldProp(i,"prettyPrecision",s))}}addFormLegacyConfig(){this.formLegacyConfigName&&this._configManager.addFormLegacyConfig(this.formLegacyConfigName)}render(){if(this._dataUnit&&this._dataState)return s("section",null,s("div",{class:"ez-row"},s("div",{class:"ez-col ez-col--sd-12"},s("ez-form",{ref:i=>this._form=i,key:"ezForm"+this._snkDataUnit.entityName,"data-element-id":"embedded",dataUnit:this._dataUnit,config:this._configManager.getConfig(this._dataUnit),recordsValidator:this.recordsValidator,class:this._showFormConfig?"snk-form__form--hidden":""}),this._showFormConfig&&s("snk-form-config",{messagesBuilder:this.messagesBuilder,dataUnit:this._dataUnit,configManager:this._configManager,onConfigClose:()=>this.closeConfig()}))))}get _element(){return e(this)}};w.style=".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";const F=class{constructor(s){i(this,s),this.configClose=t(this,"configClose",7),this.configChange=t(this,"configChange",7),this.guidesMap=new Map,this.availableFields=[],this.guidesList=[],this.groupsList=[],this.selectedGuide=void 0,this._formConfig={},this.configOptions=[],this.originalConfigSelected=void 0,this.configSelected=void 0,this.hasChanges=!1,this.optionConfigChanged=!1,this.dataUnit=void 0,this.configManager=void 0,this.ignoreReadOnlyFormFields=void 0,this.messagesBuilder=void 0,this.customGuidesConfig=[]}handleFieldConfigChanged(){this.hasChanges=!0}async handleFormConfigOptionSelected({detail:i}){this.configSelected=i,await this.loadConfigByUser(),this.selectedGuide=void 0,this.optionConfigChanged=!a.equals(this.configSelected,this.originalConfigSelected),this.configSelected.origin===f.DEFAULT&&(this.hasChanges=!1)}async handleAddFieldToGuide({detail:i}){var t;this.selectedGuide?this.selectedGuide.isCustom||this.selectedGuide.isDetail?this.showCanNotAddFieldToGuideDialog():(this.availableFields=[...this.availableFields.filter((t=>t.name!==i.name))],await(null===(t=this.refFieldsLayout)||void 0===t?void 0:t.addFieldToLayout(i))):this.showNoGuideSelectedDialog()}async handleSetFieldAsAvailable({detail:i}){this.availableFields.some((t=>t.name===i.name))||(this.availableFields=[...this.availableFields,i])}async handleRemoveFieldFromAvailable({detail:i}){this.availableFields=this.availableFields.filter((t=>t.name!==i.name))}observeSelectedGuide(i){var t;const s=null!==(t=this.guidesMap.get(null==i?void 0:i.name))&&void 0!==t?t:[];this.groupsList=[...s]}observeConfigManager(){this.loadFormConfig()}showNoGuideSelectedDialog(){const i=this.getMessage("snkFormConfig.noGuideSelected.title"),t=this.getMessage("snkFormConfig.noGuideSelected.message");c.alert(i,t)}showCanNotAddFieldToGuideDialog(){const i=this.getMessage("snkFormConfig.canNotAddFieldToGuide.title"),t=this.getMessage("snkFormConfig.canNotAddFieldToGuide.message");c.alert(i,t)}getMessage(i,t){return this.messagesBuilder.getMessage(i,t)}async initializeUserConfig(){if(null!=this.configManager)try{const i=await this.configManager.fetchUserAvailableConfigs();this.configOptions=i;const t=null==this._formConfig||this._formConfig.defaultConfiguration?f.DEFAULT:f.USER;this.configSelected=null==i?void 0:i.find((i=>i.origin===t)),this.originalConfigSelected=null==i?void 0:i.find((i=>i.origin===t))}catch(i){console.error(this.getMessage("snkFormConfig.errors.failFetchUserConfig")),console.error(i)}}async loadConfigByUser(){this.configManager&&this.configSelected&&(this.isConfigDefaultSelected()?await this.handleLoadDefaultConfig():this.loadFormConfig())}async handleLoadDefaultConfig(){const i=await this.configManager.fetchDefaultConfig();if(i)return void this.loadFormConfig(i);const t=this.configManager.getEmptyConfig();t&&this.loadFormConfig(t)}isConfigDefaultSelected(){return this.configSelected.origin===f.DEFAULT}loadFormConfig(i){this._formConfig=i||this.getConfig(),this.loadGuides(),this.initializeAvailableFields()}initializeAvailableFields(){var i;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;const t=[...this._formConfig.fields];this.availableFields=this.dataUnit.metadata.fields.filter((({name:i,visible:s,properties:e})=>{const h=t.some((({name:t})=>t===i));return h||!0!==e.visibleOnConfig||s?!0===s&&!1===h:e.visibleOnConfig}))}getInitialOrder(i){var t,s;return Array.isArray(null===(t=this._formConfig)||void 0===t?void 0:t.tabs)?null===(s=this._formConfig.tabs)||void 0===s?void 0:s.length:i.length>0?Math.max(...i.map((i=>i.order))):0}loadGuides(){var i;this.guidesList=[],this.guidesList.push(...m(this._formConfig,this.getMessage("snkFormConfig.form.mainArea"))),this.guidesList.push(...v(this.dataUnit,this.getInitialOrder(this.guidesList),this.guidesList)),this.guidesList.push(...p(this.customGuidesConfig,this.guidesList)),this.guidesMap=C(null===(i=this._formConfig)||void 0===i?void 0:i.fields,this.guidesList,this.dataUnit,this.getMessage("snkFormConfig.form.tabGeneral"))}getConfig(){let i=this.configManager.getConfig(this.dataUnit,!1);return i.fields&&0===i.fields.length&&(i=void 0),null==i&&(i=r(this.dataUnit)),a.copy(i)}handleSelectGuide({detail:i}){this.selectedGuide=i}handleLayoutChanged({detail:i}){this.hasChanges=!0,this.groupsList=[...i],this.guidesMap.set(this.selectedGuide.name,[...i])}getIsDefaultConfig(){var i;return(null===(i=this.configSelected)||void 0===i?void 0:i.origin)===f.DEFAULT&&!0===this.optionConfigChanged&&!1===this.hasChanges}getTabsToSave(){return this.guidesList.map((i=>({name:i.name,label:i.name===g.main?i.name:i.label,order:i.name===g.main?0:i.order,visible:i.visible})))}async handleSaveConfig(){var i;const t=await this.configManager.saveConfig(this.buildConfigToSave());this.configSelected=null===(i=this.configOptions)||void 0===i?void 0:i.find((i=>i.origin===(this.hasChanges?f.USER:f.DEFAULT))),this.originalConfigSelected=this.configSelected,this.hasChanges=!1,this.optionConfigChanged=!1,c.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"),{iconName:"check"}),this.configChange.emit(t)}buildConfigToSave(){if(this.getIsDefaultConfig()){const i=this._formConfig;return i.defaultConfiguration=!0,i}const i=a.copy(this._formConfig);return i.tabs=this.getTabsToSave(),i.fields=b(this.guidesMap),i.defaultConfiguration=!1,i}handleAvailableFieldListChanged({detail:i}){this.availableFields=[...i]}handleSetFieldListAsAvailable({detail:i}){this.availableFields=[...this.availableFields,...i]}handleGuideDeleted({detail:i}){var t,s;const e=i.name,h=null!==(t=this.guidesMap.get(e))&&void 0!==t?t:[],o=[];h.forEach((i=>o.push(...i.fields))),this.availableFields=[...this.availableFields,...o],this.guidesList=[...this.guidesList.filter((i=>i.name!==e))],this.guidesMap.delete(e),(null===(s=this.selectedGuide)||void 0===s?void 0:s.name)===e&&(this.selectedGuide=void 0),this.hasChanges=!0}handleGuideListChanged({detail:i}){this.hasChanges=!0,this.guidesList=[...i]}handleGuideRenamed({detail:i}){var t;const s=null!==(t=this.guidesMap.get(this.selectedGuide.name))&&void 0!==t?t:[],e=y(s,i);this.guidesMap.delete(this.selectedGuide.name),this.guidesMap.set(i,e);const h={name:i,label:i,visible:this.selectedGuide.visible,order:this.selectedGuide.order};this.guidesList=[...this.guidesList.map((i=>i.name===this.selectedGuide.name?h:i))],this.groupsList=[...e],this.selectedGuide=h,this.hasChanges=!0}handleCreateNewGuide(){const i=k(this.guidesList,this.getMessage.bind(this)),t={name:i,label:i,visible:!0,order:this.guidesList.length+1},s={name:u.noGroup,fields:[]};this.guidesList=[...this.guidesList,t],this.guidesMap.set(i,[s]),this.selectedGuide=t,this.hasChanges=!0}getGuideNames(){return[...this.guidesList.map((i=>i.name.toLowerCase())),this.getMessage("snkFormConfig.form.mainArea").toLowerCase()]}async componentWillRender(){if(null==this.messagesBuilder){const i=n.getContextValue("__SNK__APPLICATION__");this.messagesBuilder=i.messagesBuilder}}async componentWillLoad(){this.loadFormConfig(),await this.initializeUserConfig()}render(){return s(h,null,s("config-header",{configOptions:this.configOptions,selectedConfig:this.configSelected,messagesBuilder:this.messagesBuilder,hasChanges:this.hasChanges,optionConfigChanged:this.optionConfigChanged,onConfigClose:()=>this.configClose.emit(),onSaveConfig:async()=>await this.handleSaveConfig()}),s("div",{class:"ez-padding--medium"},s("div",{class:"ez-flex sidebarNavigator__container"},s("guides-configurator",{messagesBuilder:this.messagesBuilder,guidesList:this.guidesList,selectedGuide:this.selectedGuide,onGuideSelected:this.handleSelectGuide.bind(this),onGuideListChanged:this.handleGuideListChanged.bind(this),onCreateNewGuide:this.handleCreateNewGuide.bind(this),onGuideDeleted:this.handleGuideDeleted.bind(this)}),s("fields-layout",{ref:i=>this.refFieldsLayout=i,selectedGuide:this.selectedGuide,guideNames:this.getGuideNames(),groupsList:this.groupsList,messagesBuilder:this.messagesBuilder,dataUnit:this.dataUnit,onGuideRenamed:this.handleGuideRenamed.bind(this),onLayoutChanged:this.handleLayoutChanged.bind(this),onSetFieldListAsAvailable:this.handleSetFieldListAsAvailable.bind(this)}),s("fields-selector",{dataUnit:this.dataUnit,availableFields:this.availableFields,onFieldListChanged:this.handleAvailableFieldListChanged.bind(this),messagesBuilder:this.messagesBuilder}))))}static get watchers(){return{selectedGuide:["observeSelectedGuide"],configManager:["observeConfigManager"]}}};F.style='.sc-snk-form-config-h{display:flex;flex-direction:column;height:100vh;width:100vw;font-family:var(--font-pattern, "Roboto");background:white;color:#2b3a54;--snk-form-config-container-height:calc(100vh - 95px);outline:none}.sidebarNavigator__container.sc-snk-form-config{height:var(--snk-form-config-container-height);gap:20px;align-items:flex-start}.guide-header.sc-snk-form-config{display:flex;width:100%;padding-bottom:12px;border-bottom:1px solid #dce0e8;height:30px;font-weight:500;font-size:16px}';export{w as snk_form,F as snk_form_config}