@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-77730.0 → 0.0.0-bugfix-dev-KB-76362.1
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/{ContinuousInsertUtils-c9877865.js → ContinuousInsertUtils-64e47516.js} +1 -1
- package/dist/cjs/{SnkMessageBuilder-bae64d0d.js → SnkMessageBuilder-7691a2c1.js} +10 -0
- package/dist/cjs/index-f9e81701.js +8 -0
- package/dist/cjs/input-distinct-search_2.cjs.entry.js +471 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-2b2badbb.js → pesquisa-fetcher-a9bfeb22.js} +0 -3
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +23 -26
- package/dist/cjs/snk-application.cjs.entry.js +3 -19
- package/dist/cjs/snk-attach.cjs.entry.js +1 -1
- package/dist/cjs/snk-config-options_3.cjs.entry.js +5 -17
- package/dist/cjs/snk-crud.cjs.entry.js +3 -9
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
- package/dist/cjs/{snk-data-unit-3d9b6ed4.js → snk-data-unit-7dbdad0e.js} +14 -26
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +3 -3
- package/dist/cjs/snk-distinct-search.cjs.entry.js +123 -0
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +0 -9
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -2
- package/dist/cjs/snk-grid.cjs.entry.js +4 -12
- package/dist/cjs/{snk-guides-viewer-d767917a.js → snk-guides-viewer-eee43c8b.js} +2 -2
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
- package/dist/cjs/snk-simple-crud.cjs.entry.js +6 -9
- package/dist/cjs/snk-taskbar.cjs.entry.js +37 -40
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +26 -27
- package/dist/collection/components/snk-application/snk-application.js +1 -41
- package/dist/collection/components/snk-crud/snk-crud.js +2 -26
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +13 -25
- package/dist/collection/components/snk-distinct-search/snk-distinct-search.css +4 -0
- package/dist/collection/components/snk-distinct-search/snk-distinct-search.js +372 -0
- package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.css +110 -0
- package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.js +544 -0
- package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.css +28 -0
- package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.js +593 -0
- package/dist/collection/components/snk-distinct-search/utils/filter-distinct-search.js +15 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -2
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +1 -5
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +0 -20
- package/dist/collection/components/snk-form-config/snk-form-config.js +5 -17
- package/dist/collection/components/snk-grid/snk-grid.js +2 -28
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +4 -25
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +38 -41
- package/dist/collection/lib/http/data-fetcher/fetchers/distinct-search-fetcher.js +25 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +1 -7
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +1 -4
- package/dist/collection/lib/message/SnkMessageBuilder.js +2 -0
- package/dist/collection/lib/message/resources/snk-distinct-search.msg.js +9 -0
- package/dist/components/SnkMessageBuilder.js +10 -0
- package/dist/components/filter-distinct-search.js +17 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/components/input-distinct-search.d.ts +11 -0
- package/dist/components/input-distinct-search.js +6 -0
- package/dist/components/input-distinct-search2.js +264 -0
- package/dist/components/pesquisa-fetcher.js +1 -4
- package/dist/components/search-modal.d.ts +11 -0
- package/dist/components/search-modal.js +6 -0
- package/dist/components/search-modal2.js +264 -0
- package/dist/components/snk-actions-button2.js +26 -27
- package/dist/components/snk-application2.js +2 -19
- package/dist/components/snk-crud.js +2 -9
- package/dist/components/snk-data-unit2.js +13 -25
- package/dist/components/snk-detail-view2.js +1 -1
- package/dist/components/snk-distinct-search.d.ts +11 -0
- package/dist/components/snk-distinct-search.js +163 -0
- package/dist/components/snk-filter-bar2.js +0 -6
- package/dist/components/snk-filter-item2.js +1 -5
- package/dist/components/snk-filter-text.js +1 -2
- package/dist/components/snk-form-config2.js +5 -17
- package/dist/components/snk-grid2.js +2 -11
- package/dist/components/snk-simple-crud2.js +4 -8
- package/dist/components/snk-taskbar2.js +38 -41
- package/dist/esm/{ContinuousInsertUtils-ce29b742.js → ContinuousInsertUtils-b62906f9.js} +1 -1
- package/dist/esm/{SnkMessageBuilder-6fff4a4c.js → SnkMessageBuilder-7ace6803.js} +10 -0
- package/dist/esm/index-a7d3d3f1.js +8 -0
- package/dist/esm/input-distinct-search_2.entry.js +466 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-887fff39.js → pesquisa-fetcher-6bc2e41a.js} +1 -4
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +24 -27
- package/dist/esm/snk-application.entry.js +4 -20
- package/dist/esm/snk-attach.entry.js +1 -1
- package/dist/esm/snk-config-options_3.entry.js +5 -17
- package/dist/esm/snk-crud.entry.js +3 -9
- package/dist/esm/snk-data-exporter.entry.js +3 -3
- package/dist/esm/{snk-data-unit-9fa7d2b9.js → snk-data-unit-7a579dbd.js} +14 -26
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +3 -3
- package/dist/esm/snk-distinct-search.entry.js +119 -0
- package/dist/esm/snk-filter-bar_4.entry.js +1 -10
- package/dist/esm/snk-filter-text.entry.js +1 -2
- package/dist/esm/snk-grid.entry.js +4 -12
- package/dist/esm/{snk-guides-viewer-479a38e2.js → snk-guides-viewer-e8ca764a.js} +2 -2
- package/dist/esm/snk-guides-viewer.entry.js +2 -2
- package/dist/esm/snk-simple-crud.entry.js +6 -9
- package/dist/esm/snk-taskbar.entry.js +38 -41
- package/dist/sankhyablocks/{p-5bf70e1d.entry.js → p-00f9fe5c.entry.js} +1 -1
- package/dist/sankhyablocks/p-0e250436.entry.js +1 -0
- package/dist/sankhyablocks/p-154aa2a6.entry.js +11 -0
- package/dist/sankhyablocks/p-18cb1acb.entry.js +1 -0
- package/dist/sankhyablocks/p-1dbd5c18.entry.js +1 -0
- package/dist/sankhyablocks/p-2aae03a1.entry.js +1 -0
- package/dist/sankhyablocks/p-30ebcbe0.entry.js +1 -0
- package/dist/sankhyablocks/p-341465ce.js +6 -0
- package/dist/sankhyablocks/p-3858a2e4.entry.js +1 -0
- package/dist/sankhyablocks/{p-9791c561.entry.js → p-42130213.entry.js} +1 -1
- package/dist/sankhyablocks/p-563b7c28.entry.js +1 -0
- package/dist/sankhyablocks/p-96a89d58.entry.js +1 -0
- package/dist/sankhyablocks/p-987c7328.entry.js +1 -0
- package/dist/sankhyablocks/{p-8a20c65a.entry.js → p-a2c790ac.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ac55b0e4.entry.js → p-b389ed49.entry.js} +1 -1
- package/dist/sankhyablocks/p-c75fae8e.js +1 -0
- package/dist/sankhyablocks/p-d8665750.js +1 -0
- package/dist/sankhyablocks/{p-dd5311d4.js → p-e3a285a2.js} +1 -1
- package/dist/sankhyablocks/{p-6335ca42.js → p-e4391e16.js} +1 -1
- package/dist/sankhyablocks/p-f0aaad2b.entry.js +1 -0
- package/dist/sankhyablocks/{p-0d2a2e9e.entry.js → p-f4e221b2.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +2 -3
- package/dist/types/components/snk-application/snk-application.d.ts +1 -6
- package/dist/types/components/snk-crud/snk-crud.d.ts +0 -4
- package/dist/types/components/snk-distinct-search/snk-distinct-search.d.ts +83 -0
- package/dist/types/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.d.ts +105 -0
- package/dist/types/components/snk-distinct-search/subcomponents/search-modal/search-modal.d.ts +127 -0
- package/dist/types/components/snk-distinct-search/types/index.d.ts +12 -0
- package/dist/types/components/snk-distinct-search/utils/filter-distinct-search.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +0 -2
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -4
- package/dist/types/components/snk-grid/snk-grid.d.ts +0 -4
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -2
- package/dist/types/components.d.ts +393 -31
- package/dist/types/lib/http/data-fetcher/fetchers/distinct-search-fetcher.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +0 -1
- package/dist/types/lib/message/resources/snk-distinct-search.msg.d.ts +2 -0
- package/package.json +1 -1
- package/react/components.d.ts +3 -0
- package/react/components.js +3 -0
- package/react/components.js.map +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js +0 -8
- package/dist/sankhyablocks/p-12c532d8.entry.js +0 -1
- package/dist/sankhyablocks/p-17425c72.js +0 -1
- package/dist/sankhyablocks/p-1d3ce0d9.entry.js +0 -1
- package/dist/sankhyablocks/p-342eeb3b.js +0 -1
- package/dist/sankhyablocks/p-5e07905d.entry.js +0 -1
- package/dist/sankhyablocks/p-619aeac8.entry.js +0 -1
- package/dist/sankhyablocks/p-6bf88099.entry.js +0 -1
- package/dist/sankhyablocks/p-89c92727.entry.js +0 -1
- package/dist/sankhyablocks/p-b6f1b975.entry.js +0 -11
- package/dist/sankhyablocks/p-bf14e395.entry.js +0 -1
- package/dist/sankhyablocks/p-c716c4f5.js +0 -6
- package/dist/sankhyablocks/p-ec43fcc8.entry.js +0 -1
- package/dist/types/components/snk-actions-button/interfaces/index.d.ts +0 -3
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.d.ts +0 -7
- /package/dist/collection/components/{snk-actions-button/interfaces → snk-distinct-search/types}/index.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-a7d3d3f1.js';
|
|
2
2
|
import { Action, ObjectUtils, DataUnitAction, StringUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
|
-
import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-
|
|
4
|
+
import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-7ace6803.js';
|
|
5
5
|
import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-56cb648b.js';
|
|
6
6
|
import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
7
7
|
import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
|
|
@@ -23,7 +23,7 @@ const SnkDataUnit = class {
|
|
|
23
23
|
this._rowMetadataCache = new Map();
|
|
24
24
|
this.REGEX_DATAUNIT_NAME = /dd:\/\/(.+?)\//;
|
|
25
25
|
this._dataUnitObserver = async (action) => {
|
|
26
|
-
const duState =
|
|
26
|
+
const duState = this.buildDataState(action.type);
|
|
27
27
|
this.dataState = duState;
|
|
28
28
|
this.messagesBuilder.currentOperation = this.getMessageOperation();
|
|
29
29
|
switch (action.type) {
|
|
@@ -135,22 +135,14 @@ const SnkDataUnit = class {
|
|
|
135
135
|
async getRowMetadata(record) {
|
|
136
136
|
return this.doGetRowMetadata(record);
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
doGetRowMetadata(record) {
|
|
139
139
|
const selectedRecord = this.dataUnit.getSelectedRecord();
|
|
140
140
|
if (!record && !selectedRecord) {
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
143
|
const currentRecord = record || selectedRecord;
|
|
144
144
|
const recordId = typeof currentRecord === 'string' ? currentRecord : currentRecord.__record__id__;
|
|
145
|
-
|
|
146
|
-
/*
|
|
147
|
-
Nao fazemos cache de metadataByRow pra registros novos, pois a chave do mesmo
|
|
148
|
-
muda ao ser salvo, por isso essa tratativa é necessária para que o dataState fique com metadados
|
|
149
|
-
corretos nao confiando apenas no _metadataByRow
|
|
150
|
-
*/
|
|
151
|
-
if (this.dataUnit.isNewRecord(recordId) && !rowMetadata) {
|
|
152
|
-
rowMetadata = await this.handleLoadRowMetadata(selectedRecord);
|
|
153
|
-
}
|
|
145
|
+
const rowMetadata = this._metadataByRow.get(recordId);
|
|
154
146
|
if (!rowMetadata) {
|
|
155
147
|
return;
|
|
156
148
|
}
|
|
@@ -344,7 +336,7 @@ const SnkDataUnit = class {
|
|
|
344
336
|
case Action.RECORDS_COPIED:
|
|
345
337
|
return this.interceptRecordsCopied(action);
|
|
346
338
|
case Action.DATA_CHANGED:
|
|
347
|
-
await this.handleLoadRowMetadata(action
|
|
339
|
+
await this.handleLoadRowMetadata(action);
|
|
348
340
|
return await this.interceptDataChange(action);
|
|
349
341
|
case Action.CHANGING_DATA:
|
|
350
342
|
return await this.interceptDataChange(action);
|
|
@@ -364,9 +356,8 @@ const SnkDataUnit = class {
|
|
|
364
356
|
return action;
|
|
365
357
|
}
|
|
366
358
|
}
|
|
367
|
-
async handleLoadRowMetadata(
|
|
368
|
-
|
|
369
|
-
return;
|
|
359
|
+
async handleLoadRowMetadata(action) {
|
|
360
|
+
const record = action.type === Action.DATA_CHANGED ? action.payload : action.payload.changes[0].record;
|
|
370
361
|
const keysPayload = Object.keys(record);
|
|
371
362
|
const rmpField = keysPayload.find((field) => this._fieldsWithRmp.includes(field));
|
|
372
363
|
if (rmpField) {
|
|
@@ -445,7 +436,7 @@ const SnkDataUnit = class {
|
|
|
445
436
|
isAllowed(flag) {
|
|
446
437
|
return this._permissions ? this._permissions.isSup || this._permissions[flag] : false;
|
|
447
438
|
}
|
|
448
|
-
|
|
439
|
+
buildDataState(actionType) {
|
|
449
440
|
var _a;
|
|
450
441
|
const selectionInfo = this.dataUnit.getSelectionInfo();
|
|
451
442
|
const isStartingInsertionMode = (this.dataUnit.hasDirtyRecords() || this.dataUnit.hasWaitingChanges()) && (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isEmpty());
|
|
@@ -453,7 +444,7 @@ const SnkDataUnit = class {
|
|
|
453
444
|
let rowMetadata = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.rowMetadata;
|
|
454
445
|
const allowedOverwrite = [Action.SELECTION_CHANGED, Action.EDITION_CANCELED, Action.NEXT_SELECTED, Action.PREVIOUS_SELECTED];
|
|
455
446
|
if (selectedRecord && (!rowMetadata || allowedOverwrite.includes(actionType))) {
|
|
456
|
-
rowMetadata =
|
|
447
|
+
rowMetadata = this.doGetRowMetadata(selectedRecord);
|
|
457
448
|
}
|
|
458
449
|
else if (rowMetadata) {
|
|
459
450
|
rowMetadata.getProp = this.buildGetPropRowMetadata(rowMetadata);
|
|
@@ -475,20 +466,17 @@ const SnkDataUnit = class {
|
|
|
475
466
|
});
|
|
476
467
|
}
|
|
477
468
|
async handleDataSaved(action) {
|
|
478
|
-
|
|
479
|
-
const newRowMetadata = await this.handleLoadRowMetadata((_c = (_b = (_a = action === null || action === void 0 ? void 0 : action.payload) === null || _a === void 0 ? void 0 : _a.changes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.record);
|
|
469
|
+
const newRowMetadata = await this.handleLoadRowMetadata(action);
|
|
480
470
|
if (newRowMetadata) {
|
|
481
471
|
newRowMetadata.getProp = this.buildGetPropRowMetadata(newRowMetadata);
|
|
482
472
|
}
|
|
483
473
|
const recordId = action.payload.records[0].__record__id__;
|
|
484
474
|
this._metadataByRow.set(recordId, newRowMetadata);
|
|
485
|
-
this.dataState =
|
|
486
|
-
|
|
487
|
-
if (saveOperation == 'copy')
|
|
488
|
-
saveOperation = OperationMap.CLONE;
|
|
489
|
-
if (this.ignoreSaveMessage && ![OperationMap.CLONE, OperationMap.INSERT].includes(saveOperation)) {
|
|
475
|
+
this.dataState = this.buildDataState();
|
|
476
|
+
if (this.ignoreSaveMessage) {
|
|
490
477
|
return;
|
|
491
478
|
}
|
|
479
|
+
const saveOperation = action.payload.changes[0]._operation.toLowerCase();
|
|
492
480
|
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
|
|
493
481
|
if (msg != undefined) {
|
|
494
482
|
this.showSuccessMessage(msg);
|
|
@@ -581,7 +569,7 @@ const SnkDataUnit = class {
|
|
|
581
569
|
const { records } = this.getMetadataByRow(this.dataUnit);
|
|
582
570
|
this.dataUnit.records = records;
|
|
583
571
|
}
|
|
584
|
-
this.dataState =
|
|
572
|
+
this.dataState = this.buildDataState();
|
|
585
573
|
let resolver;
|
|
586
574
|
while (resolver = this._onDataUnitResolve.pop()) {
|
|
587
575
|
resolver(this.dataUnit);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { S as snk_data_unit } from './snk-data-unit-
|
|
1
|
+
export { S as snk_data_unit } from './snk-data-unit-7a579dbd.js';
|
|
2
2
|
import './index-a7d3d3f1.js';
|
|
3
3
|
import '@sankhyalabs/core';
|
|
4
4
|
import '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
-
import './SnkMessageBuilder-
|
|
5
|
+
import './SnkMessageBuilder-7ace6803.js';
|
|
6
6
|
import './dataunit-fetcher-56cb648b.js';
|
|
7
7
|
import './DataFetcher-5034df59.js';
|
|
8
8
|
import './PrintUtils-3e4ff0f5.js';
|
|
@@ -3,7 +3,7 @@ import { Action } from '@sankhyalabs/core';
|
|
|
3
3
|
import { S as SnkFormConfigManager } from './SnkFormConfigManager-b409c745.js';
|
|
4
4
|
import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
|
5
5
|
import './DataFetcher-5034df59.js';
|
|
6
|
-
import './pesquisa-fetcher-
|
|
6
|
+
import './pesquisa-fetcher-6bc2e41a.js';
|
|
7
7
|
import { P as PresentationMode } from './index-3aa4977a.js';
|
|
8
8
|
import './ISave-d8c8bc59.js';
|
|
9
9
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
@@ -13,8 +13,8 @@ import './filter-item-type.enum-d45e026f.js';
|
|
|
13
13
|
import './form-config-fetcher-a7d3e277.js';
|
|
14
14
|
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
|
15
15
|
import { V as VIEW_MODE } from './constants-7302ee87.js';
|
|
16
|
-
import { S as SnkGuidesViewer } from './snk-guides-viewer-
|
|
17
|
-
import { S as SnkMessageBuilder } from './SnkMessageBuilder-
|
|
16
|
+
import { S as SnkGuidesViewer } from './snk-guides-viewer-e8ca764a.js';
|
|
17
|
+
import { S as SnkMessageBuilder } from './SnkMessageBuilder-7ace6803.js';
|
|
18
18
|
import './ConfigStorage-6514d66e.js';
|
|
19
19
|
import './PrintUtils-3e4ff0f5.js';
|
|
20
20
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-a7d3d3f1.js';
|
|
2
|
+
import { D as DataFetcher } from './DataFetcher-5034df59.js';
|
|
3
|
+
import { ApplicationContext } from '@sankhyalabs/core';
|
|
4
|
+
import './PrintUtils-3e4ff0f5.js';
|
|
5
|
+
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
6
|
+
|
|
7
|
+
class DistinctSearchFetcher {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.SERVICE = 'mge@Pesquisa.getSelectDistinct';
|
|
10
|
+
}
|
|
11
|
+
buildRequestBody(coluna, instancia) {
|
|
12
|
+
return {
|
|
13
|
+
selectDistinct: {
|
|
14
|
+
instancia,
|
|
15
|
+
coluna,
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
parseResponseBody(response) {
|
|
20
|
+
var _a, _b, _c;
|
|
21
|
+
const ocorrencias = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.ocorrencias) === null || _a === void 0 ? void 0 : _a.ocorrencia) === null || _b === void 0 ? void 0 : _b.map(({ $ }) => $)) !== null && _c !== void 0 ? _c : [];
|
|
22
|
+
return ocorrencias;
|
|
23
|
+
}
|
|
24
|
+
async fetchItens(coluna, instancia) {
|
|
25
|
+
const requestBody = this.buildRequestBody(coluna, instancia);
|
|
26
|
+
const response = await DataFetcher.get().callServiceBroker(this.SERVICE, requestBody);
|
|
27
|
+
const parsedResponse = this.parseResponseBody(response);
|
|
28
|
+
return parsedResponse;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const snkDistinctSearchCss = ".sc-snk-distinct-search-h{display:block;width:100%}";
|
|
33
|
+
|
|
34
|
+
const SnkDistinctSearch = class {
|
|
35
|
+
constructor(hostRef) {
|
|
36
|
+
registerInstance(this, hostRef);
|
|
37
|
+
this.changeValue = createEvent(this, "changeValue", 7);
|
|
38
|
+
this.onIconClick = () => {
|
|
39
|
+
this._searchModalElement.value = this.value || "";
|
|
40
|
+
this._searchModalElement.openModal();
|
|
41
|
+
};
|
|
42
|
+
this.distinctItems = undefined;
|
|
43
|
+
this.value = "";
|
|
44
|
+
this.label = "";
|
|
45
|
+
this.configSearch = undefined;
|
|
46
|
+
this.maxItems = 100;
|
|
47
|
+
this.debounceTime = 300;
|
|
48
|
+
this.canShowError = false;
|
|
49
|
+
this.mode = 'regular';
|
|
50
|
+
this.restrict = undefined;
|
|
51
|
+
this.errorMessage = undefined;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Método para limpa o campo de entrada de pesquisa
|
|
55
|
+
*/
|
|
56
|
+
clearInput() {
|
|
57
|
+
this._inputDistinctSearch.clearInput();
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Retorna se o conteúdo é inválido.
|
|
61
|
+
*/
|
|
62
|
+
isInvalid() {
|
|
63
|
+
return this._inputDistinctSearch.isInvalid();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Remove o foco do campo
|
|
67
|
+
*/
|
|
68
|
+
setBlur() {
|
|
69
|
+
this._inputDistinctSearch.setBlur();
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Aplica o foco do campo
|
|
73
|
+
*/
|
|
74
|
+
setFocus() {
|
|
75
|
+
this._inputDistinctSearch.setFocus();
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Método para fechar o modal
|
|
79
|
+
*/
|
|
80
|
+
closeModal() {
|
|
81
|
+
this._searchModalElement.closeModal();
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Método para abrir o modal
|
|
85
|
+
*/
|
|
86
|
+
openModal() {
|
|
87
|
+
this._searchModalElement.openModal();
|
|
88
|
+
}
|
|
89
|
+
async componentWillLoad() {
|
|
90
|
+
await this.fetchDistinctItems();
|
|
91
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
92
|
+
}
|
|
93
|
+
async fetchDistinctItems() {
|
|
94
|
+
const distinctFetcher = new DistinctSearchFetcher();
|
|
95
|
+
const response = await distinctFetcher.fetchItens(this.configSearch.column, this.configSearch.instance);
|
|
96
|
+
this.distinctItems = [...response];
|
|
97
|
+
}
|
|
98
|
+
onChange(event) {
|
|
99
|
+
event.stopPropagation();
|
|
100
|
+
this.value = event.detail.value;
|
|
101
|
+
this._inputDistinctSearch.selectValue(event.detail.value, event.detail.isNewItem);
|
|
102
|
+
this.changeValue.emit(event.detail);
|
|
103
|
+
}
|
|
104
|
+
onPopupClose() {
|
|
105
|
+
this._inputDistinctSearch.setFocus();
|
|
106
|
+
}
|
|
107
|
+
getMessage(key) {
|
|
108
|
+
return this._application.messagesBuilder.getMessage(key, null);
|
|
109
|
+
}
|
|
110
|
+
renderEmptyMessage() {
|
|
111
|
+
return (h("span", { innerHTML: this.getMessage("snkDistinctSearch.emptyResult") }));
|
|
112
|
+
}
|
|
113
|
+
render() {
|
|
114
|
+
return (h(Host, null, h("input-distinct-search", { ref: (ref) => this._inputDistinctSearch = ref, application: this._application, label: this.label, distinctItems: this.distinctItems, onChangeValue: this.onChange.bind(this), debounceTime: this.debounceTime, value: this.value, onIconClick: this.onIconClick, maxItems: this.maxItems, canShowError: this.canShowError, mode: this.mode, restrict: this.restrict, errorMessage: this.errorMessage }), h("search-modal", { ref: (ref) => this._searchModalElement = ref, application: this._application, listItens: this.distinctItems, onChangeValue: this.onChange.bind(this), restrict: this.restrict, value: this.value, label: this.label, emptyMessage: this.renderEmptyMessage(), maxItens: this.maxItems, debounceTime: this.debounceTime, canShowError: this.canShowError, mode: this.mode, errorMessage: this.errorMessage, onPopupClose: this.onPopupClose.bind(this) })));
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
SnkDistinctSearch.style = snkDistinctSearchCss;
|
|
118
|
+
|
|
119
|
+
export { SnkDistinctSearch as snk_distinct_search };
|
|
@@ -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 { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext, FloatingManager, DateUtils,
|
|
2
|
+
import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext, FloatingManager, DateUtils, ArrayUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
|
4
4
|
import { C as ConfigStorage } from './ConfigStorage-6514d66e.js';
|
|
5
5
|
import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
@@ -286,7 +286,6 @@ const SnkFilterBar = class {
|
|
|
286
286
|
this.disablePersonalizedFilter = undefined;
|
|
287
287
|
this.filterBarLegacyConfigName = undefined;
|
|
288
288
|
this.autoLoad = undefined;
|
|
289
|
-
this.afterApplyConfig = undefined;
|
|
290
289
|
this.allowDefault = undefined;
|
|
291
290
|
this.scrollerLocked = false;
|
|
292
291
|
this.showPersonalizedFilter = false;
|
|
@@ -422,7 +421,6 @@ const SnkFilterBar = class {
|
|
|
422
421
|
return this.filterConfig.find(item => item.type === FilterItemType.PERSONALIZED);
|
|
423
422
|
}
|
|
424
423
|
async processAfterUpdateConfig() {
|
|
425
|
-
var _a;
|
|
426
424
|
if (this._loadingPending) {
|
|
427
425
|
if (await this._application.isLoadedByPk() && !this._configUpdated)
|
|
428
426
|
return;
|
|
@@ -437,7 +435,6 @@ const SnkFilterBar = class {
|
|
|
437
435
|
if (this._configUpdated) {
|
|
438
436
|
this._configUpdated = false;
|
|
439
437
|
ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
|
|
440
|
-
(_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
441
438
|
}
|
|
442
439
|
}
|
|
443
440
|
async doLoadData(forceReload = false) {
|
|
@@ -642,9 +639,7 @@ const SnkFilterBar = class {
|
|
|
642
639
|
*/
|
|
643
640
|
async showFilterModal() {
|
|
644
641
|
const callbackOnApplyFilter = (filters) => {
|
|
645
|
-
var _a;
|
|
646
642
|
this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
|
|
647
|
-
(_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
648
643
|
};
|
|
649
644
|
let filtersConfigCopy = ObjectUtils.copy(this.filterConfig);
|
|
650
645
|
filtersConfigCopy = filtersConfigCopy.sort((itemA, itemB) => {
|
|
@@ -938,10 +933,6 @@ const SnkFilterItem = class {
|
|
|
938
933
|
return `${label}: ${this.getMessage('snkFilterBar.onlyEndToltip')} ${Number(end)}`;
|
|
939
934
|
}
|
|
940
935
|
}
|
|
941
|
-
if (this.config.mask) {
|
|
942
|
-
const _maskFormatter = new MaskFormatter(this.config.mask);
|
|
943
|
-
return `${label}: ${_maskFormatter.format(value)}`;
|
|
944
|
-
}
|
|
945
936
|
return `${label}: ${value}`;
|
|
946
937
|
}
|
|
947
938
|
return label;
|
|
@@ -21,11 +21,10 @@ const SnkFilterText = class {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
var _a;
|
|
25
24
|
if (!this.config) {
|
|
26
25
|
return undefined;
|
|
27
26
|
}
|
|
28
|
-
return (h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, label: this.config.label, value: this.config.value
|
|
27
|
+
return (h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, label: this.config.label, value: this.config.value }));
|
|
29
28
|
}
|
|
30
29
|
get _element() { return getElement(this); }
|
|
31
30
|
};
|
|
@@ -5,10 +5,10 @@ import { C as ConfigStorage } from './ConfigStorage-6514d66e.js';
|
|
|
5
5
|
import { P as PresentationMode } from './index-3aa4977a.js';
|
|
6
6
|
import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-f8b1d91e.js';
|
|
7
7
|
import { s as store } from './index-bdf75557.js';
|
|
8
|
-
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils } from './ContinuousInsertUtils-
|
|
8
|
+
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils } from './ContinuousInsertUtils-b62906f9.js';
|
|
9
9
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
10
10
|
import './DataFetcher-5034df59.js';
|
|
11
|
-
import './pesquisa-fetcher-
|
|
11
|
+
import './pesquisa-fetcher-6bc2e41a.js';
|
|
12
12
|
import './ISave-d8c8bc59.js';
|
|
13
13
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
14
14
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
@@ -142,7 +142,6 @@ const SnkGrid = class {
|
|
|
142
142
|
this.autoLoad = undefined;
|
|
143
143
|
this.autoFocus = true;
|
|
144
144
|
this.enableGridInsert = false;
|
|
145
|
-
this.enableLockManger = false;
|
|
146
145
|
}
|
|
147
146
|
/**
|
|
148
147
|
* Exibe a janela de configurações da grade.
|
|
@@ -230,17 +229,10 @@ const SnkGrid = class {
|
|
|
230
229
|
this._grid.setFocus();
|
|
231
230
|
}
|
|
232
231
|
async handleClick(event) {
|
|
233
|
-
var _a;
|
|
234
232
|
if (this.hasToBlockEvent(event)) {
|
|
235
233
|
event.preventDefault();
|
|
236
234
|
event.stopPropagation();
|
|
237
|
-
|
|
238
|
-
return;
|
|
239
|
-
const newEvent = new event.constructor(event.type, event);
|
|
240
|
-
(_a = event.target) === null || _a === void 0 ? void 0 : _a.dispatchEvent(newEvent);
|
|
241
|
-
}
|
|
242
|
-
if (this._grid && !this._grid.contains(event.target)) {
|
|
243
|
-
this._grid.stopEdit();
|
|
235
|
+
await this._dataUnit.cancelEdition();
|
|
244
236
|
}
|
|
245
237
|
}
|
|
246
238
|
hasToBlockEvent(event) {
|
|
@@ -531,7 +523,7 @@ const SnkGrid = class {
|
|
|
531
523
|
return undefined;
|
|
532
524
|
}
|
|
533
525
|
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 &&
|
|
534
|
-
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 }), 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
|
|
526
|
+
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 }), 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 }, 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" }, 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 }))));
|
|
535
527
|
}
|
|
536
528
|
get _element() { return getElement(this); }
|
|
537
529
|
static get watchers() { return {
|
|
@@ -6,7 +6,7 @@ import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } fr
|
|
|
6
6
|
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
|
7
7
|
import { V as VIEW_MODE } from './constants-7302ee87.js';
|
|
8
8
|
import './DataFetcher-5034df59.js';
|
|
9
|
-
import './pesquisa-fetcher-
|
|
9
|
+
import './pesquisa-fetcher-6bc2e41a.js';
|
|
10
10
|
import { P as PresentationMode } from './index-3aa4977a.js';
|
|
11
11
|
import './ISave-d8c8bc59.js';
|
|
12
12
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
@@ -454,7 +454,7 @@ const SnkGuidesViewer = class {
|
|
|
454
454
|
await this.openGuideNavigator(guideName);
|
|
455
455
|
}
|
|
456
456
|
if (action.type === Action.METADATA_LOADED) {
|
|
457
|
-
this.loadGuides(
|
|
457
|
+
this.loadGuides(false);
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
async addErrorBadgeToGuide(guideName) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { S as snk_guides_viewer } from './snk-guides-viewer-
|
|
1
|
+
export { S as snk_guides_viewer } from './snk-guides-viewer-e8ca764a.js';
|
|
2
2
|
import './index-a7d3d3f1.js';
|
|
3
3
|
import '@sankhyalabs/core';
|
|
4
4
|
import './SnkFormConfigManager-b409c745.js';
|
|
@@ -14,7 +14,7 @@ import './field-search-f8b1d91e.js';
|
|
|
14
14
|
import './taskbar-elements-d59867f1.js';
|
|
15
15
|
import './index-3aa4977a.js';
|
|
16
16
|
import './index-bdf75557.js';
|
|
17
|
-
import './pesquisa-fetcher-
|
|
17
|
+
import './pesquisa-fetcher-6bc2e41a.js';
|
|
18
18
|
import './ISave-d8c8bc59.js';
|
|
19
19
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
20
20
|
import './dataunit-fetcher-56cb648b.js';
|
|
@@ -4,8 +4,8 @@ import { CSSVarsUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
|
4
4
|
import { V as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-7302ee87.js';
|
|
5
5
|
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
|
6
6
|
import './DataFetcher-5034df59.js';
|
|
7
|
-
import './pesquisa-fetcher-
|
|
8
|
-
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, a as CrudUtils } from './ContinuousInsertUtils-
|
|
7
|
+
import './pesquisa-fetcher-6bc2e41a.js';
|
|
8
|
+
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, a as CrudUtils } from './ContinuousInsertUtils-b62906f9.js';
|
|
9
9
|
import { D as DataExporterOption, P as PresentationMode } from './index-3aa4977a.js';
|
|
10
10
|
import './ISave-d8c8bc59.js';
|
|
11
11
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
@@ -117,7 +117,6 @@ const SnkSimpleCrud = class {
|
|
|
117
117
|
this.mode = SIMPLE_CRUD_MODE.SERVER;
|
|
118
118
|
this.gridConfig = undefined;
|
|
119
119
|
this.formConfig = undefined;
|
|
120
|
-
this.enableLockManger = false;
|
|
121
120
|
this._formFields = [];
|
|
122
121
|
this._fieldsProps = new Map();
|
|
123
122
|
this._enableContinuousInsert = true;
|
|
@@ -802,18 +801,16 @@ const SnkSimpleCrud = class {
|
|
|
802
801
|
return;
|
|
803
802
|
this.goToView(VIEW_MODE.FORM);
|
|
804
803
|
}
|
|
805
|
-
renderTaskbarContent() {
|
|
806
|
-
var _a;
|
|
807
|
-
return (h("snk-taskbar", { class: this._currentViewMode === VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--small", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
|
|
808
|
-
}
|
|
809
804
|
/* istanbul ignore next */
|
|
810
805
|
render() {
|
|
806
|
+
var _a;
|
|
811
807
|
if (this.dataUnit == undefined) {
|
|
812
808
|
return;
|
|
813
809
|
}
|
|
814
|
-
|
|
810
|
+
const taskbarContent = (h("snk-taskbar", { class: this._currentViewMode === VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--small", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
|
|
811
|
+
return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, this._currentViewMode === VIEW_MODE.FORM && taskbarContent, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
815
812
|
? undefined
|
|
816
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert,
|
|
813
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, this._currentViewMode === VIEW_MODE.GRID && taskbarContent, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, 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.resolveResourceID() }))));
|
|
817
814
|
}
|
|
818
815
|
get _element() { return getElement(this); }
|
|
819
816
|
static get watchers() { return {
|
|
@@ -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 { Action,
|
|
2
|
+
import { Action, StringUtils, ApplicationContext, OVERFLOWED_CLASS_NAME, OverflowWatcher, OverflowDirection, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { A as AuthorizationConfig } from './AuthorizationConfig-dcbd207a.js';
|
|
4
4
|
import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-d59867f1.js';
|
|
5
5
|
import { P as PresentationMode } from './index-3aa4977a.js';
|
|
@@ -156,44 +156,42 @@ const SnkTaskbar = class {
|
|
|
156
156
|
return key ? (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, {}) : "";
|
|
157
157
|
}
|
|
158
158
|
elementClick(elem) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
159
|
+
if (this.dataUnit) {
|
|
160
|
+
switch (elem) {
|
|
161
|
+
case TaskbarElement.PREVIOUS:
|
|
162
|
+
this.dataUnit.previousRecord();
|
|
163
|
+
break;
|
|
164
|
+
case TaskbarElement.NEXT:
|
|
165
|
+
this.dataUnit.nextRecord();
|
|
166
|
+
break;
|
|
167
|
+
case TaskbarElement.REFRESH:
|
|
168
|
+
this.dataUnit.loadData();
|
|
169
|
+
break;
|
|
170
|
+
case TaskbarElement.CLONE:
|
|
171
|
+
this.dataUnit.copySelected();
|
|
172
|
+
break;
|
|
173
|
+
case TaskbarElement.REMOVE:
|
|
174
|
+
this.dataUnit.removeSelectedRecords();
|
|
175
|
+
break;
|
|
176
|
+
case TaskbarElement.INSERT:
|
|
177
|
+
this.dataUnit.addRecord();
|
|
178
|
+
break;
|
|
179
|
+
case TaskbarElement.CANCEL:
|
|
180
|
+
this.dataUnit.cancelEdition();
|
|
181
|
+
break;
|
|
182
|
+
case TaskbarElement.SAVE:
|
|
183
|
+
if (!this._isWaitingForSave) {
|
|
184
|
+
this._isWaitingForSave = true;
|
|
185
|
+
this.dataUnit.saveData()
|
|
186
|
+
.finally(() => {
|
|
187
|
+
this._isWaitingForSave = false;
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
break;
|
|
193
191
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
}
|
|
193
|
+
if (this.isEnabled(elem))
|
|
194
|
+
this.actionClick.emit(elem);
|
|
197
195
|
}
|
|
198
196
|
isEnabled(elem) {
|
|
199
197
|
if (!this.isAllowed(elem)) {
|
|
@@ -397,10 +395,9 @@ const SnkTaskbar = class {
|
|
|
397
395
|
this._lastWidth = this._element.getBoundingClientRect().width;
|
|
398
396
|
}
|
|
399
397
|
disconnectedCallback() {
|
|
400
|
-
var _a
|
|
401
|
-
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.unsubscribe(this.onSaveEvent);
|
|
398
|
+
var _a;
|
|
402
399
|
this.unlinkAllCustomElements();
|
|
403
|
-
(
|
|
400
|
+
(_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
404
401
|
}
|
|
405
402
|
unlinkAllCustomElements() {
|
|
406
403
|
var _a;
|