@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-81596.1 → 0.0.0-bugfix-dev-KB-87855.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 (71) hide show
  1. package/dist/cjs/{ClientSideExporterProvider-5fff8770.js → ClientSideExporterProvider-e4f717b5.js} +11 -5
  2. package/dist/cjs/{dataunit-fetcher-4a5d491a.js → dataunit-fetcher-a723f0dc.js} +5 -2
  3. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +1 -1
  4. package/dist/cjs/snk-actions-button_7.cjs.entry.js +3 -3
  5. package/dist/cjs/snk-application.cjs.entry.js +2 -5
  6. package/dist/cjs/snk-attach.cjs.entry.js +1 -1
  7. package/dist/cjs/snk-crud.cjs.entry.js +22 -34
  8. package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
  9. package/dist/cjs/{snk-data-unit-4b510d6e.js → snk-data-unit-bab0b78a.js} +1 -1
  10. package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
  11. package/dist/cjs/snk-detail-view.cjs.entry.js +2 -2
  12. package/dist/cjs/snk-grid.cjs.entry.js +2 -2
  13. package/dist/cjs/{snk-guides-viewer-e8e5f7b4.js → snk-guides-viewer-b9a97db8.js} +1 -1
  14. package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
  15. package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
  16. package/dist/cjs/snk-simple-crud.cjs.entry.js +8 -5
  17. package/dist/collection/components/snk-application/snk-application.js +1 -4
  18. package/dist/collection/components/snk-crud/snk-crud.js +22 -34
  19. package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js +2 -2
  20. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +6 -3
  21. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css +13 -0
  22. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +1 -1
  23. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +8 -2
  24. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +5 -2
  25. package/dist/components/ContinuousInsertUtils.js +10 -4
  26. package/dist/components/dataunit-fetcher.js +5 -2
  27. package/dist/components/snk-application2.js +1 -4
  28. package/dist/components/snk-crud.js +23 -35
  29. package/dist/components/snk-simple-crud2.js +6 -3
  30. package/dist/components/taskbar-actions-button2.js +2 -2
  31. package/dist/esm/{ClientSideExporterProvider-da9935ed.js → ClientSideExporterProvider-3b8ba474.js} +11 -5
  32. package/dist/esm/{dataunit-fetcher-1d02ecfc.js → dataunit-fetcher-0e025732.js} +5 -2
  33. package/dist/esm/pesquisa-grid_2.entry.js +1 -1
  34. package/dist/esm/snk-actions-button_7.entry.js +3 -3
  35. package/dist/esm/snk-application.entry.js +2 -5
  36. package/dist/esm/snk-attach.entry.js +1 -1
  37. package/dist/esm/snk-crud.entry.js +23 -35
  38. package/dist/esm/snk-data-exporter.entry.js +2 -2
  39. package/dist/esm/{snk-data-unit-7d0ce406.js → snk-data-unit-0cb53554.js} +1 -1
  40. package/dist/esm/snk-data-unit.entry.js +2 -2
  41. package/dist/esm/snk-detail-view.entry.js +2 -2
  42. package/dist/esm/snk-grid.entry.js +2 -2
  43. package/dist/esm/{snk-guides-viewer-c44b3839.js → snk-guides-viewer-83eecbd7.js} +1 -1
  44. package/dist/esm/snk-guides-viewer.entry.js +2 -2
  45. package/dist/esm/snk-pesquisa.entry.js +1 -1
  46. package/dist/esm/snk-simple-crud.entry.js +8 -5
  47. package/dist/sankhyablocks/{p-092078e3.entry.js → p-10878f04.entry.js} +1 -1
  48. package/dist/sankhyablocks/{p-92778d5a.js → p-15784f66.js} +1 -1
  49. package/dist/sankhyablocks/{p-6293ded9.entry.js → p-15f67e59.entry.js} +2 -2
  50. package/dist/sankhyablocks/{p-6e0a5314.js → p-18c460f2.js} +1 -1
  51. package/dist/sankhyablocks/{p-b2a2a83e.entry.js → p-1bdc7355.entry.js} +1 -1
  52. package/dist/sankhyablocks/{p-ef6f0a1b.entry.js → p-475df998.entry.js} +1 -1
  53. package/dist/sankhyablocks/{p-5cc206bb.entry.js → p-6a0c8ce0.entry.js} +1 -1
  54. package/dist/sankhyablocks/p-7993b2e3.js +60 -0
  55. package/dist/sankhyablocks/p-841d3c3e.entry.js +1 -0
  56. package/dist/sankhyablocks/{p-35f85998.entry.js → p-9a7f7ca3.entry.js} +1 -1
  57. package/dist/sankhyablocks/{p-38e3ffda.entry.js → p-9b4c5dae.entry.js} +1 -1
  58. package/dist/sankhyablocks/{p-893b9483.entry.js → p-af133934.entry.js} +1 -1
  59. package/dist/sankhyablocks/{p-3b190fb1.entry.js → p-d31a701e.entry.js} +1 -1
  60. package/dist/sankhyablocks/{p-5503e89f.entry.js → p-d4752c92.entry.js} +1 -1
  61. package/dist/sankhyablocks/{p-00796b12.entry.js → p-dc6ad9a6.entry.js} +1 -1
  62. package/dist/sankhyablocks/p-e66968aa.js +1 -0
  63. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  64. package/dist/types/components/snk-crud/snk-crud.d.ts +1 -0
  65. package/dist/types/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.d.ts +2 -1
  66. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -0
  67. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -1
  68. package/package.json +1 -1
  69. package/dist/sankhyablocks/p-4ad638be.js +0 -1
  70. package/dist/sankhyablocks/p-a8be1d67.js +0 -60
  71. package/dist/sankhyablocks/p-d9fdb018.entry.js +0 -1
@@ -153,7 +153,7 @@ class PreloadManager {
153
153
  static getSortingFunction(dataUnit, sorting) {
154
154
  return SortingUtils.getSortingFunction(dataUnit, sorting);
155
155
  }
156
- static async getDistinct(dataUnit, fieldName) {
156
+ static async getDistinct(dataUnit, fieldName, onlyLabel = false) {
157
157
  if (!PreloadManager.isCacheEnabled(dataUnit)) {
158
158
  return Promise.resolve(ColumnFilterManager.compileDistinct(fieldName, dataUnit));
159
159
  }
@@ -172,7 +172,10 @@ class PreloadManager {
172
172
  if (fieldValue == undefined) {
173
173
  return { key: null, value: null };
174
174
  }
175
- const value = fieldValue.value != undefined ? fieldValue.value : fieldValue;
175
+ let value = fieldValue.value != undefined ? fieldValue.value : fieldValue;
176
+ if ((fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.label) && onlyLabel) {
177
+ return { key: fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.label, value: dataUnit.getFormattedValue(fieldName, value) };
178
+ }
176
179
  return { key: dataUnit.getFormattedValue(fieldName, fieldValue), value };
177
180
  })
178
181
  .then(result => {
@@ -1658,10 +1658,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
1658
1658
  .bind("F1", Workspace.openHelp.bind(this), { description: "Abrir ajuda" });
1659
1659
  }
1660
1660
  removeShortcuts() {
1661
- this._keyboardManager
1662
- .unbind("ctrl + g")
1663
- .unbind("ctrl + d")
1664
- .unbind("F1");
1661
+ this._keyboardManager.unbindAllShortcutKeys();
1665
1662
  }
1666
1663
  renderLoadingSkeleton() {
1667
1664
  if (!this.enableLockManagerLoadingApp)
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { StringUtils, ElementIDUtils, ApplicationContext, JSUtils, FloatingManager } from '@sankhyalabs/core';
2
+ import { StringUtils, ElementIDUtils, ApplicationContext, KeyboardManager, JSUtils, FloatingManager } from '@sankhyalabs/core';
3
3
  import { T as TaskbarElement, d as defineCustomElement$4 } from './snk-taskbar2.js';
4
4
  import './DataFetcher.js';
5
5
  import { P as PresentationMode, E as ExporterStrategy } from './ISave.js';
@@ -312,29 +312,28 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
312
312
  }
313
313
  }
314
314
  async initKeyboardManager() {
315
- var _a;
316
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
317
- if (keyboardManager) {
318
- const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
319
- async function saveDataUnitHandlingFocus() {
320
- const element = document.activeElement;
321
- const isDocumentBody = (element == document.body);
322
- if (!isDocumentBody)
323
- element.blur();
324
- await dataUnit.saveData();
325
- if (!isDocumentBody && element.setFocus != undefined) {
326
- element.setFocus();
327
- return;
328
- }
329
- if (!isDocumentBody)
330
- element.focus();
331
- }
332
- async function handleAddRecord() {
333
- if (!dataUnit.hasNewRecord()) {
334
- dataUnit.addRecord();
335
- }
315
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
316
+ const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
317
+ async function saveDataUnitHandlingFocus() {
318
+ const element = document.activeElement;
319
+ const isDocumentBody = (element == document.body);
320
+ if (!isDocumentBody)
321
+ element.blur();
322
+ await dataUnit.saveData();
323
+ if (!isDocumentBody && element.setFocus != undefined) {
324
+ element.setFocus();
325
+ return;
326
+ }
327
+ if (!isDocumentBody)
328
+ element.focus();
329
+ }
330
+ async function handleAddRecord() {
331
+ if (!dataUnit.hasNewRecord()) {
332
+ dataUnit.addRecord();
336
333
  }
337
- keyboardManager
334
+ }
335
+ if (this._keyboardManager) {
336
+ this._keyboardManager
338
337
  .bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
339
338
  .bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
340
339
  .bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
@@ -359,18 +358,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
359
358
  }
360
359
  async removeShortcuts() {
361
360
  var _a;
362
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
363
- if (keyboardManager) {
364
- keyboardManager
365
- .unbind("F6")
366
- .unbind("F7")
367
- .unbind("ctrl + \\")
368
- .unbind("F8")
369
- .unbind("F9")
370
- .unbind("ctrl + F9")
371
- .unbind("F5")
372
- .unbind("Escape");
373
- }
361
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
374
362
  }
375
363
  async toggleView() {
376
364
  const currentView = await this._viewStack.getSelectedIndex();
@@ -663,7 +663,9 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
663
663
  window.addEventListener("keydown", this._keyDownHandler, { capture: true });
664
664
  }
665
665
  disconnectedCallback() {
666
+ var _a;
666
667
  window.removeEventListener("keydown", this._keyDownHandler);
668
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
667
669
  }
668
670
  gridConfigChangeHandler(evt) {
669
671
  evt.stopPropagation();
@@ -745,12 +747,12 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
745
747
  }
746
748
  async initKeyboardManager() {
747
749
  var _a;
748
- const keyboardManager = new KeyboardManager();
750
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
749
751
  const dataUnit = this.dataUnit || await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
750
752
  if (dataUnit == undefined) {
751
753
  return;
752
754
  }
753
- keyboardManager
755
+ this._keyboardManager
754
756
  .bind("F7", () => dataUnit.saveData(), { description: "Salva os dados.", element: this._element })
755
757
  .bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
756
758
  .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
@@ -760,7 +762,8 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
760
762
  }
761
763
  }, {
762
764
  debounceTime: 1000,
763
- description: "Cancela uma ação.", element: this._element
765
+ description: "Cancela uma ação.",
766
+ element: this._element
764
767
  });
765
768
  }
766
769
  async handleFormConfigSaved() {
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
 
3
- const taskbarActionsButtonCss = ".sc-taskbar-actions-button-h{display:flex;width:fit-content;height:fit-content}";
3
+ const taskbarActionsButtonCss = ".sc-taskbar-actions-button-h{--ez-dropdown--min-width:150px;display:flex;width:fit-content;height:fit-content}.ez-dropdown-container.sc-taskbar-actions-button{position:relative;display:inline-block}.ez-dropdown--sticky.sc-taskbar-actions-button{position:absolute;display:block;min-width:var(--ez-dropdown--min-width)}";
4
4
 
5
5
  const TaskbarActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
6
  constructor() {
@@ -126,7 +126,7 @@ const TaskbarActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTML
126
126
  this.taskbarActionsButtonDisconnected.emit();
127
127
  }
128
128
  render() {
129
- return (h(Host, null, h("div", { class: `${this.canShowDropdown() ? ' ez-elevation--16' : ''}` }, h("ez-button", { title: this.title, mode: 'icon', iconName: 'dots-vertical', size: 'small', enabled: this.enabled, onClick: () => this.controlDropdown() }), this.canShowDropdown() && h("ez-dropdown", { items: this.loadItems(), onEzClick: (evt) => this.onSelectAction(evt.detail), onEzOutsideClick: () => this._showDropdown = false, itemBuilder: (item, level) => this.dropdownItemBuilder(item, level) }))));
129
+ return (h(Host, null, h("div", { class: `${this.canShowDropdown() ? ' ez-elevation--16' : ''} ez-dropdown-container` }, h("ez-button", { title: this.title, mode: 'icon', iconName: 'dots-vertical', size: 'small', enabled: this.enabled, onClick: () => this.controlDropdown() }), this.canShowDropdown() && h("ez-dropdown", { class: `ez-dropdown--sticky`, items: this.loadItems(), onEzClick: (evt) => this.onSelectAction(evt.detail), onEzOutsideClick: () => this._showDropdown = false, itemBuilder: (item, level) => this.dropdownItemBuilder(item, level) }))));
130
130
  }
131
131
  get _element() { return this; }
132
132
  static get style() { return taskbarActionsButtonCss; }
@@ -4,7 +4,7 @@ import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, St
4
4
  import { D as DataExporterOption } from './index-b40568ff.js';
5
5
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
6
6
  import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
7
- import { P as PreloadManager } from './dataunit-fetcher-1d02ecfc.js';
7
+ import { P as PreloadManager } from './dataunit-fetcher-0e025732.js';
8
8
  import './filter-item-type.enum-d45e026f.js';
9
9
  import './form-config-fetcher-fa208a6c.js';
10
10
  import './constants-7db1128a.js';
@@ -119,11 +119,11 @@ class SnkMultiSelectionListDataSource {
119
119
  }
120
120
  return String(this._dataUnit.getFormattedValue(fieldName, value));
121
121
  }
122
- async getStaticOptions(fieldName) {
122
+ async getStaticOptions(fieldName, options) {
123
123
  if (fieldName == undefined) {
124
124
  return Promise.resolve(undefined);
125
125
  }
126
- return Promise.resolve(await PreloadManager.getDistinct(this._dataUnit, fieldName));
126
+ return Promise.resolve(await PreloadManager.getDistinct(this._dataUnit, fieldName, options));
127
127
  }
128
128
  fetchData(filterTerm, fieldName) {
129
129
  return new Promise(resolve => {
@@ -168,9 +168,15 @@ class RmPrecisionCustomValueFormatter {
168
168
  if (rmPrecision || rmPrecision === 0) {
169
169
  return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
170
170
  }
171
- else {
172
- return currentValue;
171
+ const columnProps = column === null || column === void 0 ? void 0 : column.props;
172
+ if (columnProps) {
173
+ const precision = column === null || column === void 0 ? void 0 : column.props.get('precision');
174
+ const prettyPrecision = column === null || column === void 0 ? void 0 : column.props.get('prettyPrecision');
175
+ if (precision !== undefined && prettyPrecision !== undefined) {
176
+ return NumberUtils.format(currentValue, precision, prettyPrecision);
177
+ }
173
178
  }
179
+ return currentValue;
174
180
  }
175
181
  refreshSelectedRows() {
176
182
  var _a;
@@ -125,7 +125,7 @@ class PreloadManager {
125
125
  static getSortingFunction(dataUnit, sorting) {
126
126
  return SortingUtils.getSortingFunction(dataUnit, sorting);
127
127
  }
128
- static async getDistinct(dataUnit, fieldName) {
128
+ static async getDistinct(dataUnit, fieldName, onlyLabel = false) {
129
129
  if (!PreloadManager.isCacheEnabled(dataUnit)) {
130
130
  return Promise.resolve(ColumnFilterManager.compileDistinct(fieldName, dataUnit));
131
131
  }
@@ -144,7 +144,10 @@ class PreloadManager {
144
144
  if (fieldValue == undefined) {
145
145
  return { key: null, value: null };
146
146
  }
147
- const value = fieldValue.value != undefined ? fieldValue.value : fieldValue;
147
+ let value = fieldValue.value != undefined ? fieldValue.value : fieldValue;
148
+ if ((fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.label) && onlyLabel) {
149
+ return { key: fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.label, value: dataUnit.getFormattedValue(fieldName, value) };
150
+ }
148
151
  return { key: dataUnit.getFormattedValue(fieldName, fieldValue), value };
149
152
  })
150
153
  .then(result => {
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment } from './index-a7d3d3f1.js';
2
- import { I as InMemoryLoader } from './dataunit-fetcher-1d02ecfc.js';
2
+ import { I as InMemoryLoader } from './dataunit-fetcher-0e025732.js';
3
3
  import './DataFetcher-88e56266.js';
4
4
  import { P as PesquisaFetcher } from './ISave-5efafc97.js';
5
5
  import '@sankhyalabs/core';
@@ -6,7 +6,7 @@ import './ISave-5efafc97.js';
6
6
  import './index-b40568ff.js';
7
7
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
8
8
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
9
- import './dataunit-fetcher-1d02ecfc.js';
9
+ import './dataunit-fetcher-0e025732.js';
10
10
  import './filter-item-type.enum-d45e026f.js';
11
11
  import { F as FormConfigFetcher } from './form-config-fetcher-fa208a6c.js';
12
12
  import { O as ORDER_VALUES } from './constants-7db1128a.js';
@@ -1381,7 +1381,7 @@ const SnkViewRepresentation = class {
1381
1381
  };
1382
1382
  SnkViewRepresentation.style = snkViewRepresentationCss;
1383
1383
 
1384
- const taskbarActionsButtonCss = ".sc-taskbar-actions-button-h{display:flex;width:fit-content;height:fit-content}";
1384
+ const taskbarActionsButtonCss = ".sc-taskbar-actions-button-h{--ez-dropdown--min-width:150px;display:flex;width:fit-content;height:fit-content}.ez-dropdown-container.sc-taskbar-actions-button{position:relative;display:inline-block}.ez-dropdown--sticky.sc-taskbar-actions-button{position:absolute;display:block;min-width:var(--ez-dropdown--min-width)}";
1385
1385
 
1386
1386
  const TaskbarActionsButton = class {
1387
1387
  constructor(hostRef) {
@@ -1506,7 +1506,7 @@ const TaskbarActionsButton = class {
1506
1506
  this.taskbarActionsButtonDisconnected.emit();
1507
1507
  }
1508
1508
  render() {
1509
- return (h(Host, null, h("div", { class: `${this.canShowDropdown() ? ' ez-elevation--16' : ''}` }, h("ez-button", { title: this.title, mode: 'icon', iconName: 'dots-vertical', size: 'small', enabled: this.enabled, onClick: () => this.controlDropdown() }), this.canShowDropdown() && h("ez-dropdown", { items: this.loadItems(), onEzClick: (evt) => this.onSelectAction(evt.detail), onEzOutsideClick: () => this._showDropdown = false, itemBuilder: (item, level) => this.dropdownItemBuilder(item, level) }))));
1509
+ return (h(Host, null, h("div", { class: `${this.canShowDropdown() ? ' ez-elevation--16' : ''} ez-dropdown-container` }, h("ez-button", { title: this.title, mode: 'icon', iconName: 'dots-vertical', size: 'small', enabled: this.enabled, onClick: () => this.controlDropdown() }), this.canShowDropdown() && h("ez-dropdown", { class: `ez-dropdown--sticky`, items: this.loadItems(), onEzClick: (evt) => this.onSelectAction(evt.detail), onEzOutsideClick: () => this._showDropdown = false, itemBuilder: (item, level) => this.dropdownItemBuilder(item, level) }))));
1510
1510
  }
1511
1511
  get _element() { return getElement(this); }
1512
1512
  };
@@ -4,7 +4,7 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { C as ConfigStorage } from './ConfigStorage-71e6766f.js';
5
5
  import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-88e56266.js';
6
6
  import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-3510520e.js';
7
- import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher-1d02ecfc.js';
7
+ import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher-0e025732.js';
8
8
  import { P as PesquisaFetcher } from './ISave-5efafc97.js';
9
9
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
10
10
  import { T as TEMPLATES_SKELETON } from './constants-7db1128a.js';
@@ -1661,10 +1661,7 @@ const SnkApplication = class {
1661
1661
  .bind("F1", Workspace.openHelp.bind(this), { description: "Abrir ajuda" });
1662
1662
  }
1663
1663
  removeShortcuts() {
1664
- this._keyboardManager
1665
- .unbind("ctrl + g")
1666
- .unbind("ctrl + d")
1667
- .unbind("F1");
1664
+ this._keyboardManager.unbindAllShortcutKeys();
1668
1665
  }
1669
1666
  renderLoadingSkeleton() {
1670
1667
  if (!this.enableLockManagerLoadingApp)
@@ -3,7 +3,7 @@ import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataU
3
3
  import { D as DataFetcher } from './DataFetcher-88e56266.js';
4
4
  import { S as SaveErrorsEnum } from './ISave-5efafc97.js';
5
5
  import './index-b40568ff.js';
6
- import { P as PreloadManager, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-1d02ecfc.js';
6
+ import { P as PreloadManager, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-0e025732.js';
7
7
  import './filter-item-type.enum-d45e026f.js';
8
8
  import './form-config-fetcher-fa208a6c.js';
9
9
  import { V as VIEW_MODE } from './constants-7db1128a.js';
@@ -1,12 +1,12 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
2
- import { StringUtils, ElementIDUtils, ApplicationContext, JSUtils, FloatingManager } from '@sankhyalabs/core';
2
+ import { StringUtils, ElementIDUtils, ApplicationContext, KeyboardManager, JSUtils, FloatingManager } from '@sankhyalabs/core';
3
3
  import { T as TaskbarElement } from './taskbar-elements-d2353c64.js';
4
4
  import './DataFetcher-88e56266.js';
5
5
  import './ISave-5efafc97.js';
6
6
  import { P as PresentationMode, E as ExporterStrategy } from './index-b40568ff.js';
7
7
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
8
8
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
9
- import './dataunit-fetcher-1d02ecfc.js';
9
+ import './dataunit-fetcher-0e025732.js';
10
10
  import './filter-item-type.enum-d45e026f.js';
11
11
  import './form-config-fetcher-fa208a6c.js';
12
12
  import { V as VIEW_MODE } from './constants-7db1128a.js';
@@ -285,29 +285,28 @@ const SnkCrud = class {
285
285
  }
286
286
  }
287
287
  async initKeyboardManager() {
288
- var _a;
289
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
290
- if (keyboardManager) {
291
- const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
292
- async function saveDataUnitHandlingFocus() {
293
- const element = document.activeElement;
294
- const isDocumentBody = (element == document.body);
295
- if (!isDocumentBody)
296
- element.blur();
297
- await dataUnit.saveData();
298
- if (!isDocumentBody && element.setFocus != undefined) {
299
- element.setFocus();
300
- return;
301
- }
302
- if (!isDocumentBody)
303
- element.focus();
288
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
289
+ const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
290
+ async function saveDataUnitHandlingFocus() {
291
+ const element = document.activeElement;
292
+ const isDocumentBody = (element == document.body);
293
+ if (!isDocumentBody)
294
+ element.blur();
295
+ await dataUnit.saveData();
296
+ if (!isDocumentBody && element.setFocus != undefined) {
297
+ element.setFocus();
298
+ return;
304
299
  }
305
- async function handleAddRecord() {
306
- if (!dataUnit.hasNewRecord()) {
307
- dataUnit.addRecord();
308
- }
300
+ if (!isDocumentBody)
301
+ element.focus();
302
+ }
303
+ async function handleAddRecord() {
304
+ if (!dataUnit.hasNewRecord()) {
305
+ dataUnit.addRecord();
309
306
  }
310
- keyboardManager
307
+ }
308
+ if (this._keyboardManager) {
309
+ this._keyboardManager
311
310
  .bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
312
311
  .bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
313
312
  .bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
@@ -332,18 +331,7 @@ const SnkCrud = class {
332
331
  }
333
332
  async removeShortcuts() {
334
333
  var _a;
335
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
336
- if (keyboardManager) {
337
- keyboardManager
338
- .unbind("F6")
339
- .unbind("F7")
340
- .unbind("ctrl + \\")
341
- .unbind("F8")
342
- .unbind("F9")
343
- .unbind("ctrl + F9")
344
- .unbind("F5")
345
- .unbind("Escape");
346
- }
334
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
347
335
  }
348
336
  async toggleView() {
349
337
  const currentView = await this._viewStack.getSelectedIndex();
@@ -5,11 +5,11 @@ import { I as IExportType } from './IFetchDataExporterParams-d73bed3d.js';
5
5
  import { D as DataExporterOption, a as DataExporterType, b as DataExporterFormat } from './index-b40568ff.js';
6
6
  import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-7db1128a.js';
7
7
  import { D as DataFetcher } from './DataFetcher-88e56266.js';
8
- import { S as SnkDataUnit } from './snk-data-unit-7d0ce406.js';
8
+ import { S as SnkDataUnit } from './snk-data-unit-0cb53554.js';
9
9
  import './ISave-5efafc97.js';
10
10
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
11
11
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
12
- import './dataunit-fetcher-1d02ecfc.js';
12
+ import './dataunit-fetcher-0e025732.js';
13
13
  import './filter-item-type.enum-d45e026f.js';
14
14
  import './form-config-fetcher-fa208a6c.js';
15
15
  import './PrintUtils-3e4ff0f5.js';
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, g as getElement, H as Host
2
2
  import { Action, ObjectUtils, DataUnitAction, StringUtils, ApplicationContext } from '@sankhyalabs/core';
3
3
  import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
4
4
  import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
5
- import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-1d02ecfc.js';
5
+ import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-0e025732.js';
6
6
  import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
7
7
  import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
8
8
 
@@ -1,9 +1,9 @@
1
- export { S as snk_data_unit } from './snk-data-unit-7d0ce406.js';
1
+ export { S as snk_data_unit } from './snk-data-unit-0cb53554.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import '@sankhyalabs/ezui/dist/collection/utils';
5
5
  import './SnkMessageBuilder-6fff4a4c.js';
6
- import './dataunit-fetcher-1d02ecfc.js';
6
+ import './dataunit-fetcher-0e025732.js';
7
7
  import './DataFetcher-88e56266.js';
8
8
  import './PrintUtils-3e4ff0f5.js';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
@@ -7,12 +7,12 @@ import './ISave-5efafc97.js';
7
7
  import { P as PresentationMode } from './index-b40568ff.js';
8
8
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
9
9
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
10
- import './dataunit-fetcher-1d02ecfc.js';
10
+ import './dataunit-fetcher-0e025732.js';
11
11
  import './filter-item-type.enum-d45e026f.js';
12
12
  import './form-config-fetcher-fa208a6c.js';
13
13
  import { V as VIEW_MODE } from './constants-7db1128a.js';
14
14
  import { T as TaskbarElement } from './taskbar-elements-d2353c64.js';
15
- import { S as SnkGuidesViewer } from './snk-guides-viewer-c44b3839.js';
15
+ import { S as SnkGuidesViewer } from './snk-guides-viewer-83eecbd7.js';
16
16
  import { S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
17
17
  import './ConfigStorage-71e6766f.js';
18
18
  import './PrintUtils-3e4ff0f5.js';
@@ -5,13 +5,13 @@ import { C as ConfigStorage } from './ConfigStorage-71e6766f.js';
5
5
  import { P as PresentationMode, E as ExporterStrategy } from './index-b40568ff.js';
6
6
  import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-f8b1d91e.js';
7
7
  import { s as store } from './index-bdf75557.js';
8
- import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, c as ClientSideExporterProvider } from './ClientSideExporterProvider-da9935ed.js';
8
+ import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, c as ClientSideExporterProvider } from './ClientSideExporterProvider-3b8ba474.js';
9
9
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
10
10
  import './DataFetcher-88e56266.js';
11
11
  import './ISave-5efafc97.js';
12
12
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
13
13
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
14
- import './dataunit-fetcher-1d02ecfc.js';
14
+ import './dataunit-fetcher-0e025732.js';
15
15
  import './filter-item-type.enum-d45e026f.js';
16
16
  import './form-config-fetcher-fa208a6c.js';
17
17
  import './constants-7db1128a.js';
@@ -10,7 +10,7 @@ import './ISave-5efafc97.js';
10
10
  import { P as PresentationMode } from './index-b40568ff.js';
11
11
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
12
12
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
13
- import './dataunit-fetcher-1d02ecfc.js';
13
+ import './dataunit-fetcher-0e025732.js';
14
14
  import './filter-item-type.enum-d45e026f.js';
15
15
  import './form-config-fetcher-fa208a6c.js';
16
16
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
@@ -1,4 +1,4 @@
1
- export { S as snk_guides_viewer } from './snk-guides-viewer-c44b3839.js';
1
+ export { S as snk_guides_viewer } from './snk-guides-viewer-83eecbd7.js';
2
2
  import './index-a7d3d3f1.js';
3
3
  import '@sankhyalabs/core';
4
4
  import './SnkFormConfigManager-be490a33.js';
@@ -16,7 +16,7 @@ import './index-b40568ff.js';
16
16
  import './index-bdf75557.js';
17
17
  import './ISave-5efafc97.js';
18
18
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
19
- import './dataunit-fetcher-1d02ecfc.js';
19
+ import './dataunit-fetcher-0e025732.js';
20
20
  import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
21
21
  import '@sankhyalabs/core/dist/utils/SortingUtils';
22
22
  import './ResourceIDUtils-a114189a.js';
@@ -5,7 +5,7 @@ import './DataFetcher-88e56266.js';
5
5
  import './index-b40568ff.js';
6
6
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
7
7
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
8
- import './dataunit-fetcher-1d02ecfc.js';
8
+ import './dataunit-fetcher-0e025732.js';
9
9
  import './filter-item-type.enum-d45e026f.js';
10
10
  import './form-config-fetcher-fa208a6c.js';
11
11
  import './constants-7db1128a.js';
@@ -5,11 +5,11 @@ import { V as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-7db1128a.js';
5
5
  import { T as TaskbarElement } from './taskbar-elements-d2353c64.js';
6
6
  import './DataFetcher-88e56266.js';
7
7
  import './ISave-5efafc97.js';
8
- import { S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, a as CrudUtils, c as ClientSideExporterProvider } from './ClientSideExporterProvider-da9935ed.js';
8
+ import { S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, a as CrudUtils, c as ClientSideExporterProvider } from './ClientSideExporterProvider-3b8ba474.js';
9
9
  import { P as PresentationMode } from './index-b40568ff.js';
10
10
  import '@sankhyalabs/ezui/dist/collection/utils/constants';
11
11
  import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
12
- import { I as InMemoryLoader } from './dataunit-fetcher-1d02ecfc.js';
12
+ import { I as InMemoryLoader } from './dataunit-fetcher-0e025732.js';
13
13
  import './filter-item-type.enum-d45e026f.js';
14
14
  import { F as FormConfigFetcher } from './form-config-fetcher-fa208a6c.js';
15
15
  import { T as TaskbarProcessor, b as buildFieldSearch, o as openFieldSearch } from './field-search-f8b1d91e.js';
@@ -660,7 +660,9 @@ const SnkSimpleCrud = class {
660
660
  window.addEventListener("keydown", this._keyDownHandler, { capture: true });
661
661
  }
662
662
  disconnectedCallback() {
663
+ var _a;
663
664
  window.removeEventListener("keydown", this._keyDownHandler);
665
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
664
666
  }
665
667
  gridConfigChangeHandler(evt) {
666
668
  evt.stopPropagation();
@@ -742,12 +744,12 @@ const SnkSimpleCrud = class {
742
744
  }
743
745
  async initKeyboardManager() {
744
746
  var _a;
745
- const keyboardManager = new KeyboardManager();
747
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
746
748
  const dataUnit = this.dataUnit || await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
747
749
  if (dataUnit == undefined) {
748
750
  return;
749
751
  }
750
- keyboardManager
752
+ this._keyboardManager
751
753
  .bind("F7", () => dataUnit.saveData(), { description: "Salva os dados.", element: this._element })
752
754
  .bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
753
755
  .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
@@ -757,7 +759,8 @@ const SnkSimpleCrud = class {
757
759
  }
758
760
  }, {
759
761
  debounceTime: 1000,
760
- description: "Cancela uma ação.", element: this._element
762
+ description: "Cancela uma ação.",
763
+ element: this._element
761
764
  });
762
765
  }
763
766
  async handleFormConfigSaved() {