@sankhyalabs/sankhyablocks 1.4.0-beta.9 → 2.0.1

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 (75) hide show
  1. package/dist/cjs/{SnkMessageBuilder-6c2f7bcd.js → SnkMessageBuilder-89482d28.js} +8 -4
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/sankhyablocks.cjs.js +1 -1
  4. package/dist/cjs/snk-application.cjs.entry.js +39 -22
  5. package/dist/cjs/snk-config-modal.cjs.entry.js +1 -1
  6. package/dist/cjs/snk-configurator_6.cjs.entry.js +2 -2
  7. package/dist/cjs/snk-crud.cjs.entry.js +1 -1
  8. package/dist/cjs/snk-data-unit.cjs.entry.js +8 -2
  9. package/dist/cjs/snk-field-config_2.cjs.entry.js +6 -1
  10. package/dist/cjs/snk-form-config.cjs.entry.js +31 -20
  11. package/dist/cjs/snk-pesquisa.cjs.entry.js +2 -2
  12. package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
  13. package/dist/cjs/{taskbar-elements-9a4b1e19.js → taskbar-elements-90350a55.js} +2 -2
  14. package/dist/collection/components/snk-application/snk-application.js +27 -5
  15. package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.css +2 -2
  16. package/dist/collection/components/snk-data-unit/snk-data-unit.js +7 -1
  17. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
  18. package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +26 -1
  19. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.css +1 -1
  20. package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +31 -20
  21. package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.css +1 -1
  22. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +2 -2
  23. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +2 -2
  24. package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +15 -15
  25. package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +12 -1
  26. package/dist/collection/lib/message/resources/snk-data-unit.msg.js +5 -1
  27. package/dist/collection/lib/message/resources/snk-form.msg.js +3 -3
  28. package/dist/components/SnkMessageBuilder.js +8 -4
  29. package/dist/components/snk-application2.js +39 -21
  30. package/dist/components/snk-config-modal2.js +1 -1
  31. package/dist/components/snk-data-unit.js +7 -1
  32. package/dist/components/snk-field-config2.js +8 -2
  33. package/dist/components/snk-filter-modal2.js +1 -1
  34. package/dist/components/snk-form-config2.js +32 -21
  35. package/dist/components/snk-pesquisa2.js +2 -2
  36. package/dist/components/snk-tab-config2.js +1 -1
  37. package/dist/components/snk-taskbar2.js +2 -2
  38. package/dist/esm/{SnkMessageBuilder-5792c260.js → SnkMessageBuilder-a27fc561.js} +8 -4
  39. package/dist/esm/loader.js +1 -1
  40. package/dist/esm/sankhyablocks.js +1 -1
  41. package/dist/esm/snk-application.entry.js +39 -22
  42. package/dist/esm/snk-config-modal.entry.js +1 -1
  43. package/dist/esm/snk-configurator_6.entry.js +2 -2
  44. package/dist/esm/snk-crud.entry.js +1 -1
  45. package/dist/esm/snk-data-unit.entry.js +8 -2
  46. package/dist/esm/snk-field-config_2.entry.js +6 -1
  47. package/dist/esm/snk-form-config.entry.js +32 -21
  48. package/dist/esm/snk-pesquisa.entry.js +2 -2
  49. package/dist/esm/snk-tab-config.entry.js +1 -1
  50. package/dist/esm/{taskbar-elements-e2ed0536.js → taskbar-elements-0f41cd77.js} +2 -2
  51. package/dist/sankhyablocks/p-2517529d.js +1 -0
  52. package/dist/sankhyablocks/p-4c887c1f.entry.js +75 -0
  53. package/dist/sankhyablocks/p-59d8c47a.js +1 -0
  54. package/dist/sankhyablocks/p-60eef7cd.entry.js +1 -0
  55. package/dist/sankhyablocks/p-626cf022.entry.js +1 -0
  56. package/dist/sankhyablocks/{p-d1ac09c9.entry.js → p-92782503.entry.js} +1 -1
  57. package/dist/sankhyablocks/p-ac71ef38.entry.js +1 -0
  58. package/dist/sankhyablocks/{p-a17a4fca.entry.js → p-e128f747.entry.js} +1 -1
  59. package/dist/sankhyablocks/{p-366aa0f5.entry.js → p-e8591491.entry.js} +1 -1
  60. package/dist/sankhyablocks/p-eb23420d.entry.js +1 -0
  61. package/dist/sankhyablocks/{p-2284c850.entry.js → p-f37cdeb5.entry.js} +1 -1
  62. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  63. package/dist/types/components/snk-application/snk-application.d.ts +4 -0
  64. package/dist/types/components/snk-form/subcomponents/snk-field-config/snk-field-config.d.ts +6 -0
  65. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +3 -3
  66. package/dist/types/components.d.ts +12 -0
  67. package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +7 -7
  68. package/package.json +5 -5
  69. package/dist/sankhyablocks/p-1feabfc7.entry.js +0 -1
  70. package/dist/sankhyablocks/p-21c8929b.js +0 -1
  71. package/dist/sankhyablocks/p-36d2d9cf.entry.js +0 -75
  72. package/dist/sankhyablocks/p-6988f4a6.entry.js +0 -1
  73. package/dist/sankhyablocks/p-776ff4d1.entry.js +0 -1
  74. package/dist/sankhyablocks/p-7b4a4a50.entry.js +0 -1
  75. package/dist/sankhyablocks/p-d9fbb26f.js +0 -1
@@ -6,7 +6,7 @@
6
6
  --snk-config-modal__title--color: var(--title--primary, #2B3A54);
7
7
 
8
8
  /*@doc Define o estilo da fonte utilizada para o titulo do componente.*/
9
- --snk-config-modal__title--font-family: var(--font-pattern, "Sora");
9
+ --snk-config-modal__title--font-family: var(--font-pattern, "Roboto");
10
10
 
11
11
  /*@doc Define o tamanho da fonte utilizada para o titulo do componente.*/
12
12
  --snk-config-modal__title--font-size: var(--title--large, 20px);
@@ -18,7 +18,7 @@
18
18
  --snk-config-modal__subtitle--color: var(--title--primary, #2B3A54);
19
19
 
20
20
  /*@doc Define o estilo da fonte utilizada para o subtitulo do componente.*/
21
- --snk-config-modal__subtitle--font-family: var(--font-pattern, "Sora");
21
+ --snk-config-modal__subtitle--font-family: var(--font-pattern, "Roboto");
22
22
 
23
23
  /*@doc Define o tamanho da fonte utilizada para o subtitulo do componente.*/
24
24
  --snk-config-modal__subtitle--font-size: var(--text--medium, 14px);
@@ -167,8 +167,14 @@ export class SnkDataUnit {
167
167
  resolve(action);
168
168
  }
169
169
  else {
170
+ const options = {
171
+ canClose: false,
172
+ labelCancel: this.getMessage("snkDataUnit.confirm.cancel"),
173
+ labelConfirm: this.getMessage("snkDataUnit.confirm.delete"),
174
+ btnConfirmDanger: false
175
+ };
170
176
  const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
171
- ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, "delete", DialogType.CRITICAL, { btnConfirmDanger: true })
177
+ ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, null, DialogType.WARN, options)
172
178
  .then((result) => resolve(result ? action : undefined));
173
179
  }
174
180
  }
@@ -5,7 +5,7 @@ import { CheckMode } from "@sankhyalabs/ezui/dist/collection/utils";
5
5
  export class SnkFilterModal {
6
6
  updateValue(id, value = undefined) {
7
7
  this.items = this.items.map(item => {
8
- if (item.id === id) {
8
+ if (item.id === id && item.enabled) {
9
9
  if (value == undefined) {
10
10
  value = !item.active;
11
11
  }
@@ -30,6 +30,11 @@ export class SnkFieldConfig {
30
30
  getMessage(key) {
31
31
  return this._application.messagesBuilder.getMessage(key, {});
32
32
  }
33
+ isRequired() {
34
+ var _a, _b;
35
+ const fieldMD = this.dataUnit && this.dataUnit.getField((_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.name);
36
+ return (fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.required) === true || ((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.required) === true;
37
+ }
33
38
  componentWillLoad() {
34
39
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
35
40
  }
@@ -37,7 +42,7 @@ export class SnkFieldConfig {
37
42
  if (this.fieldConfig == undefined) {
38
43
  return;
39
44
  }
40
- return (h(Host, null, h("div", { class: "field-config" }, h("div", { class: "field-config__draggable" }, h("ez-icon", { iconName: "drag-indicator", size: "small" })), h("div", null, this.fieldConfig.label, this.fieldConfig.required && h("span", { class: "field-config__required-label" }, "*")), this.modeInsertion ?
45
+ return (h(Host, null, h("div", { class: "field-config" }, h("div", { class: "field-config__draggable" }, h("ez-icon", { iconName: "drag-indicator", size: "small" })), h("div", null, this.fieldConfig.label, this.isRequired() && h("span", { class: "field-config__required-label" }, "*")), this.modeInsertion ?
41
46
  h("div", { class: "field-config__add" }, h("ez-button", { onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.add), mode: "icon", class: "ez-button--tertiary", iconName: "plus", size: "large", title: this.getMessage("snkFieldConfig.titleAdd") })) :
42
47
  h("div", { class: "field-config__options" + (this.isConfigActive ? " field-config__options--is-active" : " ") }, h("ez-button", { mode: "icon", class: "ez-button--tertiary field-config__remove-icon", onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.remove), iconName: "minus", size: "large", title: this.getMessage("snkFieldConfig.titleRemove") }), h("ez-button", { id: "buttonConfig_" + this.fieldConfig.name, mode: "icon", class: "ez-button--tertiary", onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.configuration), iconName: this.isConfigActive ? "chevron-up" : "settings-inverted", size: "large", title: this.getMessage("snkFieldConfig.titleConfigurations") }))), this.isConfigActive && h("div", { class: "field-config__config-popover" }, h("div", { class: "field-config__config-outer-arrow" }, h("div", { class: "field-config__config-inner-arrow" })))));
43
48
  }
@@ -112,6 +117,26 @@ export class SnkFieldConfig {
112
117
  "attribute": "mode-insertion",
113
118
  "reflect": true,
114
119
  "defaultValue": "true"
120
+ },
121
+ "dataUnit": {
122
+ "type": "unknown",
123
+ "mutable": false,
124
+ "complexType": {
125
+ "original": "DataUnit",
126
+ "resolved": "DataUnit",
127
+ "references": {
128
+ "DataUnit": {
129
+ "location": "import",
130
+ "path": "@sankhyalabs/core"
131
+ }
132
+ }
133
+ },
134
+ "required": false,
135
+ "optional": false,
136
+ "docs": {
137
+ "tags": [],
138
+ "text": "Reposit\u00F3rio de dados, controla a manipula\u00E7\u00E3o dos dados"
139
+ }
115
140
  }
116
141
  };
117
142
  }
@@ -1,7 +1,7 @@
1
1
  :host {
2
2
  /* Título */
3
3
  /*@doc Define o estilo da mensagem exibida no título.*/
4
- --snk-form-config__title--font-pattern: var(--font-pattern, "'Sora', 'Algerian'");
4
+ --snk-form-config__title--font-pattern: var(--font-pattern, "Roboto");
5
5
  /*@doc Define o peso do título.*/
6
6
  --snk-form-config__title--weight--large: var(--text-weight--large, 600);
7
7
 
@@ -2,7 +2,7 @@ import { h, Host } from "@stencil/core";
2
2
  import { Sortable } from '@shopify/draggable';
3
3
  import { ApplicationContext, ObjectUtils, ArrayUtils } from '@sankhyalabs/core';
4
4
  import { ApplicationUtils, DialogType } from "@sankhyalabs/ezui/dist/collection/utils";
5
- import { ACTION_CONFIG, CONFIG_EVENTS, TAB_NAMES } from "../../../../lib/utils/constants";
5
+ import { ACTION_CONFIG, CONFIG_EVENTS, DEFAULT_TYPE, TAB_NAMES } from "../../../../lib/utils/constants";
6
6
  import { UserConfigType } from "../../../../lib/http/data-fetcher/fetchers/form-config-fetcher";
7
7
  const CONTAINER_ID = {
8
8
  collapsibleBox: "EZ-COLLAPSIBLE-BOX",
@@ -121,19 +121,30 @@ export class SnkFormConfig {
121
121
  const snkFieldConfigs = this._formContainer.querySelectorAll('snk-field-config');
122
122
  snkFieldConfigs.forEach((snkField) => {
123
123
  const fieldConfig = snkField.fieldConfig;
124
- if (fieldConfig) {
125
- const fieldToSave = {
126
- cleanOnCopy: fieldConfig.cleanOnCopy || false,
127
- group: fieldConfig.group,
128
- label: fieldConfig.label,
129
- name: fieldConfig.name,
130
- required: fieldConfig.required,
131
- readOnly: fieldConfig.readOnly,
132
- tab: fieldConfig.tab,
133
- defaultValue: fieldConfig.defaultValue
134
- };
135
- fields.push(fieldToSave);
124
+ if (fieldConfig == undefined) {
125
+ return;
136
126
  }
127
+ const fieldToSave = {
128
+ cleanOnCopy: fieldConfig.cleanOnCopy || false,
129
+ group: fieldConfig.group,
130
+ label: fieldConfig.label,
131
+ name: fieldConfig.name,
132
+ required: fieldConfig.required,
133
+ readOnly: fieldConfig.readOnly,
134
+ tab: fieldConfig.tab
135
+ };
136
+ if (fieldConfig.defaultValue != undefined) {
137
+ if (fieldConfig.defaultValue.type == undefined) {
138
+ fieldToSave.defaultValue = {
139
+ type: DEFAULT_TYPE.fixed,
140
+ value: fieldConfig.defaultValue
141
+ };
142
+ }
143
+ else {
144
+ fieldToSave.defaultValue = fieldConfig.defaultValue;
145
+ }
146
+ }
147
+ fields.push(fieldToSave);
137
148
  });
138
149
  return fields;
139
150
  }
@@ -210,8 +221,8 @@ export class SnkFormConfig {
210
221
  var _a;
211
222
  return ((_a = group.fields) === null || _a === void 0 ? void 0 : _a.length) ? group.fields.map((field) => {
212
223
  var _a, _b;
213
- return h("div", { key: field.name, class: this.getFieldConfigStyle(field), "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, modeInsertion: false, fieldConfig: field, isConfigActive: ((_a = this._fieldConfigSelected) === null || _a === void 0 ? void 0 : _a.name) === field.name }), ((_b = this._fieldConfigSelected) === null || _b === void 0 ? void 0 : _b.name) === field.name &&
214
- h("div", { class: "ez-flex form-config__config-options" }, h("snk-config-options", { idConfig: field.name, dataUnit: this.dataUnit, fieldConfig: this._fieldConfigSelected, onConfigOptionsChanged: (ev) => this.handleconfigOptionsChanged(ev.detail) })));
224
+ return h("div", { key: field.name, class: this.getFieldConfigStyle(field), "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { 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 }), ((_b = this._fieldConfigSelected) === null || _b === void 0 ? void 0 : _b.name) === field.name &&
225
+ h("div", { class: "ez-flex form-config__config-options" }, h("snk-config-options", { idConfig: field.name, dataUnit: this.dataUnit, fieldConfig: this._fieldConfigSelected, onConfigOptionsChanged: (evt) => this.handleconfigOptionsChanged(evt.detail) })));
215
226
  }) : 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")))));
216
227
  }
217
228
  handleconfigOptionsChanged(fieldEdited) {
@@ -863,13 +874,13 @@ export class SnkFormConfig {
863
874
  handleDeleteTab(tabSelected) {
864
875
  let options = {
865
876
  canClose: false,
866
- labelCancel: this.getMessage("snkFormConfig.confirm.labelNo"),
867
- labelConfirm: this.getMessage("snkFormConfig.confirm.labelYes"),
877
+ labelCancel: this.getMessage("snkFormConfig.confirm.labelCancel"),
878
+ labelConfirm: this.getMessage("snkFormConfig.confirm.labelDelete"),
868
879
  btnConfirmDanger: false
869
880
  };
870
881
  const title = this.getMessage("snkFormConfig.confirm.title");
871
- const deleteTab = this.getMessage("snkFormConfig.confirm.deleteTab");
872
- ApplicationUtils.confirm(title, `${deleteTab} <b>${tabSelected.detail.label}</b>?`, "delete", DialogType.WARN, options)
882
+ const deleteTab = this.getMessage("snkFormConfig.confirm.deleteTab") + ` <b>${tabSelected.detail.label}</b>?`;
883
+ ApplicationUtils.confirm(title, deleteTab, null, DialogType.WARN, options)
873
884
  .then(response => {
874
885
  var _a;
875
886
  if (response) {
@@ -939,7 +950,7 @@ export class SnkFormConfig {
939
950
  return h("div", { class: "ez-flex ez-flex--column ez-size-width--full" }, h("label", { class: "ez-text ez-text--secondary ez-margin-vertical--small" }, this.getMessage("snkFormConfig.form.subTitleInfo")), h("div", { id: CONTAINER_ID.withoutGroup, class: "ez-row", "data-draggable-parent": "field" }, this.getFieldsByGroup(group)), h("hr", { class: "ez-divider-horizontal ez-margin-vertical--medium" }));
940
951
  }
941
952
  }), this.renderTempGroupByTab(tab.tab))), h("div", { class: "form-config__btn-add-group ez-row" }, h("div", { class: "form-config__btn-add-group-container ez-col ez-col--sd-12 ez-col--tb-12 ez-align--center" }, h("ez-button", { label: this.getMessage("snkFormConfig.form.labelNewGroup"), class: "ez-padding-horizontal--small ez-button--primary", size: "small", onClick: () => this.addNewGroup() }, h("ez-icon", { class: "ez-margin-right--small", slot: "leftIcon", iconName: "plus" })))))), h("div", { class: "form-config__fields-available ez-col ez-col--sd-3 ez-col--tb-3" }, h("section", { class: "ez-box__container ez-col ez-col--pn-12" }, h("h1", { class: "ez-title ez-title--large ez-title--primary ez-padding-bottom--medium" }, this.getMessage("snkFormConfig.availableFields.title")), h("ez-filter-input", { ref: ref => this._filterFieldsAvailable = ref, label: this.getMessage("snkFormConfig.availableFields.labelSearchField"), onEzChange: evt => this.onFilterChange(evt.detail) }), h("span", { class: "ez-box__label-counter ez-text ez-text--medium ez-text--primary ez-margin-bottom--medium" }, this.handleLabelCounter((_c = this._fieldsAvailable) === null || _c === void 0 ? void 0 : _c.length)), ((_d = this._layoutFormConfig) === null || _d === void 0 ? void 0 : _d.length) > 0 &&
942
- h("div", { id: CONTAINER_ID.fieldsAvailable, class: "ez-row", "data-draggable-parent": "field" }, this.orderFieldsAvailable(this._fieldsAvailable).map((field) => h("div", { key: field.name, class: this._fieldsAvailableStyle, "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, fieldConfig: field })))))))));
953
+ h("div", { id: CONTAINER_ID.fieldsAvailable, class: "ez-row", "data-draggable-parent": "field" }, this.orderFieldsAvailable(this._fieldsAvailable).map((field) => h("div", { key: field.name, class: this._fieldsAvailableStyle, "data-draggable-element": "field", onMouseDown: (evt) => this.controlMoveField(evt) }, h("snk-field-config", { onEzClickIcon: (evt) => { this.handleFieldConfigChange(evt); }, dataUnit: this.dataUnit, fieldConfig: field })))))))));
943
954
  }
944
955
  static get is() { return "snk-form-config"; }
945
956
  static get encapsulation() { return "scoped"; }
@@ -64,7 +64,7 @@
64
64
 
65
65
  /*public*/
66
66
  color: var(--text--primary, #626e82);
67
- font-family: var(--font-pattern, "Sora, Algerian");
67
+ font-family: var(--font-pattern, "Roboto");
68
68
  font-size: var(--title--small, 14px);
69
69
  padding: var(--space--small, 6px) var(--space--medium, 12px);
70
70
  }
@@ -54,7 +54,7 @@ export class SnkPesquisa {
54
54
  resp = ObjectUtils.stringToObject(resp.json.$);
55
55
  let descriptionField = resp.descriptionField;
56
56
  let pkField = resp.pkField;
57
- if (descriptionField && pkField) {
57
+ if (pkField) {
58
58
  let newItemList = [];
59
59
  resp.data.forEach((item) => {
60
60
  var _a;
@@ -62,7 +62,7 @@ export class SnkPesquisa {
62
62
  let fields = this.buildFirstFields(item['__matchFields'], fieldsMetadata);
63
63
  let exibitionItem = {
64
64
  key: this.highlightValue(item['__matchFields'], (_a = item[pkField]) === null || _a === void 0 ? void 0 : _a.toString(), fields, true),
65
- title: this.highlightValue(item['__matchFields'], item[descriptionField], fields, true),
65
+ title: descriptionField ? this.highlightValue(item['__matchFields'], item[descriptionField], fields, true) : "",
66
66
  details: this.buildDetails(fields, item)
67
67
  };
68
68
  newItemList.push(exibitionItem);
@@ -12,6 +12,7 @@ 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";
15
16
  TaskbarElement["MORE_OPTIONS"] = "MORE_OPTIONS";
16
17
  TaskbarElement["DIVIDER"] = "DIVIDER";
17
18
  TaskbarElement["CONFIGURATOR"] = "CONFIGURATOR";
@@ -22,12 +23,11 @@ export var AuthorizationElements;
22
23
  AuthorizationElements["CLONE"] = "CLONE";
23
24
  AuthorizationElements["REMOVE"] = "REMOVE";
24
25
  AuthorizationElements["INSERT"] = "INSERT";
25
- AuthorizationElements["CONFIGURATOR"] = "CONFIGURATOR";
26
+ AuthorizationElements["CONFIG_GRID"] = "CONFIG_GRID";
26
27
  })(AuthorizationElements || (AuthorizationElements = {}));
27
28
  export var VisibleWhenForbidden;
28
29
  (function (VisibleWhenForbidden) {
29
30
  VisibleWhenForbidden["CONFIG_GRID"] = "CONFIG_GRID";
30
- VisibleWhenForbidden["CONFIGURATOR"] = "CONFIGURATOR";
31
31
  })(VisibleWhenForbidden || (VisibleWhenForbidden = {}));
32
32
  export const buildCustomButton = (def, className, action, isEnabled) => {
33
33
  const { hint, text, iconName } = def;
@@ -14,35 +14,35 @@ export default class ParametersFetcher {
14
14
  }
15
15
  }`);
16
16
  }
17
- async getParam(name, resourceID) {
18
- const completPath = `param://${resourceID}?params=${window.btoa(name)}`;
17
+ async getParam(name) {
18
+ const completPath = `param://application?params=${name}`;
19
19
  return DataFetcher.get().callGraphQL({
20
20
  values: { name: completPath },
21
21
  query: this.templateByQuery.get("fetchParam"),
22
22
  });
23
23
  }
24
- async asString(name, resourceID) {
25
- const paramArr = await this.getParam(name, resourceID);
24
+ async asString(name) {
25
+ const paramArr = await this.getParam(name);
26
26
  return this.getValue(paramArr);
27
27
  }
28
- async asInteger(name, resourceID) {
29
- const paramArr = await this.getParam(name, resourceID);
28
+ async asInteger(name) {
29
+ const paramArr = await this.getParam(name);
30
30
  return parseInt(this.getValue(paramArr));
31
31
  }
32
- async asFloat(name, resourceID) {
33
- const paramArr = await this.getParam(name, resourceID);
32
+ async asFloat(name) {
33
+ const paramArr = await this.getParam(name);
34
34
  return parseFloat(this.getValue(paramArr));
35
35
  }
36
- async asBoolean(name, resourceID) {
37
- const paramArr = await this.getParam(name, resourceID);
38
- return this.getValue(paramArr) == "S";
36
+ async asBoolean(name) {
37
+ const paramArr = await this.getParam(name);
38
+ return this.getValue(paramArr).includes('"S"');
39
39
  }
40
- async asDate(name, resourceID) {
41
- const paramArr = await this.getParam(name, resourceID);
40
+ async asDate(name) {
41
+ const paramArr = await this.getParam(name);
42
42
  return DateUtils.strToDate(this.getValue(paramArr));
43
43
  }
44
- async getBatchParams(names, resourceID) {
45
- const paramArr = await this.getParam(names.join(","), resourceID);
44
+ async getBatchParams(names) {
45
+ const paramArr = await this.getParam(names.join(","));
46
46
  //TODO: try to typed params val?
47
47
  const response = {};
48
48
  paramArr.forEach((param) => (response[param.name] = param.resource));
@@ -41,7 +41,18 @@ export class PesquisaFetcher {
41
41
  };
42
42
  if ((criteria === null || criteria === void 0 ? void 0 : criteria.params.length) > 0) {
43
43
  externalCriteria.params = {
44
- param: criteria.params.map(p => { return { $: p.value, type: convertParamType(p.dataType) }; })
44
+ param: criteria.params.map(param => {
45
+ let value = param.value;
46
+ let type = param.dataType;
47
+ if (type === DataType.OBJECT) {
48
+ value = value.value;
49
+ type = "S";
50
+ }
51
+ else {
52
+ type = convertParamType(param.dataType);
53
+ }
54
+ return { $: value, type };
55
+ })
45
56
  };
46
57
  }
47
58
  const reqBody = {
@@ -9,10 +9,14 @@ const snkDataUnitMessages = {
9
9
  insert: "A inclusão descartada!",
10
10
  update: "A edição foi descartada!"
11
11
  },
12
+ confirm: {
13
+ cancel: "Cancelar",
14
+ delete: "Excluir"
15
+ },
12
16
  removeInfo: "Registro removido com sucesso!",
13
17
  cancelConfirmationTitle: "Aviso",
14
18
  cancelConfirmation: "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?",
15
- removeConfirmationTitle: "Excluir",
19
+ removeConfirmationTitle: "Aviso",
16
20
  removeConfirmation: "Deseja realmente excluir o registro atual?",
17
21
  forbidden: "Sem permissão",
18
22
  forbiddenUpdate: "Não é possível fazer alterações. Verifique as permissões de acesso.",
@@ -40,13 +40,13 @@ export const snkFormConfigMessages = {
40
40
  },
41
41
  confirm: {
42
42
  title: "Aviso",
43
- deleteTab: "A aba selecionada será excluída.<br/><br/> Tem certeza que deseja excluir aba",
43
+ deleteTab: "Você realmente deseja excluir a aba",
44
44
  cancel: "As alterações realizadas serão descartadas.<br/><br/><b>Gostaria de continuar?</b>",
45
45
  exit: "Ao sair as alterações serão descartadas.<br/><br/><b>Você realmente gostaria de sair?</b>",
46
46
  apply: "A <b>{0}</b> irá substituir a sua configuração {1}!<br/><br/><b>Deseja continuar?</b>",
47
47
  group: "Não é possível salvar as configurações com um grupo vazio!",
48
- labelYes: "Sim",
49
- labelNo: "Não"
48
+ labelCancel: "Cancelar",
49
+ labelDelete: "Excluir"
50
50
  },
51
51
  alert: {
52
52
  titleGroupExists: "Já existe um grupo com título",
@@ -9,10 +9,14 @@ const snkDataUnitMessages = {
9
9
  insert: "A inclusão descartada!",
10
10
  update: "A edição foi descartada!"
11
11
  },
12
+ confirm: {
13
+ cancel: "Cancelar",
14
+ delete: "Excluir"
15
+ },
12
16
  removeInfo: "Registro removido com sucesso!",
13
17
  cancelConfirmationTitle: "Aviso",
14
18
  cancelConfirmation: "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?",
15
- removeConfirmationTitle: "Excluir",
19
+ removeConfirmationTitle: "Aviso",
16
20
  removeConfirmation: "Deseja realmente excluir o registro atual?",
17
21
  forbidden: "Sem permissão",
18
22
  forbiddenUpdate: "Não é possível fazer alterações. Verifique as permissões de acesso.",
@@ -114,13 +118,13 @@ const snkFormConfigMessages = {
114
118
  },
115
119
  confirm: {
116
120
  title: "Aviso",
117
- deleteTab: "A aba selecionada será excluída.<br/><br/> Tem certeza que deseja excluir aba",
121
+ deleteTab: "Você realmente deseja excluir a aba",
118
122
  cancel: "As alterações realizadas serão descartadas.<br/><br/><b>Gostaria de continuar?</b>",
119
123
  exit: "Ao sair as alterações serão descartadas.<br/><br/><b>Você realmente gostaria de sair?</b>",
120
124
  apply: "A <b>{0}</b> irá substituir a sua configuração {1}!<br/><br/><b>Deseja continuar?</b>",
121
125
  group: "Não é possível salvar as configurações com um grupo vazio!",
122
- labelYes: "Sim",
123
- labelNo: "Não"
126
+ labelCancel: "Cancelar",
127
+ labelDelete: "Excluir"
124
128
  },
125
129
  alert: {
126
130
  titleGroupExists: "Já existe um grupo com título",
@@ -105,7 +105,18 @@ class PesquisaFetcher {
105
105
  };
106
106
  if ((criteria === null || criteria === void 0 ? void 0 : criteria.params.length) > 0) {
107
107
  externalCriteria.params = {
108
- param: criteria.params.map(p => { return { $: p.value, type: convertParamType(p.dataType) }; })
108
+ param: criteria.params.map(param => {
109
+ let value = param.value;
110
+ let type = param.dataType;
111
+ if (type === DataType.OBJECT) {
112
+ value = value.value;
113
+ type = "S";
114
+ }
115
+ else {
116
+ type = convertParamType(param.dataType);
117
+ }
118
+ return { $: value, type };
119
+ })
109
120
  };
110
121
  }
111
122
  const reqBody = {
@@ -489,35 +500,35 @@ class ParametersFetcher {
489
500
  }
490
501
  }`);
491
502
  }
492
- async getParam(name, resourceID) {
493
- const completPath = `param://${resourceID}?params=${window.btoa(name)}`;
503
+ async getParam(name) {
504
+ const completPath = `param://application?params=${name}`;
494
505
  return DataFetcher.get().callGraphQL({
495
506
  values: { name: completPath },
496
507
  query: this.templateByQuery.get("fetchParam"),
497
508
  });
498
509
  }
499
- async asString(name, resourceID) {
500
- const paramArr = await this.getParam(name, resourceID);
510
+ async asString(name) {
511
+ const paramArr = await this.getParam(name);
501
512
  return this.getValue(paramArr);
502
513
  }
503
- async asInteger(name, resourceID) {
504
- const paramArr = await this.getParam(name, resourceID);
514
+ async asInteger(name) {
515
+ const paramArr = await this.getParam(name);
505
516
  return parseInt(this.getValue(paramArr));
506
517
  }
507
- async asFloat(name, resourceID) {
508
- const paramArr = await this.getParam(name, resourceID);
518
+ async asFloat(name) {
519
+ const paramArr = await this.getParam(name);
509
520
  return parseFloat(this.getValue(paramArr));
510
521
  }
511
- async asBoolean(name, resourceID) {
512
- const paramArr = await this.getParam(name, resourceID);
513
- return this.getValue(paramArr) == "S";
522
+ async asBoolean(name) {
523
+ const paramArr = await this.getParam(name);
524
+ return this.getValue(paramArr).includes('"S"');
514
525
  }
515
- async asDate(name, resourceID) {
516
- const paramArr = await this.getParam(name, resourceID);
526
+ async asDate(name) {
527
+ const paramArr = await this.getParam(name);
517
528
  return DateUtils.strToDate(this.getValue(paramArr));
518
529
  }
519
- async getBatchParams(names, resourceID) {
520
- const paramArr = await this.getParam(names.join(","), resourceID);
530
+ async getBatchParams(names) {
531
+ const paramArr = await this.getParam(names.join(","));
521
532
  //TODO: try to typed params val?
522
533
  const response = {};
523
534
  paramArr.forEach((param) => (response[param.name] = param.resource));
@@ -755,31 +766,31 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
755
766
  * Retorna o valor de um parâmetro do tipo string.
756
767
  */
757
768
  async getStringParam(name) {
758
- return this.parameters.asString(name, this.resourceID);
769
+ return this.parameters.asString(name);
759
770
  }
760
771
  /**
761
772
  * Retorna o valor de um parâmetro do tipo Inteiro.
762
773
  */
763
774
  async getIntParam(name) {
764
- return this.parameters.asInteger(name, this.resourceID);
775
+ return this.parameters.asInteger(name);
765
776
  }
766
777
  /**
767
778
  * Retorna o valor de um parâmetro do tipo Decimal.
768
779
  */
769
780
  async getFloatParam(name) {
770
- return this.parameters.asFloat(name, this.resourceID);
781
+ return this.parameters.asFloat(name);
771
782
  }
772
783
  /**
773
784
  * Retorna o valor de um parâmetro do tipo booleano.
774
785
  */
775
786
  async getBooleanParam(name) {
776
- return this.parameters.asBoolean(name, this.resourceID);
787
+ return this.parameters.asBoolean(name);
777
788
  }
778
789
  /**
779
790
  * Retorna o valor de um parâmetro do tipo data.
780
791
  */
781
792
  async getDateParam(name) {
782
- return this.parameters.asDate(name, this.resourceID);
793
+ return this.parameters.asDate(name);
783
794
  }
784
795
  /**
785
796
  * Mostra o conteúdo passado em um Popup
@@ -950,6 +961,12 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
950
961
  async getResourceID() {
951
962
  return Promise.resolve(this.resourceID);
952
963
  }
964
+ /**
965
+ * Retorna o resourceID da tela em questão.
966
+ */
967
+ async getUserID() {
968
+ return Promise.resolve(window["UID"]);
969
+ }
953
970
  /**
954
971
  * Mostra o diálogo de alerta de acordo com os parâmetros passados.
955
972
  */
@@ -1246,6 +1263,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1246
1263
  "createDataunit": [64],
1247
1264
  "getDataUnit": [64],
1248
1265
  "getResourceID": [64],
1266
+ "getUserID": [64],
1249
1267
  "alert": [64],
1250
1268
  "error": [64],
1251
1269
  "success": [64],
@@ -19,7 +19,7 @@ class ConfigurableElementsStorage {
19
19
  ConfigurableElementsStorage._gridById = new Map();
20
20
  ConfigurableElementsStorage._formById = new Map();
21
21
 
22
- const snkConfigModalCss = ".sc-snk-config-modal-h{--snk-config-modal__button-close--padding-left:var(--space--medium, 12px);--snk-config-modal__title--color:var(--title--primary, #2B3A54);--snk-config-modal__title--font-family:var(--font-pattern, \"Sora\");--snk-config-modal__title--font-size:var(--title--large, 20px);--snk-config-modal__title--font-weight:var(--text-weight--extra-large, 700);--snk-config-modal__subtitle--color:var(--title--primary, #2B3A54);--snk-config-modal__subtitle--font-family:var(--font-pattern, \"Sora\");--snk-config-modal__subtitle--font-size:var(--text--medium, 14px);--snk-config-modal__subtitle--font-weight:var(--text-weight--large, 600);--snk-config-modal__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-config-modal__scrollbar--width:var(--space--medium, 12px);--snk-config-modal__scrollbar--background-color-primary:var(--scrollbar--primary, #2B3A54);--snk-config-modal__scrollbar--background-color-secondary:var(--scrollbar--secondary, #E5EAF0);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}@media screen and (min-width: 480px){.sc-snk-config-modal-h{width:359px;max-width:359px}}.snk-config-modal__button-config.sc-snk-config-modal{--ez-button--min-width:100%}.snk-config-modal__header.sc-snk-config-modal{display:flex;justify-content:space-between;align-items:center;width:100%}.snk-config-modal__title.sc-snk-config-modal{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-config-modal__title--color);font-size:var(--snk-config-modal__title--font-size);font-family:var(--snk-config-modal__title--font-family);font-weight:var(--snk-config-modal__title--font-weight)}.snk-config-modal__subtitle.sc-snk-config-modal{display:flex;margin:0;padding-top:var(--space--medium);padding-bottom:var(--space--small);color:var(--snk-config-modal__subtitle--color);font-size:var(--snk-config-modal__subtitle--font-size);font-family:var(--snk-config-modal__subtitle--font-family);font-weight:var(--snk-config-modal__subtitle--font-weight)}.snk-config-modal__button-close.sc-snk-config-modal{padding-left:var(--snk-config-modal__button-close--padding-left)}.snk-config-modal__main.sc-snk-config-modal{overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-config-modal__scrollbar--background-color-primary) var(--snk-config-modal__scrollbar--background-color-secondary)}.snk-config-modal__main.sc-snk-config-modal::-webkit-scrollbar-track{background-color:var(--snk-config-modal__scrollbar--background-color-secondary)}.snk-config-modal__main.sc-snk-config-modal::-webkit-scrollbar-thumb{background-color:var(--snk-config-modal__scrollbar--background-color-primary);border-radius:var(--snk-config-modal__scrollbar--border-radius)}.snk-config-modal__main.sc-snk-config-modal::-webkit-scrollbar{background-color:var(--snk-config-modal__scrollbar--background-color-secondary);width:var(--snk-config-modal__scrollbar--width);max-width:var(--snk-config-modal__scrollbar--width);min-width:var(--snk-config-modal__scrollbar--width)}";
22
+ const snkConfigModalCss = ".sc-snk-config-modal-h{--snk-config-modal__button-close--padding-left:var(--space--medium, 12px);--snk-config-modal__title--color:var(--title--primary, #2B3A54);--snk-config-modal__title--font-family:var(--font-pattern, \"Roboto\");--snk-config-modal__title--font-size:var(--title--large, 20px);--snk-config-modal__title--font-weight:var(--text-weight--extra-large, 700);--snk-config-modal__subtitle--color:var(--title--primary, #2B3A54);--snk-config-modal__subtitle--font-family:var(--font-pattern, \"Roboto\");--snk-config-modal__subtitle--font-size:var(--text--medium, 14px);--snk-config-modal__subtitle--font-weight:var(--text-weight--large, 600);--snk-config-modal__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-config-modal__scrollbar--width:var(--space--medium, 12px);--snk-config-modal__scrollbar--background-color-primary:var(--scrollbar--primary, #2B3A54);--snk-config-modal__scrollbar--background-color-secondary:var(--scrollbar--secondary, #E5EAF0);display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}@media screen and (min-width: 480px){.sc-snk-config-modal-h{width:359px;max-width:359px}}.snk-config-modal__button-config.sc-snk-config-modal{--ez-button--min-width:100%}.snk-config-modal__header.sc-snk-config-modal{display:flex;justify-content:space-between;align-items:center;width:100%}.snk-config-modal__title.sc-snk-config-modal{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-config-modal__title--color);font-size:var(--snk-config-modal__title--font-size);font-family:var(--snk-config-modal__title--font-family);font-weight:var(--snk-config-modal__title--font-weight)}.snk-config-modal__subtitle.sc-snk-config-modal{display:flex;margin:0;padding-top:var(--space--medium);padding-bottom:var(--space--small);color:var(--snk-config-modal__subtitle--color);font-size:var(--snk-config-modal__subtitle--font-size);font-family:var(--snk-config-modal__subtitle--font-family);font-weight:var(--snk-config-modal__subtitle--font-weight)}.snk-config-modal__button-close.sc-snk-config-modal{padding-left:var(--snk-config-modal__button-close--padding-left)}.snk-config-modal__main.sc-snk-config-modal{overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--snk-config-modal__scrollbar--background-color-primary) var(--snk-config-modal__scrollbar--background-color-secondary)}.snk-config-modal__main.sc-snk-config-modal::-webkit-scrollbar-track{background-color:var(--snk-config-modal__scrollbar--background-color-secondary)}.snk-config-modal__main.sc-snk-config-modal::-webkit-scrollbar-thumb{background-color:var(--snk-config-modal__scrollbar--background-color-primary);border-radius:var(--snk-config-modal__scrollbar--border-radius)}.snk-config-modal__main.sc-snk-config-modal::-webkit-scrollbar{background-color:var(--snk-config-modal__scrollbar--background-color-secondary);width:var(--snk-config-modal__scrollbar--width);max-width:var(--snk-config-modal__scrollbar--width);min-width:var(--snk-config-modal__scrollbar--width)}";
23
23
 
24
24
  const GRID_MODE = VIEW_MODE.grid;
25
25
  const FORM_MODE = VIEW_MODE.form;
@@ -176,8 +176,14 @@ const SnkDataUnit$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
176
176
  resolve(action);
177
177
  }
178
178
  else {
179
+ const options = {
180
+ canClose: false,
181
+ labelCancel: this.getMessage("snkDataUnit.confirm.cancel"),
182
+ labelConfirm: this.getMessage("snkDataUnit.confirm.delete"),
183
+ btnConfirmDanger: false
184
+ };
179
185
  const removeConfirmationTitle = this.getMessage("snkDataUnit.removeConfirmationTitle");
180
- ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, "delete", DialogType.CRITICAL, { btnConfirmDanger: true })
186
+ ApplicationUtils.confirm(removeConfirmationTitle, removeConfirmation, null, DialogType.WARN, options)
181
187
  .then((result) => resolve(result ? action : undefined));
182
188
  }
183
189
  }
@@ -36,6 +36,11 @@ const SnkFieldConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
36
36
  getMessage(key) {
37
37
  return this._application.messagesBuilder.getMessage(key, {});
38
38
  }
39
+ isRequired() {
40
+ var _a, _b;
41
+ const fieldMD = this.dataUnit && this.dataUnit.getField((_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.name);
42
+ return (fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.required) === true || ((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.required) === true;
43
+ }
39
44
  componentWillLoad() {
40
45
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
41
46
  }
@@ -43,7 +48,7 @@ const SnkFieldConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
43
48
  if (this.fieldConfig == undefined) {
44
49
  return;
45
50
  }
46
- return (h(Host, null, h("div", { class: "field-config" }, h("div", { class: "field-config__draggable" }, h("ez-icon", { iconName: "drag-indicator", size: "small" })), h("div", null, this.fieldConfig.label, this.fieldConfig.required && h("span", { class: "field-config__required-label" }, "*")), this.modeInsertion ?
51
+ return (h(Host, null, h("div", { class: "field-config" }, h("div", { class: "field-config__draggable" }, h("ez-icon", { iconName: "drag-indicator", size: "small" })), h("div", null, this.fieldConfig.label, this.isRequired() && h("span", { class: "field-config__required-label" }, "*")), this.modeInsertion ?
47
52
  h("div", { class: "field-config__add" }, h("ez-button", { onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.add), mode: "icon", class: "ez-button--tertiary", iconName: "plus", size: "large", title: this.getMessage("snkFieldConfig.titleAdd") })) :
48
53
  h("div", { class: "field-config__options" + (this.isConfigActive ? " field-config__options--is-active" : " ") }, h("ez-button", { mode: "icon", class: "ez-button--tertiary field-config__remove-icon", onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.remove), iconName: "minus", size: "large", title: this.getMessage("snkFieldConfig.titleRemove") }), h("ez-button", { id: "buttonConfig_" + this.fieldConfig.name, mode: "icon", class: "ez-button--tertiary", onClick: (evt) => this.handleAction(evt, ACTION_CONFIG.configuration), iconName: this.isConfigActive ? "chevron-up" : "settings-inverted", size: "large", title: this.getMessage("snkFieldConfig.titleConfigurations") }))), this.isConfigActive && h("div", { class: "field-config__config-popover" }, h("div", { class: "field-config__config-outer-arrow" }, h("div", { class: "field-config__config-inner-arrow" })))));
49
54
  }
@@ -51,7 +56,8 @@ const SnkFieldConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
51
56
  }, [2, "snk-field-config", {
52
57
  "isConfigActive": [16],
53
58
  "fieldConfig": [16],
54
- "modeInsertion": [516, "mode-insertion"]
59
+ "modeInsertion": [516, "mode-insertion"],
60
+ "dataUnit": [16]
55
61
  }]);
56
62
  function defineCustomElement() {
57
63
  if (typeof customElements === "undefined") {
@@ -10,7 +10,7 @@ const SnkFilterModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
10
10
  }
11
11
  updateValue(id, value = undefined) {
12
12
  this.items = this.items.map(item => {
13
- if (item.id === id) {
13
+ if (item.id === id && item.enabled) {
14
14
  if (value == undefined) {
15
15
  value = !item.active;
16
16
  }