@sankhyalabs/sankhyablocks 0.0.0-feat-dev-KB-66041.3 → 0.0.0-feat-dev-KB-66041.4

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 (29) hide show
  1. package/dist/cjs/{ClientSideExporterProvider-5fff8770.js → ClientSideExporterProvider-8c219037.js} +8 -2
  2. package/dist/cjs/snk-application.cjs.entry.js +1 -4
  3. package/dist/cjs/snk-crud.cjs.entry.js +21 -33
  4. package/dist/cjs/snk-grid.cjs.entry.js +1 -1
  5. package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -4
  6. package/dist/collection/components/snk-application/snk-application.js +1 -4
  7. package/dist/collection/components/snk-crud/snk-crud.js +22 -34
  8. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +6 -3
  9. package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +8 -2
  10. package/dist/components/ContinuousInsertUtils.js +8 -2
  11. package/dist/components/snk-application2.js +1 -4
  12. package/dist/components/snk-crud.js +23 -35
  13. package/dist/components/snk-simple-crud2.js +6 -3
  14. package/dist/esm/{ClientSideExporterProvider-da9935ed.js → ClientSideExporterProvider-a37f890b.js} +8 -2
  15. package/dist/esm/snk-application.entry.js +1 -4
  16. package/dist/esm/snk-crud.entry.js +22 -34
  17. package/dist/esm/snk-grid.entry.js +1 -1
  18. package/dist/esm/snk-simple-crud.entry.js +7 -4
  19. package/dist/sankhyablocks/{p-2a79b025.entry.js → p-53e1de0a.entry.js} +1 -1
  20. package/dist/sankhyablocks/p-8fa828b5.js +1 -0
  21. package/dist/sankhyablocks/{p-fe2acb29.entry.js → p-a5e5574c.entry.js} +1 -1
  22. package/dist/sankhyablocks/{p-3a0770b9.entry.js → p-cf685cef.entry.js} +1 -1
  23. package/dist/sankhyablocks/p-dcfc8b35.entry.js +1 -0
  24. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  25. package/dist/types/components/snk-crud/snk-crud.d.ts +1 -0
  26. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -0
  27. package/package.json +1 -1
  28. package/dist/sankhyablocks/p-4ad638be.js +0 -1
  29. package/dist/sankhyablocks/p-f12dfe4b.entry.js +0 -1
@@ -174,9 +174,15 @@ class RmPrecisionCustomValueFormatter {
174
174
  if (rmPrecision || rmPrecision === 0) {
175
175
  return core.NumberUtils.format(currentValue, rmPrecision, rmPrecision);
176
176
  }
177
- else {
178
- return currentValue;
177
+ const columnProps = column === null || column === void 0 ? void 0 : column.props;
178
+ if (columnProps) {
179
+ const precision = column === null || column === void 0 ? void 0 : column.props.get('precision');
180
+ const prettyPrecision = column === null || column === void 0 ? void 0 : column.props.get('prettyPrecision');
181
+ if (precision !== undefined && prettyPrecision !== undefined) {
182
+ return core.NumberUtils.format(currentValue, precision, prettyPrecision);
183
+ }
179
184
  }
185
+ return currentValue;
180
186
  }
181
187
  refreshSelectedRows() {
182
188
  var _a;
@@ -1665,10 +1665,7 @@ const SnkApplication = class {
1665
1665
  .bind("F1", Workspace.openHelp.bind(this), { description: "Abrir ajuda" });
1666
1666
  }
1667
1667
  removeShortcuts() {
1668
- this._keyboardManager
1669
- .unbind("ctrl + g")
1670
- .unbind("ctrl + d")
1671
- .unbind("F1");
1668
+ this._keyboardManager.unbindAllShortcutKeys();
1672
1669
  }
1673
1670
  renderLoadingSkeleton() {
1674
1671
  if (!this.enableLockManagerLoadingApp)
@@ -297,29 +297,28 @@ const SnkCrud = class {
297
297
  }
298
298
  }
299
299
  async initKeyboardManager() {
300
- var _a;
301
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
302
- if (keyboardManager) {
303
- const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
304
- async function saveDataUnitHandlingFocus() {
305
- const element = document.activeElement;
306
- const isDocumentBody = (element == document.body);
307
- if (!isDocumentBody)
308
- element.blur();
309
- await dataUnit.saveData();
310
- if (!isDocumentBody && element.setFocus != undefined) {
311
- element.setFocus();
312
- return;
313
- }
314
- if (!isDocumentBody)
315
- element.focus();
300
+ this._keyboardManager = new core.KeyboardManager({ propagate: false, element: this._element });
301
+ const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
302
+ async function saveDataUnitHandlingFocus() {
303
+ const element = document.activeElement;
304
+ const isDocumentBody = (element == document.body);
305
+ if (!isDocumentBody)
306
+ element.blur();
307
+ await dataUnit.saveData();
308
+ if (!isDocumentBody && element.setFocus != undefined) {
309
+ element.setFocus();
310
+ return;
316
311
  }
317
- async function handleAddRecord() {
318
- if (!dataUnit.hasNewRecord()) {
319
- dataUnit.addRecord();
320
- }
312
+ if (!isDocumentBody)
313
+ element.focus();
314
+ }
315
+ async function handleAddRecord() {
316
+ if (!dataUnit.hasNewRecord()) {
317
+ dataUnit.addRecord();
321
318
  }
322
- keyboardManager
319
+ }
320
+ if (this._keyboardManager) {
321
+ this._keyboardManager
323
322
  .bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
324
323
  .bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
325
324
  .bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
@@ -344,18 +343,7 @@ const SnkCrud = class {
344
343
  }
345
344
  async removeShortcuts() {
346
345
  var _a;
347
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
348
- if (keyboardManager) {
349
- keyboardManager
350
- .unbind("F6")
351
- .unbind("F7")
352
- .unbind("ctrl + \\")
353
- .unbind("F8")
354
- .unbind("F9")
355
- .unbind("ctrl + F9")
356
- .unbind("F5")
357
- .unbind("Escape");
358
- }
346
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
359
347
  }
360
348
  async toggleView() {
361
349
  const currentView = await this._viewStack.getSelectedIndex();
@@ -9,7 +9,7 @@ const ConfigStorage = require('./ConfigStorage-df09fb78.js');
9
9
  const index$1 = require('./index-e3e39724.js');
10
10
  const fieldSearch = require('./field-search-68e34bf4.js');
11
11
  const index$2 = require('./index-102ba62d.js');
12
- const ClientSideExporterProvider = require('./ClientSideExporterProvider-5fff8770.js');
12
+ const ClientSideExporterProvider = require('./ClientSideExporterProvider-8c219037.js');
13
13
  const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
14
14
  require('./DataFetcher-1afdb18e.js');
15
15
  require('./ISave-c76e2c51.js');
@@ -9,7 +9,7 @@ const constants = require('./constants-77c1b8bd.js');
9
9
  const taskbarElements = require('./taskbar-elements-02379452.js');
10
10
  require('./DataFetcher-1afdb18e.js');
11
11
  require('./ISave-c76e2c51.js');
12
- const ClientSideExporterProvider = require('./ClientSideExporterProvider-5fff8770.js');
12
+ const ClientSideExporterProvider = require('./ClientSideExporterProvider-8c219037.js');
13
13
  const index$1 = require('./index-e3e39724.js');
14
14
  require('@sankhyalabs/ezui/dist/collection/utils/constants');
15
15
  require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
@@ -698,7 +698,9 @@ const SnkSimpleCrud = class {
698
698
  window.addEventListener("keydown", this._keyDownHandler, { capture: true });
699
699
  }
700
700
  disconnectedCallback() {
701
+ var _a;
701
702
  window.removeEventListener("keydown", this._keyDownHandler);
703
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
702
704
  }
703
705
  gridConfigChangeHandler(evt) {
704
706
  evt.stopPropagation();
@@ -780,12 +782,12 @@ const SnkSimpleCrud = class {
780
782
  }
781
783
  async initKeyboardManager() {
782
784
  var _a;
783
- const keyboardManager = new core.KeyboardManager();
785
+ this._keyboardManager = new core.KeyboardManager({ propagate: false, element: this._element });
784
786
  const dataUnit = this.dataUnit || await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
785
787
  if (dataUnit == undefined) {
786
788
  return;
787
789
  }
788
- keyboardManager
790
+ this._keyboardManager
789
791
  .bind("F7", () => dataUnit.saveData(), { description: "Salva os dados.", element: this._element })
790
792
  .bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
791
793
  .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
@@ -795,7 +797,8 @@ const SnkSimpleCrud = class {
795
797
  }
796
798
  }, {
797
799
  debounceTime: 1000,
798
- description: "Cancela uma ação.", element: this._element
800
+ description: "Cancela uma ação.",
801
+ element: this._element
799
802
  });
800
803
  }
801
804
  async handleFormConfigSaved() {
@@ -1169,10 +1169,7 @@ export class SnkApplication {
1169
1169
  .bind("F1", Workspace.openHelp.bind(this), { description: "Abrir ajuda" });
1170
1170
  }
1171
1171
  removeShortcuts() {
1172
- this._keyboardManager
1173
- .unbind("ctrl + g")
1174
- .unbind("ctrl + d")
1175
- .unbind("F1");
1172
+ this._keyboardManager.unbindAllShortcutKeys();
1176
1173
  }
1177
1174
  renderLoadingSkeleton() {
1178
1175
  if (!this.enableLockManagerLoadingApp)
@@ -1,5 +1,5 @@
1
1
  import { h, Host } from '@stencil/core';
2
- import { ApplicationContext, ElementIDUtils, FloatingManager, StringUtils, JSUtils } from '@sankhyalabs/core';
2
+ import { ApplicationContext, ElementIDUtils, FloatingManager, StringUtils, JSUtils, KeyboardManager } from '@sankhyalabs/core';
3
3
  import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
4
4
  import { PresentationMode } from '../../lib';
5
5
  import { VIEW_MODE } from '../../lib/utils/constants';
@@ -279,29 +279,28 @@ export class SnkCrud {
279
279
  ;
280
280
  }
281
281
  async initKeyboardManager() {
282
- var _a;
283
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
284
- if (keyboardManager) {
285
- const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
286
- async function saveDataUnitHandlingFocus() {
287
- const element = document.activeElement;
288
- const isDocumentBody = (element == document.body);
289
- if (!isDocumentBody)
290
- element.blur();
291
- await dataUnit.saveData();
292
- if (!isDocumentBody && element.setFocus != undefined) {
293
- element.setFocus();
294
- return;
295
- }
296
- if (!isDocumentBody)
297
- element.focus();
282
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
283
+ const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
284
+ async function saveDataUnitHandlingFocus() {
285
+ const element = document.activeElement;
286
+ const isDocumentBody = (element == document.body);
287
+ if (!isDocumentBody)
288
+ element.blur();
289
+ await dataUnit.saveData();
290
+ if (!isDocumentBody && element.setFocus != undefined) {
291
+ element.setFocus();
292
+ return;
298
293
  }
299
- async function handleAddRecord() {
300
- if (!dataUnit.hasNewRecord()) {
301
- dataUnit.addRecord();
302
- }
294
+ if (!isDocumentBody)
295
+ element.focus();
296
+ }
297
+ async function handleAddRecord() {
298
+ if (!dataUnit.hasNewRecord()) {
299
+ dataUnit.addRecord();
303
300
  }
304
- keyboardManager
301
+ }
302
+ if (this._keyboardManager) {
303
+ this._keyboardManager
305
304
  .bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
306
305
  .bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
307
306
  .bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
@@ -326,18 +325,7 @@ export class SnkCrud {
326
325
  }
327
326
  async removeShortcuts() {
328
327
  var _a;
329
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
330
- if (keyboardManager) {
331
- keyboardManager
332
- .unbind("F6")
333
- .unbind("F7")
334
- .unbind("ctrl + \\")
335
- .unbind("F8")
336
- .unbind("F9")
337
- .unbind("ctrl + F9")
338
- .unbind("F5")
339
- .unbind("Escape");
340
- }
328
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
341
329
  }
342
330
  async toggleView() {
343
331
  const currentView = await this._viewStack.getSelectedIndex();
@@ -673,7 +673,9 @@ export class SnkSimpleCrud {
673
673
  window.addEventListener("keydown", this._keyDownHandler, { capture: true });
674
674
  }
675
675
  disconnectedCallback() {
676
+ var _a;
676
677
  window.removeEventListener("keydown", this._keyDownHandler);
678
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
677
679
  }
678
680
  gridConfigChangeHandler(evt) {
679
681
  evt.stopPropagation();
@@ -755,12 +757,12 @@ export class SnkSimpleCrud {
755
757
  }
756
758
  async initKeyboardManager() {
757
759
  var _a;
758
- const keyboardManager = new KeyboardManager();
760
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
759
761
  const dataUnit = this.dataUnit || await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
760
762
  if (dataUnit == undefined) {
761
763
  return;
762
764
  }
763
- keyboardManager
765
+ this._keyboardManager
764
766
  .bind("F7", () => dataUnit.saveData(), { description: "Salva os dados.", element: this._element })
765
767
  .bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
766
768
  .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
@@ -770,7 +772,8 @@ export class SnkSimpleCrud {
770
772
  }
771
773
  }, {
772
774
  debounceTime: 1000,
773
- description: "Cancela uma ação.", element: this._element
775
+ description: "Cancela uma ação.",
776
+ element: this._element
774
777
  });
775
778
  }
776
779
  async handleFormConfigSaved() {
@@ -24,9 +24,15 @@ export default class RmPrecisionCustomValueFormatter {
24
24
  if (rmPrecision || rmPrecision === 0) {
25
25
  return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
26
26
  }
27
- else {
28
- return currentValue;
27
+ const columnProps = column === null || column === void 0 ? void 0 : column.props;
28
+ if (columnProps) {
29
+ const precision = column === null || column === void 0 ? void 0 : column.props.get('precision');
30
+ const prettyPrecision = column === null || column === void 0 ? void 0 : column.props.get('prettyPrecision');
31
+ if (precision !== undefined && prettyPrecision !== undefined) {
32
+ return NumberUtils.format(currentValue, precision, prettyPrecision);
33
+ }
29
34
  }
35
+ return currentValue;
30
36
  }
31
37
  refreshSelectedRows() {
32
38
  var _a;
@@ -248,9 +248,15 @@ class RmPrecisionCustomValueFormatter {
248
248
  if (rmPrecision || rmPrecision === 0) {
249
249
  return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
250
250
  }
251
- else {
252
- return currentValue;
251
+ const columnProps = column === null || column === void 0 ? void 0 : column.props;
252
+ if (columnProps) {
253
+ const precision = column === null || column === void 0 ? void 0 : column.props.get('precision');
254
+ const prettyPrecision = column === null || column === void 0 ? void 0 : column.props.get('prettyPrecision');
255
+ if (precision !== undefined && prettyPrecision !== undefined) {
256
+ return NumberUtils.format(currentValue, precision, prettyPrecision);
257
+ }
253
258
  }
259
+ return currentValue;
254
260
  }
255
261
  refreshSelectedRows() {
256
262
  var _a;
@@ -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';
@@ -320,29 +320,28 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
320
320
  }
321
321
  }
322
322
  async initKeyboardManager() {
323
- var _a;
324
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
325
- if (keyboardManager) {
326
- const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
327
- async function saveDataUnitHandlingFocus() {
328
- const element = document.activeElement;
329
- const isDocumentBody = (element == document.body);
330
- if (!isDocumentBody)
331
- element.blur();
332
- await dataUnit.saveData();
333
- if (!isDocumentBody && element.setFocus != undefined) {
334
- element.setFocus();
335
- return;
336
- }
337
- if (!isDocumentBody)
338
- element.focus();
339
- }
340
- async function handleAddRecord() {
341
- if (!dataUnit.hasNewRecord()) {
342
- dataUnit.addRecord();
343
- }
323
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
324
+ const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
325
+ async function saveDataUnitHandlingFocus() {
326
+ const element = document.activeElement;
327
+ const isDocumentBody = (element == document.body);
328
+ if (!isDocumentBody)
329
+ element.blur();
330
+ await dataUnit.saveData();
331
+ if (!isDocumentBody && element.setFocus != undefined) {
332
+ element.setFocus();
333
+ return;
334
+ }
335
+ if (!isDocumentBody)
336
+ element.focus();
337
+ }
338
+ async function handleAddRecord() {
339
+ if (!dataUnit.hasNewRecord()) {
340
+ dataUnit.addRecord();
344
341
  }
345
- keyboardManager
342
+ }
343
+ if (this._keyboardManager) {
344
+ this._keyboardManager
346
345
  .bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
347
346
  .bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
348
347
  .bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
@@ -367,18 +366,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
367
366
  }
368
367
  async removeShortcuts() {
369
368
  var _a;
370
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
371
- if (keyboardManager) {
372
- keyboardManager
373
- .unbind("F6")
374
- .unbind("F7")
375
- .unbind("ctrl + \\")
376
- .unbind("F8")
377
- .unbind("F9")
378
- .unbind("ctrl + F9")
379
- .unbind("F5")
380
- .unbind("Escape");
381
- }
369
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
382
370
  }
383
371
  async toggleView() {
384
372
  const currentView = await this._viewStack.getSelectedIndex();
@@ -697,7 +697,9 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
697
697
  window.addEventListener("keydown", this._keyDownHandler, { capture: true });
698
698
  }
699
699
  disconnectedCallback() {
700
+ var _a;
700
701
  window.removeEventListener("keydown", this._keyDownHandler);
702
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
701
703
  }
702
704
  gridConfigChangeHandler(evt) {
703
705
  evt.stopPropagation();
@@ -779,12 +781,12 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
779
781
  }
780
782
  async initKeyboardManager() {
781
783
  var _a;
782
- const keyboardManager = new KeyboardManager();
784
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
783
785
  const dataUnit = this.dataUnit || await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
784
786
  if (dataUnit == undefined) {
785
787
  return;
786
788
  }
787
- keyboardManager
789
+ this._keyboardManager
788
790
  .bind("F7", () => dataUnit.saveData(), { description: "Salva os dados.", element: this._element })
789
791
  .bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
790
792
  .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
@@ -794,7 +796,8 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
794
796
  }
795
797
  }, {
796
798
  debounceTime: 1000,
797
- description: "Cancela uma ação.", element: this._element
799
+ description: "Cancela uma ação.",
800
+ element: this._element
798
801
  });
799
802
  }
800
803
  async handleFormConfigSaved() {
@@ -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;
@@ -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)
@@ -1,5 +1,5 @@
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-c62b6c66.js';
4
4
  import './DataFetcher-88e56266.js';
5
5
  import './ISave-5efafc97.js';
@@ -293,29 +293,28 @@ const SnkCrud = class {
293
293
  }
294
294
  }
295
295
  async initKeyboardManager() {
296
- var _a;
297
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
298
- if (keyboardManager) {
299
- const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
300
- async function saveDataUnitHandlingFocus() {
301
- const element = document.activeElement;
302
- const isDocumentBody = (element == document.body);
303
- if (!isDocumentBody)
304
- element.blur();
305
- await dataUnit.saveData();
306
- if (!isDocumentBody && element.setFocus != undefined) {
307
- element.setFocus();
308
- return;
309
- }
310
- if (!isDocumentBody)
311
- element.focus();
296
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
297
+ const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
298
+ async function saveDataUnitHandlingFocus() {
299
+ const element = document.activeElement;
300
+ const isDocumentBody = (element == document.body);
301
+ if (!isDocumentBody)
302
+ element.blur();
303
+ await dataUnit.saveData();
304
+ if (!isDocumentBody && element.setFocus != undefined) {
305
+ element.setFocus();
306
+ return;
312
307
  }
313
- async function handleAddRecord() {
314
- if (!dataUnit.hasNewRecord()) {
315
- dataUnit.addRecord();
316
- }
308
+ if (!isDocumentBody)
309
+ element.focus();
310
+ }
311
+ async function handleAddRecord() {
312
+ if (!dataUnit.hasNewRecord()) {
313
+ dataUnit.addRecord();
317
314
  }
318
- keyboardManager
315
+ }
316
+ if (this._keyboardManager) {
317
+ this._keyboardManager
319
318
  .bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
320
319
  .bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
321
320
  .bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
@@ -340,18 +339,7 @@ const SnkCrud = class {
340
339
  }
341
340
  async removeShortcuts() {
342
341
  var _a;
343
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
344
- if (keyboardManager) {
345
- keyboardManager
346
- .unbind("F6")
347
- .unbind("F7")
348
- .unbind("ctrl + \\")
349
- .unbind("F8")
350
- .unbind("F9")
351
- .unbind("ctrl + F9")
352
- .unbind("F5")
353
- .unbind("Escape");
354
- }
342
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
355
343
  }
356
344
  async toggleView() {
357
345
  const currentView = await this._viewStack.getSelectedIndex();
@@ -5,7 +5,7 @@ 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-a37f890b.js';
9
9
  import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
10
10
  import './DataFetcher-88e56266.js';
11
11
  import './ISave-5efafc97.js';
@@ -5,7 +5,7 @@ import { V as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-7db1128a.js';
5
5
  import { T as TaskbarElement } from './taskbar-elements-c62b6c66.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-a37f890b.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';
@@ -694,7 +694,9 @@ const SnkSimpleCrud = class {
694
694
  window.addEventListener("keydown", this._keyDownHandler, { capture: true });
695
695
  }
696
696
  disconnectedCallback() {
697
+ var _a;
697
698
  window.removeEventListener("keydown", this._keyDownHandler);
699
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
698
700
  }
699
701
  gridConfigChangeHandler(evt) {
700
702
  evt.stopPropagation();
@@ -776,12 +778,12 @@ const SnkSimpleCrud = class {
776
778
  }
777
779
  async initKeyboardManager() {
778
780
  var _a;
779
- const keyboardManager = new KeyboardManager();
781
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
780
782
  const dataUnit = this.dataUnit || await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
781
783
  if (dataUnit == undefined) {
782
784
  return;
783
785
  }
784
- keyboardManager
786
+ this._keyboardManager
785
787
  .bind("F7", () => dataUnit.saveData(), { description: "Salva os dados.", element: this._element })
786
788
  .bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
787
789
  .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
@@ -791,7 +793,8 @@ const SnkSimpleCrud = class {
791
793
  }
792
794
  }, {
793
795
  debounceTime: 1000,
794
- description: "Cancela uma ação.", element: this._element
796
+ description: "Cancela uma ação.",
797
+ element: this._element
795
798
  });
796
799
  }
797
800
  async handleFormConfigSaved() {