@sankhyalabs/sankhyablocks 5.13.0 → 5.15.0

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 (49) 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-crud.cjs.entry.js +7 -0
  4. package/dist/cjs/snk-entity-list.cjs.entry.js +17 -13
  5. package/dist/cjs/snk-filter-bar.cjs.entry.js +6 -0
  6. package/dist/cjs/snk-form-config.cjs.entry.js +33 -56
  7. package/dist/cjs/snk-grid.cjs.entry.js +7 -0
  8. package/dist/cjs/snk-tab-config.cjs.entry.js +13 -21
  9. package/dist/collection/components/snk-crud/snk-crud.js +23 -0
  10. package/dist/collection/components/snk-entity-list/snk-entity-list.js +17 -13
  11. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +26 -0
  12. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +33 -56
  13. package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +32 -21
  14. package/dist/collection/components/snk-grid/snk-grid.js +23 -0
  15. package/dist/components/snk-crud.js +9 -1
  16. package/dist/components/snk-entity-list.js +17 -13
  17. package/dist/components/snk-filter-bar2.js +8 -1
  18. package/dist/components/snk-form-config2.js +33 -56
  19. package/dist/components/snk-grid2.js +9 -1
  20. package/dist/components/snk-tab-config2.js +14 -21
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/esm/sankhyablocks.js +1 -1
  23. package/dist/esm/snk-crud.entry.js +7 -0
  24. package/dist/esm/snk-entity-list.entry.js +17 -13
  25. package/dist/esm/snk-filter-bar.entry.js +6 -0
  26. package/dist/esm/snk-form-config.entry.js +33 -56
  27. package/dist/esm/snk-grid.entry.js +7 -0
  28. package/dist/esm/snk-tab-config.entry.js +13 -21
  29. package/dist/sankhyablocks/p-0c2afa63.entry.js +1 -0
  30. package/dist/sankhyablocks/p-584a315a.entry.js +1 -0
  31. package/dist/sankhyablocks/p-72e78de0.entry.js +1 -0
  32. package/dist/sankhyablocks/p-8d40909d.entry.js +1 -0
  33. package/dist/sankhyablocks/p-9a448ff9.entry.js +1 -0
  34. package/dist/sankhyablocks/p-e0c04667.entry.js +1 -0
  35. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  36. package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
  37. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +1 -0
  38. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  39. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +0 -1
  40. package/dist/types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.d.ts +4 -0
  41. package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
  42. package/dist/types/components.d.ts +20 -0
  43. package/package.json +1 -1
  44. package/dist/sankhyablocks/p-0409d41b.entry.js +0 -1
  45. package/dist/sankhyablocks/p-1c0ee011.entry.js +0 -1
  46. package/dist/sankhyablocks/p-656eab86.entry.js +0 -1
  47. package/dist/sankhyablocks/p-69859375.entry.js +0 -1
  48. package/dist/sankhyablocks/p-ba511f48.entry.js +0 -1
  49. package/dist/sankhyablocks/p-c8095917.entry.js +0 -1
@@ -17,20 +17,20 @@ export class SnkEntityList {
17
17
  (_b = (_a = this._searchElement) === null || _a === void 0 ? void 0 : _a['clearValue']) === null || _b === void 0 ? void 0 : _b.call(_a);
18
18
  }
19
19
  ezListChangeListener(evt) {
20
- var _a, _b, _c, _d;
21
- (_c = ((_a = this.config.value) !== null && _a !== void 0 ? _a : (_b = this.config.value) === null || _b === void 0 ? void 0 : _b.elements)) === null || _c === void 0 ? void 0 : _c.forEach(value => {
20
+ var _a, _b;
21
+ (_a = (this.getListConfigValue(this.config))) === null || _a === void 0 ? void 0 : _a.forEach(value => {
22
22
  var _a, _b;
23
23
  if (value && value.id === ((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.id)) {
24
24
  value.check = (_b = evt.detail) === null || _b === void 0 ? void 0 : _b.check;
25
25
  }
26
26
  });
27
27
  this.saveConfig.emit(this.config);
28
- this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
28
+ this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
29
29
  }
30
30
  loadListSource() {
31
- var _a, _b, _c, _d, _e, _f, _g, _h;
31
+ var _a;
32
32
  this._ezListSource = [];
33
- (_h = ((_e = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.elements) !== null && _e !== void 0 ? _e : (_g = (_f = this.config) === null || _f === void 0 ? void 0 : _f.value) === null || _g === void 0 ? void 0 : _g.members)) === null || _h === void 0 ? void 0 : _h.forEach(value => {
33
+ (_a = (this.getListConfigValue(this.config))) === null || _a === void 0 ? void 0 : _a.forEach(value => {
34
34
  if (value) {
35
35
  this._ezListSource.push({
36
36
  label: `${value.id} - ${value.label}`,
@@ -41,17 +41,17 @@ export class SnkEntityList {
41
41
  });
42
42
  }
43
43
  componentDidLoad() {
44
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
45
- let configValue = (_f = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.elements) !== null && _c !== void 0 ? _c : (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.value) === null || _e === void 0 ? void 0 : _e.members) !== null && _f !== void 0 ? _f : (_g = this.config) === null || _g === void 0 ? void 0 : _g.value;
44
+ var _a, _b, _c, _d, _e;
45
+ let configValue = this.getListConfigValue(this.config);
46
46
  let configValueArray = [];
47
47
  if (Array.isArray(configValue)) {
48
48
  configValueArray = configValue;
49
49
  }
50
50
  else {
51
- configValueArray.push((_j = (_h = this.config) === null || _h === void 0 ? void 0 : _h.value) === null || _j === void 0 ? void 0 : _j.members);
51
+ configValueArray.push((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.members);
52
52
  }
53
53
  this.config.value = configValueArray;
54
- this._entityName = (_m = (_l = (_k = this.config) === null || _k === void 0 ? void 0 : _k.props) === null || _l === void 0 ? void 0 : _l.searchContext) === null || _m === void 0 ? void 0 : _m.entity;
54
+ this._entityName = (_e = (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.searchContext) === null || _e === void 0 ? void 0 : _e.entity;
55
55
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
56
56
  this.loadListSource();
57
57
  }
@@ -70,10 +70,10 @@ export class SnkEntityList {
70
70
  return this._application.executePreparedSearch(mode, argument, options);
71
71
  }
72
72
  onEzSearchChange(evt) {
73
- var _a, _b, _c, _d, _e, _f, _g, _h;
74
- if (evt.detail != undefined && ((_e = ((_c = (_a = this.config.value) !== null && _a !== void 0 ? _a : (_b = this.config.value) === null || _b === void 0 ? void 0 : _b.elements) !== null && _c !== void 0 ? _c : (_d = this.config.value) === null || _d === void 0 ? void 0 : _d.members)) === null || _e === void 0 ? void 0 : _e.find(i => { var _a; return (i === null || i === void 0 ? void 0 : i.id) == ((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); })) === undefined) {
73
+ var _a, _b, _c, _d;
74
+ if (evt.detail != undefined && ((_a = (this.getListConfigValue(this.config))) === null || _a === void 0 ? void 0 : _a.find(i => { var _a; return (i === null || i === void 0 ? void 0 : i.id) == ((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); })) === undefined) {
75
75
  this.config = Object.assign(Object.assign({}, this.config), { value: [
76
- ...((_g = (_f = this.config) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : []),
76
+ ...((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : []),
77
77
  {
78
78
  id: evt.detail.value,
79
79
  check: true,
@@ -82,13 +82,17 @@ export class SnkEntityList {
82
82
  ] });
83
83
  this.loadListSource();
84
84
  this.saveConfig.emit(this.config);
85
- this.valueChanged.emit((_h = this.config) === null || _h === void 0 ? void 0 : _h.value);
85
+ this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
86
86
  }
87
87
  }
88
88
  getMessage(key, params) {
89
89
  var _a;
90
90
  return (_a = this._application) === null || _a === void 0 ? void 0 : _a.messagesBuilder.getMessage(key, params);
91
91
  }
92
+ getListConfigValue(config) {
93
+ var _a, _b, _c, _d;
94
+ return (_d = (_b = (_a = config.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : (_c = config === null || config === void 0 ? void 0 : config.value) === null || _c === void 0 ? void 0 : _c.members) !== null && _d !== void 0 ? _d : config === null || config === void 0 ? void 0 : config.value;
95
+ }
92
96
  render() {
93
97
  var _a;
94
98
  return (h(Host, null, h("ez-search", { ref: elem => this._searchElement = elem, optionLoader: argument => this.optionLoader(argument), value: this._searchValue, label: (_a = this.config) === null || _a === void 0 ? void 0 : _a.label, onEzChange: evt => this.onEzSearchChange(evt) }), h("label", { class: "label" }, this.getMessage("snkEntityList.selected")), h("div", { style: this.maxHeightList ? { 'max-height': this.maxHeightList } : {}, class: { "snk-entity-list--overflow": !!this.maxHeightList } }, h("ez-list", { ref: (el) => this._ezList = el, id: "snkEntityList", listMode: "check", dataSource: this._ezListSource, hoverFeedback: true, itemSlotBuilder: this.rightListSlotBuilder, onEzCheckChange: evt => this.ezListChangeListener(evt) }))));
@@ -52,6 +52,12 @@ export class SnkFilterBar {
52
52
  }
53
53
  this.processAfterUpdateConfig();
54
54
  }
55
+ /**
56
+ * Faz o recarregamento da filterbar bascando o state no servidor.
57
+ */
58
+ async reload() {
59
+ this.loadConfigFromStorage();
60
+ }
55
61
  componentDidLoad() {
56
62
  if (this._element) {
57
63
  const dataInfo = { dataUnit: this.dataUnit };
@@ -368,6 +374,26 @@ export class SnkFilterBar {
368
374
  "scrollerLocked": {}
369
375
  };
370
376
  }
377
+ static get methods() {
378
+ return {
379
+ "reload": {
380
+ "complexType": {
381
+ "signature": "() => Promise<void>",
382
+ "parameters": [],
383
+ "references": {
384
+ "Promise": {
385
+ "location": "global"
386
+ }
387
+ },
388
+ "return": "Promise<void>"
389
+ },
390
+ "docs": {
391
+ "text": "Faz o recarregamento da filterbar bascando o state no servidor.",
392
+ "tags": []
393
+ }
394
+ }
395
+ };
396
+ }
371
397
  static get elementRef() { return "_element"; }
372
398
  static get watchers() {
373
399
  return [{
@@ -15,7 +15,6 @@ export class SnkFormConfig {
15
15
  constructor() {
16
16
  this._listEnabledFields = [];
17
17
  this._renderTimer = 500;
18
- this._sortableTimer = 100;
19
18
  this._tabSelected = 1;
20
19
  this._labelNewGroup = "Novo grupo";
21
20
  this._mouseOnFieldConfig = false;
@@ -40,36 +39,20 @@ export class SnkFormConfig {
40
39
  this.messagesBuilder = undefined;
41
40
  }
42
41
  observeConfigManager() {
43
- this.loadConfig(this._sortableTimer);
42
+ this.loadConfig();
44
43
  }
45
- loadFields(updateTimer = 0) {
44
+ loadFields() {
46
45
  this._layoutFormConfig = [];
47
- // this._layoutFormConfig ? this._layoutFormConfig.length = 0 : this._layoutFormConfig = [];
48
- /*
49
- TODO: Validar a possibilidade de fazer diretamente this._layoutFormConfig.length = 0
50
- sem a necessidade do ternario abaixo, para isso definir um default para o this._layoutFormConfig
51
- na declaração da variavel
52
- - Impactou:
53
- - Inserir um field, alterar a tab de lugar e inserir um novo campo
54
- - Ocultar/Deletar sequencialmente mais de uma aba
55
- */
56
- if (updateTimer > 0) {
57
- setTimeout(() => {
58
- this.buildFields();
59
- }, updateTimer);
60
- }
61
- else {
62
- this.buildFields();
63
- }
46
+ this.buildFields();
64
47
  }
65
48
  buildFields() {
66
49
  this.buildFormConfig();
67
50
  this.buildAvailableFields();
68
51
  }
69
- loadFormConfig(updateTimer) {
52
+ loadFormConfig() {
70
53
  var _a;
71
54
  this._formConfig = this.getConfig();
72
- this.loadFields(updateTimer);
55
+ this.loadFields();
73
56
  this.controlFieldConfig();
74
57
  if (((_a = this._filterFieldsAvailable) === null || _a === void 0 ? void 0 : _a.value) != undefined) {
75
58
  this._filterFieldsAvailable.value = "";
@@ -112,12 +95,12 @@ export class SnkFormConfig {
112
95
  }
113
96
  }
114
97
  resetChangeConfig() {
115
- this.loadFormConfig(this._sortableTimer);
98
+ this.loadFormConfig();
116
99
  this.clearTempGroups();
117
100
  }
118
101
  resetChangeOptionConfig() {
119
102
  this._formConfigChanged = false;
120
- this.loadConfig(this._sortableTimer);
103
+ this.loadConfig();
121
104
  this.clearTempGroups();
122
105
  }
123
106
  getTabsToSave() {
@@ -242,7 +225,7 @@ export class SnkFormConfig {
242
225
  var _a;
243
226
  return ((_a = group.fields) === null || _a === void 0 ? void 0 : _a.length) ? group.fields.map((field) => {
244
227
  var _a, _b;
245
- return h("div", { key: field.name, class: this.getFieldConfigStyle(field), "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { messagesBuilder: this.messagesBuilder, onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, modeInsertion: false, fieldConfig: field, dataUnit: this.dataUnit, isConfigActive: ((_a = this._fieldConfigSelected) === null || _a === void 0 ? void 0 : _a.name) === field.name, id: field.name }), ((_b = this._fieldConfigSelected) === null || _b === void 0 ? void 0 : _b.name) === field.name &&
228
+ return h("div", { key: field.name, class: this.getFieldConfigStyle(field), "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { messagesBuilder: this.messagesBuilder, onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, modeInsertion: false, fieldConfig: field, dataUnit: this.dataUnit, isConfigActive: ((_a = this._fieldConfigSelected) === null || _a === void 0 ? void 0 : _a.name) === field.name, id: field.name, key: field.name }), ((_b = this._fieldConfigSelected) === null || _b === void 0 ? void 0 : _b.name) === field.name &&
246
229
  h("div", { class: "ez-flex form-config__config-options" }, h("snk-config-options", { idConfig: field.name, messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, fieldConfig: this._fieldConfigSelected, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), onConfigOptionsChanged: (evt) => this.handleconfigOptionsChanged(evt.detail) })));
247
230
  }) : h("div", { class: "form-config__add-group-container" }, h("div", { class: "form-config__add-group-content" }, h("div", { class: "form-config__add-group-label" }, h("label", { class: "ez-text ez-text--center ez-text--medium ez-text--primary ez-text--bold" }, this.getMessage("snkFormConfig.form.labelDropField")))));
248
231
  }
@@ -335,9 +318,7 @@ export class SnkFormConfig {
335
318
  && oldContainer.id === newContainer.id) {
336
319
  evt.cancel();
337
320
  this._fieldsAvailable = [];
338
- setTimeout(() => {
339
- this.buildAvailableFields();
340
- }, this._sortableTimer);
321
+ this.buildAvailableFields();
341
322
  return true;
342
323
  }
343
324
  return false;
@@ -356,7 +337,7 @@ export class SnkFormConfig {
356
337
  }
357
338
  };
358
339
  setTimeout(() => {
359
- this.handleFieldConfigChange(eventDetail, this._sortableTimer);
340
+ this.handleFieldConfigChange(eventDetail);
360
341
  }, this._renderTimer);
361
342
  return true;
362
343
  }
@@ -380,11 +361,7 @@ export class SnkFormConfig {
380
361
  if (isNewGroup) {
381
362
  this.clearTempGroups(true);
382
363
  }
383
- const sortableTimer = oldContainer.dataset.groupName !== newContainer.dataset.groupName
384
- || (newContainer.id === CONTAINER_ID.withoutGroup && oldContainer.id === CONTAINER_ID.fieldsAvailable)
385
- ? this._sortableTimer
386
- : 0;
387
- this.updateFieldsToSave(sortableTimer);
364
+ this.updateFieldsToSave();
388
365
  }, this._renderTimer);
389
366
  return true;
390
367
  }
@@ -414,12 +391,12 @@ export class SnkFormConfig {
414
391
  return;
415
392
  }
416
393
  }
417
- updateFieldsToSave(updateTimer = 0) {
394
+ updateFieldsToSave() {
418
395
  const fields = this.getFieldsToSave();
419
396
  if ((fields === null || fields === void 0 ? void 0 : fields.length) > 0) {
420
397
  this._formConfig.fields = fields;
421
398
  }
422
- this.loadFields(updateTimer);
399
+ this.loadFields();
423
400
  this._formConfigChanged = true;
424
401
  }
425
402
  controlSortableField() {
@@ -448,7 +425,7 @@ export class SnkFormConfig {
448
425
  controlStopDraggingGroup(evt) {
449
426
  if (evt.data.newIndex !== evt.data.oldIndex) {
450
427
  setTimeout(() => {
451
- this.updateFieldsToSave(this._sortableTimer);
428
+ this.updateFieldsToSave();
452
429
  }, this._renderTimer);
453
430
  }
454
431
  }
@@ -523,7 +500,7 @@ export class SnkFormConfig {
523
500
  });
524
501
  if (tabs.length > 0) {
525
502
  this._formConfig.tabs = tabs;
526
- this.loadFields(this._sortableTimer);
503
+ this.loadFields();
527
504
  this.controlFieldConfig();
528
505
  this._formConfigChanged = true;
529
506
  }
@@ -550,13 +527,13 @@ export class SnkFormConfig {
550
527
  if (config != undefined) {
551
528
  this._formConfig = config;
552
529
  this._tabSelected = 1;
553
- this.loadFields(this._sortableTimer);
530
+ this.loadFields();
554
531
  this.controlFieldConfig();
555
532
  this.clearTempGroups();
556
533
  }
557
534
  }
558
- loadConfig(updateTimer = 0) {
559
- this.loadFormConfig(updateTimer);
535
+ loadConfig() {
536
+ this.loadFormConfig();
560
537
  this.loadUserConfig();
561
538
  }
562
539
  addNewGroup() {
@@ -597,7 +574,7 @@ export class SnkFormConfig {
597
574
  });
598
575
  }
599
576
  else {
600
- this.updateFieldsToSave(this._sortableTimer);
577
+ this.updateFieldsToSave();
601
578
  }
602
579
  }
603
580
  checkGroupExists(newLabel, indexGroup, isTempGroup = false) {
@@ -608,11 +585,11 @@ export class SnkFormConfig {
608
585
  if (tabGroupsNames === null || tabGroupsNames === void 0 ? void 0 : tabGroupsNames.includes(newLabel === null || newLabel === void 0 ? void 0 : newLabel.toLowerCase())) {
609
586
  const title = this.getMessage("snkFormConfig.confirm.title");
610
587
  const message = `
611
- ${this.getMessage("snkFormConfig.alert.titleGroupExists")}
612
- <b>${newLabel}</b>
613
- ${this.getMessage("snkFormConfig.alert.inTab")}
614
- <b>${tabName === TAB_NAMES.main ? this.getMessage("snkFormConfig.form.mainArea") : tabName}</b>.
615
- <br/><br/>
588
+ ${this.getMessage("snkFormConfig.alert.titleGroupExists")}
589
+ <b>${newLabel}</b>
590
+ ${this.getMessage("snkFormConfig.alert.inTab")}
591
+ <b>${tabName === TAB_NAMES.main ? this.getMessage("snkFormConfig.form.mainArea") : tabName}</b>.
592
+ <br/><br/>
616
593
  ${this.getMessage("snkFormConfig.alert.infoValidTitle")}
617
594
  `;
618
595
  ApplicationUtils.alert(title, message)
@@ -643,7 +620,7 @@ export class SnkFormConfig {
643
620
  field.group = newLabel;
644
621
  }
645
622
  });
646
- this.loadFields(this._sortableTimer);
623
+ this.loadFields();
647
624
  this.controlFieldConfig();
648
625
  this._formConfigChanged = true;
649
626
  }
@@ -857,14 +834,14 @@ export class SnkFormConfig {
857
834
  this._formConfigChanged = true;
858
835
  this.resetSortables();
859
836
  }
860
- controlRemoveFieldConfig(fieldConfig, updateTimer) {
837
+ controlRemoveFieldConfig(fieldConfig) {
861
838
  var _a;
862
839
  this._formConfigChanged = false;
863
840
  if (fieldConfig == undefined) {
864
841
  return;
865
842
  }
866
843
  this._formConfig.fields = (_a = this._formConfig.fields) === null || _a === void 0 ? void 0 : _a.filter((field) => field.name !== fieldConfig.name);
867
- this.loadFields(updateTimer);
844
+ this.loadFields();
868
845
  this.controlFieldConfig();
869
846
  this._formConfigChanged = true;
870
847
  this.resetSortables();
@@ -873,14 +850,14 @@ export class SnkFormConfig {
873
850
  this.controlSortableField();
874
851
  this.controlSortableGroup();
875
852
  }
876
- handleFieldConfigChange(evt, updateTimer = 0) {
853
+ handleFieldConfigChange(evt) {
877
854
  const { field: fieldConfig, type: actionType } = evt.detail;
878
855
  if (actionType === ACTION_CONFIG.configuration) {
879
856
  this.controlFieldConfig(fieldConfig);
880
857
  return;
881
858
  }
882
859
  if (actionType === ACTION_CONFIG.remove) {
883
- this.controlRemoveFieldConfig(fieldConfig, updateTimer);
860
+ this.controlRemoveFieldConfig(fieldConfig);
884
861
  return;
885
862
  }
886
863
  if (actionType === ACTION_CONFIG.add) {
@@ -901,7 +878,7 @@ export class SnkFormConfig {
901
878
  tab.label = newLabel;
902
879
  }
903
880
  });
904
- this.loadFields(this._sortableTimer);
881
+ this.loadFields();
905
882
  this.controlFieldConfig();
906
883
  this._formConfigChanged = true;
907
884
  }
@@ -921,7 +898,7 @@ export class SnkFormConfig {
921
898
  this._formConfig.tabs = (_a = this._formConfig.tabs) === null || _a === void 0 ? void 0 : _a.filter((tab) => {
922
899
  return tab.label !== tabSelected.detail.label;
923
900
  });
924
- this.loadFields(this._sortableTimer);
901
+ this.loadFields();
925
902
  this.controlFieldConfig();
926
903
  this._formConfigChanged = true;
927
904
  }
@@ -934,7 +911,7 @@ export class SnkFormConfig {
934
911
  tab.visible = !tab.visible;
935
912
  }
936
913
  });
937
- this.loadFields(this._sortableTimer);
914
+ this.loadFields();
938
915
  this.controlFieldConfig();
939
916
  this._formConfigChanged = true;
940
917
  }
@@ -978,7 +955,7 @@ export class SnkFormConfig {
978
955
  }), onEzAction: (evt) => this.controlSelectFormConfig(evt), id: "selectConfig" })), h("div", { class: "ez-col ez-col--sd-5 ez-col--tb-3 ez-align--middle ez-align--right" }, this._formConfigChanged === true && this._optionFormConfigChanged === false &&
979
956
  h("div", { class: "ez-row ez-align--middle ez-align--right" }, h("ez-button", { label: "Cancelar", class: "ez-padding-left--medium", size: "small", onClick: () => this.cancelChangeConfig() }), h("ez-button", { label: "Salvar", class: "ez-button--primary ez-padding-left--medium", size: "small", onClick: () => this.saveConfig() }, h("ez-icon", { class: "ez-margin-right--small", slot: "leftIcon", iconName: "save" }))), this._optionFormConfigChanged === true &&
980
957
  h("div", { class: "ez-row ez-align--middle ez-align--right" }, h("ez-button", { label: "Cancelar", class: "ez-padding-left--medium", size: "small", onClick: () => this.cancelChangeOptionConfig() }), h("ez-button", { label: this.getMessage("snkFormConfig.applyConfig"), class: "ez-button--primary ez-padding-left--medium", size: "small", onClick: () => this.applyOptionConfig() })))), h("div", { class: "ez-row ez-padding--medium", ref: ref => this._sortableContainer = ref }, h("div", { class: "form-config__tab-container ez-col ez-col--sd-9 ez-col--tb-9 ez-padding-right--medium" }, ((_b = this._layoutFormConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
981
- h("section", { class: "ez-box__container", ref: ref => this._formContainer = ref }, h("snk-tab-config", { ref: ref => this._tabConfig = ref, selectedIndex: this._tabSelected, messagesBuilder: this.messagesBuilder, onEzTabChange: (ev) => this.changeTabSelected(ev.detail), onEzOrderChange: (ev) => this.changeTabOrder(ev.detail), onEditionTitleTab: (ev) => this.changeTabLabel(ev), onDeleteTab: (ev) => this.handleDeleteTab(ev), onHideTab: (ev) => this.changeHideTab(ev), onCanStartDrag: () => this.handleCanStartDragTab() }, this._layoutFormConfig.map((tab) => h("snk-tab", { tabKey: tab.tab, label: tab.tab, visible: tab.visible }))), this._layoutFormConfig.map((tab, indexTab) => h("div", { id: "tab" + indexTab, "data-draggable-parent": "group", class: this._tabSelected === indexTab
958
+ h("section", { class: "ez-box__container", ref: ref => this._formContainer = ref }, h("snk-tab-config", { ref: ref => this._tabConfig = ref, selectedIndex: this._tabSelected, messagesBuilder: this.messagesBuilder, onEzTabChange: (ev) => this.changeTabSelected(ev.detail), onEzOrderChange: (ev) => this.changeTabOrder(ev.detail), onEditionTitleTab: (ev) => this.changeTabLabel(ev), onDeleteTab: (ev) => this.handleDeleteTab(ev), onHideTab: (ev) => this.changeHideTab(ev), onCanStartDrag: () => this.handleCanStartDragTab(), tabItems: this._layoutFormConfig.map((tab) => { return { tabKey: tab.tab, label: tab.tab, visible: tab.visible }; }) }), this._layoutFormConfig.map((tab, indexTab) => h("div", { id: "tab" + indexTab, "data-draggable-parent": "group", class: this._tabSelected === indexTab
982
959
  ? "form-config__tab-content ez-flex ez-flex--column ez-size-width--full ez-padding--medium"
983
960
  : "form-config__hide-content" }, tab.groups.map((group, indexGroup) => {
984
961
  if (group.group) {
@@ -13,6 +13,7 @@ export class SnkTabConfig {
13
13
  this.selectedIndex = undefined;
14
14
  this.selectedTab = undefined;
15
15
  this.tabs = undefined;
16
+ this.tabItems = undefined;
16
17
  this.messagesBuilder = undefined;
17
18
  }
18
19
  /**
@@ -120,7 +121,7 @@ export class SnkTabConfig {
120
121
  window.clearTimeout(this._scrollCallBackFocus);
121
122
  this._scrollCallBackFocus = window.setTimeout(() => {
122
123
  const tabtoscroll = this._scrollContainer.querySelector(`#tab${index}`);
123
- tabtoscroll.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
124
+ tabtoscroll === null || tabtoscroll === void 0 ? void 0 : tabtoscroll.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
124
125
  }, 200);
125
126
  }
126
127
  controlKeyEventEnter(evt) {
@@ -270,27 +271,18 @@ export class SnkTabConfig {
270
271
  }
271
272
  }
272
273
  componentWillRender() {
273
- if (this._processedTabs == undefined) {
274
- this._processedTabs = [];
275
- if (this.tabs) {
276
- this.tabs.split(",").forEach((label) => {
277
- label = label.trim();
278
- this._processedTabs.push({ label, tabKey: label, index: this._processedTabs.length });
279
- });
280
- }
281
- this._hostElem.querySelectorAll("snk-tab").forEach((elem) => {
282
- const tabKey = elem.getAttribute("tabKey");
283
- const label = elem.getAttribute("label") !== TAB_NAMES.main ? elem.getAttribute("label") : this.getMessage("snkFormConfig.form.mainArea");
284
- const visible = elem.hasAttribute("visible");
285
- const tab = { label, tabKey, index: this._processedTabs.length, visible };
286
- const content = elem.firstChild;
287
- if (content) {
288
- content.setAttribute("slot", "tab" + tab.index);
289
- this._hostElem.appendChild(content);
290
- }
291
- this._processedTabs.push(tab);
274
+ this._processedTabs = [];
275
+ if (this.tabs) {
276
+ this.tabs.split(",").forEach((label) => {
277
+ label = label.trim();
278
+ this._processedTabs.push({ label, tabKey: label, index: this._processedTabs.length });
292
279
  });
293
280
  }
281
+ this.tabItems.forEach((tab) => {
282
+ tab.label = tab.label !== TAB_NAMES.main ? tab.label : this.getMessage("snkFormConfig.form.mainArea");
283
+ tab.index = this._processedTabs.length;
284
+ this._processedTabs.push(tab);
285
+ });
294
286
  }
295
287
  componentDidRender() {
296
288
  this.updateScroll();
@@ -311,7 +303,7 @@ export class SnkTabConfig {
311
303
  this.selectedTab = tab.tabKey;
312
304
  this.selectedIndex = index;
313
305
  }
314
- return h("button", { id: tabId, class: `tab-config__tab${isSelected ? " tab-config__tab--is-active" : ""}`, onClick: () => this.handleTabClick(tab), onDblClick: () => { this._activeEditText = true; this._activeEditTextIndex = index; }, "data-draggable-element": index > 0 ? "tab" : "", onMouseLeave: () => this.onHideActions(index) }, (this._activeEditText === true && this._activeEditTextIndex === index && index > 0) ||
306
+ return h("button", { id: tabId, class: `tab-config__tab${isSelected ? " tab-config__tab--is-active" : ""}`, onClick: () => this.handleTabClick(tab), onDblClick: () => { this._activeEditText = true; this._activeEditTextIndex = index; }, "data-draggable-element": index > 0 ? "tab" : "", onMouseLeave: () => this.onHideActions(index), key: tab.label }, (this._activeEditText === true && this._activeEditTextIndex === index && index > 0) ||
315
307
  h(Fragment, null, index > 0 && h("ez-icon", { iconName: tab.leftIcon || "drag-indicator", class: "tab-config__left-icon" }), (tab.visible === false && index > 0) && h("ez-icon", { iconName: tab.leftIcon || "eye-off", class: "tab-config__left-icon tab-config__left-icon--eye-off" }), h("span", { class: "tab-config__tab-label" + (tab.visible === false && index > 0 ? " tab-config__tab-label-disabled" : ""), title: tab.label }, tab.label), index > 0 &&
316
308
  h("ez-actions-button", { class: "tab-config__actions-button", size: "small", ref: elem => this._refTabActions[index] = elem, actions: tab.visible === false ? this._actionsShow : this._actionsHide, isTransparent: true, arrowActive: true, onEzAction: (ev) => this.handleActions(ev, tab) }), h("slot", { name: tabId, onSlotchange: (ev) => { this.handleSlotChange(ev); } })), (this._activeEditText === true && index > 0 && this._activeEditTextIndex === index) &&
317
309
  h("ez-text-edit", { value: tab.label, styled: this.getStyledLabel(tabId), class: "tab-config__edit-text", onSaveEdition: (ev) => this.handleSaveEditionText(ev), onCancelEdition: () => this.cancelEditText() }));
@@ -382,6 +374,25 @@ export class SnkTabConfig {
382
374
  "attribute": "tabs",
383
375
  "reflect": false
384
376
  },
377
+ "tabItems": {
378
+ "type": "unknown",
379
+ "mutable": false,
380
+ "complexType": {
381
+ "original": "ITab[]",
382
+ "resolved": "ITab[]",
383
+ "references": {
384
+ "ITab": {
385
+ "location": "local"
386
+ }
387
+ }
388
+ },
389
+ "required": false,
390
+ "optional": false,
391
+ "docs": {
392
+ "tags": [],
393
+ "text": "Define o nome das abas do componente separadas por v\u00EDrgulas \",\"."
394
+ }
395
+ },
385
396
  "messagesBuilder": {
386
397
  "type": "unknown",
387
398
  "mutable": true,
@@ -57,6 +57,13 @@ export class SnkGrid {
57
57
  async setConfig(config) {
58
58
  this.setGridConfig(config);
59
59
  }
60
+ /**
61
+ * Faz o recarregamento da filter-bar da grade bascando o state no servidor.
62
+ */
63
+ async reloadFilterBar() {
64
+ var _a;
65
+ (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.reload();
66
+ }
60
67
  openGridConfig() {
61
68
  this._grid.getColumnsState()
62
69
  .then((gridColumns) => {
@@ -549,6 +556,22 @@ export class SnkGrid {
549
556
  "text": "Atribui o valor da configura\u00E7\u00E3o da grade.",
550
557
  "tags": []
551
558
  }
559
+ },
560
+ "reloadFilterBar": {
561
+ "complexType": {
562
+ "signature": "() => Promise<void>",
563
+ "parameters": [],
564
+ "references": {
565
+ "Promise": {
566
+ "location": "global"
567
+ }
568
+ },
569
+ "return": "Promise<void>"
570
+ },
571
+ "docs": {
572
+ "text": "Faz o recarregamento da filter-bar da grade bascando o state no servidor.",
573
+ "tags": []
574
+ }
552
575
  }
553
576
  };
554
577
  }
@@ -70,6 +70,13 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
70
70
  var _a;
71
71
  (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
72
72
  }
73
+ /**
74
+ * Faz o recarregamento da filter-bar do crud, bascando o state no servidor.
75
+ */
76
+ async reloadFilterBar() {
77
+ var _a;
78
+ (_a = this._snkGrid) === null || _a === void 0 ? void 0 : _a.reloadFilterBar();
79
+ }
73
80
  currentViewModeWatcher(currentView) {
74
81
  this._viewHistory = [...this._viewHistory.slice(-1), currentView];
75
82
  }
@@ -194,7 +201,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
194
201
  "_currentViewMode": [32],
195
202
  "goToView": [64],
196
203
  "openConfigurator": [64],
197
- "closeConfigurator": [64]
204
+ "closeConfigurator": [64],
205
+ "reloadFilterBar": [64]
198
206
  }]);
199
207
  function defineCustomElement$1() {
200
208
  if (typeof customElements === "undefined") {
@@ -24,20 +24,20 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
24
24
  (_b = (_a = this._searchElement) === null || _a === void 0 ? void 0 : _a['clearValue']) === null || _b === void 0 ? void 0 : _b.call(_a);
25
25
  }
26
26
  ezListChangeListener(evt) {
27
- var _a, _b, _c, _d;
28
- (_c = ((_a = this.config.value) !== null && _a !== void 0 ? _a : (_b = this.config.value) === null || _b === void 0 ? void 0 : _b.elements)) === null || _c === void 0 ? void 0 : _c.forEach(value => {
27
+ var _a, _b;
28
+ (_a = (this.getListConfigValue(this.config))) === null || _a === void 0 ? void 0 : _a.forEach(value => {
29
29
  var _a, _b;
30
30
  if (value && value.id === ((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.id)) {
31
31
  value.check = (_b = evt.detail) === null || _b === void 0 ? void 0 : _b.check;
32
32
  }
33
33
  });
34
34
  this.saveConfig.emit(this.config);
35
- this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
35
+ this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
36
36
  }
37
37
  loadListSource() {
38
- var _a, _b, _c, _d, _e, _f, _g, _h;
38
+ var _a;
39
39
  this._ezListSource = [];
40
- (_h = ((_e = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.elements) !== null && _e !== void 0 ? _e : (_g = (_f = this.config) === null || _f === void 0 ? void 0 : _f.value) === null || _g === void 0 ? void 0 : _g.members)) === null || _h === void 0 ? void 0 : _h.forEach(value => {
40
+ (_a = (this.getListConfigValue(this.config))) === null || _a === void 0 ? void 0 : _a.forEach(value => {
41
41
  if (value) {
42
42
  this._ezListSource.push({
43
43
  label: `${value.id} - ${value.label}`,
@@ -48,17 +48,17 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
48
48
  });
49
49
  }
50
50
  componentDidLoad() {
51
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
52
- let configValue = (_f = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.elements) !== null && _c !== void 0 ? _c : (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.value) === null || _e === void 0 ? void 0 : _e.members) !== null && _f !== void 0 ? _f : (_g = this.config) === null || _g === void 0 ? void 0 : _g.value;
51
+ var _a, _b, _c, _d, _e;
52
+ let configValue = this.getListConfigValue(this.config);
53
53
  let configValueArray = [];
54
54
  if (Array.isArray(configValue)) {
55
55
  configValueArray = configValue;
56
56
  }
57
57
  else {
58
- configValueArray.push((_j = (_h = this.config) === null || _h === void 0 ? void 0 : _h.value) === null || _j === void 0 ? void 0 : _j.members);
58
+ configValueArray.push((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.members);
59
59
  }
60
60
  this.config.value = configValueArray;
61
- this._entityName = (_m = (_l = (_k = this.config) === null || _k === void 0 ? void 0 : _k.props) === null || _l === void 0 ? void 0 : _l.searchContext) === null || _m === void 0 ? void 0 : _m.entity;
61
+ this._entityName = (_e = (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.searchContext) === null || _e === void 0 ? void 0 : _e.entity;
62
62
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
63
63
  this.loadListSource();
64
64
  }
@@ -77,10 +77,10 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
77
77
  return this._application.executePreparedSearch(mode, argument, options);
78
78
  }
79
79
  onEzSearchChange(evt) {
80
- var _a, _b, _c, _d, _e, _f, _g, _h;
81
- if (evt.detail != undefined && ((_e = ((_c = (_a = this.config.value) !== null && _a !== void 0 ? _a : (_b = this.config.value) === null || _b === void 0 ? void 0 : _b.elements) !== null && _c !== void 0 ? _c : (_d = this.config.value) === null || _d === void 0 ? void 0 : _d.members)) === null || _e === void 0 ? void 0 : _e.find(i => { var _a; return (i === null || i === void 0 ? void 0 : i.id) == ((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); })) === undefined) {
80
+ var _a, _b, _c, _d;
81
+ if (evt.detail != undefined && ((_a = (this.getListConfigValue(this.config))) === null || _a === void 0 ? void 0 : _a.find(i => { var _a; return (i === null || i === void 0 ? void 0 : i.id) == ((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); })) === undefined) {
82
82
  this.config = Object.assign(Object.assign({}, this.config), { value: [
83
- ...((_g = (_f = this.config) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : []),
83
+ ...((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : []),
84
84
  {
85
85
  id: evt.detail.value,
86
86
  check: true,
@@ -89,13 +89,17 @@ const SnkEntityList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
89
89
  ] });
90
90
  this.loadListSource();
91
91
  this.saveConfig.emit(this.config);
92
- this.valueChanged.emit((_h = this.config) === null || _h === void 0 ? void 0 : _h.value);
92
+ this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
93
93
  }
94
94
  }
95
95
  getMessage(key, params) {
96
96
  var _a;
97
97
  return (_a = this._application) === null || _a === void 0 ? void 0 : _a.messagesBuilder.getMessage(key, params);
98
98
  }
99
+ getListConfigValue(config) {
100
+ var _a, _b, _c, _d;
101
+ return (_d = (_b = (_a = config.value) === null || _a === void 0 ? void 0 : _a.elements) !== null && _b !== void 0 ? _b : (_c = config === null || config === void 0 ? void 0 : config.value) === null || _c === void 0 ? void 0 : _c.members) !== null && _d !== void 0 ? _d : config === null || config === void 0 ? void 0 : config.value;
102
+ }
99
103
  render() {
100
104
  var _a;
101
105
  return (h(Host, null, h("ez-search", { ref: elem => this._searchElement = elem, optionLoader: argument => this.optionLoader(argument), value: this._searchValue, label: (_a = this.config) === null || _a === void 0 ? void 0 : _a.label, onEzChange: evt => this.onEzSearchChange(evt) }), h("label", { class: "label" }, this.getMessage("snkEntityList.selected")), h("div", { style: this.maxHeightList ? { 'max-height': this.maxHeightList } : {}, class: { "snk-entity-list--overflow": !!this.maxHeightList } }, h("ez-list", { ref: (el) => this._ezList = el, id: "snkEntityList", listMode: "check", dataSource: this._ezListSource, hoverFeedback: true, itemSlotBuilder: this.rightListSlotBuilder, onEzCheckChange: evt => this.ezListChangeListener(evt) }))));
@@ -191,6 +191,12 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
191
191
  }
192
192
  this.processAfterUpdateConfig();
193
193
  }
194
+ /**
195
+ * Faz o recarregamento da filterbar bascando o state no servidor.
196
+ */
197
+ async reload() {
198
+ this.loadConfigFromStorage();
199
+ }
194
200
  componentDidLoad() {
195
201
  if (this._element) {
196
202
  const dataInfo = { dataUnit: this.dataUnit };
@@ -416,7 +422,8 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
416
422
  "filterConfig": [1040],
417
423
  "messagesBuilder": [1040],
418
424
  "allowDefault": [32],
419
- "scrollerLocked": [32]
425
+ "scrollerLocked": [32],
426
+ "reload": [64]
420
427
  }, [[0, "filterChange", "filterChangeListener"]]]);
421
428
  function defineCustomElement() {
422
429
  if (typeof customElements === "undefined") {