@sankhyalabs/sankhyablocks 8.16.0-dev.110 → 8.16.0-dev.111
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/{SnkMessageBuilder-aecd7c18.js → SnkMessageBuilder-9deeae08.js} +4 -3
- package/dist/cjs/index-f9e81701.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/{snk-actions-button_7.cjs.entry.js → snk-actions-button_8.cjs.entry.js} +61 -0
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-attach.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +2 -26
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-ebfdb9ba.js → snk-data-unit-57916de4.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +57 -5
- package/dist/cjs/snk-form-view.cjs.entry.js +19 -7
- package/dist/cjs/snk-grid.cjs.entry.js +22 -23
- package/dist/cjs/{snk-guides-viewer-fd39f437.js → snk-guides-viewer-d33379cd.js} +36 -24
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +4 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +73 -85
- package/dist/cjs/snk-taskbar.cjs.entry.js +7 -3
- package/dist/cjs/{taskbar-elements-02379452.js → taskbar-elements-6f4e06af.js} +8 -0
- package/dist/cjs/{field-search-68e34bf4.js → taskbar-processor-2fba34a8.js} +0 -35
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/snk-crud/snk-crud.js +2 -26
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +58 -4
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +54 -7
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +36 -40
- package/dist/collection/components/snk-grid/snk-grid.js +36 -36
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +75 -85
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +8 -0
- package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.css +0 -0
- package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js +220 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +28 -2
- package/dist/collection/lib/message/resources/snk-crud.msg.js +1 -1
- package/dist/collection/lib/message/resources/snk-grid.msg.js +1 -1
- package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +2 -1
- package/dist/components/ContinuousInsertUtils.js +2 -33
- package/dist/components/SnkMessageBuilder.js +4 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-attach2.js +34 -28
- package/dist/components/snk-crud.js +75 -93
- package/dist/components/snk-detail-view2.js +193 -117
- package/dist/components/snk-form-view2.js +22 -8
- package/dist/components/snk-grid2.js +62 -57
- package/dist/components/snk-simple-crud2.js +104 -109
- package/dist/components/snk-taskbar2.js +29 -10
- package/dist/components/taskbar-split-button.d.ts +11 -0
- package/dist/components/taskbar-split-button.js +6 -0
- package/dist/components/taskbar-split-button2.js +87 -0
- package/dist/esm/{SnkMessageBuilder-12f5fe1a.js → SnkMessageBuilder-2dbd8fa2.js} +4 -3
- package/dist/esm/index-a7d3d3f1.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_7.entry.js → snk-actions-button_8.entry.js} +61 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-attach.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +3 -27
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-03654813.js → snk-data-unit-65c9dd1a.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +59 -7
- package/dist/esm/snk-form-view.entry.js +19 -7
- package/dist/esm/snk-grid.entry.js +20 -21
- package/dist/esm/{snk-guides-viewer-75e06feb.js → snk-guides-viewer-72953334.js} +37 -25
- package/dist/esm/snk-guides-viewer.entry.js +4 -3
- package/dist/esm/snk-simple-crud.entry.js +74 -86
- package/dist/esm/snk-taskbar.entry.js +7 -3
- package/dist/esm/{taskbar-elements-c62b6c66.js → taskbar-elements-f2cb4922.js} +8 -0
- package/dist/esm/{field-search-f8b1d91e.js → taskbar-processor-3436124c.js} +1 -34
- package/dist/sankhyablocks/p-0fadb620.js +1 -0
- package/dist/sankhyablocks/p-1a0caadb.js +1 -0
- package/dist/sankhyablocks/{p-2c08fa3e.entry.js → p-1bdffb17.entry.js} +1 -1
- package/dist/sankhyablocks/p-1f80174b.entry.js +1 -0
- package/dist/sankhyablocks/p-24a0dbd2.entry.js +1 -0
- package/dist/sankhyablocks/p-2f7e2251.entry.js +1 -0
- package/dist/sankhyablocks/p-3372178e.entry.js +1 -0
- package/dist/sankhyablocks/p-4689c2e6.js +1 -0
- package/dist/sankhyablocks/{p-271c86d3.entry.js → p-52d10014.entry.js} +1 -1
- package/dist/sankhyablocks/p-6a03b190.entry.js +1 -0
- package/dist/sankhyablocks/{p-ad07f0c5.entry.js → p-7beeabc1.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4a93daef.entry.js → p-a4ebeec4.entry.js} +1 -1
- package/dist/sankhyablocks/p-bc101064.entry.js +1 -0
- package/dist/sankhyablocks/{p-f4d5bb7f.js → p-c9675d64.js} +1 -1
- package/dist/sankhyablocks/{p-4e861843.entry.js → p-ce94e6c4.entry.js} +1 -1
- package/dist/sankhyablocks/p-d07b18a4.js +1 -0
- package/dist/sankhyablocks/{p-6a0c8ce0.entry.js → p-ddf93f36.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +0 -3
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +12 -0
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +11 -1
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +6 -6
- package/dist/types/components/snk-grid/snk-grid.d.ts +7 -5
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +10 -10
- package/dist/types/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.d.ts +44 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +5 -0
- package/dist/types/components.d.ts +107 -8
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/collection/components/snk-taskbar/subcomponents/field-search.js +0 -31
- package/dist/sankhyablocks/p-1a51dfde.entry.js +0 -1
- package/dist/sankhyablocks/p-1db45d26.entry.js +0 -1
- package/dist/sankhyablocks/p-23736d75.js +0 -1
- package/dist/sankhyablocks/p-2d6df7e7.entry.js +0 -1
- package/dist/sankhyablocks/p-41da5310.js +0 -1
- package/dist/sankhyablocks/p-65be98c5.entry.js +0 -1
- package/dist/sankhyablocks/p-80f8c22c.js +0 -1
- package/dist/sankhyablocks/p-cc8c3bca.entry.js +0 -1
- package/dist/sankhyablocks/p-cf1f25ed.entry.js +0 -1
- package/dist/sankhyablocks/p-fb0f0087.js +0 -1
- package/dist/types/components/snk-taskbar/subcomponents/field-search.d.ts +0 -4
@@ -1,11 +1,13 @@
|
|
1
1
|
import { ElementIDUtils } from "@sankhyalabs/core";
|
2
2
|
import { Host, h } from "@stencil/core";
|
3
3
|
import { DataBinder } from "@sankhyalabs/ezui/dist/collection/utils/form";
|
4
|
+
import { focusOnFieldSerch, SEARCH_FIELD_FULL_WIDTH } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
5
|
export class SnkFormView {
|
5
6
|
constructor() {
|
6
7
|
this._customEditors = new Map();
|
7
8
|
this._fieldProps = new Map();
|
8
9
|
this.levelPath = undefined;
|
10
|
+
this.fieldSearch = undefined;
|
9
11
|
this.label = undefined;
|
10
12
|
this.name = undefined;
|
11
13
|
this.fields = undefined;
|
@@ -38,11 +40,6 @@ export class SnkFormView {
|
|
38
40
|
newCustomEditors.set(fieldName, { customEditor, detailContext });
|
39
41
|
this._customEditors = newCustomEditors;
|
40
42
|
}
|
41
|
-
observePropsCustomEditor(newValue) {
|
42
|
-
for (const fieldName in newValue) {
|
43
|
-
this.addCustomEditor(fieldName, newValue[fieldName]);
|
44
|
-
}
|
45
|
-
}
|
46
43
|
/**
|
47
44
|
* Altera/adiciona uma propriedade nos metadados do campo.
|
48
45
|
*/
|
@@ -50,6 +47,21 @@ export class SnkFormView {
|
|
50
47
|
const props = this._fieldProps.get(fieldName) || [];
|
51
48
|
this._fieldProps.set(fieldName, [...props, { propName, value }]);
|
52
49
|
}
|
50
|
+
/**
|
51
|
+
* Exibe a busca de campos ancorada ao container de cabeçalho do snk-form-view.
|
52
|
+
*/
|
53
|
+
async showSearchField() {
|
54
|
+
if (!this._headerContainer || !this._ezPopoverFieldColumn)
|
55
|
+
return;
|
56
|
+
const container = this._headerContainer.getBoundingClientRect();
|
57
|
+
await focusOnFieldSerch(this.fieldSearch);
|
58
|
+
this._ezPopoverFieldColumn.showUnder(this._headerContainer, { horizontalGap: container.width - (SEARCH_FIELD_FULL_WIDTH), verticalGap: container.height * -1 });
|
59
|
+
}
|
60
|
+
observePropsCustomEditor(newValue) {
|
61
|
+
for (const fieldName in newValue) {
|
62
|
+
this.addCustomEditor(fieldName, newValue[fieldName]);
|
63
|
+
}
|
64
|
+
}
|
53
65
|
async observeFieldsProps(newValue) {
|
54
66
|
for (const field in newValue) {
|
55
67
|
const fieldProps = newValue[field];
|
@@ -156,13 +168,13 @@ export class SnkFormView {
|
|
156
168
|
}
|
157
169
|
}
|
158
170
|
render() {
|
159
|
-
return (h(Host, { class: "ez-box__container" }, h("div", { class: "summary-header ez-flex ez-size-width--full" }, h("div", { class: "ez-flex ez-text ez-title--primary ez-text--bold ez-flex--justify-start ez-flex--align-items-center ez-col--sd-9" }, this.levelPath ? h("span", { class: "level-path" }, this.levelPath + " /") : undefined, this.label), h("div", { class: "ez-flex ez-flex--justify-end ez-col--sd-3" }, this.canFix &&
|
171
|
+
return (h(Host, { class: "ez-box__container" }, h("div", { class: "summary-header ez-flex ez-size-width--full", ref: ref => this._headerContainer = ref }, h("div", { class: "ez-flex ez-text ez-title--primary ez-text--bold ez-flex--justify-start ez-flex--align-items-center ez-col--sd-9" }, this.levelPath ? h("span", { class: "level-path" }, this.levelPath + " /") : undefined, this.label), h("div", { class: "ez-flex ez-flex--justify-end ez-col--sd-3" }, this.canFix &&
|
160
172
|
h("ez-button", { class: "ez-padding-left--medium", mode: "icon", size: "small", iconName: this.fixed ? "un-pin" : "push-pin", "data-element-id": ElementIDUtils.getInternalIDInfo("toggleFixed_ezFormCard"), onClick: () => this.changeFix(), title: this.fixed ? "Desafixar" : "Fixar" }), this.canExpand &&
|
161
173
|
h("ez-button", { class: "ez-padding-left--medium", mode: "icon", size: "small", iconName: this.contracted ? "chevron-down" : "chevron-up", "data-element-id": ElementIDUtils.getInternalIDInfo("toggleExpand_ezFormCard"), onClick: () => this.changeContracted(), title: this.contracted ? "Expandir" : "Resumir" }))), h("slot", null), this.contracted
|
162
174
|
?
|
163
175
|
h("snk-form-summary", { summary: this.getCardSummary() })
|
164
176
|
:
|
165
|
-
h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) })));
|
177
|
+
h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) }), this.fieldSearch && h("ez-popover", { ref: elem => (this._ezPopoverFieldColumn = elem), overlayType: "none" }, this.fieldSearch)));
|
166
178
|
}
|
167
179
|
static get is() { return "snk-form-view"; }
|
168
180
|
static get encapsulation() { return "scoped"; }
|
@@ -195,6 +207,25 @@ export class SnkFormView {
|
|
195
207
|
"attribute": "level-path",
|
196
208
|
"reflect": false
|
197
209
|
},
|
210
|
+
"fieldSearch": {
|
211
|
+
"type": "unknown",
|
212
|
+
"mutable": false,
|
213
|
+
"complexType": {
|
214
|
+
"original": "HTMLEzSearchElement",
|
215
|
+
"resolved": "HTMLEzSearchElement",
|
216
|
+
"references": {
|
217
|
+
"HTMLEzSearchElement": {
|
218
|
+
"location": "global"
|
219
|
+
}
|
220
|
+
}
|
221
|
+
},
|
222
|
+
"required": false,
|
223
|
+
"optional": false,
|
224
|
+
"docs": {
|
225
|
+
"tags": [],
|
226
|
+
"text": "Campo para o buscador de campos."
|
227
|
+
}
|
228
|
+
},
|
198
229
|
"label": {
|
199
230
|
"type": "string",
|
200
231
|
"mutable": false,
|
@@ -593,6 +624,22 @@ export class SnkFormView {
|
|
593
624
|
"text": "Altera/adiciona uma propriedade nos metadados do campo.",
|
594
625
|
"tags": []
|
595
626
|
}
|
627
|
+
},
|
628
|
+
"showSearchField": {
|
629
|
+
"complexType": {
|
630
|
+
"signature": "() => Promise<void>",
|
631
|
+
"parameters": [],
|
632
|
+
"references": {
|
633
|
+
"Promise": {
|
634
|
+
"location": "global"
|
635
|
+
}
|
636
|
+
},
|
637
|
+
"return": "Promise<void>"
|
638
|
+
},
|
639
|
+
"docs": {
|
640
|
+
"text": "Exibe a busca de campos ancorada ao container de cabe\u00E7alho do snk-form-view.",
|
641
|
+
"tags": []
|
642
|
+
}
|
596
643
|
}
|
597
644
|
};
|
598
645
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Action as DUAction, ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
1
|
+
import { Action as DUAction, ElementIDUtils, KeyboardManager, StringUtils, ObjectUtils } from '@sankhyalabs/core';
|
2
2
|
import { Fragment, h } from '@stencil/core';
|
3
3
|
import { SnkFormConfigManager } from '../../snk-form-config/SnkFormConfigManager';
|
4
4
|
import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
@@ -7,7 +7,7 @@ import { TaskbarElement } from '../../snk-taskbar/elements/taskbar-elements';
|
|
7
7
|
import { VIEW_MODE } from '../../../lib/utils/constants';
|
8
8
|
import { PresentationMode } from '../../../lib';
|
9
9
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
10
|
-
import { buildFieldSearch,
|
10
|
+
import { buildFieldSearch, LABEL_SEARCH_FIELD, SHORTCUT_SEARCH_FIELD } from '@sankhyalabs/ezui/dist/collection/utils';
|
11
11
|
const FORM_NAME_PREFIX = "__FORM:";
|
12
12
|
export class SnkGuidesViewer {
|
13
13
|
constructor() {
|
@@ -39,6 +39,7 @@ export class SnkGuidesViewer {
|
|
39
39
|
this._customEditors = undefined;
|
40
40
|
this._customRenders = undefined;
|
41
41
|
this._fieldsProps = {};
|
42
|
+
this._mainForm = undefined;
|
42
43
|
}
|
43
44
|
observeDataUnit() {
|
44
45
|
this.loadGuides(true);
|
@@ -65,12 +66,6 @@ export class SnkGuidesViewer {
|
|
65
66
|
this._formEditorConfigManager = masterConfig ? this._configManager : this._currentDetail.formConfigManager;
|
66
67
|
this._formEditorDataUnit = masterConfig ? this.dataUnit : this._currentDetail.dataUnit;
|
67
68
|
}
|
68
|
-
/**
|
69
|
-
* Abre o localizador de campos
|
70
|
-
*/
|
71
|
-
async findField() {
|
72
|
-
await openFieldSearch(this._moreOptions, this._fieldSearch);
|
73
|
-
}
|
74
69
|
/**
|
75
70
|
* Registra um editor customizado para campos da grade e formulário
|
76
71
|
*/
|
@@ -315,7 +310,7 @@ export class SnkGuidesViewer {
|
|
315
310
|
const sheet = this._masterFormMetadata.getSheet(cardId);
|
316
311
|
if (sheet) {
|
317
312
|
const cardConfig = (_c = (_b = this.masterFormConfig) === null || _b === void 0 ? void 0 : _b.cardsState) === null || _c === void 0 ? void 0 : _c.get(cardId);
|
318
|
-
content = h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_e = (_d = this.masterFormConfig) === null || _d === void 0 ? void 0 : _d.summary) === null || _e === void 0 ? void 0 : _e.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar());
|
313
|
+
content = h("snk-form-view", { ref: ref => this._mainForm = ref, fixed: cardConfig === null || cardConfig === void 0 ? void 0 : cardConfig.fixed, summaryFields: (_e = (_d = this.masterFormConfig) === null || _d === void 0 ? void 0 : _d.summary) === null || _e === void 0 ? void 0 : _e.get(cardId), name: cardId, label: sheet.label, fields: sheet.fields, dataUnit: this.dataUnit, formMetadata: this._masterFormMetadata, recordsValidator: this.recordsValidator, fieldToFocus: this._fieldToGetFocus, key: guideId, onSnkRequestClearFieldToFocus: _ => this.clearFieldToFocusHandler(), customEditors: this._customEditors, fieldsProps: this._fieldsProps, fieldSearch: this._fieldSearch }, this.presentationMode == PresentationMode.SECONDARY && this.buildTaskBar());
|
319
314
|
}
|
320
315
|
}
|
321
316
|
return content;
|
@@ -415,12 +410,10 @@ export class SnkGuidesViewer {
|
|
415
410
|
}
|
416
411
|
this._guideHasChanged = false;
|
417
412
|
}
|
418
|
-
getFieldsSearch(
|
413
|
+
getFieldsSearch(item) {
|
419
414
|
if (this._fieldSearch == undefined || this._hasToCreateFieldSearch) {
|
420
415
|
this._hasToCreateFieldSearch = false;
|
421
|
-
this.
|
422
|
-
actionButton.addEventListener("taskbarActionsButtonDisconnected", () => this._hasToCreateFieldSearch = true);
|
423
|
-
this._fieldSearch = buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option, actionButton));
|
416
|
+
this._fieldSearch = buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option));
|
424
417
|
}
|
425
418
|
return this._fieldSearch;
|
426
419
|
}
|
@@ -428,7 +421,7 @@ export class SnkGuidesViewer {
|
|
428
421
|
return Promise.resolve(this._configManager.getFieldsList(argument)
|
429
422
|
.map(field => ({ value: field.name, label: field.label })));
|
430
423
|
}
|
431
|
-
onSelectField(option
|
424
|
+
onSelectField(option) {
|
432
425
|
if (option == undefined) {
|
433
426
|
return;
|
434
427
|
}
|
@@ -437,24 +430,28 @@ export class SnkGuidesViewer {
|
|
437
430
|
if (fieldGuideName !== this.selectedGuide.id) {
|
438
431
|
this.changeGuideHandler(fieldGuideName);
|
439
432
|
}
|
440
|
-
actionButton.hideActions();
|
441
433
|
}
|
442
434
|
getActionsList() {
|
435
|
+
var _a;
|
436
|
+
const hardList = [];
|
437
|
+
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
438
|
+
return hardList.concat((_a = this.taskbarManager.getMoreOptions(this.getTaskBarId(), this.configName, this.dataState, this.actionsList)) !== null && _a !== void 0 ? _a : []);
|
439
|
+
}
|
440
|
+
return hardList.concat(this.actionsList);
|
441
|
+
}
|
442
|
+
getSettingsListForm() {
|
443
443
|
const hardList = [{
|
444
|
-
value:
|
444
|
+
value: StringUtils.generateUUID(),
|
445
445
|
label: this.getMessage("snkCrud.findColumn"),
|
446
446
|
disableCloseOnSelect: true,
|
447
447
|
eagerInitialize: true,
|
448
|
-
itemBuilder: (
|
448
|
+
itemBuilder: (_, item) => this.getFieldsSearch(item)
|
449
449
|
}];
|
450
|
-
|
451
|
-
return hardList.concat(this.taskbarManager.getMoreOptions(this.getTaskBarId(), this.configName, this.dataState, this.actionsList));
|
452
|
-
}
|
453
|
-
return hardList.concat(this.actionsList);
|
450
|
+
return hardList;
|
454
451
|
}
|
455
452
|
buildTaskBar() {
|
456
453
|
var _a;
|
457
|
-
return h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.getActionsList(), messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? TaskbarElement.SAVE : TaskbarElement.INSERT, "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS", alignRigth: true }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
|
454
|
+
return h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.getActionsList(), actionsSettingsList: this.getSettingsListForm(), messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? TaskbarElement.SAVE : TaskbarElement.INSERT, "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS", alignRigth: true }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
|
458
455
|
}
|
459
456
|
async dataUnitActionHandler(action) {
|
460
457
|
var _a;
|
@@ -530,11 +527,24 @@ export class SnkGuidesViewer {
|
|
530
527
|
}
|
531
528
|
componentDidLoad() {
|
532
529
|
this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
|
530
|
+
this.initKeyboardManager();
|
531
|
+
}
|
532
|
+
disconnectedCallback() {
|
533
|
+
var _a;
|
534
|
+
(_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
|
535
|
+
}
|
536
|
+
async initKeyboardManager() {
|
537
|
+
this._keyboardManager = new KeyboardManager({ propagate: false, element: this._element });
|
538
|
+
this._keyboardManager.bind(SHORTCUT_SEARCH_FIELD, async () => {
|
539
|
+
if (!this._mainForm)
|
540
|
+
return;
|
541
|
+
await this._mainForm.showSearchField();
|
542
|
+
}, { description: LABEL_SEARCH_FIELD, element: this._element });
|
533
543
|
}
|
534
544
|
render() {
|
535
545
|
var _a, _b;
|
536
546
|
if (this._formEditorConfigManager != undefined) {
|
537
|
-
return (h("snk-form-config", {
|
547
|
+
return (h("snk-form-config", { tabindex: -1, dataUnit: this._formEditorDataUnit, messagesBuilder: this.messagesBuilder, configManager: this._formEditorConfigManager, onConfigClose: () => this._formEditorConfigManager = null, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }));
|
538
548
|
}
|
539
549
|
if (!this.dataUnit || !this._configManager.isLoaded) {
|
540
550
|
return;
|
@@ -921,7 +931,8 @@ export class SnkGuidesViewer {
|
|
921
931
|
"_fieldToGetFocus": {},
|
922
932
|
"_customEditors": {},
|
923
933
|
"_customRenders": {},
|
924
|
-
"_fieldsProps": {}
|
934
|
+
"_fieldsProps": {},
|
935
|
+
"_mainForm": {}
|
925
936
|
};
|
926
937
|
}
|
927
938
|
static get events() {
|
@@ -1026,22 +1037,6 @@ export class SnkGuidesViewer {
|
|
1026
1037
|
}]
|
1027
1038
|
}
|
1028
1039
|
},
|
1029
|
-
"findField": {
|
1030
|
-
"complexType": {
|
1031
|
-
"signature": "() => Promise<void>",
|
1032
|
-
"parameters": [],
|
1033
|
-
"references": {
|
1034
|
-
"Promise": {
|
1035
|
-
"location": "global"
|
1036
|
-
}
|
1037
|
-
},
|
1038
|
-
"return": "Promise<void>"
|
1039
|
-
},
|
1040
|
-
"docs": {
|
1041
|
-
"text": "Abre o localizador de campos",
|
1042
|
-
"tags": []
|
1043
|
-
}
|
1044
|
-
},
|
1045
1040
|
"addCustomEditor": {
|
1046
1041
|
"complexType": {
|
1047
1042
|
"signature": "(fieldName: string, customEditor: ICustomEditor) => Promise<void>",
|
@@ -1137,6 +1132,7 @@ export class SnkGuidesViewer {
|
|
1137
1132
|
}
|
1138
1133
|
};
|
1139
1134
|
}
|
1135
|
+
static get elementRef() { return "_element"; }
|
1140
1136
|
static get watchers() {
|
1141
1137
|
return [{
|
1142
1138
|
"propName": "dataUnit",
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { h, Fragment, } from '@stencil/core';
|
2
|
-
import { Action as DUAction, ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
|
2
|
+
import { Action as DUAction, ApplicationContext, ElementIDUtils, StringUtils, KeyboardManager } from '@sankhyalabs/core';
|
3
3
|
import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
|
4
4
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
5
5
|
import { ExporterStrategy, PresentationMode } from '../../lib/@types';
|
@@ -7,16 +7,17 @@ import TaskbarProcessor from '../snk-taskbar/processor/taskbar-processor';
|
|
7
7
|
import store from "../../lib/store";
|
8
8
|
import SnkMultiSelectionListDataSource from './filtercolumn/SnkMultiSelectionListDataSource';
|
9
9
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
10
|
-
import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/field-search';
|
11
10
|
import { CrudUtils } from '../../lib';
|
12
11
|
import RmPrecisionCustomValueFormatter from '../../lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter';
|
13
12
|
import ServerSideExporterProvider from '../snk-data-exporter/providers/ServerSideExporterProvider';
|
14
13
|
import { ContinuousInsertUtils } from '../../lib/utils/ContinuousInsertUtils';
|
15
14
|
import ClientSideExporterProvider from '../snk-data-exporter/providers/ClientSideExporterProvider';
|
15
|
+
import { buildFieldSearch } from '@sankhyalabs/ezui/dist/collection/utils';
|
16
16
|
export class SnkGrid {
|
17
17
|
constructor() {
|
18
18
|
this._customEditors = new Map();
|
19
19
|
this._customRenders = new Map();
|
20
|
+
this._keyboardManager = new KeyboardManager();
|
20
21
|
this._topTaskbarProcessor = new TaskbarProcessor({
|
21
22
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
22
23
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
@@ -78,6 +79,7 @@ export class SnkGrid {
|
|
78
79
|
this.enableGridInsert = false;
|
79
80
|
this.outlineMode = false;
|
80
81
|
this.strategyExporter = ExporterStrategy.SERVER_SIDE;
|
82
|
+
this.useSearchColumn = true;
|
81
83
|
this.multipleEditionEnabled = true;
|
82
84
|
}
|
83
85
|
getGridHeaderSelectedBtns() {
|
@@ -130,12 +132,6 @@ export class SnkGrid {
|
|
130
132
|
async getFilterBar() {
|
131
133
|
return this._snkFilterBar;
|
132
134
|
}
|
133
|
-
/**
|
134
|
-
* Abre o localizador de colunas
|
135
|
-
*/
|
136
|
-
async findColumn() {
|
137
|
-
await openFieldSearch(this._moreOptions, this._columnSearch);
|
138
|
-
}
|
139
135
|
/**
|
140
136
|
* Registra um editor customizado para campos da grade e formulário
|
141
137
|
*/
|
@@ -434,11 +430,10 @@ export class SnkGrid {
|
|
434
430
|
};
|
435
431
|
return primaryButtonLookup[this.presentationMode];
|
436
432
|
}
|
437
|
-
getColumnSearch(
|
433
|
+
getColumnSearch(item) {
|
438
434
|
if (this._columnSearch != undefined) {
|
439
435
|
return this._columnSearch;
|
440
436
|
}
|
441
|
-
this._moreOptions = actionButton;
|
442
437
|
this._columnSearch = buildFieldSearch(item, ({ argument }) => new Promise(accept => {
|
443
438
|
this._grid.filterColumns(argument).then((columns) => {
|
444
439
|
accept(columns
|
@@ -448,19 +443,12 @@ export class SnkGrid {
|
|
448
443
|
}), (option) => {
|
449
444
|
if (option != undefined) {
|
450
445
|
this._grid.locateColumn(option.value);
|
451
|
-
actionButton.hideActions();
|
452
446
|
}
|
453
447
|
});
|
454
448
|
return this._columnSearch;
|
455
449
|
}
|
456
450
|
getActionsList() {
|
457
|
-
const hardList = [
|
458
|
-
value: StringUtils.generateUUID(),
|
459
|
-
label: this.messagesBuilder.getMessage("snkGrid.findColumn", {}),
|
460
|
-
disableCloseOnSelect: true,
|
461
|
-
eagerInitialize: true,
|
462
|
-
itemBuilder: (actionButton, item) => this.getColumnSearch(actionButton, item)
|
463
|
-
}];
|
451
|
+
const hardList = [];
|
464
452
|
if (this.enableGridInsert) {
|
465
453
|
hardList.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert, () => {
|
466
454
|
this._enableContinuousInsert = !this._enableContinuousInsert;
|
@@ -475,6 +463,16 @@ export class SnkGrid {
|
|
475
463
|
}
|
476
464
|
return hardList.concat(this.actionsList);
|
477
465
|
}
|
466
|
+
getActionsSettingsList() {
|
467
|
+
const hardList = [{
|
468
|
+
value: StringUtils.generateUUID(),
|
469
|
+
label: this.messagesBuilder.getMessage("snkGrid.findColumn", {}),
|
470
|
+
disableCloseOnSelect: true,
|
471
|
+
eagerInitialize: true,
|
472
|
+
itemBuilder: (_, item) => this.getColumnSearch(item)
|
473
|
+
}];
|
474
|
+
return hardList;
|
475
|
+
}
|
478
476
|
handleFilterConfigUpdated(filterConfig) {
|
479
477
|
if (!filterConfig.length) {
|
480
478
|
this._showSnkFilterBar = false;
|
@@ -498,8 +496,8 @@ export class SnkGrid {
|
|
498
496
|
if (!this._dataUnit) {
|
499
497
|
return undefined;
|
500
498
|
}
|
501
|
-
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
|
502
|
-
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
499
|
+
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large ez-box--no-outline", tabindex: "0" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
|
500
|
+
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium ez-padding-top--extra-small", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none', actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode, useSearchColumn: this.useSearchColumn }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId, actionsSettingsList: this.getActionsSettingsList() }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
503
501
|
}
|
504
502
|
static get is() { return "snk-grid"; }
|
505
503
|
static get encapsulation() { return "scoped"; }
|
@@ -1041,6 +1039,24 @@ export class SnkGrid {
|
|
1041
1039
|
"reflect": false,
|
1042
1040
|
"defaultValue": "ExporterStrategy.SERVER_SIDE"
|
1043
1041
|
},
|
1042
|
+
"useSearchColumn": {
|
1043
|
+
"type": "boolean",
|
1044
|
+
"mutable": false,
|
1045
|
+
"complexType": {
|
1046
|
+
"original": "boolean",
|
1047
|
+
"resolved": "boolean",
|
1048
|
+
"references": {}
|
1049
|
+
},
|
1050
|
+
"required": false,
|
1051
|
+
"optional": false,
|
1052
|
+
"docs": {
|
1053
|
+
"tags": [],
|
1054
|
+
"text": "Define se a grade deve exibir um buscador de coluna com uso do Ctrl+F"
|
1055
|
+
},
|
1056
|
+
"attribute": "use-search-column",
|
1057
|
+
"reflect": false,
|
1058
|
+
"defaultValue": "true"
|
1059
|
+
},
|
1044
1060
|
"multipleEditionEnabled": {
|
1045
1061
|
"type": "boolean",
|
1046
1062
|
"mutable": false,
|
@@ -1208,22 +1224,6 @@ export class SnkGrid {
|
|
1208
1224
|
"tags": []
|
1209
1225
|
}
|
1210
1226
|
},
|
1211
|
-
"findColumn": {
|
1212
|
-
"complexType": {
|
1213
|
-
"signature": "() => Promise<void>",
|
1214
|
-
"parameters": [],
|
1215
|
-
"references": {
|
1216
|
-
"Promise": {
|
1217
|
-
"location": "global"
|
1218
|
-
}
|
1219
|
-
},
|
1220
|
-
"return": "Promise<void>"
|
1221
|
-
},
|
1222
|
-
"docs": {
|
1223
|
-
"text": "Abre o localizador de colunas",
|
1224
|
-
"tags": []
|
1225
|
-
}
|
1226
|
-
},
|
1227
1227
|
"addCustomEditor": {
|
1228
1228
|
"complexType": {
|
1229
1229
|
"signature": "(fieldName: string, customEditor: ICustomEditor, detailContext?: string) => Promise<void>",
|