@sankhyalabs/sankhyablocks 8.16.0-dev.100 → 8.16.0-dev.102

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-092078e3.entry.js → p-460f1827.entry.js} +1 -1
  20. package/dist/sankhyablocks/{p-6293ded9.entry.js → p-754559b9.entry.js} +1 -1
  21. package/dist/sankhyablocks/p-835128f5.entry.js +1 -0
  22. package/dist/sankhyablocks/p-8fa828b5.js +1 -0
  23. package/dist/sankhyablocks/{p-893b9483.entry.js → p-e35fe2bd.entry.js} +1 -1
  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-d9fdb018.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)
@@ -289,29 +289,28 @@ const SnkCrud = class {
289
289
  }
290
290
  }
291
291
  async initKeyboardManager() {
292
- var _a;
293
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
294
- if (keyboardManager) {
295
- const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
296
- async function saveDataUnitHandlingFocus() {
297
- const element = document.activeElement;
298
- const isDocumentBody = (element == document.body);
299
- if (!isDocumentBody)
300
- element.blur();
301
- await dataUnit.saveData();
302
- if (!isDocumentBody && element.setFocus != undefined) {
303
- element.setFocus();
304
- return;
305
- }
306
- if (!isDocumentBody)
307
- element.focus();
292
+ this._keyboardManager = new core.KeyboardManager({ propagate: false, element: this._element });
293
+ const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
294
+ async function saveDataUnitHandlingFocus() {
295
+ const element = document.activeElement;
296
+ const isDocumentBody = (element == document.body);
297
+ if (!isDocumentBody)
298
+ element.blur();
299
+ await dataUnit.saveData();
300
+ if (!isDocumentBody && element.setFocus != undefined) {
301
+ element.setFocus();
302
+ return;
308
303
  }
309
- async function handleAddRecord() {
310
- if (!dataUnit.hasNewRecord()) {
311
- dataUnit.addRecord();
312
- }
304
+ if (!isDocumentBody)
305
+ element.focus();
306
+ }
307
+ async function handleAddRecord() {
308
+ if (!dataUnit.hasNewRecord()) {
309
+ dataUnit.addRecord();
313
310
  }
314
- keyboardManager
311
+ }
312
+ if (this._keyboardManager) {
313
+ this._keyboardManager
315
314
  .bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
316
315
  .bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
317
316
  .bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
@@ -336,18 +335,7 @@ const SnkCrud = class {
336
335
  }
337
336
  async removeShortcuts() {
338
337
  var _a;
339
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
340
- if (keyboardManager) {
341
- keyboardManager
342
- .unbind("F6")
343
- .unbind("F7")
344
- .unbind("ctrl + \\")
345
- .unbind("F8")
346
- .unbind("F9")
347
- .unbind("ctrl + F9")
348
- .unbind("F5")
349
- .unbind("Escape");
350
- }
338
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
351
339
  }
352
340
  async toggleView() {
353
341
  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-7e19882d.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');
@@ -664,7 +664,9 @@ const SnkSimpleCrud = class {
664
664
  window.addEventListener("keydown", this._keyDownHandler, { capture: true });
665
665
  }
666
666
  disconnectedCallback() {
667
+ var _a;
667
668
  window.removeEventListener("keydown", this._keyDownHandler);
669
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
668
670
  }
669
671
  gridConfigChangeHandler(evt) {
670
672
  evt.stopPropagation();
@@ -746,12 +748,12 @@ const SnkSimpleCrud = class {
746
748
  }
747
749
  async initKeyboardManager() {
748
750
  var _a;
749
- const keyboardManager = new core.KeyboardManager();
751
+ this._keyboardManager = new core.KeyboardManager({ propagate: false, element: this._element });
750
752
  const dataUnit = this.dataUnit || await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
751
753
  if (dataUnit == undefined) {
752
754
  return;
753
755
  }
754
- keyboardManager
756
+ this._keyboardManager
755
757
  .bind("F7", () => dataUnit.saveData(), { description: "Salva os dados.", element: this._element })
756
758
  .bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
757
759
  .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
@@ -761,7 +763,8 @@ const SnkSimpleCrud = class {
761
763
  }
762
764
  }, {
763
765
  debounceTime: 1000,
764
- description: "Cancela uma ação.", element: this._element
766
+ description: "Cancela uma ação.",
767
+ element: this._element
765
768
  });
766
769
  }
767
770
  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';
@@ -271,29 +271,28 @@ export class SnkCrud {
271
271
  ;
272
272
  }
273
273
  async initKeyboardManager() {
274
- var _a;
275
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
276
- if (keyboardManager) {
277
- const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
278
- async function saveDataUnitHandlingFocus() {
279
- const element = document.activeElement;
280
- const isDocumentBody = (element == document.body);
281
- if (!isDocumentBody)
282
- element.blur();
283
- await dataUnit.saveData();
284
- if (!isDocumentBody && element.setFocus != undefined) {
285
- element.setFocus();
286
- return;
287
- }
288
- if (!isDocumentBody)
289
- element.focus();
274
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
275
+ const dataUnit = this._dataUnit || await this._snkDataUnit.getDataUnit();
276
+ async function saveDataUnitHandlingFocus() {
277
+ const element = document.activeElement;
278
+ const isDocumentBody = (element == document.body);
279
+ if (!isDocumentBody)
280
+ element.blur();
281
+ await dataUnit.saveData();
282
+ if (!isDocumentBody && element.setFocus != undefined) {
283
+ element.setFocus();
284
+ return;
290
285
  }
291
- async function handleAddRecord() {
292
- if (!dataUnit.hasNewRecord()) {
293
- dataUnit.addRecord();
294
- }
286
+ if (!isDocumentBody)
287
+ element.focus();
288
+ }
289
+ async function handleAddRecord() {
290
+ if (!dataUnit.hasNewRecord()) {
291
+ dataUnit.addRecord();
295
292
  }
296
- keyboardManager
293
+ }
294
+ if (this._keyboardManager) {
295
+ this._keyboardManager
297
296
  .bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
298
297
  .bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
299
298
  .bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
@@ -318,18 +317,7 @@ export class SnkCrud {
318
317
  }
319
318
  async removeShortcuts() {
320
319
  var _a;
321
- const keyboardManager = await ((_a = this._application) === null || _a === void 0 ? void 0 : _a.getKeyboardManager());
322
- if (keyboardManager) {
323
- keyboardManager
324
- .unbind("F6")
325
- .unbind("F7")
326
- .unbind("ctrl + \\")
327
- .unbind("F8")
328
- .unbind("F9")
329
- .unbind("ctrl + F9")
330
- .unbind("F5")
331
- .unbind("Escape");
332
- }
320
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
333
321
  }
334
322
  async toggleView() {
335
323
  const currentView = await this._viewStack.getSelectedIndex();
@@ -639,7 +639,9 @@ export class SnkSimpleCrud {
639
639
  window.addEventListener("keydown", this._keyDownHandler, { capture: true });
640
640
  }
641
641
  disconnectedCallback() {
642
+ var _a;
642
643
  window.removeEventListener("keydown", this._keyDownHandler);
644
+ (_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
643
645
  }
644
646
  gridConfigChangeHandler(evt) {
645
647
  evt.stopPropagation();
@@ -721,12 +723,12 @@ export class SnkSimpleCrud {
721
723
  }
722
724
  async initKeyboardManager() {
723
725
  var _a;
724
- const keyboardManager = new KeyboardManager();
726
+ this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
725
727
  const dataUnit = this.dataUnit || await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
726
728
  if (dataUnit == undefined) {
727
729
  return;
728
730
  }
729
- keyboardManager
731
+ this._keyboardManager
730
732
  .bind("F7", () => dataUnit.saveData(), { description: "Salva os dados.", element: this._element })
731
733
  .bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
732
734
  .bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
@@ -736,7 +738,8 @@ export class SnkSimpleCrud {
736
738
  }
737
739
  }, {
738
740
  debounceTime: 1000,
739
- description: "Cancela uma ação.", element: this._element
741
+ description: "Cancela uma ação.",
742
+ element: this._element
740
743
  });
741
744
  }
742
745
  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';
@@ -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() {
@@ -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-d2353c64.js';
4
4
  import './DataFetcher-88e56266.js';
5
5
  import './ISave-5efafc97.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,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-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-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';
@@ -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() {