@sankhyalabs/sankhyablocks 2.1.3 → 2.1.5

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 (128) hide show
  1. package/dist/cjs/AuthorizationConfig-79ffae4b.js +7 -0
  2. package/dist/cjs/{form-config-fetcher-2de7c16a.js → ConfigStorage-c112de1d.js} +101 -1
  3. package/dist/cjs/{SnkMessageBuilder-89482d28.js → SnkMessageBuilder-61f00e7f.js} +33 -5
  4. package/dist/cjs/{constants-9056ca9e.js → constants-a47a5190.js} +15 -0
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  7. package/dist/cjs/snk-application.cjs.entry.js +30 -64
  8. package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
  9. package/dist/cjs/{snk-field-config_2.cjs.entry.js → snk-configurator_3.cjs.entry.js} +134 -13
  10. package/dist/cjs/snk-crud.cjs.entry.js +23 -6
  11. package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
  12. package/dist/cjs/{snk-configurator_6.cjs.entry.js → snk-filter-bar_7.cjs.entry.js} +498 -188
  13. package/dist/cjs/snk-form-config.cjs.entry.js +32 -26
  14. package/dist/cjs/snk-form.cjs.entry.js +30 -17
  15. package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
  16. package/dist/cjs/{taskbar-elements-d762e436.js → taskbar-elements-997af1c9.js} +9 -8
  17. package/dist/collection/collection-manifest.json +3 -2
  18. package/dist/collection/components/snk-application/snk-application.js +3 -2
  19. package/dist/collection/components/snk-configurator/AuthorizationConfig.js +5 -0
  20. package/dist/collection/components/snk-configurator/snk-configurator.css +124 -0
  21. package/dist/collection/components/snk-configurator/snk-configurator.js +126 -181
  22. package/dist/collection/components/snk-crud/snk-crud.js +23 -5
  23. package/dist/collection/components/snk-form/snk-form.js +37 -54
  24. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.css +1 -1
  25. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +48 -29
  26. package/dist/collection/components/snk-grid/snk-grid.js +69 -20
  27. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.css +166 -0
  28. package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +605 -0
  29. package/dist/collection/components/snk-grid/subcomponents/snk-select-box/snk-select-box.css +9 -0
  30. package/dist/collection/components/snk-grid/subcomponents/snk-select-box/snk-select-box.js +70 -0
  31. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +9 -8
  32. package/dist/collection/components/snk-taskbar/snk-taskbar.js +9 -1
  33. package/dist/collection/lib/configs/ConfigStorage.js +15 -15
  34. package/dist/collection/lib/message/SnkMessageBuilder.js +5 -3
  35. package/dist/collection/lib/message/resources/snk-configurator.msg.js +0 -3
  36. package/dist/collection/lib/message/resources/snk-form.msg.js +3 -0
  37. package/dist/collection/lib/message/resources/snk-grid.msg.js +26 -0
  38. package/dist/collection/lib/utils/constants.js +14 -0
  39. package/dist/components/AuthorizationConfig.js +7 -0
  40. package/dist/components/{form-config-fetcher.js → ConfigStorage.js} +100 -2
  41. package/dist/components/SnkMessageBuilder.js +33 -5
  42. package/dist/components/constants.js +15 -1
  43. package/dist/components/index.d.ts +2 -1
  44. package/dist/components/index.js +2 -1
  45. package/dist/components/snk-application2.js +2 -36
  46. package/dist/components/snk-configurator2.js +63 -165
  47. package/dist/components/snk-crud.js +53 -29
  48. package/dist/components/snk-form-config2.js +27 -21
  49. package/dist/components/snk-form2.js +33 -32
  50. package/dist/components/{snk-config-modal.d.ts → snk-grid-config.d.ts} +4 -4
  51. package/dist/components/snk-grid-config.js +6 -0
  52. package/dist/components/snk-grid-config2.js +497 -0
  53. package/dist/components/snk-grid2.js +65 -27
  54. package/dist/components/snk-select-box.d.ts +11 -0
  55. package/dist/components/snk-select-box.js +6 -0
  56. package/dist/components/snk-select-box2.js +38 -0
  57. package/dist/components/snk-taskbar2.js +19 -22
  58. package/dist/esm/AuthorizationConfig-dcbd207a.js +7 -0
  59. package/dist/esm/{form-config-fetcher-96c6c2dc.js → ConfigStorage-99025655.js} +100 -2
  60. package/dist/esm/{SnkMessageBuilder-a27fc561.js → SnkMessageBuilder-f5ef87df.js} +33 -5
  61. package/dist/esm/{constants-c6039d3d.js → constants-babe1a08.js} +15 -1
  62. package/dist/esm/loader.js +1 -1
  63. package/dist/esm/sankhyablocks.js +1 -1
  64. package/dist/esm/snk-application.entry.js +3 -37
  65. package/dist/esm/snk-config-options.entry.js +1 -1
  66. package/dist/esm/{snk-field-config_2.entry.js → snk-configurator_3.entry.js} +134 -14
  67. package/dist/esm/snk-crud.entry.js +23 -6
  68. package/dist/esm/snk-data-unit.entry.js +1 -1
  69. package/dist/esm/{snk-configurator_6.entry.js → snk-filter-bar_7.entry.js} +499 -190
  70. package/dist/esm/snk-form-config.entry.js +27 -21
  71. package/dist/esm/snk-form.entry.js +30 -17
  72. package/dist/esm/snk-tab-config.entry.js +1 -1
  73. package/dist/esm/{taskbar-elements-1092b0b7.js → taskbar-elements-a0a8b106.js} +9 -8
  74. package/dist/sankhyablocks/p-09720dd1.js +1 -0
  75. package/dist/sankhyablocks/p-105cd4a8.entry.js +1 -0
  76. package/dist/sankhyablocks/p-133cf71d.entry.js +1 -0
  77. package/dist/sankhyablocks/p-341b2ceb.entry.js +1 -0
  78. package/dist/sankhyablocks/p-395d5e42.entry.js +1 -0
  79. package/dist/sankhyablocks/{p-8706fe65.entry.js → p-43aff8f5.entry.js} +1 -1
  80. package/dist/sankhyablocks/p-53f33e9d.entry.js +1 -0
  81. package/dist/sankhyablocks/p-639b8f6e.entry.js +76 -0
  82. package/dist/sankhyablocks/{p-a5b26df2.js → p-6673c77c.js} +1 -1
  83. package/dist/sankhyablocks/p-6ba8f415.js +26 -0
  84. package/dist/sankhyablocks/{p-2517529d.js → p-877bd6cf.js} +1 -1
  85. package/dist/sankhyablocks/{p-f37cdeb5.entry.js → p-cd03ea9e.entry.js} +1 -1
  86. package/dist/sankhyablocks/p-dc36cfbf.js +1 -0
  87. package/dist/sankhyablocks/{p-92782503.entry.js → p-eb94df0b.entry.js} +1 -1
  88. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  89. package/dist/types/components/snk-application/snk-application.d.ts +0 -1
  90. package/dist/types/components/snk-configurator/AuthorizationConfig.d.ts +4 -0
  91. package/dist/types/components/snk-configurator/snk-configurator.d.ts +21 -24
  92. package/dist/types/components/snk-crud/snk-crud.d.ts +6 -0
  93. package/dist/types/components/snk-form/snk-form.d.ts +6 -9
  94. package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +7 -3
  95. package/dist/types/components/snk-grid/snk-grid.d.ts +13 -3
  96. package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +66 -0
  97. package/dist/types/components/snk-grid/subcomponents/snk-select-box/snk-select-box.d.ts +7 -0
  98. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +3 -4
  99. package/dist/types/components.d.ts +104 -74
  100. package/dist/types/lib/configs/ConfigStorage.d.ts +3 -3
  101. package/dist/types/lib/message/resources/snk-configurator.msg.d.ts +0 -1
  102. package/dist/types/lib/message/resources/snk-grid.msg.d.ts +2 -0
  103. package/dist/types/lib/utils/constants.d.ts +14 -0
  104. package/package.json +1 -1
  105. package/react/components.d.ts +2 -1
  106. package/react/components.js +2 -1
  107. package/react/components.js.map +1 -1
  108. package/dist/cjs/configurableElementsStorage-93459c72.js +0 -20
  109. package/dist/cjs/snk-config-modal.cjs.entry.js +0 -62
  110. package/dist/collection/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.js +0 -16
  111. package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.css +0 -122
  112. package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.js +0 -137
  113. package/dist/components/snk-config-modal.js +0 -6
  114. package/dist/components/snk-config-modal2.js +0 -91
  115. package/dist/esm/configurableElementsStorage-cdc144b5.js +0 -18
  116. package/dist/esm/snk-config-modal.entry.js +0 -58
  117. package/dist/sankhyablocks/p-361299e8.js +0 -26
  118. package/dist/sankhyablocks/p-429c5e3f.entry.js +0 -1
  119. package/dist/sankhyablocks/p-4fab64ec.js +0 -1
  120. package/dist/sankhyablocks/p-60eef7cd.entry.js +0 -1
  121. package/dist/sankhyablocks/p-626cf022.entry.js +0 -1
  122. package/dist/sankhyablocks/p-6511d132.entry.js +0 -1
  123. package/dist/sankhyablocks/p-8c14bbfb.entry.js +0 -76
  124. package/dist/sankhyablocks/p-c4ae984b.entry.js +0 -1
  125. package/dist/sankhyablocks/p-ce7c38a1.entry.js +0 -1
  126. package/dist/sankhyablocks/p-d50651a3.js +0 -1
  127. package/dist/types/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.d.ts +0 -8
  128. package/dist/types/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.d.ts +0 -38
@@ -12,7 +12,6 @@ export var TaskbarElement;
12
12
  TaskbarElement["SAVE"] = "SAVE";
13
13
  TaskbarElement["GRID_MODE"] = "GRID_MODE";
14
14
  TaskbarElement["FORM_MODE"] = "FORM_MODE";
15
- TaskbarElement["CONFIG_GRID"] = "CONFIG_GRID";
16
15
  TaskbarElement["MORE_OPTIONS"] = "MORE_OPTIONS";
17
16
  TaskbarElement["DIVIDER"] = "DIVIDER";
18
17
  TaskbarElement["CONFIGURATOR"] = "CONFIGURATOR";
@@ -23,11 +22,11 @@ export var AuthorizationElements;
23
22
  AuthorizationElements["CLONE"] = "CLONE";
24
23
  AuthorizationElements["REMOVE"] = "REMOVE";
25
24
  AuthorizationElements["INSERT"] = "INSERT";
26
- AuthorizationElements["CONFIG_GRID"] = "CONFIG_GRID";
25
+ AuthorizationElements["CONFIGURATOR"] = "CONFIGURATOR";
27
26
  })(AuthorizationElements || (AuthorizationElements = {}));
28
27
  export var VisibleWhenForbidden;
29
28
  (function (VisibleWhenForbidden) {
30
- VisibleWhenForbidden["CONFIG_GRID"] = "CONFIG_GRID";
29
+ VisibleWhenForbidden["CONFIGURATOR"] = "CONFIGURATOR";
31
30
  })(VisibleWhenForbidden || (VisibleWhenForbidden = {}));
32
31
  export const buildCustomButton = (def, className, action, isEnabled) => {
33
32
  const { hint, text, iconName } = def;
@@ -43,7 +42,7 @@ export const buildCustomButton = (def, className, action, isEnabled) => {
43
42
  return textButton(def.name, className, text, hint, action, isEnabled);
44
43
  }
45
44
  };
46
- export const buildElem = (element, className, getTitle, action, isEnabled, actions, configName) => {
45
+ export const buildElem = (element, className, getTitle, action, isEnabled, actions) => {
47
46
  const title = getTitle(element);
48
47
  switch (element) {
49
48
  case TaskbarElement.PREVIOUS:
@@ -69,9 +68,9 @@ export const buildElem = (element, className, getTitle, action, isEnabled, actio
69
68
  case TaskbarElement.FORM_MODE:
70
69
  return iconButton("list", element, className, title, action, isEnabled);
71
70
  case TaskbarElement.CONFIGURATOR:
72
- return configButton(element, className, getTitle, action, isEnabled, configName);
71
+ return iconButton("settings-inverted", element, className, title, action, isEnabled);
73
72
  case TaskbarElement.MORE_OPTIONS:
74
- return actions && actions.length > 0 ? h("ez-actions-button", { title: title, size: "small", class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions }) : undefined;
73
+ return actionButton(element, className, title, action, isEnabled, actions);
75
74
  case TaskbarElement.DIVIDER:
76
75
  return h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-horizontal--medium", "data-taskbar-divider": true });
77
76
  }
@@ -85,6 +84,8 @@ function iconButton(iconName, name, className, title, action, isEnabled) {
85
84
  function iconTextButton(iconName, name, className, text, title, action, isEnabled) {
86
85
  return h("ez-button", { name: iconName, title: title, label: text, size: "small", class: className, enabled: isEnabled(name), onClick: () => action(name) }, h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
87
86
  }
88
- function configButton(element, className, getTitle, action, isEnabled, configName) {
89
- return h("snk-configurator", { key: "configurator", configName: configName, title: getTitle(element), class: className, enabled: isEnabled(element), onChangeViewMode: (evt) => action(evt === null || evt === void 0 ? void 0 : evt.detail) });
87
+ function actionButton(element, className, title, action, isEnabled, actions) {
88
+ return actions && actions.length > 0
89
+ ? h("ez-actions-button", { title: title, size: "small", arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
90
+ : undefined;
90
91
  }
@@ -1,5 +1,6 @@
1
1
  import { ApplicationContext } from '@sankhyalabs/core';
2
2
  import { h, Host } from '@stencil/core';
3
+ import { AuthorizationConfig } from '../snk-configurator/AuthorizationConfig';
3
4
  import { TaskbarElement, buildElem, AuthorizationElements, buildCustomButton, VisibleWhenForbidden } from './elements/taskbar-elements';
4
5
  export class SnkTaskbar {
5
6
  constructor() {
@@ -36,6 +37,13 @@ export class SnkTaskbar {
36
37
  return elements;
37
38
  }
38
39
  isAllowed(buttonName) {
40
+ if (buttonName === AuthorizationElements.CONFIGURATOR) {
41
+ return this._permissions
42
+ ? this._permissions.isSup
43
+ || this._permissions[AuthorizationConfig.CONFIG_GRID]
44
+ || this._permissions[AuthorizationConfig.CONFIG]
45
+ : false;
46
+ }
39
47
  if (AuthorizationElements[buttonName]) {
40
48
  return this._permissions ? this._permissions.isSup || this._permissions[buttonName] : false;
41
49
  }
@@ -100,7 +108,7 @@ export class SnkTaskbar {
100
108
  className += "ez-padding-left--medium";
101
109
  }
102
110
  if (TaskbarElement[def.toString()]) {
103
- return buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList, this.configName);
111
+ return buildElem(def, className, elem => this.getTitle(elem), elem => this.elementClick(elem), elem => this.isEnabled(elem), this.actionsList);
104
112
  }
105
113
  else {
106
114
  return buildCustomButton(def, className, elem => this.elementClick(elem), elem => this.isEnabled(elem));
@@ -14,38 +14,38 @@ export class ConfigStorage {
14
14
  application.getResourceID().then((resourceID) => {
15
15
  const configName = application.configName;
16
16
  ConfigStorage.resourceID = resourceID;
17
- ConfigStorage.loadFormConfig(configName);
18
- ConfigStorage.loadGridConfig(configName);
17
+ ConfigStorage.instance.loadFormConfig(configName);
18
+ ConfigStorage.instance.loadGridConfig(configName);
19
19
  });
20
20
  }
21
21
  }
22
22
  return this.instance;
23
23
  }
24
- static async loadFormConfig(name) {
24
+ async loadFormConfig(name) {
25
25
  if (name == undefined) {
26
26
  return;
27
27
  }
28
- const cacheID = this.getCacheID(name, CONFIG_SOURCE.form);
29
- if (!this.configById.has(cacheID)) {
30
- this.configById.set(cacheID, this.formConfigFetcher.loadFormConfig(name, this.resourceID));
28
+ const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form);
29
+ if (!ConfigStorage.configById.has(cacheID)) {
30
+ ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, ConfigStorage.resourceID));
31
31
  }
32
- return this.configById.get(cacheID);
32
+ return ConfigStorage.configById.get(cacheID);
33
33
  }
34
- static async loadGridConfig(name) {
34
+ async loadGridConfig(name) {
35
35
  if (name == undefined) {
36
36
  return;
37
37
  }
38
- const cacheID = this.getCacheID(name, CONFIG_SOURCE.grid);
39
- if (!this.configById.has(cacheID)) {
40
- this.configById.set(cacheID, this.gridConfigFetcher.getConfig(name, this.resourceID));
38
+ const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid);
39
+ if (!ConfigStorage.configById.has(cacheID)) {
40
+ ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, ConfigStorage.resourceID));
41
41
  }
42
- return this.configById.get(cacheID);
42
+ return ConfigStorage.configById.get(cacheID);
43
43
  }
44
44
  static async saveFormConfig(config, name) {
45
45
  if (config == undefined || name == undefined) {
46
46
  return;
47
47
  }
48
- const cacheID = this.getCacheID(name, CONFIG_SOURCE.form);
48
+ const cacheID = this.buildCacheID(name, CONFIG_SOURCE.form);
49
49
  this.configById.delete(cacheID);
50
50
  return this.formConfigFetcher.saveConfig(config, name, this.resourceID);
51
51
  }
@@ -53,11 +53,11 @@ export class ConfigStorage {
53
53
  if (config == undefined || name == undefined) {
54
54
  return;
55
55
  }
56
- const cacheID = this.getCacheID(name, CONFIG_SOURCE.grid);
56
+ const cacheID = this.buildCacheID(name, CONFIG_SOURCE.grid);
57
57
  this.configById.delete(cacheID);
58
58
  return this.gridConfigFetcher.saveConfig(config, this.resourceID);
59
59
  }
60
- static getCacheID(name, source) {
60
+ static buildCacheID(name, source) {
61
61
  return `req_${source}_${name}_${this.resourceID}`;
62
62
  }
63
63
  }
@@ -3,7 +3,8 @@ import snkFilterBarMessages from "./resources/snk-filter-bar.msg.js";
3
3
  import snkTaskbarMessages from "./resources/snk-taskbar.msg.js";
4
4
  import crudUtilsMessages from "./resources/crud-utils.msg.js";
5
5
  import { snkFormMessages, snkFormConfigMessages, snkConfigOptionsMessages, snkFieldConfigMessages, snkTabConfigMessages } from "./resources/snk-form.msg.js";
6
- import { snkConfiguratorMessages, snkConfigModalMessages } from "./resources/snk-configurator.msg.js";
6
+ import { snkConfiguratorMessages } from "./resources/snk-configurator.msg.js";
7
+ import { snkGridMessages, snkGridConfigMessages } from "./resources/snk-grid.msg.js";
7
8
  export class SnkMessageBuilder {
8
9
  constructor() {
9
10
  this._defaults = {
@@ -12,12 +13,13 @@ export class SnkMessageBuilder {
12
13
  snkFormConfig: snkFormConfigMessages,
13
14
  snkConfigOptions: snkConfigOptionsMessages,
14
15
  snkTaskbar: snkTaskbarMessages,
15
- snkConfigModal: snkConfigModalMessages,
16
16
  snkFieldConfig: snkFieldConfigMessages,
17
17
  snkFilterBar: snkFilterBarMessages,
18
18
  snkConfigurator: snkConfiguratorMessages,
19
19
  snkTabConfig: snkTabConfigMessages,
20
- crudUtils: crudUtilsMessages
20
+ crudUtils: crudUtilsMessages,
21
+ snkGrid: snkGridMessages,
22
+ snkGridConfig: snkGridConfigMessages
21
23
  };
22
24
  this._currentOperation = OperationMap.CLEAN;
23
25
  this.loadAppMessages().then((msgs) => {
@@ -1,7 +1,4 @@
1
1
  export const snkConfiguratorMessages = {
2
- msgSaveSuccessfully: "As configurações foram salvas com sucesso!"
3
- };
4
- export const snkConfigModalMessages = {
5
2
  titleConfigurations: "Configurações",
6
3
  subTitleModeConfig: "Modo de visualização",
7
4
  labelConfigGrid: "Configurar grade",
@@ -52,6 +52,9 @@ export const snkFormConfigMessages = {
52
52
  titleGroupExists: "Já existe um grupo com título",
53
53
  infoValidTitle: "Por favor, digite um título válido.",
54
54
  inTab: "na aba"
55
+ },
56
+ info: {
57
+ successfullyConfigSaved: "As configurações foram salvas com sucesso!"
55
58
  }
56
59
  };
57
60
  export const snkFieldConfigMessages = {
@@ -0,0 +1,26 @@
1
+ export const snkGridMessages = {};
2
+ export const snkGridConfigMessages = {
3
+ gridConfiguration: "Configuração da Grade",
4
+ columnVisibilityOrder: "Defina visibilidade e ordem das colunas.",
5
+ sortingSequence: "Sequência da ordenação",
6
+ findColumn: "Localizar coluna",
7
+ cancel: "Cancelar",
8
+ complete: "Concluir",
9
+ tab: {
10
+ columns: "Colunas",
11
+ lineOrdering: "Ordenação das linhas",
12
+ },
13
+ info: {
14
+ successfullyConfigSaved: "As configurações foram salvas com sucesso!"
15
+ },
16
+ confirm: {
17
+ cancel: "Descartar",
18
+ save: "Salvar",
19
+ alert: "Aviso",
20
+ msgCancel: "As alterações realizadas serão descartadas. Gostaria de salvar antes de sair?"
21
+ },
22
+ group: {
23
+ visible: "Visíveis",
24
+ hidden: "Ocultas"
25
+ }
26
+ };
@@ -70,3 +70,17 @@ export const TAGS_BY_TYPE = {
70
70
  INTEGERNUMBER: "ez-number-input",
71
71
  DECIMALNUMBER: "ez-number-input"
72
72
  };
73
+ export const ORDER_VALUES = {
74
+ none: {
75
+ value: "NA",
76
+ label: "N/A",
77
+ },
78
+ asc: {
79
+ value: "ASC",
80
+ label: "A-Z"
81
+ },
82
+ desc: {
83
+ value: "DESC",
84
+ label: "Z-A"
85
+ }
86
+ };
@@ -0,0 +1,7 @@
1
+ var AuthorizationConfig;
2
+ (function (AuthorizationConfig) {
3
+ AuthorizationConfig["CONFIG_GRID"] = "CONFIG_GRID";
4
+ AuthorizationConfig["CONFIG"] = "CONFIG";
5
+ })(AuthorizationConfig || (AuthorizationConfig = {}));
6
+
7
+ export { AuthorizationConfig as A };
@@ -1,5 +1,5 @@
1
+ import { ErrorException, WarningException, StringUtils, ObjectUtils, ApplicationContext } from '@sankhyalabs/core';
1
2
  import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers.js';
2
- import { ErrorException, WarningException, StringUtils, ObjectUtils } from '@sankhyalabs/core';
3
3
 
4
4
  var browserPonyfill = createCommonjsModule(function (module, exports) {
5
5
  var global = typeof self !== 'undefined' ? self : commonjsGlobal;
@@ -6886,4 +6886,102 @@ var UserConfigType;
6886
6886
  UserConfigType["SHARED"] = "SHARED";
6887
6887
  })(UserConfigType || (UserConfigType = {}));
6888
6888
 
6889
- export { DataFetcher as D, FormConfigFetcher as F, ResourceFetcher as R, UrlUtils as U, UserConfigType as a, dist as d };
6889
+ class GridConfigFetcher extends ResourceFetcher {
6890
+ constructor() {
6891
+ super(...arguments);
6892
+ this.GRID_CONFIG_VERSION = "V3:";
6893
+ }
6894
+ getConfig(_gridName, resourceID) {
6895
+ const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
6896
+ return new Promise((resolve, reject) => {
6897
+ this.loadResource(completePath)
6898
+ .then(loadedResource => {
6899
+ let config = undefined;
6900
+ if (loadedResource) {
6901
+ config = JSON.parse(loadedResource);
6902
+ }
6903
+ resolve(config);
6904
+ }).catch((error) => {
6905
+ reject(error);
6906
+ });
6907
+ });
6908
+ }
6909
+ saveConfig(config, resourceID) {
6910
+ const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
6911
+ return new Promise((resolve, reject) => {
6912
+ this.saveResource(config, completePath)
6913
+ .then((resp) => {
6914
+ resolve(resp);
6915
+ })
6916
+ .catch((error) => {
6917
+ reject(error);
6918
+ });
6919
+ });
6920
+ }
6921
+ }
6922
+
6923
+ const CONFIG_SOURCE = {
6924
+ form: "form",
6925
+ grid: "grid"
6926
+ };
6927
+ class ConfigStorage {
6928
+ static get() {
6929
+ if (!ConfigStorage.instance) {
6930
+ const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
6931
+ if (application != undefined) {
6932
+ ConfigStorage.instance = new ConfigStorage();
6933
+ application.getResourceID().then((resourceID) => {
6934
+ const configName = application.configName;
6935
+ ConfigStorage.resourceID = resourceID;
6936
+ ConfigStorage.instance.loadFormConfig(configName);
6937
+ ConfigStorage.instance.loadGridConfig(configName);
6938
+ });
6939
+ }
6940
+ }
6941
+ return this.instance;
6942
+ }
6943
+ async loadFormConfig(name) {
6944
+ if (name == undefined) {
6945
+ return;
6946
+ }
6947
+ const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.form);
6948
+ if (!ConfigStorage.configById.has(cacheID)) {
6949
+ ConfigStorage.configById.set(cacheID, ConfigStorage.formConfigFetcher.loadFormConfig(name, ConfigStorage.resourceID));
6950
+ }
6951
+ return ConfigStorage.configById.get(cacheID);
6952
+ }
6953
+ async loadGridConfig(name) {
6954
+ if (name == undefined) {
6955
+ return;
6956
+ }
6957
+ const cacheID = ConfigStorage.buildCacheID(name, CONFIG_SOURCE.grid);
6958
+ if (!ConfigStorage.configById.has(cacheID)) {
6959
+ ConfigStorage.configById.set(cacheID, ConfigStorage.gridConfigFetcher.getConfig(name, ConfigStorage.resourceID));
6960
+ }
6961
+ return ConfigStorage.configById.get(cacheID);
6962
+ }
6963
+ static async saveFormConfig(config, name) {
6964
+ if (config == undefined || name == undefined) {
6965
+ return;
6966
+ }
6967
+ const cacheID = this.buildCacheID(name, CONFIG_SOURCE.form);
6968
+ this.configById.delete(cacheID);
6969
+ return this.formConfigFetcher.saveConfig(config, name, this.resourceID);
6970
+ }
6971
+ static async saveGridConfig(config, name) {
6972
+ if (config == undefined || name == undefined) {
6973
+ return;
6974
+ }
6975
+ const cacheID = this.buildCacheID(name, CONFIG_SOURCE.grid);
6976
+ this.configById.delete(cacheID);
6977
+ return this.gridConfigFetcher.saveConfig(config, this.resourceID);
6978
+ }
6979
+ static buildCacheID(name, source) {
6980
+ return `req_${source}_${name}_${this.resourceID}`;
6981
+ }
6982
+ }
6983
+ ConfigStorage.configById = new Map();
6984
+ ConfigStorage.formConfigFetcher = new FormConfigFetcher();
6985
+ ConfigStorage.gridConfigFetcher = new GridConfigFetcher();
6986
+
6987
+ export { ConfigStorage as C, DataFetcher as D, FormConfigFetcher as F, GridConfigFetcher as G, ResourceFetcher as R, UrlUtils as U, UserConfigType as a, dist as d };
@@ -130,6 +130,9 @@ const snkFormConfigMessages = {
130
130
  titleGroupExists: "Já existe um grupo com título",
131
131
  infoValidTitle: "Por favor, digite um título válido.",
132
132
  inTab: "na aba"
133
+ },
134
+ info: {
135
+ successfullyConfigSaved: "As configurações foram salvas com sucesso!"
133
136
  }
134
137
  };
135
138
  const snkFieldConfigMessages = {
@@ -145,9 +148,6 @@ const snkTabConfigMessages = {
145
148
  };
146
149
 
147
150
  const snkConfiguratorMessages = {
148
- msgSaveSuccessfully: "As configurações foram salvas com sucesso!"
149
- };
150
- const snkConfigModalMessages = {
151
151
  titleConfigurations: "Configurações",
152
152
  subTitleModeConfig: "Modo de visualização",
153
153
  labelConfigGrid: "Configurar grade",
@@ -156,6 +156,33 @@ const snkConfigModalMessages = {
156
156
  labelForm: "Formulário"
157
157
  };
158
158
 
159
+ const snkGridMessages = {};
160
+ const snkGridConfigMessages = {
161
+ gridConfiguration: "Configuração da Grade",
162
+ columnVisibilityOrder: "Defina visibilidade e ordem das colunas.",
163
+ sortingSequence: "Sequência da ordenação",
164
+ findColumn: "Localizar coluna",
165
+ cancel: "Cancelar",
166
+ complete: "Concluir",
167
+ tab: {
168
+ columns: "Colunas",
169
+ lineOrdering: "Ordenação das linhas",
170
+ },
171
+ info: {
172
+ successfullyConfigSaved: "As configurações foram salvas com sucesso!"
173
+ },
174
+ confirm: {
175
+ cancel: "Descartar",
176
+ save: "Salvar",
177
+ alert: "Aviso",
178
+ msgCancel: "As alterações realizadas serão descartadas. Gostaria de salvar antes de sair?"
179
+ },
180
+ group: {
181
+ visible: "Visíveis",
182
+ hidden: "Ocultas"
183
+ }
184
+ };
185
+
159
186
  class SnkMessageBuilder {
160
187
  constructor() {
161
188
  this._defaults = {
@@ -164,12 +191,13 @@ class SnkMessageBuilder {
164
191
  snkFormConfig: snkFormConfigMessages,
165
192
  snkConfigOptions: snkConfigOptionsMessages,
166
193
  snkTaskbar: snkTaskbarMessages,
167
- snkConfigModal: snkConfigModalMessages,
168
194
  snkFieldConfig: snkFieldConfigMessages,
169
195
  snkFilterBar: snkFilterBarMessages,
170
196
  snkConfigurator: snkConfiguratorMessages,
171
197
  snkTabConfig: snkTabConfigMessages,
172
- crudUtils: crudUtilsMessages
198
+ crudUtils: crudUtilsMessages,
199
+ snkGrid: snkGridMessages,
200
+ snkGridConfig: snkGridConfigMessages
173
201
  };
174
202
  this._currentOperation = OperationMap.CLEAN;
175
203
  this.loadAppMessages().then((msgs) => {
@@ -70,5 +70,19 @@ const TAGS_BY_TYPE = {
70
70
  INTEGERNUMBER: "ez-number-input",
71
71
  DECIMALNUMBER: "ez-number-input"
72
72
  };
73
+ const ORDER_VALUES = {
74
+ none: {
75
+ value: "NA",
76
+ label: "N/A",
77
+ },
78
+ asc: {
79
+ value: "ASC",
80
+ label: "A-Z"
81
+ },
82
+ desc: {
83
+ value: "DESC",
84
+ label: "Z-A"
85
+ }
86
+ };
73
87
 
74
- export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, TAGS_BY_TYPE as T, VIEW_MODE as V, VARS_BY_TYPE as a, TAB_NAMES as b, TYPE_ACTIONS as c };
88
+ export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, ORDER_VALUES as O, TAGS_BY_TYPE as T, VIEW_MODE as V, VARS_BY_TYPE as a, TAB_NAMES as b, TYPE_ACTIONS as c };
@@ -1,6 +1,5 @@
1
1
  /* sankhyablocks custom elements */
2
2
  export { SnkApplication as SnkApplication } from '../types/components/snk-application/snk-application';
3
- export { SnkConfigModal as SnkConfigModal } from '../types/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal';
4
3
  export { SnkConfigOptions as SnkConfigOptions } from '../types/components/snk-form/subcomponents/snk-config-options/snk-config-options';
5
4
  export { SnkConfigurator as SnkConfigurator } from '../types/components/snk-configurator/snk-configurator';
6
5
  export { SnkCrud as SnkCrud } from '../types/components/snk-crud/snk-crud';
@@ -21,7 +20,9 @@ export { SnkFilterText as SnkFilterText } from '../types/components/snk-filter-b
21
20
  export { SnkForm as SnkForm } from '../types/components/snk-form/snk-form';
22
21
  export { SnkFormConfig as SnkFormConfig } from '../types/components/snk-form/subcomponents/snk-form-config/snk-form-config';
23
22
  export { SnkGrid as SnkGrid } from '../types/components/snk-grid/snk-grid';
23
+ export { EzGridConfig as SnkGridConfig } from '../types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config';
24
24
  export { SnkPesquisa as SnkPesquisa } from '../types/components/snk-pesquisa/snk-pesquisa';
25
+ export { SelectBox as SnkSelectBox } from '../types/components/snk-grid/subcomponents/snk-select-box/snk-select-box';
25
26
  export { SnkTabConfig as SnkTabConfig } from '../types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config';
26
27
  export { SnkTaskbar as SnkTaskbar } from '../types/components/snk-taskbar/snk-taskbar';
27
28
  export { TestePesquisa as TestePesquisa } from '../types/components/teste-pesquisa/teste-pesquisa';
@@ -1,6 +1,5 @@
1
1
  export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
2
2
  export { SnkApplication, defineCustomElement as defineCustomElementSnkApplication } from './snk-application.js';
3
- export { SnkConfigModal, defineCustomElement as defineCustomElementSnkConfigModal } from './snk-config-modal.js';
4
3
  export { SnkConfigOptions, defineCustomElement as defineCustomElementSnkConfigOptions } from './snk-config-options.js';
5
4
  export { SnkConfigurator, defineCustomElement as defineCustomElementSnkConfigurator } from './snk-configurator.js';
6
5
  export { SnkCrud, defineCustomElement as defineCustomElementSnkCrud } from './snk-crud.js';
@@ -21,7 +20,9 @@ export { SnkFilterText, defineCustomElement as defineCustomElementSnkFilterText
21
20
  export { SnkForm, defineCustomElement as defineCustomElementSnkForm } from './snk-form.js';
22
21
  export { SnkFormConfig, defineCustomElement as defineCustomElementSnkFormConfig } from './snk-form-config.js';
23
22
  export { SnkGrid, defineCustomElement as defineCustomElementSnkGrid } from './snk-grid.js';
23
+ export { SnkGridConfig, defineCustomElement as defineCustomElementSnkGridConfig } from './snk-grid-config.js';
24
24
  export { SnkPesquisa, defineCustomElement as defineCustomElementSnkPesquisa } from './snk-pesquisa.js';
25
+ export { SnkSelectBox, defineCustomElement as defineCustomElementSnkSelectBox } from './snk-select-box.js';
25
26
  export { SnkTabConfig, defineCustomElement as defineCustomElementSnkTabConfig } from './snk-tab-config.js';
26
27
  export { SnkTaskbar, defineCustomElement as defineCustomElementSnkTaskbar } from './snk-taskbar.js';
27
28
  export { TestePesquisa, defineCustomElement as defineCustomElementTestePesquisa } from './teste-pesquisa.js';
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { WaitingChangeException, WarningException, ErrorException, ObjectUtils, DataType, DataUnit, StringUtils, ChangeOperation, DateUtils, DependencyType, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
3
- import { d as dist, D as DataFetcher, R as ResourceFetcher, U as UrlUtils, F as FormConfigFetcher } from './form-config-fetcher.js';
3
+ import { d as dist, D as DataFetcher, R as ResourceFetcher, U as UrlUtils, F as FormConfigFetcher, G as GridConfigFetcher, C as ConfigStorage } from './ConfigStorage.js';
4
4
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
6
6
  import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
@@ -547,40 +547,6 @@ class ParametersFetcher {
547
547
 
548
548
  const _0x5b7870=_0x2202;(function(_0x42e134,_0x5d9727){const _0x185c97=_0x2202,_0x5854c7=_0x42e134();while(!![]){try{const _0x129d35=parseInt(_0x185c97(0x18f))/0x1*(-parseInt(_0x185c97(0x183))/0x2)+-parseInt(_0x185c97(0x191))/0x3+parseInt(_0x185c97(0x17d))/0x4*(-parseInt(_0x185c97(0x185))/0x5)+parseInt(_0x185c97(0x184))/0x6*(-parseInt(_0x185c97(0x182))/0x7)+parseInt(_0x185c97(0x17b))/0x8+parseInt(_0x185c97(0x18c))/0x9+parseInt(_0x185c97(0x17f))/0xa;if(_0x129d35===_0x5d9727)break;else _0x5854c7['push'](_0x5854c7['shift']());}catch(_0x4becb4){_0x5854c7['push'](_0x5854c7['shift']());}}}(_0xdfb1,0x44ac7));function _0x2202(_0x2eac1f,_0x170d27){const _0xdfb1b4=_0xdfb1();return _0x2202=function(_0x2202d7,_0x224df5){_0x2202d7=_0x2202d7-0x17a;let _0x4d54a9=_0xdfb1b4[_0x2202d7];return _0x4d54a9;},_0x2202(_0x2eac1f,_0x170d27);}function _0xdfb1(){const _0x2b9dc4=['true','863GKWjmo','parse','56355fjjjAm','isSup','putAccess','4324480sjuCdS','hasOwnProperty','239748okvJLB','name','6055770tXeRaU','actions','forEach','7RPRvzn','1042CHxkUw','2988126NIwRMm','20MTNzmH','authorizationSf','item','string','hasAccess','isArray','Objeto\x20não\x20pode\x20ser\x20indefinido.','3071943fWslZp','parseFromJSON'];_0xdfb1=function(){return _0x2b9dc4;};return _0xdfb1();}class MGEAuthorization{[_0x5b7870(0x18d)](_0x37e96b){const _0x580407=_0x5b7870;_0x37e96b=utxt(_0x37e96b[_0x580407(0x186)]);typeof _0x37e96b==_0x580407(0x188)&&(_0x37e96b=JSON[_0x580407(0x190)](_0x37e96b));if(_0x37e96b==undefined)throw Error(_0x580407(0x18b));const _0x291d34=new MGEAuthorizationData(_0x37e96b[_0x580407(0x192)]==='S'||_0x37e96b[_0x580407(0x192)]===!![]);return Array[_0x580407(0x18a)](_0x37e96b[_0x580407(0x187)])&&_0x37e96b[_0x580407(0x187)][_0x580407(0x181)](_0x58a748=>_0x291d34['putAccess'](_0x58a748[_0x580407(0x17e)],String(_0x58a748['status'])==_0x580407(0x18e))),_0x291d34;}}class MGEAuthorizationData{constructor(_0x51ec5d){const _0x2c8472=_0x5b7870;this['isSup']=_0x51ec5d,this[_0x2c8472(0x180)]={};}[_0x5b7870(0x17a)](_0x5bd0f2,_0x2ef465){const _0x40d701=_0x5b7870;this[_0x40d701(0x180)][_0x5bd0f2]=_0x2ef465;}[_0x5b7870(0x189)](_0x4fd772){const _0x3707c1=_0x5b7870;if(this[_0x3707c1(0x192)])return !![];let _0x25e60a=!![];return this[_0x3707c1(0x180)][_0x3707c1(0x17c)](_0x4fd772)&&(_0x25e60a=this['actions'][_0x4fd772]),_0x25e60a;}['isUserSup'](){return this['isSup'];}}
549
549
 
550
- class GridConfigFetcher extends ResourceFetcher {
551
- constructor() {
552
- super(...arguments);
553
- this.GRID_CONFIG_VERSION = "V3:";
554
- }
555
- getConfig(_gridName, resourceID) {
556
- const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
557
- return new Promise((resolve, reject) => {
558
- this.loadResource(completePath)
559
- .then(loadedResource => {
560
- let config = undefined;
561
- if (loadedResource) {
562
- config = JSON.parse(loadedResource);
563
- }
564
- resolve(config);
565
- }).catch((error) => {
566
- reject(error);
567
- });
568
- });
569
- }
570
- saveConfig(config, resourceID) {
571
- const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
572
- return new Promise((resolve, reject) => {
573
- this.saveResource(config, completePath)
574
- .then((resp) => {
575
- resolve(resp);
576
- })
577
- .catch((error) => {
578
- reject(error);
579
- });
580
- });
581
- }
582
- }
583
-
584
550
  class AuthFetcher extends ResourceFetcher {
585
551
  getData(resourceID) {
586
552
  const completePath = `cfg://auth/${resourceID}`;
@@ -868,7 +834,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
868
834
  }
869
835
  /**
870
836
  * Retorna a configuração de um recurso por service broker
871
- * Veja também o método "loadConfig"
872
837
  */
873
838
  async getConfig(key) {
874
839
  let payload = {
@@ -1258,6 +1223,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1258
1223
  });
1259
1224
  }
1260
1225
  ErrorTracking.init();
1226
+ ConfigStorage.get();
1261
1227
  this.getDefaultValues().then((defaultValues) => {
1262
1228
  this._defaultValues = defaultValues;
1263
1229
  });