@sankhyalabs/sankhyablocks 0.0.0-feat-dev-KB-66041.3 → 0.0.0-feat-dev-KB-66041.5
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.
- package/dist/cjs/{ClientSideExporterProvider-5fff8770.js → ClientSideExporterProvider-8c219037.js} +8 -2
- package/dist/cjs/snk-application.cjs.entry.js +1 -4
- package/dist/cjs/snk-crud.cjs.entry.js +21 -33
- package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
- package/dist/cjs/{snk-data-unit-8027d70a.js → snk-data-unit-530253bc.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-grid.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -4
- package/dist/collection/components/snk-application/snk-application.js +1 -4
- package/dist/collection/components/snk-crud/snk-crud.js +22 -34
- package/dist/collection/components/snk-data-unit/MultipleUpdateHelper.js +1 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +6 -3
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +8 -2
- package/dist/components/ContinuousInsertUtils.js +8 -2
- package/dist/components/snk-application2.js +1 -4
- package/dist/components/snk-crud.js +23 -35
- package/dist/components/snk-data-unit2.js +1 -1
- package/dist/components/snk-simple-crud2.js +6 -3
- package/dist/esm/{ClientSideExporterProvider-da9935ed.js → ClientSideExporterProvider-a37f890b.js} +8 -2
- package/dist/esm/snk-application.entry.js +1 -4
- package/dist/esm/snk-crud.entry.js +22 -34
- package/dist/esm/snk-data-exporter.entry.js +1 -1
- package/dist/esm/{snk-data-unit-c5498e61.js → snk-data-unit-b4bd2ead.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-grid.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +7 -4
- package/dist/sankhyablocks/{p-2a79b025.entry.js → p-53e1de0a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-646371ba.entry.js → p-7278db77.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ce2e4f74.entry.js → p-86c79e76.entry.js} +1 -1
- package/dist/sankhyablocks/p-8fa828b5.js +1 -0
- package/dist/sankhyablocks/{p-fe2acb29.entry.js → p-a5e5574c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-cba92f73.js → p-b2f6c99c.js} +1 -1
- package/dist/sankhyablocks/{p-3a0770b9.entry.js → p-cf685cef.entry.js} +1 -1
- package/dist/sankhyablocks/p-dcfc8b35.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-4ad638be.js +0 -1
- package/dist/sankhyablocks/p-f12dfe4b.entry.js +0 -1
package/dist/cjs/{ClientSideExporterProvider-5fff8770.js → ClientSideExporterProvider-8c219037.js}
RENAMED
|
@@ -174,9 +174,15 @@ class RmPrecisionCustomValueFormatter {
|
|
|
174
174
|
if (rmPrecision || rmPrecision === 0) {
|
|
175
175
|
return core.NumberUtils.format(currentValue, rmPrecision, rmPrecision);
|
|
176
176
|
}
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
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
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
312
|
+
if (!isDocumentBody)
|
|
313
|
+
element.focus();
|
|
314
|
+
}
|
|
315
|
+
async function handleAddRecord() {
|
|
316
|
+
if (!dataUnit.hasNewRecord()) {
|
|
317
|
+
dataUnit.addRecord();
|
|
321
318
|
}
|
|
322
|
-
|
|
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
|
-
|
|
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 IFetchDataExporterParams = require('./IFetchDataExporterParams-e78ec415.js
|
|
|
9
9
|
const index = require('./index-e3e39724.js');
|
|
10
10
|
const constants = require('./constants-77c1b8bd.js');
|
|
11
11
|
const DataFetcher = require('./DataFetcher-1afdb18e.js');
|
|
12
|
-
const snkDataUnit = require('./snk-data-unit-
|
|
12
|
+
const snkDataUnit = require('./snk-data-unit-530253bc.js');
|
|
13
13
|
require('./ISave-c76e2c51.js');
|
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
@@ -70,7 +70,7 @@ function buildChangesContainer(changingFields) {
|
|
|
70
70
|
changesContainer.style.flexDirection = 'column';
|
|
71
71
|
changesContainer.style.display = 'flex';
|
|
72
72
|
changesContainer.style.overflow = 'auto';
|
|
73
|
-
changesContainer.style.maxHeight = '
|
|
73
|
+
changesContainer.style.maxHeight = '380px';
|
|
74
74
|
const changesMap = groupChanges(changingFields);
|
|
75
75
|
changesMap.forEach((changes, key) => {
|
|
76
76
|
changesContainer.appendChild(buildChangesDiv(key, changes));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const snkDataUnit = require('./snk-data-unit-
|
|
5
|
+
const snkDataUnit = require('./snk-data-unit-530253bc.js');
|
|
6
6
|
require('./index-f9e81701.js');
|
|
7
7
|
require('@sankhyalabs/core');
|
|
8
8
|
require('@sankhyalabs/ezui/dist/collection/utils');
|
|
@@ -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-
|
|
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-
|
|
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
|
-
|
|
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
|
-
|
|
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.",
|
|
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
|
-
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
294
|
+
if (!isDocumentBody)
|
|
295
|
+
element.focus();
|
|
296
|
+
}
|
|
297
|
+
async function handleAddRecord() {
|
|
298
|
+
if (!dataUnit.hasNewRecord()) {
|
|
299
|
+
dataUnit.addRecord();
|
|
303
300
|
}
|
|
304
|
-
|
|
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
|
-
|
|
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();
|
|
@@ -60,7 +60,7 @@ function buildChangesContainer(changingFields) {
|
|
|
60
60
|
changesContainer.style.flexDirection = 'column';
|
|
61
61
|
changesContainer.style.display = 'flex';
|
|
62
62
|
changesContainer.style.overflow = 'auto';
|
|
63
|
-
changesContainer.style.maxHeight = '
|
|
63
|
+
changesContainer.style.maxHeight = '380px';
|
|
64
64
|
const changesMap = groupChanges(changingFields);
|
|
65
65
|
changesMap.forEach((changes, key) => {
|
|
66
66
|
changesContainer.appendChild(buildChangesDiv(key, changes));
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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.",
|
|
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
|
-
|
|
28
|
-
|
|
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
|
-
|
|
252
|
-
|
|
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
|
-
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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();
|
|
@@ -68,7 +68,7 @@ function buildChangesContainer(changingFields) {
|
|
|
68
68
|
changesContainer.style.flexDirection = 'column';
|
|
69
69
|
changesContainer.style.display = 'flex';
|
|
70
70
|
changesContainer.style.overflow = 'auto';
|
|
71
|
-
changesContainer.style.maxHeight = '
|
|
71
|
+
changesContainer.style.maxHeight = '380px';
|
|
72
72
|
const changesMap = groupChanges(changingFields);
|
|
73
73
|
changesMap.forEach((changes, key) => {
|
|
74
74
|
changesContainer.appendChild(buildChangesDiv(key, changes));
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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.",
|
|
799
|
+
description: "Cancela uma ação.",
|
|
800
|
+
element: this._element
|
|
798
801
|
});
|
|
799
802
|
}
|
|
800
803
|
async handleFormConfigSaved() {
|
package/dist/esm/{ClientSideExporterProvider-da9935ed.js → ClientSideExporterProvider-a37f890b.js}
RENAMED
|
@@ -168,9 +168,15 @@ class RmPrecisionCustomValueFormatter {
|
|
|
168
168
|
if (rmPrecision || rmPrecision === 0) {
|
|
169
169
|
return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
|
|
170
170
|
}
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
308
|
+
if (!isDocumentBody)
|
|
309
|
+
element.focus();
|
|
310
|
+
}
|
|
311
|
+
async function handleAddRecord() {
|
|
312
|
+
if (!dataUnit.hasNewRecord()) {
|
|
313
|
+
dataUnit.addRecord();
|
|
317
314
|
}
|
|
318
|
-
|
|
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
|
-
|
|
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 { 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-
|
|
8
|
+
import { S as SnkDataUnit } from './snk-data-unit-b4bd2ead.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';
|
|
@@ -68,7 +68,7 @@ function buildChangesContainer(changingFields) {
|
|
|
68
68
|
changesContainer.style.flexDirection = 'column';
|
|
69
69
|
changesContainer.style.display = 'flex';
|
|
70
70
|
changesContainer.style.overflow = 'auto';
|
|
71
|
-
changesContainer.style.maxHeight = '
|
|
71
|
+
changesContainer.style.maxHeight = '380px';
|
|
72
72
|
const changesMap = groupChanges(changingFields);
|
|
73
73
|
changesMap.forEach((changes, key) => {
|
|
74
74
|
changesContainer.appendChild(buildChangesDiv(key, changes));
|