@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
@@ -15,16 +15,17 @@ require('./dataunit-fetcher-a723f0dc.js');
|
|
15
15
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
16
16
|
require('./form-config-fetcher-40d3f752.js');
|
17
17
|
const constants = require('./constants-77c1b8bd.js');
|
18
|
-
const taskbarElements = require('./taskbar-elements-
|
19
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
20
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
18
|
+
const taskbarElements = require('./taskbar-elements-6f4e06af.js');
|
19
|
+
const snkGuidesViewer = require('./snk-guides-viewer-d33379cd.js');
|
20
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-9deeae08.js');
|
21
|
+
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
21
22
|
require('./ConfigStorage-df09fb78.js');
|
22
23
|
require('./PrintUtils-bcaeb82f.js');
|
23
24
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
24
25
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
25
26
|
require('./ResourceIDUtils-5ff86aa7.js');
|
26
27
|
require('./index-102ba62d.js');
|
27
|
-
require('./
|
28
|
+
require('./taskbar-processor-2fba34a8.js');
|
28
29
|
require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
29
30
|
|
30
31
|
class GuideBuilder {
|
@@ -81,6 +82,8 @@ const SnkDetailView = class {
|
|
81
82
|
this._disabledButtons = undefined;
|
82
83
|
this._currentView = undefined;
|
83
84
|
this.attachmentRegisterKey = undefined;
|
85
|
+
this._fieldToGetFocus = undefined;
|
86
|
+
this._hasToCreateFieldSearch = true;
|
84
87
|
this.formConfigManager = undefined;
|
85
88
|
this.dataUnitName = undefined;
|
86
89
|
this.resourceID = undefined;
|
@@ -300,6 +303,11 @@ const SnkDetailView = class {
|
|
300
303
|
async componentDidLoad() {
|
301
304
|
await this.observerPropsCustomEditor(this.customEditors);
|
302
305
|
await this.observeCustomRenders(this.customRenders);
|
306
|
+
this.initKeyboardManager();
|
307
|
+
}
|
308
|
+
disconnectedCallback() {
|
309
|
+
var _a;
|
310
|
+
(_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
|
303
311
|
}
|
304
312
|
async dataUnitActionHandler(action) {
|
305
313
|
if (action.type === core.Action.FIELD_INVALIDATED) {
|
@@ -313,11 +321,55 @@ const SnkDetailView = class {
|
|
313
321
|
normalizeBranchGuideId(id) {
|
314
322
|
return id === null || id === void 0 ? void 0 : id.replace(/child\[(.*?)\]/g, '$1').replace(/::/g, '>');
|
315
323
|
}
|
324
|
+
getSettingsListForm() {
|
325
|
+
const hardList = [{
|
326
|
+
value: core.StringUtils.generateUUID(),
|
327
|
+
label: this.messagesBuilder.getMessage("snkCrud.findColumn", undefined),
|
328
|
+
disableCloseOnSelect: true,
|
329
|
+
eagerInitialize: true,
|
330
|
+
itemBuilder: (_, item) => this.getFieldsSearch(item)
|
331
|
+
}];
|
332
|
+
return hardList;
|
333
|
+
}
|
334
|
+
getFieldsSearch(item) {
|
335
|
+
if (this._fieldSearch == undefined || this._hasToCreateFieldSearch) {
|
336
|
+
this._hasToCreateFieldSearch = false;
|
337
|
+
this._fieldSearch = utils.buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option));
|
338
|
+
}
|
339
|
+
return this._fieldSearch;
|
340
|
+
}
|
341
|
+
fieldsOptionLoader(argument) {
|
342
|
+
const searchTerm = argument === null || argument === void 0 ? void 0 : argument.toLowerCase();
|
343
|
+
const allFields = this.getFormFields().map(field => { var _a; return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(field.name); });
|
344
|
+
const filteredFields = allFields.filter(field => {
|
345
|
+
var _a, _b;
|
346
|
+
return ((_a = field.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm)) ||
|
347
|
+
((_b = field.label) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(searchTerm));
|
348
|
+
});
|
349
|
+
const options = filteredFields.map(field => ({ value: field.name, label: field.label }));
|
350
|
+
return Promise.resolve(options);
|
351
|
+
}
|
352
|
+
onSelectField(option) {
|
353
|
+
if (option == undefined) {
|
354
|
+
return;
|
355
|
+
}
|
356
|
+
this._fieldToGetFocus = option.value;
|
357
|
+
}
|
358
|
+
clearFieldToFocusHandler() {
|
359
|
+
this._fieldToGetFocus = undefined;
|
360
|
+
}
|
361
|
+
async initKeyboardManager() {
|
362
|
+
this._keyboardManager = new core.KeyboardManager({ propagate: false, element: this._element });
|
363
|
+
this._keyboardManager.bind(utils.SHORTCUT_SEARCH_FIELD, async () => {
|
364
|
+
await this._snkFormView.showSearchField();
|
365
|
+
}, { description: utils.LABEL_SEARCH_FIELD, element: this._element });
|
366
|
+
}
|
316
367
|
render() {
|
317
368
|
this.updateLabel();
|
318
369
|
//const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
|
319
|
-
return (index.h(index.Host, null, index.h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === constants.VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, index.h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, index.h("stack-item", null, index.h("div", { class: "ez-box ez-box--shadow grid-container" }, index.h("div", { class: "ez-title--primary ez-size-width--full ez-padding--large detail-header" }, index.h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? index.h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), index.h("snk-grid", { class: "ez-size-width--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(constants.VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: this.presentationMode, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS", outlineMode: false }))), index.h("stack-item", null, index.h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, index.h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: this.presentationMode, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }, index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
370
|
+
return (index.h(index.Host, null, index.h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === constants.VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, index.h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, index.h("stack-item", null, index.h("div", { class: "ez-box ez-box--shadow grid-container" }, index.h("div", { class: "ez-title--primary ez-size-width--full ez-padding--large detail-header" }, index.h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? index.h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), index.h("snk-grid", { class: "ez-size-width--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(constants.VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: this.presentationMode, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS", outlineMode: false }))), index.h("stack-item", null, index.h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), fieldToFocus: this._fieldToGetFocus, label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems), onSnkRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this), fieldSearch: this._fieldSearch }, index.h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: this.presentationMode, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS", actionsSettingsList: this.getSettingsListForm() }, index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
320
371
|
}
|
372
|
+
get _element() { return index.getElement(this); }
|
321
373
|
static get watchers() { return {
|
322
374
|
"dataUnit": ["observeDataUnit"],
|
323
375
|
"dataState": ["observerDataState"],
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
8
|
+
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
9
|
|
9
10
|
const snkFormViewCss = ".sc-snk-form-view-h{display:flex;width:100%;--ez-form-card-summary-field-content-weight:700}.level-path.sc-snk-form-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.summary-wrapper.sc-snk-form-view{display:flex;overflow:hidden}.summary-header.sc-snk-form-view{border-bottom:1px solid var(--color--strokes);margin-bottom:var(--space--medium);padding-bottom:var(--space--medium)}.summary-container.sc-snk-form-view{display:flex;flex-direction:column}.summary-container.sc-snk-form-view{padding-right:calc(var(--space--extra-large) / 1.5)}.summary-field.sc-snk-form-view{min-width:30px;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.summary-field__title.sc-snk-form-view{color:var(--text--primary, #626e82);font-size:var(--title--small);white-space:nowrap;font-weight:var(--text-weight--medium)}.summary-field__content.sc-snk-form-view{color:var(--title--primary, #2b3a54);font-size:var(--text--large);font-weight:var(--ez-form-card-summary-field-content-weight)}";
|
10
11
|
|
@@ -17,6 +18,7 @@ const SnkFormView = class {
|
|
17
18
|
this._customEditors = new Map();
|
18
19
|
this._fieldProps = new Map();
|
19
20
|
this.levelPath = undefined;
|
21
|
+
this.fieldSearch = undefined;
|
20
22
|
this.label = undefined;
|
21
23
|
this.name = undefined;
|
22
24
|
this.fields = undefined;
|
@@ -49,11 +51,6 @@ const SnkFormView = class {
|
|
49
51
|
newCustomEditors.set(fieldName, { customEditor, detailContext });
|
50
52
|
this._customEditors = newCustomEditors;
|
51
53
|
}
|
52
|
-
observePropsCustomEditor(newValue) {
|
53
|
-
for (const fieldName in newValue) {
|
54
|
-
this.addCustomEditor(fieldName, newValue[fieldName]);
|
55
|
-
}
|
56
|
-
}
|
57
54
|
/**
|
58
55
|
* Altera/adiciona uma propriedade nos metadados do campo.
|
59
56
|
*/
|
@@ -61,6 +58,21 @@ const SnkFormView = class {
|
|
61
58
|
const props = this._fieldProps.get(fieldName) || [];
|
62
59
|
this._fieldProps.set(fieldName, [...props, { propName, value }]);
|
63
60
|
}
|
61
|
+
/**
|
62
|
+
* Exibe a busca de campos ancorada ao container de cabeçalho do snk-form-view.
|
63
|
+
*/
|
64
|
+
async showSearchField() {
|
65
|
+
if (!this._headerContainer || !this._ezPopoverFieldColumn)
|
66
|
+
return;
|
67
|
+
const container = this._headerContainer.getBoundingClientRect();
|
68
|
+
await utils.focusOnFieldSerch(this.fieldSearch);
|
69
|
+
this._ezPopoverFieldColumn.showUnder(this._headerContainer, { horizontalGap: container.width - (utils.SEARCH_FIELD_FULL_WIDTH), verticalGap: container.height * -1 });
|
70
|
+
}
|
71
|
+
observePropsCustomEditor(newValue) {
|
72
|
+
for (const fieldName in newValue) {
|
73
|
+
this.addCustomEditor(fieldName, newValue[fieldName]);
|
74
|
+
}
|
75
|
+
}
|
64
76
|
async observeFieldsProps(newValue) {
|
65
77
|
for (const field in newValue) {
|
66
78
|
const fieldProps = newValue[field];
|
@@ -167,13 +179,13 @@ const SnkFormView = class {
|
|
167
179
|
}
|
168
180
|
}
|
169
181
|
render() {
|
170
|
-
return (index.h(index.Host, { class: "ez-box__container" }, index.h("div", { class: "summary-header ez-flex ez-size-width--full" }, index.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 ? index.h("span", { class: "level-path" }, this.levelPath + " /") : undefined, this.label), index.h("div", { class: "ez-flex ez-flex--justify-end ez-col--sd-3" }, this.canFix &&
|
182
|
+
return (index.h(index.Host, { class: "ez-box__container" }, index.h("div", { class: "summary-header ez-flex ez-size-width--full", ref: ref => this._headerContainer = ref }, index.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 ? index.h("span", { class: "level-path" }, this.levelPath + " /") : undefined, this.label), index.h("div", { class: "ez-flex ez-flex--justify-end ez-col--sd-3" }, this.canFix &&
|
171
183
|
index.h("ez-button", { class: "ez-padding-left--medium", mode: "icon", size: "small", iconName: this.fixed ? "un-pin" : "push-pin", "data-element-id": core.ElementIDUtils.getInternalIDInfo("toggleFixed_ezFormCard"), onClick: () => this.changeFix(), title: this.fixed ? "Desafixar" : "Fixar" }), this.canExpand &&
|
172
184
|
index.h("ez-button", { class: "ez-padding-left--medium", mode: "icon", size: "small", iconName: this.contracted ? "chevron-down" : "chevron-up", "data-element-id": core.ElementIDUtils.getInternalIDInfo("toggleExpand_ezFormCard"), onClick: () => this.changeContracted(), title: this.contracted ? "Expandir" : "Resumir" }))), index.h("slot", null), this.contracted
|
173
185
|
?
|
174
186
|
index.h("snk-form-summary", { summary: this.getCardSummary() })
|
175
187
|
:
|
176
|
-
index.h("ez-form-view", { ref: ref => this._formView = ref, fields: this.fields, onEzContentReady: evt => this.bindFields(evt.detail), onFormItemsReady: (event) => this.handleFormItemsReady(event) })));
|
188
|
+
index.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 && index.h("ez-popover", { ref: elem => (this._ezPopoverFieldColumn = elem), overlayType: "none" }, this.fieldSearch)));
|
177
189
|
}
|
178
190
|
static get watchers() { return {
|
179
191
|
"customEditors": ["observePropsCustomEditor"],
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const taskbarElements = require('./taskbar-elements-
|
7
|
+
const taskbarElements = require('./taskbar-elements-6f4e06af.js');
|
8
8
|
const ConfigStorage = require('./ConfigStorage-df09fb78.js');
|
9
9
|
const index$1 = require('./index-e3e39724.js');
|
10
|
-
const
|
10
|
+
const taskbarProcessor = require('./taskbar-processor-2fba34a8.js');
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
12
12
|
const ClientSideExporterProvider = require('./ClientSideExporterProvider-a2753c93.js');
|
13
13
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
@@ -20,6 +20,7 @@ require('./filter-item-type.enum-a7ffdaa6.js');
|
|
20
20
|
require('./form-config-fetcher-40d3f752.js');
|
21
21
|
require('./constants-77c1b8bd.js');
|
22
22
|
const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
23
|
+
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
23
24
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
24
25
|
require('./IFetchDataExporterParams-e78ec415.js');
|
25
26
|
require('./PrintUtils-bcaeb82f.js');
|
@@ -90,7 +91,8 @@ const SnkGrid = class {
|
|
90
91
|
this.gridDoubleClick = index.createEvent(this, "gridDoubleClick", 7);
|
91
92
|
this._customEditors = new Map();
|
92
93
|
this._customRenders = new Map();
|
93
|
-
this.
|
94
|
+
this._keyboardManager = new core.KeyboardManager();
|
95
|
+
this._topTaskbarProcessor = new taskbarProcessor.TaskbarProcessor({
|
94
96
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
95
97
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
96
98
|
"snkGridTopTaskbar.regular.singleTaskbar": [],
|
@@ -98,7 +100,7 @@ const SnkGrid = class {
|
|
98
100
|
"snkGridTopTaskbar.finish_edition.secondary": [],
|
99
101
|
"snkGridTopTaskbar.finish_edition.singleTaskbar": [],
|
100
102
|
});
|
101
|
-
this._headerTaskbarProcessor = new
|
103
|
+
this._headerTaskbarProcessor = new taskbarProcessor.TaskbarProcessor({
|
102
104
|
"snkGridHeaderTaskbar.unselected": ["REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON", "MORE_OPTIONS"],
|
103
105
|
"snkGridHeaderTaskbar.selected": this.getGridHeaderSelectedBtns(),
|
104
106
|
"snkGridHeaderTaskbar.detail.unselected": ["REFRESH", "MORE_OPTIONS"],
|
@@ -151,6 +153,7 @@ const SnkGrid = class {
|
|
151
153
|
this.enableGridInsert = false;
|
152
154
|
this.outlineMode = false;
|
153
155
|
this.strategyExporter = index$1.ExporterStrategy.SERVER_SIDE;
|
156
|
+
this.useSearchColumn = true;
|
154
157
|
this.multipleEditionEnabled = true;
|
155
158
|
}
|
156
159
|
getGridHeaderSelectedBtns() {
|
@@ -203,12 +206,6 @@ const SnkGrid = class {
|
|
203
206
|
async getFilterBar() {
|
204
207
|
return this._snkFilterBar;
|
205
208
|
}
|
206
|
-
/**
|
207
|
-
* Abre o localizador de colunas
|
208
|
-
*/
|
209
|
-
async findColumn() {
|
210
|
-
await fieldSearch.openFieldSearch(this._moreOptions, this._columnSearch);
|
211
|
-
}
|
212
209
|
/**
|
213
210
|
* Registra um editor customizado para campos da grade e formulário
|
214
211
|
*/
|
@@ -507,12 +504,11 @@ const SnkGrid = class {
|
|
507
504
|
};
|
508
505
|
return primaryButtonLookup[this.presentationMode];
|
509
506
|
}
|
510
|
-
getColumnSearch(
|
507
|
+
getColumnSearch(item) {
|
511
508
|
if (this._columnSearch != undefined) {
|
512
509
|
return this._columnSearch;
|
513
510
|
}
|
514
|
-
this.
|
515
|
-
this._columnSearch = fieldSearch.buildFieldSearch(item, ({ argument }) => new Promise(accept => {
|
511
|
+
this._columnSearch = utils.buildFieldSearch(item, ({ argument }) => new Promise(accept => {
|
516
512
|
this._grid.filterColumns(argument).then((columns) => {
|
517
513
|
accept(columns
|
518
514
|
.filter(column => !column.hidden)
|
@@ -521,19 +517,12 @@ const SnkGrid = class {
|
|
521
517
|
}), (option) => {
|
522
518
|
if (option != undefined) {
|
523
519
|
this._grid.locateColumn(option.value);
|
524
|
-
actionButton.hideActions();
|
525
520
|
}
|
526
521
|
});
|
527
522
|
return this._columnSearch;
|
528
523
|
}
|
529
524
|
getActionsList() {
|
530
|
-
const hardList = [
|
531
|
-
value: core.StringUtils.generateUUID(),
|
532
|
-
label: this.messagesBuilder.getMessage("snkGrid.findColumn", {}),
|
533
|
-
disableCloseOnSelect: true,
|
534
|
-
eagerInitialize: true,
|
535
|
-
itemBuilder: (actionButton, item) => this.getColumnSearch(actionButton, item)
|
536
|
-
}];
|
525
|
+
const hardList = [];
|
537
526
|
if (this.enableGridInsert) {
|
538
527
|
hardList.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert, () => {
|
539
528
|
this._enableContinuousInsert = !this._enableContinuousInsert;
|
@@ -548,6 +537,16 @@ const SnkGrid = class {
|
|
548
537
|
}
|
549
538
|
return hardList.concat(this.actionsList);
|
550
539
|
}
|
540
|
+
getActionsSettingsList() {
|
541
|
+
const hardList = [{
|
542
|
+
value: core.StringUtils.generateUUID(),
|
543
|
+
label: this.messagesBuilder.getMessage("snkGrid.findColumn", {}),
|
544
|
+
disableCloseOnSelect: true,
|
545
|
+
eagerInitialize: true,
|
546
|
+
itemBuilder: (_, item) => this.getColumnSearch(item)
|
547
|
+
}];
|
548
|
+
return hardList;
|
549
|
+
}
|
551
550
|
handleFilterConfigUpdated(filterConfig) {
|
552
551
|
if (!filterConfig.length) {
|
553
552
|
this._showSnkFilterBar = false;
|
@@ -571,8 +570,8 @@ const SnkGrid = class {
|
|
571
570
|
if (!this._dataUnit) {
|
572
571
|
return undefined;
|
573
572
|
}
|
574
|
-
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
|
575
|
-
index.h(index.Fragment, null, index.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 }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.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' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.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 }, index.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 }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
573
|
+
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large ez-box--no-outline", tabindex: "0" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
|
574
|
+
index.h(index.Fragment, null, index.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 }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.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() }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.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 }, index.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() }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
576
575
|
}
|
577
576
|
get _element() { return index.getElement(this); }
|
578
577
|
static get watchers() { return {
|
@@ -4,8 +4,8 @@ const index = require('./index-f9e81701.js');
|
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
5
|
const SnkFormConfigManager = require('./SnkFormConfigManager-45a8d7b7.js');
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
7
|
-
const
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
7
|
+
const taskbarProcessor = require('./taskbar-processor-2fba34a8.js');
|
8
|
+
const taskbarElements = require('./taskbar-elements-6f4e06af.js');
|
9
9
|
const constants = require('./constants-77c1b8bd.js');
|
10
10
|
require('./DataFetcher-1afdb18e.js');
|
11
11
|
require('./ISave-c76e2c51.js');
|
@@ -16,6 +16,7 @@ require('./dataunit-fetcher-a723f0dc.js');
|
|
16
16
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
17
17
|
require('./form-config-fetcher-40d3f752.js');
|
18
18
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
19
|
+
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
19
20
|
|
20
21
|
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-small);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-small));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-small))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
|
21
22
|
|
@@ -55,6 +56,7 @@ const SnkGuidesViewer = class {
|
|
55
56
|
this._customEditors = undefined;
|
56
57
|
this._customRenders = undefined;
|
57
58
|
this._fieldsProps = {};
|
59
|
+
this._mainForm = undefined;
|
58
60
|
}
|
59
61
|
observeDataUnit() {
|
60
62
|
this.loadGuides(true);
|
@@ -81,12 +83,6 @@ const SnkGuidesViewer = class {
|
|
81
83
|
this._formEditorConfigManager = masterConfig ? this._configManager : this._currentDetail.formConfigManager;
|
82
84
|
this._formEditorDataUnit = masterConfig ? this.dataUnit : this._currentDetail.dataUnit;
|
83
85
|
}
|
84
|
-
/**
|
85
|
-
* Abre o localizador de campos
|
86
|
-
*/
|
87
|
-
async findField() {
|
88
|
-
await fieldSearch.openFieldSearch(this._moreOptions, this._fieldSearch);
|
89
|
-
}
|
90
86
|
/**
|
91
87
|
* Registra um editor customizado para campos da grade e formulário
|
92
88
|
*/
|
@@ -218,7 +214,7 @@ const SnkGuidesViewer = class {
|
|
218
214
|
taskbarIDs[TASKBAR_ID.REGULAR] = this.buildBtnsRegularMode();
|
219
215
|
taskbarIDs[TASKBAR_ID.FINISH_EDITION] = [taskbarElements.TaskbarElement.CANCEL, taskbarElements.TaskbarElement.SAVE, this.handleAddGridMode()];
|
220
216
|
taskbarIDs[TASKBAR_ID.MUTIPLE_EDITION] = [taskbarElements.TaskbarElement.CANCEL];
|
221
|
-
this._taskbarProcessor = new
|
217
|
+
this._taskbarProcessor = new taskbarProcessor.TaskbarProcessor(taskbarIDs);
|
222
218
|
this._taskbarProcessor.process(this.getTaskBarId(), this.taskbarManager, this.dataState, this.buildDisabledButtons(), this.buildInvisibleButtons());
|
223
219
|
}
|
224
220
|
buildBtnsRegularMode() {
|
@@ -331,7 +327,7 @@ const SnkGuidesViewer = class {
|
|
331
327
|
const sheet = this._masterFormMetadata.getSheet(cardId);
|
332
328
|
if (sheet) {
|
333
329
|
const cardConfig = (_c = (_b = this.masterFormConfig) === null || _b === void 0 ? void 0 : _b.cardsState) === null || _c === void 0 ? void 0 : _c.get(cardId);
|
334
|
-
content = index.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 == index$1.PresentationMode.SECONDARY && this.buildTaskBar());
|
330
|
+
content = index.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 == index$1.PresentationMode.SECONDARY && this.buildTaskBar());
|
335
331
|
}
|
336
332
|
}
|
337
333
|
return content;
|
@@ -431,12 +427,10 @@ const SnkGuidesViewer = class {
|
|
431
427
|
}
|
432
428
|
this._guideHasChanged = false;
|
433
429
|
}
|
434
|
-
getFieldsSearch(
|
430
|
+
getFieldsSearch(item) {
|
435
431
|
if (this._fieldSearch == undefined || this._hasToCreateFieldSearch) {
|
436
432
|
this._hasToCreateFieldSearch = false;
|
437
|
-
this.
|
438
|
-
actionButton.addEventListener("taskbarActionsButtonDisconnected", () => this._hasToCreateFieldSearch = true);
|
439
|
-
this._fieldSearch = fieldSearch.buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option, actionButton));
|
433
|
+
this._fieldSearch = utils.buildFieldSearch(item, ({ argument }) => this.fieldsOptionLoader(argument), (option) => this.onSelectField(option));
|
440
434
|
}
|
441
435
|
return this._fieldSearch;
|
442
436
|
}
|
@@ -444,7 +438,7 @@ const SnkGuidesViewer = class {
|
|
444
438
|
return Promise.resolve(this._configManager.getFieldsList(argument)
|
445
439
|
.map(field => ({ value: field.name, label: field.label })));
|
446
440
|
}
|
447
|
-
onSelectField(option
|
441
|
+
onSelectField(option) {
|
448
442
|
if (option == undefined) {
|
449
443
|
return;
|
450
444
|
}
|
@@ -453,24 +447,28 @@ const SnkGuidesViewer = class {
|
|
453
447
|
if (fieldGuideName !== this.selectedGuide.id) {
|
454
448
|
this.changeGuideHandler(fieldGuideName);
|
455
449
|
}
|
456
|
-
actionButton.hideActions();
|
457
450
|
}
|
458
451
|
getActionsList() {
|
452
|
+
var _a;
|
453
|
+
const hardList = [];
|
454
|
+
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
455
|
+
return hardList.concat((_a = this.taskbarManager.getMoreOptions(this.getTaskBarId(), this.configName, this.dataState, this.actionsList)) !== null && _a !== void 0 ? _a : []);
|
456
|
+
}
|
457
|
+
return hardList.concat(this.actionsList);
|
458
|
+
}
|
459
|
+
getSettingsListForm() {
|
459
460
|
const hardList = [{
|
460
|
-
value:
|
461
|
+
value: core.StringUtils.generateUUID(),
|
461
462
|
label: this.getMessage("snkCrud.findColumn"),
|
462
463
|
disableCloseOnSelect: true,
|
463
464
|
eagerInitialize: true,
|
464
|
-
itemBuilder: (
|
465
|
+
itemBuilder: (_, item) => this.getFieldsSearch(item)
|
465
466
|
}];
|
466
|
-
|
467
|
-
return hardList.concat(this.taskbarManager.getMoreOptions(this.getTaskBarId(), this.configName, this.dataState, this.actionsList));
|
468
|
-
}
|
469
|
-
return hardList.concat(this.actionsList);
|
467
|
+
return hardList;
|
470
468
|
}
|
471
469
|
buildTaskBar() {
|
472
470
|
var _a;
|
473
|
-
return index.h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != index$1.PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, index.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) ? taskbarElements.TaskbarElement.SAVE : taskbarElements.TaskbarElement.INSERT, "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS", alignRigth: true }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
|
471
|
+
return index.h("div", { class: `snk-guides-viewer__header-taskbar ${this.presentationMode != index$1.PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, index.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) ? taskbarElements.TaskbarElement.SAVE : taskbarElements.TaskbarElement.INSERT, "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS", alignRigth: true }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
|
474
472
|
}
|
475
473
|
async dataUnitActionHandler(action) {
|
476
474
|
var _a;
|
@@ -546,11 +544,24 @@ const SnkGuidesViewer = class {
|
|
546
544
|
}
|
547
545
|
componentDidLoad() {
|
548
546
|
this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
|
547
|
+
this.initKeyboardManager();
|
548
|
+
}
|
549
|
+
disconnectedCallback() {
|
550
|
+
var _a;
|
551
|
+
(_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
|
552
|
+
}
|
553
|
+
async initKeyboardManager() {
|
554
|
+
this._keyboardManager = new core.KeyboardManager({ propagate: false, element: this._element });
|
555
|
+
this._keyboardManager.bind(utils.SHORTCUT_SEARCH_FIELD, async () => {
|
556
|
+
if (!this._mainForm)
|
557
|
+
return;
|
558
|
+
await this._mainForm.showSearchField();
|
559
|
+
}, { description: utils.LABEL_SEARCH_FIELD, element: this._element });
|
549
560
|
}
|
550
561
|
render() {
|
551
562
|
var _a, _b;
|
552
563
|
if (this._formEditorConfigManager != undefined) {
|
553
|
-
return (index.h("snk-form-config", {
|
564
|
+
return (index.h("snk-form-config", { tabindex: -1, dataUnit: this._formEditorDataUnit, messagesBuilder: this.messagesBuilder, configManager: this._formEditorConfigManager, onConfigClose: () => this._formEditorConfigManager = null, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }));
|
554
565
|
}
|
555
566
|
if (!this.dataUnit || !this._configManager.isLoaded) {
|
556
567
|
return;
|
@@ -573,6 +584,7 @@ const SnkGuidesViewer = class {
|
|
573
584
|
fieldsProps: this._fieldsProps
|
574
585
|
}), this.getContent())), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
|
575
586
|
}
|
587
|
+
get _element() { return index.getElement(this); }
|
576
588
|
static get watchers() { return {
|
577
589
|
"dataUnit": ["observeDataUnit"],
|
578
590
|
"dataState": ["observeDataState"],
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-d33379cd.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('./SnkFormConfigManager-45a8d7b7.js');
|
@@ -14,8 +14,8 @@ require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
14
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
15
15
|
require('./constants-77c1b8bd.js');
|
16
16
|
require('@sankhyalabs/ezui/dist/collection/utils/form');
|
17
|
-
require('./
|
18
|
-
require('./taskbar-elements-
|
17
|
+
require('./taskbar-processor-2fba34a8.js');
|
18
|
+
require('./taskbar-elements-6f4e06af.js');
|
19
19
|
require('./index-e3e39724.js');
|
20
20
|
require('./index-102ba62d.js');
|
21
21
|
require('./ISave-c76e2c51.js');
|
@@ -25,6 +25,7 @@ require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
25
25
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
26
26
|
require('./ResourceIDUtils-5ff86aa7.js');
|
27
27
|
require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
28
|
+
require('@sankhyalabs/ezui/dist/collection/utils');
|
28
29
|
|
29
30
|
|
30
31
|
|