@sankhyalabs/sankhyablocks 8.15.0-dev.66 → 8.15.0-dev.68

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 (68) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  3. package/dist/cjs/snk-attach.cjs.entry.js +15 -20
  4. package/dist/cjs/snk-crud.cjs.entry.js +50 -0
  5. package/dist/cjs/snk-detail-view.cjs.entry.js +41 -2
  6. package/dist/cjs/snk-form-view.cjs.entry.js +31 -0
  7. package/dist/cjs/snk-form.cjs.entry.js +26 -1
  8. package/dist/cjs/snk-grid.cjs.entry.js +46 -0
  9. package/dist/cjs/{snk-guides-viewer-545dd904.js → snk-guides-viewer-66dd6949.js} +19 -3
  10. package/dist/cjs/snk-guides-viewer.cjs.entry.js +1 -1
  11. package/dist/cjs/snk-simple-crud.cjs.entry.js +49 -1
  12. package/dist/collection/components/snk-attach/snk-attach.js +21 -29
  13. package/dist/collection/components/snk-crud/interfaces/PropsCustomEditor.js +1 -0
  14. package/dist/collection/components/snk-crud/interfaces/PropsCustomRender.js +1 -0
  15. package/dist/collection/components/snk-crud/snk-crud.js +102 -0
  16. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +135 -0
  17. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +82 -0
  18. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +73 -3
  19. package/dist/collection/components/snk-form/snk-form.js +52 -1
  20. package/dist/collection/components/snk-grid/snk-grid.js +104 -0
  21. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +101 -1
  22. package/dist/components/snk-attach2.js +15 -20
  23. package/dist/components/snk-crud.js +52 -0
  24. package/dist/components/snk-detail-view2.js +68 -5
  25. package/dist/components/snk-form-view2.js +33 -0
  26. package/dist/components/snk-form.js +27 -1
  27. package/dist/components/snk-grid2.js +48 -0
  28. package/dist/components/snk-simple-crud2.js +51 -1
  29. package/dist/esm/loader.js +1 -1
  30. package/dist/esm/sankhyablocks.js +1 -1
  31. package/dist/esm/snk-attach.entry.js +15 -20
  32. package/dist/esm/snk-crud.entry.js +50 -0
  33. package/dist/esm/snk-detail-view.entry.js +41 -2
  34. package/dist/esm/snk-form-view.entry.js +31 -0
  35. package/dist/esm/snk-form.entry.js +26 -1
  36. package/dist/esm/snk-grid.entry.js +46 -0
  37. package/dist/esm/{snk-guides-viewer-081bcf90.js → snk-guides-viewer-11cf8dc7.js} +19 -3
  38. package/dist/esm/snk-guides-viewer.entry.js +1 -1
  39. package/dist/esm/snk-simple-crud.entry.js +49 -1
  40. package/dist/sankhyablocks/p-188e1432.entry.js +1 -0
  41. package/dist/sankhyablocks/p-1db45d26.entry.js +1 -0
  42. package/dist/sankhyablocks/p-2c9ea7b6.entry.js +1 -0
  43. package/dist/sankhyablocks/p-50e72d6c.js +1 -0
  44. package/dist/sankhyablocks/p-5201ab24.entry.js +1 -0
  45. package/dist/sankhyablocks/{p-34935c5a.entry.js → p-8171e586.entry.js} +1 -1
  46. package/dist/sankhyablocks/p-a6c4b656.entry.js +1 -0
  47. package/dist/sankhyablocks/p-aa9c4099.entry.js +1 -0
  48. package/dist/sankhyablocks/{p-af3e1265.entry.js → p-b68918fc.entry.js} +1 -1
  49. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  50. package/dist/types/components/snk-attach/snk-attach.d.ts +9 -9
  51. package/dist/types/components/snk-crud/interfaces/PropsCustomEditor.d.ts +4 -0
  52. package/dist/types/components/snk-crud/interfaces/PropsCustomRender.d.ts +4 -0
  53. package/dist/types/components/snk-crud/snk-crud.d.ts +14 -0
  54. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +23 -0
  55. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +15 -2
  56. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +13 -0
  57. package/dist/types/components/snk-form/snk-form.d.ts +8 -0
  58. package/dist/types/components/snk-grid/snk-grid.d.ts +19 -0
  59. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +13 -2
  60. package/dist/types/components.d.ts +76 -0
  61. package/package.json +1 -1
  62. package/dist/sankhyablocks/p-1122030d.js +0 -1
  63. package/dist/sankhyablocks/p-24880828.entry.js +0 -1
  64. package/dist/sankhyablocks/p-33f695d6.entry.js +0 -1
  65. package/dist/sankhyablocks/p-39f8ebb3.entry.js +0 -1
  66. package/dist/sankhyablocks/p-e4e044cf.entry.js +0 -1
  67. package/dist/sankhyablocks/p-ecc666ef.entry.js +0 -1
  68. package/dist/sankhyablocks/p-ee1d9c09.entry.js +0 -1
@@ -657,25 +657,22 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
657
657
  this._currentDataUnit = undefined;
658
658
  this.crudConfig = undefined;
659
659
  }
660
- registerKeyWatcher(newRegisterKey, oldRegisterKey) {
660
+ async initAttach() {
661
661
  var _a, _b, _c, _d, _e, _f;
662
- if (!this._currentDataUnit) {
663
- this.loadAttachmentDataUnit();
662
+ await this.loadAttachmentDataUnit();
663
+ this.returnToGridMode();
664
+ if (this.fetcherType === "AnexoSistema") {
665
+ this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
666
+ (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
667
+ await ((_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData());
668
+ return;
664
669
  }
665
- if (oldRegisterKey !== newRegisterKey) {
666
- this.returnToGridMode();
667
- if (this.fetcherType === "AnexoSistema") {
668
- this._currentFetcher = new AnexoSistemaFetcher(this.entityName, this.registerKey, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
669
- (_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
670
- return (_c = this._currentDataUnit) === null || _c === void 0 ? void 0 : _c.loadData();
671
- }
672
- if (this.fetcherType === "Attach") {
673
- const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
674
- if (hasMoreOneItem)
675
- return;
676
- }
677
- return (_f = (_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadMetadata()) === null || _f === void 0 ? void 0 : _f.then(this._currentDataUnit.loadData.bind(undefined, undefined, true, this.registerKey));
670
+ if (this.fetcherType === "Attach") {
671
+ const hasMoreOneItem = ((_d = this.registerKey) === null || _d === void 0 ? void 0 : _d.split("_").length) > 1;
672
+ if (hasMoreOneItem)
673
+ return;
678
674
  }
675
+ (_f = (_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadMetadata()) === null || _f === void 0 ? void 0 : _f.then(this._currentDataUnit.loadData.bind(undefined, undefined, true, this.registerKey));
679
676
  }
680
677
  /**
681
678
  * Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
@@ -797,8 +794,9 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
797
794
  }
798
795
  });
799
796
  }
800
- componentWillLoad() {
797
+ async componentWillLoad() {
801
798
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
799
+ await this.initAttach();
802
800
  }
803
801
  componentWillRender() {
804
802
  if (!this.fetcherType) {
@@ -826,9 +824,6 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
826
824
  return null;
827
825
  return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder, onDataStateChange: this.handleOnDataStateChange.bind(this) }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
828
826
  }
829
- static get watchers() { return {
830
- "registerKey": ["registerKeyWatcher"]
831
- }; }
832
827
  static get style() { return snkAttachCss; }
833
828
  }, [2, "snk-attach", {
834
829
  "fetcherType": [1, "fetcher-type"],
@@ -53,6 +53,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
53
53
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
54
54
  this._keyDownHandler = async (event) => this.keyDownListener(event);
55
55
  this._viewHistory = [];
56
+ this._customEditors = new Map();
57
+ this._customRenders = new Map();
56
58
  this._dataUnit = undefined;
57
59
  this._dataState = undefined;
58
60
  this.attachmentRegisterKey = undefined;
@@ -111,6 +113,31 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
111
113
  async getFilterBar() {
112
114
  return await this._snkGrid.getFilterBar();
113
115
  }
116
+ /**
117
+ * Registra um editor customizado para campos da grade e formulário.
118
+ */
119
+ async addCustomEditor(fieldName, customEditor) {
120
+ if (this._guidesViewer && this._snkGrid) {
121
+ this._guidesViewer.addCustomEditor(fieldName, customEditor);
122
+ this._snkGrid.addCustomEditor(fieldName, customEditor);
123
+ return;
124
+ }
125
+ const newCustomEditors = new Map(this._customEditors);
126
+ newCustomEditors.set(fieldName, customEditor);
127
+ this._customEditors = newCustomEditors;
128
+ }
129
+ /**
130
+ * Registra um render customizado para colunas da grid.
131
+ */
132
+ async addGridCustomRender(fieldName, customRender) {
133
+ if (this._snkGrid) {
134
+ this._snkGrid.addGridCustomRender(fieldName, customRender);
135
+ return;
136
+ }
137
+ const newCustomRenders = new Map(this._customRenders);
138
+ newCustomRenders.set(fieldName, customRender);
139
+ this._customRenders = newCustomRenders;
140
+ }
114
141
  /**
115
142
  * Registra um formatador de valores para uma coluna da grid.
116
143
  */
@@ -182,6 +209,29 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
182
209
  const joinedPrimaryKeys = recordCriteria.map(({ value }) => value).join('_');
183
210
  return joinedPrimaryKeys;
184
211
  }
212
+ setCustomRenders() {
213
+ if (!this._snkGrid) {
214
+ return;
215
+ }
216
+ for (const [fieldName, customRender] of this._customRenders) {
217
+ this._snkGrid.addGridCustomRender(fieldName, customRender);
218
+ this._customRenders.delete(fieldName);
219
+ }
220
+ }
221
+ setCustomEditors() {
222
+ if (!this._snkGrid || !this._guidesViewer) {
223
+ return;
224
+ }
225
+ for (const [fieldName, customEditor] of this._customEditors) {
226
+ this._guidesViewer.addCustomEditor(fieldName, customEditor);
227
+ this._snkGrid.addCustomEditor(fieldName, customEditor);
228
+ this._customEditors.delete(fieldName);
229
+ }
230
+ }
231
+ componentDidRender() {
232
+ this.setCustomRenders();
233
+ this.setCustomEditors();
234
+ }
185
235
  componentWillLoad() {
186
236
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
187
237
  let parent = this._element.parentElement;
@@ -395,6 +445,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
395
445
  "closeConfigurator": [64],
396
446
  "reloadFilterBar": [64],
397
447
  "getFilterBar": [64],
448
+ "addCustomEditor": [64],
449
+ "addGridCustomRender": [64],
398
450
  "addCustomValueFormatter": [64],
399
451
  "removeCustomValueFormatter": [64],
400
452
  "setFieldProp": [64]
@@ -76,6 +76,8 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
76
76
  this._formEditorConfigManager = undefined;
77
77
  this._formEditorDataUnit = undefined;
78
78
  this._fieldToGetFocus = undefined;
79
+ this._customEditors = undefined;
80
+ this._customRenders = undefined;
79
81
  this._fieldsProps = {};
80
82
  }
81
83
  observeDataUnit() {
@@ -107,6 +109,19 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
107
109
  async findField() {
108
110
  await openFieldSearch(this._moreOptions, this._fieldSearch);
109
111
  }
112
+ /**
113
+ * Registra um editor customizado para campos da grade e formulário
114
+ */
115
+ async addCustomEditor(fieldName, customEditor) {
116
+ this._customEditors = Object.assign(Object.assign({}, this._customEditors), { [fieldName]: customEditor });
117
+ }
118
+ /**
119
+ * Registra um render customizado para colunas da grid.
120
+ */
121
+ async addGridCustomRender(fieldName, customRender) {
122
+ this._customRenders = Object.assign(Object.assign({}, this._customRenders), { [fieldName]: customRender });
123
+ }
124
+ ;
110
125
  /**
111
126
  * Altera/adiciona uma propriedade nos metadados do campo.
112
127
  */
@@ -258,7 +273,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
258
273
  if (sheet == undefined) {
259
274
  return;
260
275
  }
261
- 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); }, fieldsProps: params.fieldsProps });
276
+ 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 });
262
277
  })));
263
278
  }
264
279
  wrapDetail(levels, content) {
@@ -300,14 +315,14 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
300
315
  else {
301
316
  detailBranch = this.selectedGuide;
302
317
  }
303
- content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId }));
318
+ content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId, customEditors: this._customEditors, customRenders: this._customRenders }));
304
319
  }
305
320
  else {
306
321
  const cardId = this.selectedGuide.id;
307
322
  const sheet = this._masterFormMetadata.getSheet(cardId);
308
323
  if (sheet) {
309
324
  const cardConfig = (_c = (_b = this.masterFormConfig) === null || _b === void 0 ? void 0 : _b.cardsState) === null || _c === void 0 ? void 0 : _c.get(cardId);
310
- content = h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_e = (_d = this.masterFormConfig) === null || _d === void 0 ? void 0 : _d.summary) === null || _e === void 0 ? void 0 : _e.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), fieldsProps: this._fieldsProps }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar());
325
+ content = h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_e = (_d = this.masterFormConfig) === null || _d === void 0 ? void 0 : _d.summary) === null || _e === void 0 ? void 0 : _e.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar());
311
326
  }
312
327
  }
313
328
  return content;
@@ -514,6 +529,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
514
529
  recordsValidator: this.recordsValidator,
515
530
  fieldToFocus: this._fieldToGetFocus,
516
531
  onRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this),
532
+ propsCustomEditor: this._customEditors,
517
533
  fieldsProps: this._fieldsProps
518
534
  }), 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 })));
519
535
  }
@@ -545,9 +561,13 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
545
561
  "_formEditorConfigManager": [32],
546
562
  "_formEditorDataUnit": [32],
547
563
  "_fieldToGetFocus": [32],
564
+ "_customEditors": [32],
565
+ "_customRenders": [32],
548
566
  "_fieldsProps": [32],
549
567
  "showFormConfig": [64],
550
568
  "findField": [64],
569
+ "addCustomEditor": [64],
570
+ "addGridCustomRender": [64],
551
571
  "setFieldProp": [64]
552
572
  }, [[2, "actionClick", "onActionClick"], [0, "snkContentCardChanged", "onContentCardChanged"]]]);
553
573
  function defineCustomElement$1() {
@@ -782,6 +802,8 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
782
802
  this.branchGuide = undefined;
783
803
  this.canEdit = true;
784
804
  this.taskbarCustomContainerId = undefined;
805
+ this.customEditors = undefined;
806
+ this.customRenders = undefined;
785
807
  }
786
808
  observeDataUnit(newDataUnit, oldDataUnit) {
787
809
  newDataUnit === null || newDataUnit === void 0 ? void 0 : newDataUnit.subscribe(this.dataUnitActionHandler.bind(this));
@@ -849,10 +871,38 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
849
871
  this._snkGrid.scrollIntoView({ behavior: "smooth", block: "start" });
850
872
  }
851
873
  }
874
+ /**
875
+ * Registra um editor customizado para campos da grade e formulário.
876
+ */
877
+ async addCustomEditor(fieldName, customEditor) {
878
+ var _a;
879
+ const detailContext = this.normalizeBranchGuideId((_a = this.branchGuide) === null || _a === void 0 ? void 0 : _a.id);
880
+ this._snkGrid.addCustomEditor(fieldName, customEditor, detailContext);
881
+ this._snkFormView.addCustomEditor(fieldName, customEditor, detailContext);
882
+ }
883
+ async observerPropsCustomEditor(newValue) {
884
+ for (const fieldName in newValue) {
885
+ await this.addCustomEditor(fieldName, newValue[fieldName]);
886
+ }
887
+ }
888
+ /**
889
+ * Registra um render customizado para colunas da grid.
890
+ */
891
+ async addGridCustomRender(fieldName, customRender) {
892
+ var _a;
893
+ const detailContext = this.normalizeBranchGuideId((_a = this.branchGuide) === null || _a === void 0 ? void 0 : _a.id);
894
+ await this._snkGrid.addGridCustomRender(fieldName, customRender, detailContext);
895
+ }
852
896
  onContentCardChanged(evt) {
853
897
  SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this.formConfigManager).then(() => forceUpdate(this));
854
898
  evt.stopPropagation();
855
899
  }
900
+ async observeCustomRenders(newValue) {
901
+ for (const field in newValue) {
902
+ const customRender = newValue[field];
903
+ await this.addGridCustomRender(field, customRender);
904
+ }
905
+ }
856
906
  updateLabel() {
857
907
  const guideItemPathSize = this.guideItemPath ? this.guideItemPath.length : 0;
858
908
  if (guideItemPathSize > 0) {
@@ -955,6 +1005,10 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
955
1005
  this.messagesBuilder = new SnkMessageBuilder(this.entityName);
956
1006
  }
957
1007
  }
1008
+ async componentDidLoad() {
1009
+ await this.observerPropsCustomEditor(this.customEditors);
1010
+ await this.observeCustomRenders(this.customRenders);
1011
+ }
958
1012
  async dataUnitActionHandler(action) {
959
1013
  if (action.type === Action.FIELD_INVALIDATED) {
960
1014
  this.addErrorBadgeToBranchGuide();
@@ -964,6 +1018,9 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
964
1018
  this.branchGuide = Object.assign(Object.assign({}, this.branchGuide), { badge: 'error' });
965
1019
  this.snkDetailGuidesChange.emit(new GuideBuilder(this.branchGuide, this._formMetadata, this.dataUnit));
966
1020
  }
1021
+ normalizeBranchGuideId(id) {
1022
+ return id === null || id === void 0 ? void 0 : id.replace(/child\[(.*?)\]/g, '$1').replace(/::/g, '>');
1023
+ }
967
1024
  render() {
968
1025
  this.updateLabel();
969
1026
  //const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
@@ -971,7 +1028,9 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
971
1028
  }
972
1029
  static get watchers() { return {
973
1030
  "dataUnit": ["observeDataUnit"],
974
- "dataState": ["observerDataState"]
1031
+ "dataState": ["observerDataState"],
1032
+ "customEditors": ["observerPropsCustomEditor"],
1033
+ "customRenders": ["observeCustomRenders"]
975
1034
  }; }
976
1035
  static get style() { return snkDetailViewCss; }
977
1036
  }, [6, "snk-detail-view", {
@@ -988,12 +1047,16 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
988
1047
  "branchGuide": [1040],
989
1048
  "canEdit": [4, "can-edit"],
990
1049
  "taskbarCustomContainerId": [1, "taskbar-custom-container-id"],
1050
+ "customEditors": [16],
1051
+ "customRenders": [16],
991
1052
  "_disabledButtons": [32],
992
1053
  "_currentView": [32],
993
1054
  "attachmentRegisterKey": [32],
994
1055
  "changeViewMode": [64],
995
1056
  "configGrid": [64],
996
- "showUp": [64]
1057
+ "showUp": [64],
1058
+ "addCustomEditor": [64],
1059
+ "addGridCustomRender": [64]
997
1060
  }, [[0, "snkContentCardChanged", "onContentCardChanged"]]]);
998
1061
  SnkDetailView.REGEX_FORM_ID = /__FORM:[^:]+/g;
999
1062
  function defineCustomElement() {
@@ -12,6 +12,7 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
12
12
  this.snkContentCardChanged = createEvent(this, "snkContentCardChanged", 7);
13
13
  this.snkRequestClearFieldToFocus = createEvent(this, "snkRequestClearFieldToFocus", 7);
14
14
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
15
+ this._customEditors = new Map();
15
16
  this._fieldProps = new Map();
16
17
  this.levelPath = undefined;
17
18
  this.label = undefined;
@@ -26,6 +27,7 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
26
27
  this.canFix = true;
27
28
  this.recordsValidator = undefined;
28
29
  this.fieldToFocus = undefined;
30
+ this.customEditors = undefined;
29
31
  this.fieldsProps = undefined;
30
32
  }
31
33
  async showUp() {
@@ -33,6 +35,23 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
33
35
  this._formView.showUp();
34
36
  }
35
37
  }
38
+ /**
39
+ * Registra um editor customizado para campos da grade e formulário
40
+ */
41
+ async addCustomEditor(fieldName, customEditor, detailContext) {
42
+ if (this._formView) {
43
+ this._formView.addCustomEditor(fieldName, customEditor, detailContext);
44
+ return;
45
+ }
46
+ const newCustomEditors = new Map(this._customEditors);
47
+ newCustomEditors.set(fieldName, { customEditor, detailContext });
48
+ this._customEditors = newCustomEditors;
49
+ }
50
+ observePropsCustomEditor(newValue) {
51
+ for (const fieldName in newValue) {
52
+ this.addCustomEditor(fieldName, newValue[fieldName]);
53
+ }
54
+ }
36
55
  /**
37
56
  * Altera/adiciona uma propriedade nos metadados do campo.
38
57
  */
@@ -108,9 +127,11 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
108
127
  }
109
128
  }
110
129
  componentDidLoad() {
130
+ this.observePropsCustomEditor(this.customEditors);
111
131
  this.observeFieldsProps(this.fieldsProps);
112
132
  }
113
133
  componentDidRender() {
134
+ this.setCustomEditors();
114
135
  this.setFieldProps();
115
136
  if (this.fieldToFocus == undefined) {
116
137
  return;
@@ -123,6 +144,15 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
123
144
  this.snkRequestClearFieldToFocus.emit();
124
145
  });
125
146
  }
147
+ setCustomEditors() {
148
+ if (!this._formView) {
149
+ return;
150
+ }
151
+ for (const [fieldName, customEditorProps] of this._customEditors) {
152
+ this._formView.addCustomEditor(fieldName, customEditorProps.customEditor, customEditorProps.detailContext);
153
+ this._customEditors.delete(fieldName);
154
+ }
155
+ }
126
156
  setFieldProps() {
127
157
  if (!this._formView) {
128
158
  return;
@@ -144,6 +174,7 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
144
174
  h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) })));
145
175
  }
146
176
  static get watchers() { return {
177
+ "customEditors": ["observePropsCustomEditor"],
147
178
  "fieldsProps": ["observeFieldsProps"]
148
179
  }; }
149
180
  static get style() { return snkFormViewCss; }
@@ -161,8 +192,10 @@ const SnkFormView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
161
192
  "canFix": [4, "can-fix"],
162
193
  "recordsValidator": [16],
163
194
  "fieldToFocus": [1, "field-to-focus"],
195
+ "customEditors": [16],
164
196
  "fieldsProps": [16],
165
197
  "showUp": [64],
198
+ "addCustomEditor": [64],
166
199
  "setFieldProp": [64]
167
200
  }]);
168
201
  function defineCustomElement() {
@@ -16,6 +16,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
16
16
  this.exit = createEvent(this, "exit", 7);
17
17
  this.actionClick = createEvent(this, "actionClick", 7);
18
18
  this.formItemsReady = createEvent(this, "formItemsReady", 7);
19
+ this._customEditors = new Map();
19
20
  this._dataUnit = undefined;
20
21
  this._dataState = undefined;
21
22
  this._showFormConfig = false;
@@ -38,6 +39,18 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
38
39
  async hideConfig() {
39
40
  this._showFormConfig = false;
40
41
  }
42
+ /**
43
+ * Registra um editor customizado para campos da grade e formulário.
44
+ */
45
+ async addCustomEditor(fieldName, customEditor) {
46
+ if (this._form) {
47
+ this._form.addCustomEditor(fieldName, customEditor);
48
+ return;
49
+ }
50
+ const newCustomEditors = new Map(this._customEditors);
51
+ newCustomEditors.set(fieldName, customEditor);
52
+ this._customEditors = newCustomEditors;
53
+ }
41
54
  /**
42
55
  * Altera/adiciona uma propriedade nos metadados do campo.
43
56
  */
@@ -51,6 +64,18 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
51
64
  const dataInfo = { dataUnit: this._dataUnit };
52
65
  ElementIDUtils.addIDInfo(this._element, null, dataInfo);
53
66
  }
67
+ setCustomEditors() {
68
+ if (!this._form) {
69
+ return;
70
+ }
71
+ for (const [fieldName, customEditor] of this._customEditors) {
72
+ this._form.addCustomEditor(fieldName, customEditor);
73
+ this._customEditors.delete(fieldName);
74
+ }
75
+ }
76
+ async componentDidRender() {
77
+ this.setCustomEditors();
78
+ }
54
79
  async componentWillLoad() {
55
80
  let parent = this._element.parentElement;
56
81
  while (parent) {
@@ -103,7 +128,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
103
128
  if (!this._dataUnit || !this._dataState) {
104
129
  return undefined;
105
130
  }
106
- return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { ref: ref => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataState.insertionMode, this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
131
+ return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataState.insertionMode, this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
107
132
  h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
108
133
  }
109
134
  get _element() { return this; }
@@ -120,6 +145,7 @@ const SnkForm$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
120
145
  "_configManager": [32],
121
146
  "showConfig": [64],
122
147
  "hideConfig": [64],
148
+ "addCustomEditor": [64],
123
149
  "setFieldProp": [64]
124
150
  }]);
125
151
  function defineCustomElement$1() {
@@ -94,6 +94,8 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
94
94
  this.__registerHost();
95
95
  this.actionClick = createEvent(this, "actionClick", 7);
96
96
  this.gridDoubleClick = createEvent(this, "gridDoubleClick", 7);
97
+ this._customEditors = new Map();
98
+ this._customRenders = new Map();
97
99
  this._topTaskbarProcessor = new TaskbarProcessor({
98
100
  "snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
99
101
  "snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
@@ -192,6 +194,30 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
192
194
  async findColumn() {
193
195
  await openFieldSearch(this._moreOptions, this._columnSearch);
194
196
  }
197
+ /**
198
+ * Registra um editor customizado para campos da grade e formulário
199
+ */
200
+ async addCustomEditor(fieldName, customEditor, detailContext) {
201
+ if (this._grid) {
202
+ this._grid.addCustomEditor(fieldName, customEditor, detailContext);
203
+ return;
204
+ }
205
+ const newCustomEditors = new Map(this._customEditors);
206
+ newCustomEditors.set(fieldName, { customEditor, detailContext });
207
+ this._customEditors = newCustomEditors;
208
+ }
209
+ /**
210
+ * Registra um render customizado para colunas da grid.
211
+ */
212
+ async addGridCustomRender(fieldName, customRender, detailContext) {
213
+ if (this._grid) {
214
+ this._grid.addGridCustomRender(fieldName, customRender, detailContext);
215
+ return;
216
+ }
217
+ const newCustomRenders = new Map(this._customRenders);
218
+ newCustomRenders.set(fieldName, { customRender, detailContext });
219
+ this._customRenders = newCustomRenders;
220
+ }
195
221
  /**
196
222
  * Registra um formatador de valores para uma coluna da grid.
197
223
  */
@@ -290,6 +316,24 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
290
316
  this.columnFilterDataSource.setDataUnit(this._dataUnit);
291
317
  }
292
318
  }
319
+ setCustomRenders() {
320
+ if (!this._grid) {
321
+ return;
322
+ }
323
+ for (const [fieldName, customRenderProps] of this._customRenders) {
324
+ this._grid.addGridCustomRender(fieldName, customRenderProps.customRender, customRenderProps.detailContext);
325
+ this._customRenders.delete(fieldName);
326
+ }
327
+ }
328
+ setCustomEditors() {
329
+ if (!this._grid) {
330
+ return;
331
+ }
332
+ for (const [fieldName, customEditorProps] of this._customEditors) {
333
+ this._grid.addCustomEditor(fieldName, customEditorProps.customEditor, customEditorProps.detailContext);
334
+ this._customEditors.delete(fieldName);
335
+ }
336
+ }
293
337
  componentWillLoad() {
294
338
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
295
339
  //TODO: substituir pelo metodo nativo closest
@@ -327,6 +371,8 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
327
371
  componentDidRender() {
328
372
  this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
329
373
  this.loadGridCustomFormatters(this._dataUnit.metadata.fields);
374
+ this.setCustomRenders();
375
+ this.setCustomEditors();
330
376
  }
331
377
  async handleDataStateChange(evt) {
332
378
  this._dataState = evt.detail;
@@ -485,6 +531,8 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
485
531
  "reloadFilterBar": [64],
486
532
  "getFilterBar": [64],
487
533
  "findColumn": [64],
534
+ "addCustomEditor": [64],
535
+ "addGridCustomRender": [64],
488
536
  "addCustomValueFormatter": [64],
489
537
  "removeCustomValueFormatter": [64]
490
538
  }]);
@@ -101,6 +101,8 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
101
101
  this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
102
102
  this._keyDownHandler = (event) => this.keyDownListener(event);
103
103
  this._formConfigFetcher = new FormConfigFetcher();
104
+ this._customEditors = new Map();
105
+ this._customRenders = new Map();
104
106
  this._taskbarProcessor = new TaskbarProcessor({
105
107
  "snkSimpleCrudTaskbar.form_regular": this.getButtons(false, [TaskbarElement.GRID_MODE]),
106
108
  "snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [TaskbarElement.DATA_EXPORTER, TaskbarElement.FORM_MODE]),
@@ -137,6 +139,31 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
137
139
  this.ignoreReadOnlyFormFields = false;
138
140
  this.autoLoad = undefined;
139
141
  }
142
+ /**
143
+ * Registra um editor customizado para campos da grade e formulário.
144
+ */
145
+ async addCustomEditor(fieldName, customEditor) {
146
+ if (this._grid && this._form) {
147
+ this._grid.addCustomEditor(fieldName, customEditor);
148
+ this._form.addCustomEditor(fieldName, customEditor);
149
+ return;
150
+ }
151
+ const newCustomEditors = new Map(this._customEditors);
152
+ newCustomEditors.set(fieldName, customEditor);
153
+ this._customEditors = newCustomEditors;
154
+ }
155
+ /**
156
+ * Registra um render customizado para colunas da grid.
157
+ */
158
+ async addGridCustomRender(fieldName, customRender) {
159
+ if (this._grid) {
160
+ this._grid.addGridCustomRender(fieldName, customRender);
161
+ return;
162
+ }
163
+ const newCustomRenders = new Map(this._customRenders);
164
+ newCustomRenders.set(fieldName, customRender);
165
+ this._customRenders = newCustomRenders;
166
+ }
140
167
  handleResourceIDChanged(newValue, oldValue) {
141
168
  if (StringUtils.isEmpty(newValue)) {
142
169
  return;
@@ -364,6 +391,8 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
364
391
  this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
365
392
  this.addGridCustomValueFormattters();
366
393
  this.setFieldsProps();
394
+ this.setCustomRenders();
395
+ this.setCustomEditors();
367
396
  }
368
397
  componentWillLoad() {
369
398
  this.processMetadata();
@@ -374,6 +403,25 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
374
403
  componentDidLoad() {
375
404
  CSSVarsUtils.applyVarsGrid(this._element, this._grid);
376
405
  }
406
+ setCustomRenders() {
407
+ if (!this._grid) {
408
+ return;
409
+ }
410
+ for (const [fieldName, customRender] of this._customRenders) {
411
+ this._grid.addGridCustomRender(fieldName, customRender);
412
+ this._customRenders.delete(fieldName);
413
+ }
414
+ }
415
+ setCustomEditors() {
416
+ if (!this._grid || !this._form) {
417
+ return;
418
+ }
419
+ for (const [fieldName, customEditor] of this._customEditors) {
420
+ this._grid.addCustomEditor(fieldName, customEditor);
421
+ this._form.addCustomEditor(fieldName, customEditor);
422
+ this._customEditors.delete(fieldName);
423
+ }
424
+ }
377
425
  configDatasource() {
378
426
  this._multiSelectionListDataSource.setApplication(this.application);
379
427
  this._multiSelectionListDataSource.setDataUnit(this.dataUnit);
@@ -724,7 +772,7 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
724
772
  }
725
773
  return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this) }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
726
774
  ? undefined
727
- : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { ref: ref => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
775
+ : this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
728
776
  }
729
777
  get _element() { return this; }
730
778
  static get watchers() { return {
@@ -765,6 +813,8 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
765
813
  "_customContainerId": [32],
766
814
  "_formFields": [32],
767
815
  "_fieldsProps": [32],
816
+ "addCustomEditor": [64],
817
+ "addGridCustomRender": [64],
768
818
  "addCustomValueFormatter": [64],
769
819
  "removeCustomValueFormatter": [64],
770
820
  "setFieldProp": [64],