@sankhyalabs/sankhyablocks 5.14.0 → 5.16.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 (42) 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-application.cjs.entry.js +4 -0
  4. package/dist/cjs/snk-crud.cjs.entry.js +7 -0
  5. package/dist/cjs/snk-entity-list.cjs.entry.js +17 -13
  6. package/dist/cjs/snk-filter-bar.cjs.entry.js +6 -0
  7. package/dist/cjs/snk-grid.cjs.entry.js +7 -0
  8. package/dist/collection/components/snk-application/snk-application.js +24 -1
  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-grid/snk-grid.js +23 -0
  13. package/dist/components/snk-application2.js +6 -1
  14. package/dist/components/snk-crud.js +9 -1
  15. package/dist/components/snk-entity-list.js +17 -13
  16. package/dist/components/snk-filter-bar2.js +8 -1
  17. package/dist/components/snk-grid2.js +9 -1
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/esm/sankhyablocks.js +1 -1
  20. package/dist/esm/snk-application.entry.js +5 -1
  21. package/dist/esm/snk-crud.entry.js +7 -0
  22. package/dist/esm/snk-entity-list.entry.js +17 -13
  23. package/dist/esm/snk-filter-bar.entry.js +6 -0
  24. package/dist/esm/snk-grid.entry.js +7 -0
  25. package/dist/sankhyablocks/p-0c2afa63.entry.js +1 -0
  26. package/dist/sankhyablocks/p-8d40909d.entry.js +1 -0
  27. package/dist/sankhyablocks/p-9a448ff9.entry.js +1 -0
  28. package/dist/sankhyablocks/p-9e92ed74.entry.js +11 -0
  29. package/dist/sankhyablocks/p-e0c04667.entry.js +1 -0
  30. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  31. package/dist/types/components/snk-application/snk-application.d.ts +1 -0
  32. package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
  33. package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +1 -0
  34. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
  35. package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
  36. package/dist/types/components.d.ts +13 -0
  37. package/package.json +1 -1
  38. package/dist/sankhyablocks/p-656eab86.entry.js +0 -1
  39. package/dist/sankhyablocks/p-69859375.entry.js +0 -1
  40. package/dist/sankhyablocks/p-ba511f48.entry.js +0 -1
  41. package/dist/sankhyablocks/p-c8095917.entry.js +0 -1
  42. package/dist/sankhyablocks/p-f5e607e7.entry.js +0 -11
@@ -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") {
@@ -71,6 +71,13 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
71
71
  async setConfig(config) {
72
72
  this.setGridConfig(config);
73
73
  }
74
+ /**
75
+ * Faz o recarregamento da filter-bar da grade bascando o state no servidor.
76
+ */
77
+ async reloadFilterBar() {
78
+ var _a;
79
+ (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.reload();
80
+ }
74
81
  openGridConfig() {
75
82
  this._grid.getColumnsState()
76
83
  .then((gridColumns) => {
@@ -306,7 +313,8 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
306
313
  "_popUpGridConfig": [32],
307
314
  "showConfig": [64],
308
315
  "hideConfig": [64],
309
- "setConfig": [64]
316
+ "setConfig": [64],
317
+ "reloadFilterBar": [64]
310
318
  }]);
311
319
  function defineCustomElement() {
312
320
  if (typeof customElements === "undefined") {
@@ -11,7 +11,7 @@ const patchEsm = () => {
11
11
  const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
- return bootstrapLazy([["snk-personalized-filter",[[0,"snk-personalized-filter",{"messagesBuilder":[1040]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-filter-modal",[[0,"snk-filter-modal",{"getMessage":[16],"filters":[1040],"applyFilters":[16],"clearAll":[16],"closeModal":[16]}]]],["snk-entity-list",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"_searchValue":[32],"_ezListSource":[32],"reloadList":[64]}]]],["snk-filter-binary-select",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-list",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]]]],["snk-filter-multi-select",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[8],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-expression-item",[[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["snk-filter-modal-item",[[0,"snk-filter-modal-item",{"filterItem":[1040]}]]],["snk-detail-view",[[2,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[16],"_disabledButtons":[32],"attachmentRegisterKey":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["snk-configurator",[[6,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"viewMode":[2,"view-mode"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-attach",[[2,"snk-attach",{"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"dataUnit":[32],"crudConfig":[32]}]]],["snk-filter-bar",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"messagesBuilder":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]]]],["snk-filter-field-search_2",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["snk-config-options",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"messagesBuilder":[1040],"_defaultType":[32]}]]],["snk-field-config",[[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16],"messagesBuilder":[1040]}]]],["snk-tab-config",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"tabItems":[16],"messagesBuilder":[1040],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-form-config",[[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"messagesBuilder":[1040],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-select-box",[[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}]]],["snk-grid-config",[[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"configName":[1,"config-name"]}]]],["snk-filter-item",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["snk-filter-detail",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-exporter-email-sender",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-data-exporter",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-taskbar",[[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32]}]]],["snk-grid",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}]]],["snk-guides-viewer",[[2,"snk-guides-viewer",{"_guideBuilders":[16],"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[16],"taskbarManager":[16],"messagesBuilder":[1040],"presentationMode":[1,"presentation-mode"],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"showFormConfig":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["snk-crud",[[6,"snk-crud",{"configName":[1025,"config-name"],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64]}]]],["snk-form",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadGridConfig":[64],"loadTotals":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64]}]]],["snk-form-summary",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["snk-form-view",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"showUp":[64]}]]],["snk-simple-bar_2",[[6,"snk-simple-crud",{"dataState":[16],"dataUnit":[16],"mode":[2],"gridConfig":[16],"formConfig":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"taskbarManager":[16],"messagesBuilder":[1040],"_currentViewMode":[32],"_config":[32],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64]},[[0,"actionClick","actionClickListener"]]],[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]]], options);
14
+ return bootstrapLazy([["snk-personalized-filter",[[0,"snk-personalized-filter",{"messagesBuilder":[1040]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-filter-modal",[[0,"snk-filter-modal",{"getMessage":[16],"filters":[1040],"applyFilters":[16],"clearAll":[16],"closeModal":[16]}]]],["snk-entity-list",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"_searchValue":[32],"_ezListSource":[32],"reloadList":[64]}]]],["snk-filter-binary-select",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-list",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]]]],["snk-filter-multi-select",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[8],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-expression-item",[[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["snk-filter-modal-item",[[0,"snk-filter-modal-item",{"filterItem":[1040]}]]],["snk-detail-view",[[2,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[16],"_disabledButtons":[32],"attachmentRegisterKey":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["snk-configurator",[[6,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"viewMode":[2,"view-mode"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-attach",[[2,"snk-attach",{"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"dataUnit":[32],"crudConfig":[32]}]]],["snk-filter-bar",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"messagesBuilder":[1040],"allowDefault":[32],"scrollerLocked":[32],"reload":[64]},[[0,"filterChange","filterChangeListener"]]]]],["snk-filter-field-search_2",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["snk-config-options",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"messagesBuilder":[1040],"_defaultType":[32]}]]],["snk-field-config",[[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16],"messagesBuilder":[1040]}]]],["snk-tab-config",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"tabItems":[16],"messagesBuilder":[1040],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-form-config",[[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"messagesBuilder":[1040],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-select-box",[[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}]]],["snk-grid-config",[[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"configName":[1,"config-name"]}]]],["snk-filter-item",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["snk-filter-detail",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-exporter-email-sender",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-data-exporter",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-taskbar",[[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32]}]]],["snk-grid",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64]}]]],["snk-guides-viewer",[[2,"snk-guides-viewer",{"_guideBuilders":[16],"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[16],"taskbarManager":[16],"messagesBuilder":[1040],"presentationMode":[1,"presentation-mode"],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"showFormConfig":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["snk-crud",[[6,"snk-crud",{"configName":[1025,"config-name"],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64]}]]],["snk-form",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadGridConfig":[64],"loadTotals":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64]}]]],["snk-form-summary",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["snk-form-view",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"showUp":[64]}]]],["snk-simple-bar_2",[[6,"snk-simple-crud",{"dataState":[16],"dataUnit":[16],"mode":[2],"gridConfig":[16],"formConfig":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"taskbarManager":[16],"messagesBuilder":[1040],"_currentViewMode":[32],"_config":[32],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64]},[[0,"actionClick","actionClickListener"]]],[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]]], options);
15
15
  });
16
16
  };
17
17
 
@@ -14,5 +14,5 @@ const patchBrowser = () => {
14
14
  };
15
15
 
16
16
  patchBrowser().then(options => {
17
- return bootstrapLazy([["snk-personalized-filter",[[0,"snk-personalized-filter",{"messagesBuilder":[1040]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-filter-modal",[[0,"snk-filter-modal",{"getMessage":[16],"filters":[1040],"applyFilters":[16],"clearAll":[16],"closeModal":[16]}]]],["snk-entity-list",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"_searchValue":[32],"_ezListSource":[32],"reloadList":[64]}]]],["snk-filter-binary-select",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-list",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]]]],["snk-filter-multi-select",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[8],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-expression-item",[[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["snk-filter-modal-item",[[0,"snk-filter-modal-item",{"filterItem":[1040]}]]],["snk-detail-view",[[2,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[16],"_disabledButtons":[32],"attachmentRegisterKey":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["snk-configurator",[[6,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"viewMode":[2,"view-mode"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-attach",[[2,"snk-attach",{"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"dataUnit":[32],"crudConfig":[32]}]]],["snk-filter-bar",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"messagesBuilder":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]]]],["snk-filter-field-search_2",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["snk-config-options",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"messagesBuilder":[1040],"_defaultType":[32]}]]],["snk-field-config",[[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16],"messagesBuilder":[1040]}]]],["snk-tab-config",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"tabItems":[16],"messagesBuilder":[1040],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-form-config",[[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"messagesBuilder":[1040],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-select-box",[[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}]]],["snk-grid-config",[[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"configName":[1,"config-name"]}]]],["snk-filter-item",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["snk-filter-detail",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-exporter-email-sender",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-data-exporter",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-taskbar",[[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32]}]]],["snk-grid",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}]]],["snk-guides-viewer",[[2,"snk-guides-viewer",{"_guideBuilders":[16],"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[16],"taskbarManager":[16],"messagesBuilder":[1040],"presentationMode":[1,"presentation-mode"],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"showFormConfig":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["snk-crud",[[6,"snk-crud",{"configName":[1025,"config-name"],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64]}]]],["snk-form",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadGridConfig":[64],"loadTotals":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64]}]]],["snk-form-summary",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["snk-form-view",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"showUp":[64]}]]],["snk-simple-bar_2",[[6,"snk-simple-crud",{"dataState":[16],"dataUnit":[16],"mode":[2],"gridConfig":[16],"formConfig":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"taskbarManager":[16],"messagesBuilder":[1040],"_currentViewMode":[32],"_config":[32],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64]},[[0,"actionClick","actionClickListener"]]],[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]]], options);
17
+ return bootstrapLazy([["snk-personalized-filter",[[0,"snk-personalized-filter",{"messagesBuilder":[1040]}]]],["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-filter-modal",[[0,"snk-filter-modal",{"getMessage":[16],"filters":[1040],"applyFilters":[16],"clearAll":[16],"closeModal":[16]}]]],["snk-entity-list",[[2,"snk-entity-list",{"config":[1040],"rightListSlotBuilder":[1040],"maxHeightList":[1,"max-height-list"],"_searchValue":[32],"_ezListSource":[32],"reloadList":[64]}]]],["snk-filter-binary-select",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"presentationMode":[2,"presentation-mode"]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-list",[[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]]]],["snk-filter-multi-select",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period",[[0,"snk-filter-period",{"config":[16],"getMessage":[16],"value":[8],"presentationMode":[2,"presentation-mode"],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-expression-item",[[2,"snk-expression-item",{"expression":[16],"canRemove":[516,"can-remove"],"messagesBuilder":[1040],"_showValueVariable":[32],"_fieldSelected":[32],"_optionNotNull":[32]}]]],["snk-filter-modal-item",[[0,"snk-filter-modal-item",{"filterItem":[1040]}]]],["snk-detail-view",[[2,"snk-detail-view",{"formConfigManager":[1040],"dataUnitName":[1,"data-unit-name"],"guideItemPath":[16],"entityName":[1,"entity-name"],"label":[1],"dataUnit":[1040],"selectedForm":[1025,"selected-form"],"dataState":[1040],"messagesBuilder":[1040],"branchGuide":[16],"_disabledButtons":[32],"attachmentRegisterKey":[32],"changeViewMode":[64],"configGrid":[64],"showUp":[64]},[[0,"snkContentCardChanged","onContentCardChanged"]]]]],["snk-configurator",[[6,"snk-configurator",{"showActionButtons":[4,"show-action-buttons"],"configName":[1,"config-name"],"viewMode":[2,"view-mode"],"messagesBuilder":[1040],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-attach",[[2,"snk-attach",{"registerKey":[1,"register-key"],"entityName":[1,"entity-name"],"messagesBuilder":[1040],"dataUnit":[32],"crudConfig":[32]}]]],["snk-filter-bar",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"messagesBuilder":[1040],"allowDefault":[32],"scrollerLocked":[32],"reload":[64]},[[0,"filterChange","filterChangeListener"]]]]],["snk-filter-field-search_2",[[2,"snk-filter-field-search",{"searchable":[4],"fieldsDataSource":[16],"breadcrumbItems":[32],"linkItems":[32],"fieldItems":[32],"show":[64],"applyFilter":[64]}],[0,"snk-filter-param-config",{"messagesBuilder":[1040],"_opened":[32],"_configType":[32],"_expressionItem":[32],"_informedInstance":[32],"_canSave":[32],"open":[64],"close":[64]}]]],["snk-config-options",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"messagesBuilder":[1040],"_defaultType":[32]}]]],["snk-field-config",[[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16],"messagesBuilder":[1040]}]]],["snk-tab-config",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"tabItems":[16],"messagesBuilder":[1040],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-form-config",[[2,"snk-form-config",{"dataUnit":[16],"configManager":[16],"messagesBuilder":[1040],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-select-box",[[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}]]],["snk-grid-config",[[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"configName":[1,"config-name"]}]]],["snk-filter-item",[[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"messagesBuilder":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["snk-filter-detail",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-exporter-email-sender",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-data-exporter",[[2,"snk-data-exporter",{"provider":[16],"messagesBuilder":[1040],"_items":[32],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-taskbar",[[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"messagesBuilder":[1040],"_permissions":[32]}]]],["snk-grid",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"isDetail":[4,"is-detail"],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64],"reloadFilterBar":[64]}]]],["snk-guides-viewer",[[2,"snk-guides-viewer",{"_guideBuilders":[16],"dataUnit":[16],"dataState":[16],"configName":[1,"config-name"],"entityPath":[1,"entity-path"],"actionsList":[16],"recordsValidator":[16],"masterFormConfig":[1040],"selectedGuide":[16],"taskbarManager":[16],"messagesBuilder":[1040],"presentationMode":[1,"presentation-mode"],"_breadcrumbItems":[32],"_guides":[32],"_formEditorConfigManager":[32],"_formEditorDataUnit":[32],"showFormConfig":[64]},[[2,"actionClick","onActionClick"],[0,"snkContentCardChanged","onContentCardChanged"]]]]],["snk-crud",[[6,"snk-crud",{"configName":[1025,"config-name"],"showActionButtons":[4,"show-action-buttons"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"messagesBuilder":[1040],"_dataUnit":[32],"_dataState":[32],"attachmentRegisterKey":[32],"_currentViewMode":[32],"goToView":[64],"openConfigurator":[64],"closeConfigurator":[64],"reloadFilterBar":[64]}]]],["snk-form",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"messagesBuilder":[1040],"_dataUnit":[32],"_dataState":[32],"_showFormConfig":[32],"_configManager":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"initOnboarding":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"updateDataunitCache":[64],"getDataUnit":[64],"addClientEvent":[64],"removeClientEvent":[64],"hasClientEvent":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadGridConfig":[64],"loadTotals":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64],"addSearchListener":[64]}]]],["snk-form-summary",[[2,"snk-form-summary",{"fixed":[1540],"contracted":[1540],"summary":[16]}]]],["snk-form-view",[[6,"snk-form-view",{"levelPath":[1,"level-path"],"label":[1],"name":[1],"fields":[16],"formMetadata":[8,"form-metadata"],"dataUnit":[16],"contracted":[4],"fixed":[1540],"summaryFields":[16],"canExpand":[4,"can-expand"],"canFix":[4,"can-fix"],"recordsValidator":[16],"showUp":[64]}]]],["snk-simple-bar_2",[[6,"snk-simple-crud",{"dataState":[16],"dataUnit":[16],"mode":[2],"gridConfig":[16],"formConfig":[16],"useCancelConfirm":[4,"use-cancel-confirm"],"taskbarManager":[16],"messagesBuilder":[1040],"_currentViewMode":[32],"_config":[32],"goToView":[64],"setMetadata":[64],"setRecords":[64],"getRecords":[64]},[[0,"actionClick","actionClickListener"]]],[6,"snk-simple-bar",{"label":[1],"breadcrumbItens":[16],"messagesBuilder":[1040]}]]]], options);
18
18
  });
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-cfd4bb13.js';
2
- import { WaitingChangeException, WarningException, ErrorException, ObjectUtils, DateUtils, StringUtils, DependencyType, ElementIDUtils, ApplicationContext, ErrorTracking, DataType } from '@sankhyalabs/core';
2
+ import { WaitingChangeException, WarningException, ErrorException, ObjectUtils, DateUtils, StringUtils, OnboardingUtils, DependencyType, ElementIDUtils, ApplicationContext, ErrorTracking, DataType } from '@sankhyalabs/core';
3
3
  import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-b3d8b2d5.js';
4
4
  import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import { P as PesquisaFetcher } from './pesquisa-fetcher-bd6af0e3.js';
@@ -305,6 +305,10 @@ const SnkApplication = class {
305
305
  });
306
306
  });
307
307
  }
308
+ initOnboarding(onboardingKey) {
309
+ OnboardingUtils.getInstance().init(onboardingKey, window.envContext);
310
+ return Promise.resolve();
311
+ }
308
312
  /**
309
313
  * Obtém `true` caso o usuário logado tem permissão pra determinada ação.
310
314
  */
@@ -51,6 +51,13 @@ const SnkCrud = class {
51
51
  var _a;
52
52
  (_a = this._snkConfigurator) === null || _a === void 0 ? void 0 : _a.close();
53
53
  }
54
+ /**
55
+ * Faz o recarregamento da filter-bar do crud, bascando o state no servidor.
56
+ */
57
+ async reloadFilterBar() {
58
+ var _a;
59
+ (_a = this._snkGrid) === null || _a === void 0 ? void 0 : _a.reloadFilterBar();
60
+ }
54
61
  currentViewModeWatcher(currentView) {
55
62
  this._viewHistory = [...this._viewHistory.slice(-1), currentView];
56
63
  }
@@ -23,20 +23,20 @@ const SnkEntityList = class {
23
23
  (_b = (_a = this._searchElement) === null || _a === void 0 ? void 0 : _a['clearValue']) === null || _b === void 0 ? void 0 : _b.call(_a);
24
24
  }
25
25
  ezListChangeListener(evt) {
26
- var _a, _b, _c, _d;
27
- (_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 => {
26
+ var _a, _b;
27
+ (_a = (this.getListConfigValue(this.config))) === null || _a === void 0 ? void 0 : _a.forEach(value => {
28
28
  var _a, _b;
29
29
  if (value && value.id === ((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.id)) {
30
30
  value.check = (_b = evt.detail) === null || _b === void 0 ? void 0 : _b.check;
31
31
  }
32
32
  });
33
33
  this.saveConfig.emit(this.config);
34
- this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
34
+ this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
35
35
  }
36
36
  loadListSource() {
37
- var _a, _b, _c, _d, _e, _f, _g, _h;
37
+ var _a;
38
38
  this._ezListSource = [];
39
- (_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 => {
39
+ (_a = (this.getListConfigValue(this.config))) === null || _a === void 0 ? void 0 : _a.forEach(value => {
40
40
  if (value) {
41
41
  this._ezListSource.push({
42
42
  label: `${value.id} - ${value.label}`,
@@ -47,17 +47,17 @@ const SnkEntityList = class {
47
47
  });
48
48
  }
49
49
  componentDidLoad() {
50
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
51
- 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;
50
+ var _a, _b, _c, _d, _e;
51
+ let configValue = this.getListConfigValue(this.config);
52
52
  let configValueArray = [];
53
53
  if (Array.isArray(configValue)) {
54
54
  configValueArray = configValue;
55
55
  }
56
56
  else {
57
- configValueArray.push((_j = (_h = this.config) === null || _h === void 0 ? void 0 : _h.value) === null || _j === void 0 ? void 0 : _j.members);
57
+ configValueArray.push((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.members);
58
58
  }
59
59
  this.config.value = configValueArray;
60
- 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;
60
+ 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;
61
61
  this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
62
62
  this.loadListSource();
63
63
  }
@@ -76,10 +76,10 @@ const SnkEntityList = class {
76
76
  return this._application.executePreparedSearch(mode, argument, options);
77
77
  }
78
78
  onEzSearchChange(evt) {
79
- var _a, _b, _c, _d, _e, _f, _g, _h;
80
- 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) {
79
+ var _a, _b, _c, _d;
80
+ 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) {
81
81
  this.config = Object.assign(Object.assign({}, this.config), { value: [
82
- ...((_g = (_f = this.config) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : []),
82
+ ...((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : []),
83
83
  {
84
84
  id: evt.detail.value,
85
85
  check: true,
@@ -88,13 +88,17 @@ const SnkEntityList = class {
88
88
  ] });
89
89
  this.loadListSource();
90
90
  this.saveConfig.emit(this.config);
91
- this.valueChanged.emit((_h = this.config) === null || _h === void 0 ? void 0 : _h.value);
91
+ this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
92
92
  }
93
93
  }
94
94
  getMessage(key, params) {
95
95
  var _a;
96
96
  return (_a = this._application) === null || _a === void 0 ? void 0 : _a.messagesBuilder.getMessage(key, params);
97
97
  }
98
+ getListConfigValue(config) {
99
+ var _a, _b, _c, _d;
100
+ 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;
101
+ }
98
102
  render() {
99
103
  var _a;
100
104
  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) }))));
@@ -193,6 +193,12 @@ const SnkFilterBar = class {
193
193
  }
194
194
  this.processAfterUpdateConfig();
195
195
  }
196
+ /**
197
+ * Faz o recarregamento da filterbar bascando o state no servidor.
198
+ */
199
+ async reload() {
200
+ this.loadConfigFromStorage();
201
+ }
196
202
  componentDidLoad() {
197
203
  if (this._element) {
198
204
  const dataInfo = { dataUnit: this.dataUnit };
@@ -69,6 +69,13 @@ const SnkGrid = class {
69
69
  async setConfig(config) {
70
70
  this.setGridConfig(config);
71
71
  }
72
+ /**
73
+ * Faz o recarregamento da filter-bar da grade bascando o state no servidor.
74
+ */
75
+ async reloadFilterBar() {
76
+ var _a;
77
+ (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.reload();
78
+ }
72
79
  openGridConfig() {
73
80
  this._grid.getColumnsState()
74
81
  .then((gridColumns) => {
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as s,H as l}from"./p-b9667fbe.js";import{ApplicationContext as e}from"@sankhyalabs/core";const o=class{constructor(s){i(this,s),this.valueChanged=t(this,"valueChanged",7),this.saveConfig=t(this,"saveConfig",7),this._searchValue=void 0,this._ezListSource=[],this.config=void 0,this.rightListSlotBuilder=void 0,this.maxHeightList=""}async reloadList(){this.loadListSource(),this.saveConfig.emit(this.config)}observeConfig(){var i,t;null===(t=null===(i=this._searchElement)||void 0===i?void 0:i.clearValue)||void 0===t||t.call(i)}ezListChangeListener(i){var t,s;null===(t=this.getListConfigValue(this.config))||void 0===t||t.forEach((t=>{var s,l;t&&t.id===(null===(s=i.detail)||void 0===s?void 0:s.id)&&(t.check=null===(l=i.detail)||void 0===l?void 0:l.check)})),this.saveConfig.emit(this.config),this.valueChanged.emit(null===(s=this.config)||void 0===s?void 0:s.value)}loadListSource(){var i;this._ezListSource=[],null===(i=this.getListConfigValue(this.config))||void 0===i||i.forEach((i=>{i&&this._ezListSource.push({label:`${i.id} - ${i.label}`,check:i.check,id:i.id})}))}componentDidLoad(){var i,t,s,l,o;let n=this.getListConfigValue(this.config),a=[];Array.isArray(n)?a=n:a.push(null===(t=null===(i=this.config)||void 0===i?void 0:i.value)||void 0===t?void 0:t.members),this.config.value=a,this._entityName=null===(o=null===(l=null===(s=this.config)||void 0===s?void 0:s.props)||void 0===l?void 0:l.searchContext)||void 0===o?void 0:o.entity,this._application=e.getContextValue("__SNK__APPLICATION__"),this.loadListSource()}optionLoader(i){var t,s,l,e;const{mode:o,argument:n}=i;if(void 0===this._application)return;const a=null===(l=null===(s=null===(t=this.config)||void 0===t?void 0:t.props)||void 0===s?void 0:s.searchContext)||void 0===l?void 0:l.searchOptions,v={entityDescription:null===(e=this.config)||void 0===e?void 0:e.label,entity:this._entityName,searchOptions:a};return this._application.executePreparedSearch(o,n,v)}onEzSearchChange(i){var t,s,l,e;null!=i.detail&&void 0===(null===(t=this.getListConfigValue(this.config))||void 0===t?void 0:t.find((t=>{var s;return(null==t?void 0:t.id)==(null===(s=i.detail)||void 0===s?void 0:s.value)})))&&(this.config=Object.assign(Object.assign({},this.config),{value:[...null!==(l=null===(s=this.config)||void 0===s?void 0:s.value)&&void 0!==l?l:[],{id:i.detail.value,check:!0,label:i.detail.label}]}),this.loadListSource(),this.saveConfig.emit(this.config),this.valueChanged.emit(null===(e=this.config)||void 0===e?void 0:e.value))}getMessage(i,t){var s;return null===(s=this._application)||void 0===s?void 0:s.messagesBuilder.getMessage(i,t)}getListConfigValue(i){var t,s,l,e;return null!==(e=null!==(s=null===(t=i.value)||void 0===t?void 0:t.elements)&&void 0!==s?s:null===(l=null==i?void 0:i.value)||void 0===l?void 0:l.members)&&void 0!==e?e:null==i?void 0:i.value}render(){var i;return s(l,null,s("ez-search",{ref:i=>this._searchElement=i,optionLoader:i=>this.optionLoader(i),value:this._searchValue,label:null===(i=this.config)||void 0===i?void 0:i.label,onEzChange:i=>this.onEzSearchChange(i)}),s("label",{class:"label"},this.getMessage("snkEntityList.selected")),s("div",{style:this.maxHeightList?{"max-height":this.maxHeightList}:{},class:{"snk-entity-list--overflow":!!this.maxHeightList}},s("ez-list",{ref:i=>this._ezList=i,id:"snkEntityList",listMode:"check",dataSource:this._ezListSource,hoverFeedback:!0,itemSlotBuilder:this.rightListSlotBuilder,onEzCheckChange:i=>this.ezListChangeListener(i)})))}static get watchers(){return{config:["observeConfig"]}}};o.style=".sc-snk-entity-list-h{--snk-entity-list--label--font-size:var(--text--medium, 14px);--snk-entity-list--label--font-family:var(--font-pattern, Arial);--snk-entity-list--label--color:var(--title--primary, #000);--snk-entity-list--label--disabled--color:var(--text--disable, #AFB6C0)}.label.sc-snk-entity-list{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--snk-entity-list--label--color);font-size:var(--snk-entity-list--label--font-size);font-family:var(--snk-entity-list--label--font-family);cursor:default;padding-left:var(--space--small);padding-bottom:var(--space--extra-small)}.snk-entity-list--overflow.sc-snk-entity-list{overflow:auto}.snk-entity-list--overflow.sc-snk-entity-list::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";export{o as snk_entity_list}
@@ -0,0 +1 @@
1
+ import{r as i,c as t,h as s,g as e}from"./p-b9667fbe.js";import{ElementIDUtils as r,ApplicationContext as d,DataType as a}from"@sankhyalabs/core";import{UserInterface as n}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{T as o}from"./p-d410f45a.js";import{C as l}from"./p-b1c02726.js";import{P as h}from"./p-4c2015a9.js";import{T as c}from"./p-39082fc3.js";import{s as u}from"./p-6a02e236.js";import"./p-2ea933b2.js";import"./p-41d92871.js";import"./p-112455b1.js";import"./p-79f78e10.js";import"./p-6c2c71ca.js";import"./p-584d7212.js";const v=class{constructor(s){i(this,s),this.actionClick=t(this,"actionClick",7),this.gridDoubleClick=t(this,"gridDoubleClick",7),this._topTaskbarProcessor=new c({"snkGridTopTaskbar.regular":["FORM_MODE","CONFIGURATOR","INSERT"],"snkGridTopTaskbar.regular.secondary":["FORM_MODE","CONFIGURATOR","INSERT"],"snkGridTopTaskbar.finish_edition":["CANCEL","SAVE"],"snkGridTopTaskbar.finish_edition.secondary":[]}),this._headerTaskbarProcessor=new c({"snkGridHeaderTaskbar.unselected":["REFRESH","DATA_EXPORTER"],"snkGridHeaderTaskbar.selected":["UPDATE","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","ATTACH","REFRESH","DATA_EXPORTER"],"snkGridHeaderTaskbar.detail.unselected":["REFRESH"],"snkGridHeaderTaskbar.detail.selected":["UPDATE","ATTACH","CLONE","REMOVE","MORE_OPTIONS","DIVIDER","REFRESH"]}),this._dataUnit=void 0,this._dataState=void 0,this._gridConfig=void 0,this._popUpGridConfig=!1,this.configName=void 0,this.actionsList=void 0,this.isDetail=void 0,this.taskbarManager=void 0,this.statusResolver=void 0,this.multipleSelection=void 0,this.presentationMode=h.PRIMARY,this.messagesBuilder=void 0}async showConfig(){null!=this._grid&&this.openGridConfig()}async hideConfig(){null!=this._grid&&this.closeGridConfig()}async setConfig(i){this.setGridConfig(i)}async reloadFilterBar(){var i;null===(i=this._snkFilterBar)||void 0===i||i.reload()}openGridConfig(){this._grid.getColumnsState().then((i=>{this._snkGridConfig.columns=i.filter((i=>i.name)),this._snkGridConfig.selectedIndex=0,this._popUpGridConfig=!0}))}closeGridConfig(){this._popUpGridConfig=!1}setGridConfig(i){this._gridConfig=i}loadConfig(){l.get().then((i=>{i.loadGridConfig(this.configName).then((i=>{this.setGridConfig(i)})).catch((i=>{console.warn(i)}))}))}gridConfigChangeHandler(i){l.saveGridConfig(i.detail,this.configName),i.stopPropagation()}modalConfigChangeHandler(i){const t=i.detail;this._grid.setColumnsState(t.columns).then((()=>{this.setGridConfig(t),this.closeGridConfig(),this.dataExporterProviderStore()})),i.stopPropagation()}buildColumnsMetadata(i){const t=[];return null==i||i.forEach((i=>{var s,e;if(i.hidden&&"RECDESP"!==i.name)return;const r=null===(s=this._dataUnit)||void 0===s?void 0:s.getField(i.name);if(t.push({label:i.label,id:i.name,width:i.width,type:null==r?void 0:r.dataType,userInterface:null==r?void 0:r.userInterface}),null!=(null===(e=null==r?void 0:r.properties)||void 0===e?void 0:e.DESCRIPTIONFIELD)){const i=r.properties.mergedFrom;t.push({label:r.properties.DESCRIPTIONENTITY,id:`${i?i+".":""}${r.properties.ENTITYNAME}.${r.properties.DESCRIPTIONFIELD}`,width:200,type:a.TEXT,userInterface:n.LONGTEXT})}})),t||[]}getPaginationInfo(){var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.getPaginationInfo()}getExporterOffset(i){if(null==i)return;const t=i.firstRecord;return t>0?t-1:t}async dataExporterProviderStore(){var i;const t=await(null===(i=this._snkDataUnit)||void 0===i?void 0:i.getSelectedRecordsIDsInfo()),s={getFilters:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.getAppliedFilters()},getColumnsMetadata:async()=>{var i;const t=await(null===(i=this._grid)||void 0===i?void 0:i.getColumnsState());return this.buildColumnsMetadata(t)},getOrders:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.getSort()},getResourceURI:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.name},getSelectedNumber:()=>{var i,t;return null===(t=null===(i=this._dataState)||void 0===i?void 0:i.selectionInfo)||void 0===t?void 0:t.length},getTotalRecords:()=>{var i,t,s;const{total:e}=(null===(i=this._dataUnit)||void 0===i?void 0:i.getPaginationInfo())||{};return null!=e?e:null===(s=null===(t=this._dataUnit)||void 0===t?void 0:t.records)||void 0===s?void 0:s.length},getSelectedIDs:()=>t||[],getOffset:()=>this.getExporterOffset(this.getPaginationInfo()),getLimit:()=>{var i;return null===(i=this._dataUnit)||void 0===i?void 0:i.pageSize},getRecordID:()=>{var i,t,s;return null===(s=null===(t=null===(i=this._dataUnit)||void 0===i?void 0:i.records)||void 0===t?void 0:t[0])||void 0===s?void 0:s.__record__id__}};u.set("exporterProviders",Object.assign(Object.assign({},u.get("exporterProviders")),{[this.configName]:s}))}addElementID(){r.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}componentWillLoad(){this._application=d.getContextValue("__SNK__APPLICATION__");let i=this._element.parentElement;for(;i;){if("SNK-DATA-UNIT"===i.tagName.toUpperCase()){this._snkDataUnit=i,this._dataUnit=this._snkDataUnit.dataUnit,this._dataUnit?(this._dataUnitLoadLockerResolver=this._dataUnit.addLoadingLocker(),this.addElementID()):this._snkDataUnit.addEventListener("dataUnitReady",(i=>{this._dataUnit=i.detail,this._dataUnitLoadLockerResolver=this._dataUnit.addLoadingLocker(),this.addElementID()})),this._snkDataUnit.addEventListener("dataStateChange",(i=>{this._dataState=i.detail}));break}i=i.parentElement}this.loadConfig()}getHeaderDisabledButtons(){var i;const t=[];return(null===(i=this._dataState)||void 0===i?void 0:i.selectionInfo)&&(this._dataState.selectionInfo.length>1&&t.push(o.CLONE,"ATTACH"),this._dataState.selectionInfo.isAllRecords()&&t.push("REMOVE")),t}componentWillRender(){var i;const t=this._dataUnit&&this._dataUnit.records.length>0?[]:["DATA_EXPORTER"];let s;s=this._dataState&&(null===(i=this._dataState.selectionInfo)||void 0===i?void 0:i.length)?this.isDetail?"snkGridHeaderTaskbar.detail.selected":"snkGridHeaderTaskbar.selected":this.isDetail?"snkGridHeaderTaskbar.detail.unselected":"snkGridHeaderTaskbar.unselected",this._headerTaskbarProcessor.process(s,this.taskbarManager,this._dataState,this.getHeaderDisabledButtons(),t),this._topTaskbarProcessor.process(this.getTopTaskBarId(this.presentationMode===h.SECONDARY?".secondary":""),this.taskbarManager,this._dataState,void 0,t),this.dataExporterProviderStore()}getTopTaskBarId(i){var t;return(null===(t=this._dataState)||void 0===t?void 0:t.isDirty)?`snkGridTopTaskbar.finish_edition${i}`:`snkGridTopTaskbar.regular${i}`}getPrimaryButton(){return this.presentationMode===h.PRIMARY?"INSERT":""}onEzGridReady(){var i;null===(i=this._dataUnitLoadLockerResolver)||void 0===i||i.call(this),this._dataUnitLoadLockerResolver=void 0}render(){var i,t;if(this._dataUnit)return s("div",{class:"snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large"},s("div",{class:"snk-grid__header ez-margin-bottom--medium"},s("snk-filter-bar",{ref:i=>this._snkFilterBar=i,dataUnit:this._dataUnit,"data-element-id":"gridFilter",class:"snk-grid__filter-bar ez-align--top",configName:this.configName,messagesBuilder:this.messagesBuilder}),(null===(t=null===(i=this._snkFilterBar)||void 0===i?void 0:i.filterConfig)||void 0===t?void 0:t.length)>0&&s("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider"}),s("snk-taskbar",{class:"ez-padding-left--medium","data-element-id":"grid_top",key:"topTaskbar",configName:this.configName,dataUnit:this._dataUnit,messagesBuilder:this.messagesBuilder,buttons:this._topTaskbarProcessor.buttons,disabledButtons:this._topTaskbarProcessor.disabledButtons,customButtons:this._topTaskbarProcessor.customButtons,primaryButton:this.getPrimaryButton()})),s("ez-grid",{ref:i=>this._grid=i,class:(this.presentationMode===h.SECONDARY?"snk-grid-container__without-shadow ":"")+"snk-grid__table","data-element-id":"embedded",dataUnit:this._dataUnit,key:"grid-"+this._snkDataUnit.entityName,config:this._gridConfig,onConfigChange:i=>{this.gridConfigChangeHandler(i)},onEzDoubleClick:()=>this.gridDoubleClick.emit(),statusResolver:this.statusResolver,multipleSelection:this.multipleSelection,onComponentReady:()=>this.onEzGridReady()},s("snk-taskbar",{dataUnit:this._dataUnit,configName:this.configName,messagesBuilder:this.messagesBuilder,"data-element-id":"grid_left",buttons:this._headerTaskbarProcessor.buttons,disabledButtons:this._headerTaskbarProcessor.disabledButtons,customButtons:this._headerTaskbarProcessor.customButtons,slot:"leftButtons",actionsList:this.actionsList})),s("div",{class:"ez-col ez-col--sd-12"},s("slot",{name:"SnkGridFooter"})),s("ez-modal",{modalSize:"small",closeEsc:!1,closeOutsideClick:!1,opened:this._popUpGridConfig,onEzCloseModal:()=>this.closeGridConfig()},s("snk-grid-config",{ref:i=>this._snkGridConfig=i,config:this._gridConfig,"data-element-id":this._element.getAttribute(r.DATA_ELEMENT_ID_ATTRIBUTE_NAME),application:this._application,selectedIndex:0,configName:this.configName,onConfigChange:i=>this.modalConfigChangeHandler(i),onConfigCancel:()=>this.closeGridConfig()})))}get _element(){return e(this)}};v.style=".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:300px}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";export{v as snk_grid}
@@ -0,0 +1 @@
1
+ import{r as t,h as e,H as i,g as r}from"./p-b9667fbe.js";import{DataType as s,ObjectUtils as a,ElementIDUtils as o,ErrorException as n,ApplicationContext as l}from"@sankhyalabs/core";import{EzScrollDirection as c}from"@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection";import{C as d}from"./p-b1c02726.js";import{toString as h}from"@sankhyalabs/core/dist/dataunit/metadata/DataType";import{F as f}from"./p-584d7212.js";import{ApplicationUtils as u}from"@sankhyalabs/ezui/dist/collection/utils";import"./p-2ea933b2.js";import"./p-41d92871.js";import"./p-112455b1.js";import"./p-79f78e10.js";import"./p-6c2c71ca.js";class m{constructor({filterConfig:t,onComplete:e,getMessage:i}){this._filterConfig=t,this._onComplete=e,this._getMessage=i}applyFilters(t){this._onComplete(t),this._closeModal()}clearAll(t){return t.map((t=>Object.assign(Object.assign({},t),{value:void 0})))}buildFilterModal(){const t=document.createElement("snk-filter-modal");return t.filters=this._filterConfig,t.getMessage=this._getMessage.bind(this),t.applyFilters=this.applyFilters.bind(this),t.clearAll=this.clearAll.bind(this),t.closeModal=()=>this._closeModal(),t}async showModal(){const t={content:this.buildFilterModal(),position:"left",heightMode:"full",closeOutsideClick:!1,useScrimLight:!0};this._closeModal=await u.showModal(t)}}const p=class{constructor(e){t(this,e),this._updateSequence=[],this._loadingPending=!1,this._configUpdated=!1,this._pendingFilters=[],this._calculateSortIndex=t=>{let e=t.hardFixed?1e6:0;return t.hardFixed||(e+=t.fixed?1e5:0,e+=null==t.value?0:1e4,e+=this._updateSequence.lastIndexOf(t.id)+1),e},this._filtersComparator=(t,e)=>this._calculateSortIndex(e)-this._calculateSortIndex(t),this.dataUnit=void 0,this.configName=void 0,this.filterConfig=void 0,this.messagesBuilder=void 0,this.allowDefault=void 0,this.scrollerLocked=!1}observeFilterConfig(t,e){if(null!=e&&null==t)this._loadingPending=!0,this._configUpdated=!0;else{const i=new Map(e?e.map((t=>[t.id,t])):void 0);t.forEach((t=>{const e=i.get(t.id);null!=e?(this._configUpdated=this._configUpdated||a.objectToString(e)!=a.objectToString(t),this._loadingPending=this._loadingPending||a.objectToString(e.value)!==a.objectToString(t.value)):(this._configUpdated=!0,this._loadingPending=this._loadingPending||null!=t.value)}))}this.processAfterUpdateConfig()}async reload(){this.loadConfigFromStorage()}componentDidLoad(){this._element&&o.addIDInfo(this._element,null,{dataUnit:this.dataUnit})}processPendingFilter(){this._pendingFilters.length>0&&null==this._currentPendingFilter&&(this._currentPendingFilter=this._element.querySelector("#filter-"+this._pendingFilters.pop()),this._currentPendingFilter&&this._currentPendingFilter.showUp(!0).then((()=>{this._currentPendingFilter=void 0,this.processPendingFilter()}))),null==this._currentPendingFilter&&this.processAfterUpdateConfig()}processAfterUpdateConfig(){this._pendingFilters.length>0||(this._loadingPending&&(this._loadingPending=!1,this._inProgressLoadFromConfig=new Promise((t=>{this.dataUnit.loadData().then((()=>{t()}))}))),this._configUpdated&&(this._configUpdated=!1,d.saveFilterBarConfig(this.filterConfig,this.configName)))}getMessage(t,e,i){var r;return(null===(r=this.messagesBuilder)||void 0===r?void 0:r.getMessage(t,e))||i}getFilter(t){var e;const i=[];return null===(e=this.filterConfig)||void 0===e||e.filter((t=>this.isActiveFilter(t))).forEach((t=>{const e=(t=>{switch(t.type){case f.DEFAULT_FILTER:return function(t){return{name:t.id,expression:t.props.expression,params:[]}}(t);case f.BINARY_SELECT:return function(t){const{id:e,value:i,props:r}=t;return{name:e,expression:r.options.find((t=>t.name===i)).expression,params:[]}}(t);case f.MULTI_SELECT:return function(t){const{id:e,value:i,props:r}=t;return{name:e,expression:r.expression,params:[{name:e,dataType:s.TEXT,value:i}]}}(t);case f.PERIOD:return function(t){const{id:e,value:i,props:r}=t;let{end:a,start:o}=i;"string"==typeof a&&(a=new Date(a)),"string"==typeof o&&(o=new Date(o));const n=[];let l;return a&&o?(l=r.expression.fullfill,n.push({name:`${e}.START`,dataType:s.DATE,value:h(s.DATE,o)},{name:`${e}.END`,dataType:s.DATE,value:h(s.DATE,a)})):o?(l=r.expression.onlystart,n.push({name:e,dataType:s.DATE,value:h(s.DATE,o)})):(l=r.expression.onlyend,n.push({name:e,dataType:s.DATE,value:h(s.DATE,a)})),{name:e,expression:l,params:n}}(t);case f.SEARCH:return function(t){const{id:e,value:i,props:r}=t;return{name:e,expression:r.expression,params:[{name:e,dataType:s.TEXT,value:h(s.TEXT,i.value)}]}}(t);case f.TEXT:return function(t){const{id:e,value:i,props:r}=t;return{name:e,expression:r.expression,params:[{name:e,dataType:s.TEXT,value:h(s.TEXT,i)}]}}(t);case f.NUMBER:return function(t){const{id:e,value:i,props:r}=t;return{name:e,expression:r.expression,params:[{name:e,dataType:s.NUMBER,value:h(s.NUMBER,i)}]}}(t);case f.PERSONALIZED:return function(t){var e;const{id:i,value:r,props:a}=t;return{name:i,expression:a.expression,params:((null===(e=a.personalizedFilter)||void 0===e?void 0:e.parameters)||[]).map(((t,e)=>{const i=Array.from(r),a=t.dataType;let o=e>=0&&e<i.length?i[e]:null;return null!=o&&"object"==typeof o&&"value"in o&&(o=o.value),null==o&&a===s.BOOLEAN&&(o=!1),{name:t.name,dataType:a,value:"string"==typeof o?o:h(a,o)}}))}}(t);default:return}})(t);e&&i.push(e)})),i}isActiveFilter(t){return t.visible&&null!=t.value||t.type===f.DEFAULT_FILTER}registryFilterProvider(){this.dataUnit.addFilterProvider(this),this.filterConfig&&this.dataUnit.loadData()}itemFocused(t){this._element.querySelectorAll("snk-filter-item,snk-filter-list").forEach((e=>{e.id===t?"snk-filter-item"===e.tagName.toLowerCase()&&e.getClientRects()[0].x<0&&e.scrollIntoView({behavior:"auto",inline:"nearest"}):e.hideDetail()}))}getFilterItems(){const t=[],i=[];this.filterConfig.filter((t=>t.visible)).forEach(((r,s)=>{const a=`filter-${r.id}`,o=e("snk-filter-item",{onVisibleChanged:t=>this.scrollerLocked=t.detail,onFocusin:()=>this.itemFocused(a),id:a,config:r,class:s>0?"ez-padding-left--medium":"",getMessage:(t,e)=>this.getMessage(t,e),key:r.id});return r.fixed||r.hardFixed?t.push(o):i.push(o),o}));const r=[];return r.push(...t),t.length>0&&i.length>0&&r.push(e("hr",{class:"ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-filter-bar__divider"})),r.push(...i),r}calculateUpdateSequence(t){t&&(this._updateSequence=this._updateSequence.filter((e=>t.id!==e)),this._updateSequence.push(t.id))}normalizeItem(t){const e=Object.assign({},t);return["props","value","hardFixed","fixed"].forEach((t=>{null==e[t]&&delete e[t]})),""===t.value&&delete t.value,e}updateFilter(t){this.filterConfig=this.filterConfig.map((e=>(t=this.normalizeItem(t),e.id===t.id?(a.objectToString(e)!=a.objectToString(t)&&this.calculateUpdateSequence(t),t):e))).sort(((t,e)=>this._filtersComparator(t,e)))}loadPermitions(){this._application.isUserSup().then((t=>this.allowDefault=t))}loadConfigFromStorage(){d.get().then((t=>{t.loadFilterBarConfig(this.configName).then((t=>{var e;this.filterConfig=t.map((t=>this.normalizeItem(t))),this._inProgressLoadFromConfig||(null===(e=this.dataUnit)||void 0===e||e.loadData(void 0,void 0,!0),this._inProgressLoadFromConfig=void 0)})).catch((t=>{throw new n(this.getMessage("snkFilterBar.failToLoadConfig"),t)}))}))}attachDataUnit(){if(null==this.dataUnit){let t=this._element.parentElement;for(;t;)if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){const e=t;this.dataUnit=e.dataUnit,this.dataUnit?this.registryFilterProvider():e.addEventListener("dataUnitReady",(t=>{this.dataUnit=t.detail,this.registryFilterProvider()}));break}t=t.parentElement}else this.registryFilterProvider()}filterChangeListener(t){this.updateFilter(t.detail)}async showFilterModal(){const t=new m({filterConfig:this.filterConfig,onComplete:t=>{this.filterConfig=t.map(this.normalizeItem).sort(((t,e)=>this._filtersComparator(t,e)))},getMessage:(t,e)=>this.getMessage(t,e)});await t.showModal()}componentWillLoad(){this._application=l.getContextValue("__SNK__APPLICATION__"),this._application&&(this.loadPermitions(),this.loadConfigFromStorage()),this.attachDataUnit()}componentDidRender(){this.processPendingFilter()}render(){if(this.dataUnit&&this.filterConfig&&0!==this.filterConfig.length)return e(i,null,e("ez-scroller",{direction:c.HORIZONTAL,activeShadow:!0,locked:this.scrollerLocked},this.getFilterItems()),e("ez-button",{class:"ez-padding-left--medium",size:"small",label:this.getMessage("snkFilterBar.filters",void 0,"Filtros"),onClick:this.showFilterModal.bind(this)},e("ez-icon",{slot:"leftIcon",iconName:"plus",class:"ez-padding-right--small"})))}get _element(){return r(this)}static get watchers(){return{filterConfig:["observeFilterConfig"]}}};p.style='.sc-snk-filter-bar-h{display:grid;grid-template-columns:minmax(100px, 100%) 1fr 1fr}.snk-filter__popover-container.sc-snk-filter-bar{display:flex;cursor:auto}.snk-filter__popover.sc-snk-filter-bar{display:flex;flex-direction:column;position:absolute;width:fit-content;height:fit-content;min-width:265px;z-index:var(--most-visible, 3);background-color:var(--background--xlight, #fff);border-radius:var(--border--radius-medium, 12px);box-shadow:var(--shadow, 0px 0px 16px 0px #000)}.snk-filter-item__editor-header.sc-snk-filter-bar{flex-grow:1;font-weight:var(--text-weight--medium, 400);color:var(--color--title-primary, #2B3A54)}.snk-filter__popover-rule.sc-snk-filter-bar{border-style:solid;border-color:var(--color--disable-secondary, #F2F5F8);border-radius:1px;border-width:1px;width:100%}.editor__ez-check.sc-snk-filter-bar{--ez-check__label--padding-left:0}.snk-filter-item__editor-header-button.sc-snk-filter-bar{cursor:pointer;background-color:transparent;border:none;padding:3px;outline-color:var(--color--primary)}.snk-filter-bar__divider.sc-snk-filter-bar{margin-bottom:var(--space--small)}.snk-filter-bar__filter-list-items-container.sc-snk-filter-bar{overflow-y:auto;max-height:360px;margin-top:var(--space--small, 6px)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar{cursor:pointer;border-radius:var(--border--radius-small, 6px);border:none;background-color:transparent}.snk-filter-bar__filter-list-item__label.sc-snk-filter-bar{color:var(--title--primary)}.snk-filter-bar__filter-list-item__label--secondary.sc-snk-filter-bar{color:var(--text--primary)}.snk-filter-bar__filter-list-item__icon.sc-snk-filter-bar{--ez-icon--color:var(--title--primary)}.snk-filter-bar__filter-list-item__icon--secondary.sc-snk-filter-bar{--ez-icon--color:var(--text--secondary)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:focus-visible{outline:none;background-color:var(--background--medium)}.snk-filter-bar__filter-list-item.sc-snk-filter-bar:hover{background-color:var(--background--medium)}.snk-filter-bar__filter-list-items-container--empty.sc-snk-filter-bar{width:100%;height:100px;display:flex;justify-content:center;align-self:center;align-items:center}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar{position:relative}.snk-filter-bar__filter-list-items-button--active.sc-snk-filter-bar::after{display:flex;position:absolute;content:"";width:8px;height:8px;top:7px;left:17px;background-color:var(--icon--alert--color, #008561);border-radius:50%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar{--modal-item-border-width:2px;display:flex;flex-direction:row;margin-left:var(--modal-item-border-width);border-radius:var(--border--radius-medium, 12px);background-color:var(--background--medium, #f0f3f7);border:none;width:100%}.snk-filter-bar__filter-modal-item.sc-snk-filter-bar:focus-visible{outline:var(--color--primary) solid var(--modal-item-border-width)}.snk-filter-bar__filter-modal-item__check.sc-snk-filter-bar{width:auto}.snk-filter-bar__filter-modal-item__label.sc-snk-filter-bar{font-weight:var(--text-weight--medium)}.snk-filter-bar__filter-modal-content.sc-snk-filter-bar{display:grid;grid-template-rows:auto auto 1fr auto;width:99%;height:100%}';export{p as snk_filter_bar}
@@ -0,0 +1,11 @@
1
+ import{r as t,c as s,h as e,g as n}from"./p-b9667fbe.js";import{WaitingChangeException as i,WarningException as r,ErrorException as a,ObjectUtils as o,DateUtils as c,StringUtils as h,OnboardingUtils as u,DependencyType as l,ElementIDUtils as p,ApplicationContext as m,ErrorTracking as d,DataType as f}from"@sankhyalabs/core";import{d as w,D as y,U as g}from"./p-41d92871.js";import{ApplicationUtils as P}from"@sankhyalabs/ezui/dist/collection/utils";import{P as I}from"./p-11028eba.js";import{G as v,C as _}from"./p-b1c02726.js";import{D as A}from"./p-f821768b.js";import{R as E}from"./p-79f78e10.js";import{S as C}from"./p-c74fca58.js";import"./p-112455b1.js";import"./p-2ea933b2.js";import"./p-6c2c71ca.js";import"./p-584d7212.js";class S{constructor(t){this._app=t,window.addEventListener("error",(t=>this.errorHandler(t))),window.addEventListener("unhandledrejection",(t=>this.rejectionHandler(t)))}rejectionHandler(t){const s=t.reason;s instanceof i||(s?this.processException(s):this._app.isDebugMode().then((t=>{t&&this._app.error("Promise rejeitada","Erro interno: Uma promise foi rejeitada sem razão determinada.")})))}errorHandler(t){this.processException(t.error)}buildErrorCodeHTML(t){return'<br><a href="#" onclick="try{window.workspace.openHelp(\'_tbcode:'+t+"')} catch(e){alert('Não é possível abrir a ajuda fora do workspace Sankhya');}\">Código: "+t+"</a>"}processException(t){t.errorCode&&(t.message+=this.buildErrorCodeHTML(t.errorCode)),t instanceof i||t instanceof r?this._app.alert(t.title,t.message):t instanceof a?this._app.error(t.title,t.message):this._app.isDebugMode().then((s=>{if(s)if(t instanceof Error)this._app.error(t.name,t.message);else{const s=(null==t?void 0:t.title)||"Erro detectado",e="string"==typeof t?t:t.message||`Erro interno "${o.objectToString(t)}"`;this._app.error(s,e)}}))}}function T(){const t=["2909523kXwted","CompanyName=Sankhya Jiva Tecnologia e Inovao Ltda,LicensedApplication=Sankhya Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869","1131048CARoeW","502909mLEPmu","447255iQEXuN","428UHbJwW","270AFTxAV","194369jhGqTI","1540nWuTrj","2044062GicUQI","30CkXPWg"];return(T=function(){return t})()}const D=b;function b(t,s){const e=T();return(b=function(t){return e[t-=392]})(t,s)}!function(){const t=b,s=T();for(;;)try{if(951926==-parseInt(t(398))/1+-parseInt(t(393))/2+parseInt(t(395))/3+-parseInt(t(400))/4*(parseInt(t(392))/5)+-parseInt(t(401))/6*(-parseInt(t(402))/7)+parseInt(t(397))/8+-parseInt(t(399))/9*(-parseInt(t(394))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const N=D(396);class j{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchTotals",w.gql`query($filters: [InputFilter!] $name: String!) {
2
+ $queryAlias$: fetchTotals(name: $name, filters: $filters ){
3
+ name
4
+ value
5
+ }
6
+ }`)}async getTotals(t,s,e){let n={name:`totals://${t}/${s}`,filters:e};return y.get().callGraphQL({values:n,query:this.templateByQuery.get("fetchTotals")})}fetchTotals(t,s,e=[]){return new Promise(((n,i)=>{this.getTotals(t,s,e).then((t=>{if(t.length>0){const s=new Map;t.forEach((t=>{s.set(t.name,parseFloat(t.value))})),n(s)}else i("Não foi possível recuperar os totalizadores")})).catch((t=>{i(t)}))}))}}var O;class L{static openAppActivity(t,s){var e;null===(e=window.workspace)||void 0===e||e.openAppActivity(t,s)}static getAppLabel(t){if(null!=(null===window||void 0===window?void 0:window.workspace))return null==window.workspace.getAppLabel&&(window.workspace.getAppLabel=t=>(t||"").split(".").pop()),window.workspace.getAppLabel(t)}}L.resourceID=null===(O=window.workspace)||void 0===O?void 0:O.resourceID;class U{static webConnectionCaller(t,s,e){var n;null===(n=window.AppletCaller)||void 0===n||n.webConnectionCaller(t,s,e)}}class k{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchParam",w.gql`query($name: String!) {
7
+ $queryAlias$: fetchResource(name: $name){
8
+ name
9
+ resource
10
+ }
11
+ }`)}async getParam(t){const s=`param://application?params=${t}`;return y.get().callGraphQL({values:{name:s},query:this.templateByQuery.get("fetchParam")})}async asString(t){const s=await this.getParam(t);return this.getValue(s)}async asInteger(t){const s=await this.getParam(t);return parseInt(this.getValue(s))}async asFloat(t){const s=await this.getParam(t);return parseFloat(this.getValue(s))}async asBoolean(t){const s=await this.getParam(t);return"S"===this.getValue(s)}async asDate(t){const s=await this.getParam(t);return c.strToDate(this.getValue(s))}async getBatchParams(t){const s=await this.getParam(t.join(",")),e={};return s.forEach((t=>e[t.name]=t.resource)),e}getValue(t={}){if(Array.isArray(t)&&t.length>0&&(t=t[0]),h.isEmpty(t.resource))return"";try{const s=o.stringToObject(t.resource),[e]=Object.keys(s);return s[e]}catch(t){console.warn("Erro ao converter string JSON.")}}}const R=$;function $(t,s){const e=F();return($=function(t){return e[t-=378]})(t,s)}function F(){const t=["true","863GKWjmo","parse","56355fjjjAm","isSup","putAccess","4324480sjuCdS","hasOwnProperty","239748okvJLB","name","6055770tXeRaU","actions","forEach","7RPRvzn","1042CHxkUw","2988126NIwRMm","20MTNzmH","authorizationSf","item","string","hasAccess","isArray","Objeto não pode ser indefinido.","3071943fWslZp","parseFromJSON"];return(F=function(){return t})()}!function(){const t=$,s=F();for(;;)try{if(281287==parseInt(t(399))/1*(-parseInt(t(387))/2)+-parseInt(t(401))/3+parseInt(t(381))/4*(-parseInt(t(389))/5)+parseInt(t(388))/6*(-parseInt(t(386))/7)+parseInt(t(379))/8+parseInt(t(396))/9+parseInt(t(383))/10)break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class M{[R(397)](t){const s=R;if(typeof(t=utxt(t[s(390)]))==s(392)&&(t=JSON[s(400)](t)),null==t)throw Error(s(395));const e=new q("S"===t[s(402)]||!0===t[s(402)]);return Array[s(394)](t[s(391)])&&t[s(391)][s(385)]((t=>e.putAccess(t[s(382)],String(t.status)==s(398)))),e}}class q{constructor(t){const s=R;this.isSup=t,this[s(384)]={}}[R(378)](t,s){this[R(384)][t]=s}[R(393)](t){const s=R;if(this[s(402)])return!0;let e=!0;return this[s(384)][s(380)](t)&&(e=this.actions[t]),e}isUserSup(){return this.isSup}}class x extends E{getData(t){const s=`cfg://auth/${t}`;return new Promise(((t,e)=>{this.loadResource(s).then((s=>{let e=o.stringToObject(s);e&&"object"==typeof e&&t(e)})).catch((t=>{e(t)}))}))}}var z;!function(t){t.INSERT="I",t.UPDATE="A",t.REMOVE="E",t.SHOW="C",t.CONFIG="F",t.CONFIG_NUMBER="N",t.CLONE="D",t.CONFIG_GRID="G"}(z||(z={}));const G=class{constructor(e){t(this,e),this.applicationLoaded=s(this,"applicationLoaded",7),this.applicationLoading=s(this,"applicationLoading",7),this._authPromises=[],this._duCache=new Map,this._duPromises=new Map,this._requestListener=new H,this.messagesBuilder=void 0,this.configName=void 0}get parameters(){return this._parameters||(this._parameters=new k),this._parameters}get resourceID(){return this._resourceID||(this._resourceID=this.urlParams.get("workspaceResourceID")||this.urlParams.get("resourceID")||L.resourceID||"unknown.resource.id"),this._resourceID}get auth(){return this._auth?Promise.resolve(this._auth):new Promise(((t,s)=>{const e=this._authPromises.length>0;this._authPromises.push(new J(t,s)),e||this.authFetcher.getData(this.resourceID).then((t=>{for(this._auth=t;this._authPromises.length>0;)this._authPromises.pop().resolve(this._auth)})).catch((t=>{for(;this._authPromises.length>0;)this._authPromises.pop().reject(t)}))}))}async isUserSup(){return new Promise(((t,s)=>{this.auth.then((e=>{this.getAuthList(e).then((s=>{t(s.isSup)})).catch((t=>s(t)))}))}))}initOnboarding(t){return u.getInstance().init(t,window.envContext),Promise.resolve()}async hasAccess(t){return new Promise(((s,e)=>{this.auth.then((n=>{this.getAuthList(n).then((e=>{s(e.isSup||e.actions[t])})).catch((t=>e(t)))}))}))}async getAllAccess(){return new Promise(((t,s)=>{this.auth.then((e=>{this.getAuthList(e).then((s=>{const e={};e.isSup=s.isSup,Object.entries(z).forEach((t=>{e[t[0]]=s.actions[t[1]]||!1})),t(e)})).catch((t=>s(t)))}))}))}async getStringParam(t){return this.parameters.asString(t)}async getIntParam(t){return this.parameters.asInteger(t)}async getFloatParam(t){return this.parameters.asFloat(t)}async getBooleanParam(t){return this.parameters.asBoolean(t)}async getDateParam(t){return this.parameters.asDate(t)}async showPopUp(t,s="full",e=!0){this.clearContent(this._popUp),this._popUp.appendChild(t),this._popUp.opened=!0,this._popUp.heightMode=s,this._popUp.useHeader=e,"EZ-MODAL-CONTAINER"===t.tagName&&(this._popUp.useHeader=!1)}async showModal(t){this.clearContent(this._rightModal),this._rightModal.appendChild(t),this._rightModal.opened=!0}async closeModal(){this.clearContent(this._rightModal),this._rightModal.opened=!1}async closePopUp(){this.clearContent(this._popUp),this._popUp.opened=!1,this._popUp.useHeader=!0,this._popUp.heightMode="full"}async temOpcional(t){const s=t.split(",");return new Promise(((t,e)=>{this.getAttributeFromHTMLWrapper("opc0009").then((n=>{"1"===n?t(!0):Promise.all(s.map((t=>this.getAttributeFromHTMLWrapper("opc"+t)))).then((s=>{t(s.includes("1"))})).catch((t=>{e(t)}))})).catch((t=>{e(t)}))}))}async getConfig(t){let s={serviceName:"SystemUtilsSP.getConf",requestBody:{config:{chave:t,tipo:"T"}}};return new Promise(((t,e)=>{y.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(s)).then((s=>{var e;return t(null===(e=s.config)||void 0===e?void 0:e.data)})).catch((t=>e(t)))}))}async saveConfig(t,s){let e={serviceName:"SystemUtilsSP.saveConf",requestBody:{config:{chave:t,tipo:"T",data:s}}};return new Promise(((t,s)=>{y.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(e)).then((s=>t(s))).catch((t=>s(t)))}))}async getAttributeFromHTMLWrapper(t){return Promise.resolve(window[t])}async openApp(t,s){L.openAppActivity(t,s)}async webConnection(t,s,e){this.getStringParam(t).then((t=>{U.webConnectionCaller(t,s,e)}))}getDuPromissesStack(t){let s;return t&&(s=this._duPromises.get(t),s||(s=[],this._duPromises.set(t,s))),s||[]}async createDataunit(t,s,e){return new Promise(((n,i)=>{const r=this.getDuPromissesStack(s),a=r.length>0;if(r.push(new J(n,i)),!a){const n=this.dataUnitFetcher.getDataUnit(t,this.resourceID,e);n.loadMetadata().then((()=>{for(s&&this.updateDataunitCache(void 0,s,n);r.length>0;)r.pop().resolve(n)})).catch((t=>{for(;r.length>0;)r.pop().reject(t)}))}}))}async updateDataunitCache(t,s,e){t&&this._duCache.delete(t),this._duCache.set(s,e)}async getDataUnit(t,s,e){return new Promise(((n,i)=>{const r=this._duCache.get(s);r?n(r):this.createDataunit(t,s,e).then((t=>{n(t)})).catch((t=>i(t)))}))}async addClientEvent(t,s){return new Promise((e=>{y.addClientEvent(t,s),e()}))}async removeClientEvent(t){return new Promise((s=>{y.removeClientEvent(t),s()}))}async hasClientEvent(t){return new Promise((s=>{s(y.hasClientEvent(t))}))}async getResourceID(){return Promise.resolve(this.resourceID)}async getUserID(){return Promise.resolve(window.UID)}async alert(t,s,e,n){return P.alert(t,s,e,n)}async error(t,s,e,n){return P.error(t,s,e,n)}async success(t,s,e,n){return P.success(t,s,e,n)}async message(t,s,e,n){return P.message(t,s,e,n)}async confirm(t,s,e,n,i){return P.confirm(t,s,e,n,i)}async info(t,s){return P.info(t,s)}async loadGridConfig(t){return this.gridConfigFetcher.getConfig(t,this.resourceID)}async loadTotals(t,s,e){return this.totalsFetcher.fetchTotals(t,s,e)}async getAuthList(t){return await(new M).parseFromJSON(t)}get urlParams(){return this._urlParams||(this._urlParams=g.getQueryParams(location.search)),this._urlParams}get dataUnitFetcher(){return this._dataUnitFetcher||(this._dataUnitFetcher=new A),this._dataUnitFetcher}get gridConfigFetcher(){return this._gridConfigFetcher||(this._gridConfigFetcher=new v),this._gridConfigFetcher}get totalsFetcher(){return this._totalsFetcher||(this._totalsFetcher=new j),this._totalsFetcher}get pesquisaFetcher(){return this._pesquisaFetcher||(this._pesquisaFetcher=new I),this._pesquisaFetcher}get authFetcher(){return this._authFetcher||(this._authFetcher=new x),this._authFetcher}async executeSearch(t,s,e){const n=null==e?void 0:e.getField(s);if(n){const{mode:s,argument:i}=t,{ENTITYNAME:r,CODEFIELD:a,DESCRIPTIONFIELD:o,ROOTENTITY:c,DESCRIPTIONENTITY:h}=n.properties,u=n.dependencies;let p;const m={rootEntity:c,descriptionFieldName:o,codeFieldName:a,showInactives:!1,dataUnitId:e.dataUnitId};return null==u||u.filter((t=>t.masterFields)).forEach((t=>{var s;t.type===l.SEARCHING&&(null===(s=t.masterFields)||void 0===s?void 0:s.length)>0&&(p={expression:t.expression,params:t.masterFields.map((t=>{const s=e.getField(t),n=(null==s?void 0:s.dataType)||f.TEXT,i=e.getFieldValue(t);if(null==i)throw this.alert("Erro ao pesquisar",`É necessario informar o campo ${s.label} para executar a pesquisa.`),new Error(`É necessario informar o campo ${s.label} para executar a pesquisa.`);return{name:t,value:i,dataType:n}}))})})),this.executePreparedSearch(s,i,{entity:r,entityDescription:h,criteria:p,searchOptions:m})}}async executePreparedSearch(t,s,e){const{entity:n,entityDescription:i,criteria:r,searchOptions:a}=e;return"ADVANCED"===t?new Promise((t=>{const e=document.createElement("snk-pesquisa");e[p.DATA_ELEMENT_ID_ATTRIBUTE_NAME]=`entity_${n}`,e.argument=s,e.searchLoader=t=>this.pesquisaFetcher.loadAdvancedSearch(n,t,r,a),e.selectItem=s=>{t(s),this.clearPopUpTitle(),this.closePopUp()},this.setPopUpTitle(i),this.showPopUp(e)})):this.pesquisaFetcher.loadSearchOptions(n,s,r,a)}async isDebugMode(){return new Promise((t=>{t(window.isDebugMode)}))}async getAppLabel(){return L.getAppLabel(this._resourceID)}addSearchListener(t,s,e){return new Promise((n=>{n(this.pesquisaFetcher.addSearchListener(t,s.dataUnitId,e))}))}clearContent(t){t&&Array.from(t.children).forEach((s=>{t.removeChild(s)}))}clearPopUpTitle(){this._popUp.ezTitle=""}setPopUpTitle(t){this._popUp.ezTitle=t}componentWillLoad(){this._errorHandler=new S(this),this.messagesBuilder=new C,m.setContextValue("__EZUI__UPLOAD__ADD__URL__",`${g.getUrlBase()}/mge/upload/file`),m.setContextValue("__EZUI__SEARCH__OPTION__LOADER__",((t,s,e)=>this.executeSearch(t,s,e))),m.setContextValue("__EZUI__GRID_LICENSE__",N),d.init(),_.get()}connectedCallback(){m.setContextValue("__SNK__APPLICATION__",this),y.addRequestListener(this._requestListener)}disconnectedCallback(){y.removeRequestListener(this._requestListener)}componentDidLoad(){this.applicationLoading.emit(!0),window.requestAnimationFrame((()=>{this.applicationLoaded.emit(!0)})),p.addIDInfo(this._element,`resource_${this._resourceID}`)}render(){return e("div",null,e("ez-loading-bar",{ref:t=>this._requestListener.loadingBar=t}),e("ez-popup",{opened:!1,ref:t=>this._popUp=t,onEzClosePopup:()=>this.closePopUp()}),e("ez-modal",{opened:!1,ref:t=>this._rightModal=t,"modal-size":"small",closeOutsideClick:!0,closeEsc:!0}))}get _element(){return n(this)}};class H{constructor(){this._debounceTime=1e3,this._ignoredNameTypes=["totals"],this._countRequest=0}onRequestStart(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest++,this.loadingBar.show(),this._timerLoading&&clearTimeout(this._timerLoading))}onRequestEnd(t){this.isIgnoreLoadingOnRequest(t)||(this._countRequest--,this._timerLoading=setTimeout((()=>{this._countRequest<=0&&this.loadingBar.hide()}),this._debounceTime))}isIgnoreLoadingOnRequest(t){var s;if(1==(null===(s=null==t?void 0:t.requestBody)||void 0===s?void 0:s.length)){const{name:s}=t.requestBody[0].variables;if(s){const t=s.split(":");return this._ignoredNameTypes.indexOf(t[0])>=0}}return!1}}class J{constructor(t,s){this.resolve=t,this.reject=s}}G.style=".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";export{G as snk_application}
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as s,g as e}from"./p-b9667fbe.js";import{ElementIDUtils as a,ApplicationContext as h}from"@sankhyalabs/core";import{T as n}from"./p-d410f45a.js";import"./p-41d92871.js";import"./p-11028eba.js";import{P as o}from"./p-4c2015a9.js";import{c as r}from"./p-17375123.js";import"./p-6a02e236.js";import"./p-112455b1.js";const d=class{constructor(s){t(this,s),this.actionClick=i(this,"actionClick",7),this.configuratorSave=i(this,"configuratorSave",7),this.configuratorCancel=i(this,"configuratorCancel",7),this._viewHistory=[],this._dataUnit=void 0,this._dataState=void 0,this.attachmentRegisterKey=void 0,this._currentViewMode=r.GRID,this.configName=void 0,this.showActionButtons=!1,this.actionsList=void 0,this.taskbarManager=void 0,this.recordsValidator=void 0,this.statusResolver=void 0,this.multipleSelection=!0,this.presentationMode=o.PRIMARY,this.messagesBuilder=void 0}async goToView(t){this.executeAction(t)}async openConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.open()}async closeConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.close()}async reloadFilterBar(){var t;null===(t=this._snkGrid)||void 0===t||t.reloadFilterBar()}currentViewModeWatcher(t){this._viewHistory=[...this._viewHistory.slice(-1),t]}async gridToForm(t=!1){this._backToGrid=!t&&await this._viewStack.getSelectedIndex()===r.GRID,this.setViewMode(r.FORM)}async executeAction(t){return t===n.GRID_MODE?this.setViewMode(r.GRID):t===n.FORM_MODE||t===n.UPDATE?this.gridToForm(t!==n.UPDATE):t===n.CONFIGURATOR?this._snkConfigurator.open():"ATTACH"===t?this.setViewMode(r.ATTACHMENT):void 0}backView(){const t=this._viewHistory.at(-2)||r.GRID;this.setViewMode(t)}setViewMode(t){this._viewStack.show(t),this._currentViewMode=t}openConfig(t){this._snkConfigurator.close(),t===r.GRID?this._snkGrid.showConfig():t===r.FORM&&this._guidesViewer.showFormConfig()}addDataElementID(){a.addIDInfo(this._element,null,{dataUnit:this._dataUnit})}insertionModeHandler(){this.gridToForm()}cancelHandler(){this._backToGrid&&this.setViewMode(r.GRID)}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:t})=>t)).join("_")}componentWillLoad(){let t=this._element.parentElement;for(;t;){if("SNK-DATA-UNIT"===t.tagName.toUpperCase()){this._snkDataUnit=t,this._snkDataUnit.addEventListener("insertionMode",(()=>this.insertionModeHandler())),this._snkDataUnit.addEventListener("cancelEdition",(()=>this.cancelHandler())),this._dataUnit=this._snkDataUnit.dataUnit,this._dataState=this._snkDataUnit.dataState,this._dataUnit?this.initDataUnit():this._snkDataUnit.addEventListener("dataUnitReady",(t=>{this._dataUnit=t.detail,this.initDataUnit()})),this._snkDataUnit.addEventListener("dataStateChange",(async({detail:t})=>{this._dataState=t,void 0!==t.selectedRecord&&(this.attachmentRegisterKey=await this.getAttachmentRegisterKey())}));break}t=t.parentElement}if(!this.configName){const t=h.getContextValue("__SNK__APPLICATION__");this.configName=t.configName}}initDataUnit(){this.addDataElementID(),this.messagesBuilder||(this.messagesBuilder=this._snkDataUnit.messagesBuilder)}handleConfiguratorEvent(t,i){t.stopImmediatePropagation(),"SAVE"!==i?this.configuratorCancel.emit():this.configuratorSave.emit()}render(){return s("ez-view-stack",{ref:t=>this._viewStack=t,"data-element-id":"crud"},s("stack-item",null,s("snk-grid",{ref:t=>this._snkGrid=t,"data-element-id":"crud_grid",configName:this.configName,onGridDoubleClick:()=>this.gridToForm(!0),taskbarManager:this.taskbarManager,onActionClick:t=>this.executeAction(t.detail),messagesBuilder:this.messagesBuilder,actionsList:this.actionsList,statusResolver:this.statusResolver,multipleSelection:this.multipleSelection,presentationMode:this.presentationMode},s("slot",{name:"SnkGridHeader"}),s("slot",{name:"SnkGridFooter"}),s("slot",{name:"SnkGridTaskBar"}))),s("stack-item",null,s("snk-guides-viewer",{ref:t=>this._guidesViewer=t,entityPath:this._snkDataUnit.entityName,messagesBuilder:this.messagesBuilder,onExit:()=>this.setViewMode(r.GRID),dataState:this._dataState,dataUnit:this._dataUnit,actionsList:this.actionsList,taskbarManager:this.taskbarManager,configName:this.configName,onActionClick:t=>this.executeAction(t.detail),presentationMode:this.presentationMode,"data-element-id":"crud_form"},s("slot",{name:"SnkFormTaskBar"}))),s("stack-item",null,s("snk-attach",{registerKey:this.attachmentRegisterKey,messagesBuilder:this.messagesBuilder,entityName:this._snkDataUnit.entityName,onBack:this.backView.bind(this)})),s("snk-configurator",{ref:t=>this._snkConfigurator=t,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:t=>this.setViewMode(t.detail),onOpenConfig:t=>this.openConfig(t.detail),showActionButtons:this.showActionButtons,onSave:t=>this.handleConfiguratorEvent(t,"SAVE"),onCancel:t=>this.handleConfiguratorEvent(t,"CANCEL")},s("div",{slot:"SnkConfigContainerSlot"},s("slot",{name:"SnkConfigContainerSlot"}))))}get _element(){return e(this)}static get watchers(){return{_currentViewMode:["currentViewModeWatcher"]}}};d.style=".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";export{d as snk_crud}