@sankhyalabs/sankhyablocks 10.1.0-dev.1 → 10.1.0-dev.10
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/{ConfigStorage-5a73e979.js → ConfigStorage-5c0590b3.js} +2 -2
- package/dist/cjs/{DataFetcher-eeb3b0b7.js → DataFetcher-5181a917.js} +23 -2
- package/dist/cjs/{FormConfigHelper-ebb77625.js → FormConfigHelper-28fe4668.js} +44 -0
- package/dist/cjs/{ISave-861e9d6d.js → ISave-0f98a457.js} +4 -4
- package/dist/cjs/{SnkFormConfigManager-8d4fded8.js → SnkFormConfigManager-1907ffed.js} +7 -7
- package/dist/cjs/{SnkMultiSelectionListDataSource-3b93f6a6.js → SnkMultiSelectionListDataSource-e4e38139.js} +4 -4
- package/dist/cjs/{auth-fetcher-8d8acd69.js → auth-fetcher-cff55b1f.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-1cea0695.js → dataunit-fetcher-1ba5e2cc.js} +1 -1
- package/dist/cjs/field-config_2.cjs.entry.js +1 -1
- package/dist/cjs/fields-layout.cjs.entry.js +6 -3
- package/dist/cjs/fields-selector.cjs.entry.js +1 -1
- package/dist/cjs/{form-config-fetcher-f347f884.js → form-config-fetcher-4a679e23.js} +1 -1
- package/dist/cjs/guides-configurator.cjs.entry.js +5 -3
- package/dist/cjs/index-1cf293c1.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_9.cjs.entry.js +14 -7
- package/dist/cjs/snk-application.cjs.entry.js +81 -69
- package/dist/cjs/snk-attach.cjs.entry.js +5 -5
- package/dist/cjs/snk-crud.cjs.entry.js +97 -6
- package/dist/cjs/snk-custom-slot-guide.cjs.entry.js +40 -0
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
- package/dist/cjs/{snk-data-unit-de248308.js → snk-data-unit-061487a8.js} +4 -2
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-view.cjs.entry.js +2 -6
- package/dist/cjs/snk-form_2.cjs.entry.js +32 -9
- package/dist/cjs/snk-grid.cjs.entry.js +13 -10
- package/dist/cjs/{snk-guides-viewer-4ec3e7e1.js → snk-guides-viewer-2efe60a7.js} +84 -38
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-pesquisa.cjs.entry.js +16 -5
- package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -7
- package/dist/cjs/snk-taskbar.cjs.entry.js +64 -48
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-advaced-mode.js +27 -0
- package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js +5 -25
- package/dist/collection/components/snk-application/snk-application.js +87 -44
- package/dist/collection/components/snk-attach/snk-attach.js +1 -1
- package/dist/collection/components/snk-crud/snk-crud.js +151 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +2 -6
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +133 -34
- package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.css +3 -0
- package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.js +95 -0
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +2 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +1 -1
- package/dist/collection/components/snk-form-config/FormConfigHelper.js +42 -0
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +6 -6
- package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css +16 -0
- package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js +6 -3
- package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css +3 -3
- package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js +5 -3
- package/dist/collection/components/snk-form-config/snk-form-config.js +53 -6
- package/dist/collection/components/snk-grid/snk-grid.css +14 -0
- package/dist/collection/components/snk-grid/snk-grid.js +26 -4
- package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js +9 -2
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.css +5 -1
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +43 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +1 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +87 -48
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +3 -3
- package/dist/collection/lib/message/resources/en-us/snk-form.msg.js +7 -0
- package/dist/collection/lib/message/resources/es-es/snk-form.msg.js +7 -0
- package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js +8 -1
- package/dist/collection/lib/message/resources/pt-br/snk-pesquisa.msg.js +1 -1
- package/dist/components/DataFetcher.js +23 -2
- package/dist/components/ISave.js +3 -3
- package/dist/components/SnkFormConfigManager.js +6 -6
- package/dist/components/field-config2.js +43 -1
- package/dist/components/fields-layout2.js +6 -3
- package/dist/components/guides-configurator2.js +5 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-application2.js +76 -63
- package/dist/components/snk-attach2.js +1 -1
- package/dist/components/snk-crud.js +96 -1
- package/dist/components/snk-custom-slot-guide.d.ts +11 -0
- package/dist/components/snk-custom-slot-guide.js +55 -0
- package/dist/components/snk-data-unit2.js +2 -0
- package/dist/components/snk-detail-view2.js +81 -34
- package/dist/components/snk-filter-number.js +1 -1
- package/dist/components/snk-form-config2.js +29 -5
- package/dist/components/snk-form-view2.js +2 -6
- package/dist/components/snk-grid2.js +9 -4
- package/dist/components/snk-layout-form-config2.js +9 -2
- package/dist/components/snk-pesquisa2.js +14 -2
- package/dist/components/snk-simple-crud2.js +1 -1
- package/dist/components/snk-taskbar2.js +66 -49
- package/dist/esm/{ConfigStorage-568dc227.js → ConfigStorage-bd096633.js} +2 -2
- package/dist/esm/{DataFetcher-743feb3b.js → DataFetcher-5780ad39.js} +23 -2
- package/dist/esm/{FormConfigHelper-4e42f0b6.js → FormConfigHelper-d09669f3.js} +43 -1
- package/dist/esm/{ISave-345481c1.js → ISave-8a22ec18.js} +4 -4
- package/dist/esm/{SnkFormConfigManager-d61df0c8.js → SnkFormConfigManager-437e98bb.js} +7 -7
- package/dist/esm/{SnkMultiSelectionListDataSource-ca8d7a09.js → SnkMultiSelectionListDataSource-42125ef4.js} +4 -4
- package/dist/esm/{auth-fetcher-c353127d.js → auth-fetcher-28b9d0db.js} +1 -1
- package/dist/esm/{dataunit-fetcher-7f2c61ca.js → dataunit-fetcher-c4251d80.js} +1 -1
- package/dist/esm/field-config_2.entry.js +1 -1
- package/dist/esm/fields-layout.entry.js +6 -3
- package/dist/esm/fields-selector.entry.js +1 -1
- package/dist/esm/{form-config-fetcher-898d2dd1.js → form-config-fetcher-d0536a71.js} +1 -1
- package/dist/esm/guides-configurator.entry.js +5 -3
- package/dist/esm/index-479e1293.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +4 -4
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_9.entry.js +14 -7
- package/dist/esm/snk-application.entry.js +81 -69
- package/dist/esm/snk-attach.entry.js +5 -5
- package/dist/esm/snk-crud.entry.js +97 -6
- package/dist/esm/snk-custom-slot-guide.entry.js +36 -0
- package/dist/esm/snk-data-exporter.entry.js +5 -5
- package/dist/esm/{snk-data-unit-60b338c5.js → snk-data-unit-4a1ef77f.js} +4 -2
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-detail-view.entry.js +7 -7
- package/dist/esm/snk-filter-bar_4.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-view.entry.js +2 -6
- package/dist/esm/snk-form_2.entry.js +32 -9
- package/dist/esm/snk-grid.entry.js +13 -10
- package/dist/esm/{snk-guides-viewer-339e10b3.js → snk-guides-viewer-c182d058.js} +84 -38
- package/dist/esm/snk-guides-viewer.entry.js +7 -7
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-pesquisa.entry.js +16 -5
- package/dist/esm/snk-simple-crud.entry.js +7 -7
- package/dist/esm/snk-taskbar.entry.js +65 -49
- package/dist/sankhyablocks/{p-e6b1c769.entry.js → p-01ca59fc.entry.js} +1 -1
- package/dist/sankhyablocks/p-028fb380.entry.js +11 -0
- package/dist/sankhyablocks/{p-1f8cb438.entry.js → p-03f02b12.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1788d191.js → p-0e4f8b86.js} +1 -1
- package/dist/sankhyablocks/p-1037ea7b.entry.js +1 -0
- package/dist/sankhyablocks/{p-6d241415.js → p-1b1373b6.js} +1 -1
- package/dist/sankhyablocks/{p-27005fac.entry.js → p-2e882241.entry.js} +1 -1
- package/dist/sankhyablocks/p-30a58e29.entry.js +1 -0
- package/dist/sankhyablocks/{p-9f2cdaab.entry.js → p-35974f5f.entry.js} +1 -1
- package/dist/sankhyablocks/p-3b167a03.entry.js +1 -0
- package/dist/sankhyablocks/{p-e8c49c12.js → p-3c046287.js} +2 -2
- package/dist/sankhyablocks/{p-bd203e8d.entry.js → p-42272de8.entry.js} +1 -1
- package/dist/sankhyablocks/{p-11346b8d.entry.js → p-4c2e2767.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7fc46290.js → p-4db9dbf8.js} +1 -1
- package/dist/sankhyablocks/{p-626b7a17.js → p-55d7abe7.js} +1 -1
- package/dist/sankhyablocks/p-5d408e7e.entry.js +1 -0
- package/dist/sankhyablocks/{p-9b6d4950.entry.js → p-6e5af618.entry.js} +1 -1
- package/dist/sankhyablocks/{p-144da1d1.entry.js → p-78d4b3e3.entry.js} +1 -1
- package/dist/sankhyablocks/p-8b4d6719.js +1 -0
- package/dist/sankhyablocks/{p-e64958ba.entry.js → p-903fa0b4.entry.js} +1 -1
- package/dist/sankhyablocks/p-987cd79d.entry.js +1 -0
- package/dist/sankhyablocks/{p-88ed2793.js → p-9ab6ae1e.js} +2 -2
- package/dist/sankhyablocks/{p-c90f337a.entry.js → p-9f16d33e.entry.js} +1 -1
- package/dist/sankhyablocks/p-a1d23fef.js +1 -0
- package/dist/sankhyablocks/{p-bb0de89c.entry.js → p-a64ffe30.entry.js} +1 -1
- package/dist/sankhyablocks/p-aca74b21.js +1 -0
- package/dist/sankhyablocks/p-b7e891cc.entry.js +1 -0
- package/dist/sankhyablocks/{p-1d585081.js → p-b9699067.js} +1 -1
- package/dist/sankhyablocks/p-c98c79c3.entry.js +1 -0
- package/dist/sankhyablocks/p-d2ec9a24.entry.js +1 -0
- package/dist/sankhyablocks/{p-59b8f277.js → p-d3534985.js} +1 -1
- package/dist/sankhyablocks/{p-7b3ca294.entry.js → p-f3027bc9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f8f29e1a.entry.js → p-f35f2eb3.entry.js} +1 -1
- package/dist/sankhyablocks/p-fd05e31d.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/search-strategy/exec-prepared-search-advaced-mode.d.ts +5 -0
- package/dist/types/components/snk-application/snk-application.d.ts +9 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +22 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +23 -0
- package/dist/types/components/snk-custom-slot-guide/snk-custom-slot-guide.d.ts +16 -0
- package/dist/types/components/snk-form-config/FormConfigHelper.d.ts +6 -1
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +1 -1
- package/dist/types/components/snk-form-config/fields-layout/fields-layout.d.ts +2 -2
- package/dist/types/components/snk-form-config/guides-configurator/guides-configurator.d.ts +1 -1
- package/dist/types/components/snk-form-config/snk-form-config.d.ts +9 -2
- package/dist/types/components/snk-grid/snk-grid.d.ts +5 -0
- package/dist/types/components/snk-layout-form-config/snk-layout-form-config.d.ts +2 -2
- package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +8 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +12 -4
- package/dist/types/components.d.ts +105 -0
- package/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +1 -0
- 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/sankhyablocks/p-0cf9aa38.js +0 -1
- package/dist/sankhyablocks/p-1649f51e.entry.js +0 -1
- package/dist/sankhyablocks/p-2c86cfab.entry.js +0 -1
- package/dist/sankhyablocks/p-4759912d.entry.js +0 -1
- package/dist/sankhyablocks/p-56948f00.entry.js +0 -11
- package/dist/sankhyablocks/p-8f73da95.js +0 -1
- package/dist/sankhyablocks/p-95c71f5e.entry.js +0 -1
- package/dist/sankhyablocks/p-9fe91526.js +0 -1
- package/dist/sankhyablocks/p-a5108625.entry.js +0 -1
- package/dist/sankhyablocks/p-aae4258d.entry.js +0 -1
- package/dist/sankhyablocks/p-af9d79e0.entry.js +0 -1
- package/dist/sankhyablocks/p-f25c50f7.entry.js +0 -1
package/dist/components/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export { SnkClientConfirm, defineCustomElement as defineCustomElementSnkClientCo
|
|
|
16
16
|
export { SnkConfigurator, defineCustomElement as defineCustomElementSnkConfigurator } from './snk-configurator.js';
|
|
17
17
|
export { SnkCrud, defineCustomElement as defineCustomElementSnkCrud } from './snk-crud.js';
|
|
18
18
|
export { SnkCustomSlotElements, defineCustomElement as defineCustomElementSnkCustomSlotElements } from './snk-custom-slot-elements.js';
|
|
19
|
+
export { SnkCustomSlotGuide, defineCustomElement as defineCustomElementSnkCustomSlotGuide } from './snk-custom-slot-guide.js';
|
|
19
20
|
export { SnkDataExporter, defineCustomElement as defineCustomElementSnkDataExporter } from './snk-data-exporter.js';
|
|
20
21
|
export { SnkDataUnit, defineCustomElement as defineCustomElementSnkDataUnit } from './snk-data-unit.js';
|
|
21
22
|
export { SnkDefaultFilter, defineCustomElement as defineCustomElementSnkDefaultFilter } from './snk-default-filter.js';
|
|
@@ -385,32 +385,40 @@ class RequestListenerFactory {
|
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
+
const executeAdvancedModeSearch = async (argument, options, app, pesquisaFetcher) => {
|
|
389
|
+
const { entity, entityDescription, criteria, searchOptions, isHierarchyEntity, allowsNonAnalytic, executeOnOpen } = options;
|
|
390
|
+
return new Promise((accept, reject) => {
|
|
391
|
+
const pesquisaContent = document.createElement("snk-pesquisa");
|
|
392
|
+
pesquisaContent[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `entity_${entity}`;
|
|
393
|
+
pesquisaContent.entityName = entity;
|
|
394
|
+
pesquisaContent.argument = argument;
|
|
395
|
+
pesquisaContent.searchLoader = (text) => pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
|
|
396
|
+
pesquisaContent.isHierarchyEntity = isHierarchyEntity;
|
|
397
|
+
if (isHierarchyEntity) {
|
|
398
|
+
pesquisaContent.treeLoader = (text) => pesquisaFetcher.loadTree(entity, text, criteria, searchOptions);
|
|
399
|
+
pesquisaContent.allowsNonAnalytic = allowsNonAnalytic;
|
|
400
|
+
}
|
|
401
|
+
pesquisaContent.selectItem = (option) => {
|
|
402
|
+
accept(option);
|
|
403
|
+
app.clearPopUpTitle();
|
|
404
|
+
app.closePopUp();
|
|
405
|
+
};
|
|
406
|
+
app.setPopUpTitle(entityDescription);
|
|
407
|
+
app.showPopUp(pesquisaContent, undefined, undefined, reject);
|
|
408
|
+
if (executeOnOpen) {
|
|
409
|
+
pesquisaContent.executeSearch(argument);
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
};
|
|
413
|
+
|
|
388
414
|
const QTD_DETAIL_FIELDS_PREDICTIVE_SEARCH = 6;
|
|
389
415
|
const INVALID_CONTENT_PATTERNS = ['<img', '<svg'];
|
|
390
416
|
const executePreparedSearchPlus = async (mode, argument, options, app, pesquisaFetcher) => {
|
|
391
417
|
var _a;
|
|
392
418
|
const mdByName = {};
|
|
393
|
-
const { entity,
|
|
419
|
+
const { entity, criteria, searchOptions } = options;
|
|
394
420
|
if (mode === "ADVANCED") {
|
|
395
|
-
return
|
|
396
|
-
const pesquisaContent = document.createElement("snk-pesquisa");
|
|
397
|
-
pesquisaContent[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `entity_${entity}`;
|
|
398
|
-
pesquisaContent.entityName = entity;
|
|
399
|
-
pesquisaContent.argument = argument;
|
|
400
|
-
pesquisaContent.searchLoader = (text) => pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
|
|
401
|
-
pesquisaContent.isHierarchyEntity = isHierarchyEntity;
|
|
402
|
-
if (isHierarchyEntity) {
|
|
403
|
-
pesquisaContent.treeLoader = (text) => pesquisaFetcher.loadTree(entity, text, criteria, searchOptions);
|
|
404
|
-
pesquisaContent.allowsNonAnalytic = allowsNonAnalytic;
|
|
405
|
-
}
|
|
406
|
-
pesquisaContent.selectItem = (option) => {
|
|
407
|
-
accept(option);
|
|
408
|
-
app.clearPopUpTitle();
|
|
409
|
-
app.closePopUp();
|
|
410
|
-
};
|
|
411
|
-
app.setPopUpTitle(entityDescription);
|
|
412
|
-
app.showPopUp(pesquisaContent, undefined, undefined, reject);
|
|
413
|
-
});
|
|
421
|
+
return executeAdvancedModeSearch(argument, options, app, pesquisaFetcher);
|
|
414
422
|
}
|
|
415
423
|
else if (mode === "LOAD_DESCRIPTION") {
|
|
416
424
|
let result = await pesquisaFetcher.loadByCode(entity, argument, criteria, searchOptions);
|
|
@@ -447,14 +455,13 @@ const buildOptionItem = (argument, item, fields, descriptionField, pkField) => {
|
|
|
447
455
|
const matchFields = item['__matchFields'];
|
|
448
456
|
const descriptionValue = (_a = item[descriptionField]) !== null && _a !== void 0 ? _a : "";
|
|
449
457
|
const pkValue = item[pkField];
|
|
450
|
-
|
|
458
|
+
return {
|
|
451
459
|
value: pkValue,
|
|
452
460
|
label: descriptionValue,
|
|
453
461
|
presentationValue: StringUtils.highlightValue(argument, matchFields, pkValue, fields, true),
|
|
454
462
|
presentationLabel: descriptionField ? StringUtils.highlightValue(argument, matchFields, descriptionValue, fields, true) : "",
|
|
455
463
|
details: SearchUtils.buildDetails(argument, fields, item)
|
|
456
464
|
};
|
|
457
|
-
return searchOption;
|
|
458
465
|
};
|
|
459
466
|
const filterInvalidFields = (resp, item, mdByName) => {
|
|
460
467
|
let fieldsMetadata = resp.fieldsMetadata.filter((field) => {
|
|
@@ -890,7 +897,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
890
897
|
if (this._featureFlagsCache.get(featureName) && now < this._featureFlagsCache.get(featureName).expires) {
|
|
891
898
|
return Promise.resolve(this._featureFlagsCache.get(featureName).isActive);
|
|
892
899
|
}
|
|
893
|
-
//Caso ocorra um erro nessa chamada, o reject do error é feito automaticamente
|
|
900
|
+
//Caso ocorra um erro nessa chamada, o reject do error é feito automaticamente
|
|
894
901
|
const result = await DataFetcher.get().callServiceBroker("SystemUtilsSP.featureIsActive", JSON.stringify(payload));
|
|
895
902
|
const isActive = result.isActive;
|
|
896
903
|
this._featureFlagsCache.set(featureName, {
|
|
@@ -1381,52 +1388,57 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1381
1388
|
*/
|
|
1382
1389
|
async executePreparedSearch(mode, argument, options) {
|
|
1383
1390
|
const mdByName = {};
|
|
1384
|
-
const { entity,
|
|
1391
|
+
const { entity, criteria, searchOptions, useSearchPlus } = options;
|
|
1385
1392
|
if (useSearchPlus) {
|
|
1386
1393
|
return executePreparedSearchPlus(mode, argument, options, this, this.pesquisaFetcher);
|
|
1387
1394
|
}
|
|
1388
1395
|
if (mode === "ADVANCED") {
|
|
1389
|
-
return
|
|
1390
|
-
const pesquisaContent = document.createElement("snk-pesquisa");
|
|
1391
|
-
pesquisaContent[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME] = `entity_${entity}`;
|
|
1392
|
-
pesquisaContent.entityName = entity;
|
|
1393
|
-
pesquisaContent.argument = argument;
|
|
1394
|
-
pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
|
|
1395
|
-
pesquisaContent.isHierarchyEntity = isHierarchyEntity;
|
|
1396
|
-
if (isHierarchyEntity) {
|
|
1397
|
-
pesquisaContent.treeLoader = (text) => this.pesquisaFetcher.loadTree(entity, text, criteria, searchOptions);
|
|
1398
|
-
pesquisaContent.allowsNonAnalytic = allowsNonAnalytic;
|
|
1399
|
-
}
|
|
1400
|
-
pesquisaContent.selectItem = (option) => {
|
|
1401
|
-
accept(option);
|
|
1402
|
-
this.clearPopUpTitle();
|
|
1403
|
-
this.closePopUp();
|
|
1404
|
-
};
|
|
1405
|
-
this.setPopUpTitle(entityDescription);
|
|
1406
|
-
this.showPopUp(pesquisaContent, undefined, undefined, reject);
|
|
1407
|
-
});
|
|
1396
|
+
return executeAdvancedModeSearch(argument, options, this, this.pesquisaFetcher);
|
|
1408
1397
|
}
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
result.data.forEach((item) => {
|
|
1418
|
-
let fieldsMetadata = this.filterInvalidFields(result, item, mdByName);
|
|
1419
|
-
let qtyFields = 6;
|
|
1420
|
-
let fields = this.filterMathFields(item['__matchFields'], fieldsMetadata, qtyFields, mdByName);
|
|
1421
|
-
list.push(this.builOptionItem(argument, item, fields, descriptionField, pkField));
|
|
1422
|
-
});
|
|
1423
|
-
resolve(list);
|
|
1424
|
-
})
|
|
1425
|
-
.catch(error => {
|
|
1426
|
-
reject(error);
|
|
1427
|
-
});
|
|
1398
|
+
return new Promise((resolve, reject) => {
|
|
1399
|
+
this.pesquisaFetcher.loadAdvancedSearch(entity, argument, criteria, searchOptions)
|
|
1400
|
+
.then(result => {
|
|
1401
|
+
result = ObjectUtils.stringToObject(result.json.$);
|
|
1402
|
+
resolve(this.buildSearchResultList(result, mdByName, argument));
|
|
1403
|
+
})
|
|
1404
|
+
.catch(error => {
|
|
1405
|
+
reject(error);
|
|
1428
1406
|
});
|
|
1429
|
-
}
|
|
1407
|
+
});
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* Obtém as opções em componentes de pesquisa além dos metadados como showMore e entityPk.
|
|
1411
|
+
* @param {string} argument - O argumento da pesquisa.
|
|
1412
|
+
* @param {any} options - Opções preparadas para a pesquisa.
|
|
1413
|
+
* @returns {Promise<Array<IOption> | IOption>} Uma lista de opções ou uma única opção.
|
|
1414
|
+
* @async
|
|
1415
|
+
*/
|
|
1416
|
+
async executePreparedSearchWithFullResponse(argument, options) {
|
|
1417
|
+
const mdByName = {};
|
|
1418
|
+
const { entity, criteria, searchOptions } = options;
|
|
1419
|
+
return new Promise((resolve, reject) => {
|
|
1420
|
+
this.pesquisaFetcher.loadAdvancedSearch(entity, argument, criteria, searchOptions)
|
|
1421
|
+
.then(result => {
|
|
1422
|
+
result = ObjectUtils.stringToObject(result.json.$);
|
|
1423
|
+
result.data = this.buildSearchResultList(result, mdByName, argument);
|
|
1424
|
+
resolve(result);
|
|
1425
|
+
})
|
|
1426
|
+
.catch(error => {
|
|
1427
|
+
reject(error);
|
|
1428
|
+
});
|
|
1429
|
+
});
|
|
1430
|
+
}
|
|
1431
|
+
buildSearchResultList(result, mdByName, argument) {
|
|
1432
|
+
let descriptionField = result.descriptionField;
|
|
1433
|
+
let pkField = result.pkField;
|
|
1434
|
+
const list = [];
|
|
1435
|
+
result.data.forEach((item) => {
|
|
1436
|
+
let fieldsMetadata = this.filterInvalidFields(result, item, mdByName);
|
|
1437
|
+
let qtyFields = 6;
|
|
1438
|
+
let fields = this.filterMathFields(item['__matchFields'], fieldsMetadata, qtyFields, mdByName);
|
|
1439
|
+
list.push(this.builOptionItem(argument, item, fields, descriptionField, pkField));
|
|
1440
|
+
});
|
|
1441
|
+
return list;
|
|
1430
1442
|
}
|
|
1431
1443
|
/**
|
|
1432
1444
|
* Obtém `true` caso a tela esteja em modo de debug.
|
|
@@ -1979,6 +1991,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1979
1991
|
"executeSearch": [64],
|
|
1980
1992
|
"executePreparedSearchPlus": [64],
|
|
1981
1993
|
"executePreparedSearch": [64],
|
|
1994
|
+
"executePreparedSearchWithFullResponse": [64],
|
|
1982
1995
|
"isDebugMode": [64],
|
|
1983
1996
|
"getAppLabel": [64],
|
|
1984
1997
|
"addSearchListener": [64],
|
|
@@ -911,7 +911,7 @@ const SnkAttach = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
911
911
|
static get style() { return snkAttachCss; }
|
|
912
912
|
}, [2, "snk-attach", {
|
|
913
913
|
"gridLegacyConfigName": [1, "grid-legacy-config-name"],
|
|
914
|
-
"fetcherType": [
|
|
914
|
+
"fetcherType": [1025, "fetcher-type"],
|
|
915
915
|
"fetcher": [16],
|
|
916
916
|
"dataUnit": [16],
|
|
917
917
|
"dataUnitBuilder": [16],
|
|
@@ -58,6 +58,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
58
58
|
constructor() {
|
|
59
59
|
super();
|
|
60
60
|
this.__registerHost();
|
|
61
|
+
this.snkShowGuide = createEvent(this, "snkShowGuide", 7);
|
|
61
62
|
this.actionClick = createEvent(this, "actionClick", 7);
|
|
62
63
|
this.configuratorSave = createEvent(this, "configuratorSave", 7);
|
|
63
64
|
this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
|
|
@@ -67,6 +68,38 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
67
68
|
this._viewHistory = [];
|
|
68
69
|
this._customEditors = new Map();
|
|
69
70
|
this._customRenders = new Map();
|
|
71
|
+
this.loadEntitySuggestions = async (argument) => {
|
|
72
|
+
var _a;
|
|
73
|
+
const value = (_a = argument === null || argument === void 0 ? void 0 : argument.argument) !== null && _a !== void 0 ? _a : '';
|
|
74
|
+
const mode = (argument === null || argument === void 0 ? void 0 : argument.mode) || "PREDICTIVE";
|
|
75
|
+
if (!value || value.trim().length === 0) {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
this._showMoreOnSearch = false;
|
|
80
|
+
const entityName = this._snkDataUnit.entityName;
|
|
81
|
+
if (mode === "PREDICTIVE") {
|
|
82
|
+
return await this.handlePredictiveSearch(value, entityName);
|
|
83
|
+
}
|
|
84
|
+
return await this._application.executePreparedSearch(mode, value, this.buildSearchOptions(entityName));
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
console.error('Erro ao carregar sugestões de entidades:', error);
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
this.searchEntitySelect = async (item) => {
|
|
92
|
+
if (!this._entityPKField || !item) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
const pk = [{ name: this._entityPKField, value: item.value }];
|
|
97
|
+
await this.refreshDataUnitByPk(pk);
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
console.error('Erro ao selecionar entidade:', error);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
70
103
|
this.dataUnitInterceptor = {
|
|
71
104
|
interceptAction: (action) => {
|
|
72
105
|
if (action.type === Action.DATA_SAVED) {
|
|
@@ -83,6 +116,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
83
116
|
this._resourceID = undefined;
|
|
84
117
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
|
85
118
|
this.numberingConfig = undefined;
|
|
119
|
+
this._showMoreOnSearch = false;
|
|
120
|
+
this._entityPKField = undefined;
|
|
86
121
|
this.enableLockManagerLoadingComp = false;
|
|
87
122
|
this.enableLockManagerTaskbarClick = false;
|
|
88
123
|
this.configName = undefined;
|
|
@@ -111,6 +146,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
111
146
|
this.layoutFormConfig = true;
|
|
112
147
|
this.multipleEditionEnabled = true;
|
|
113
148
|
this.paginationCounterMode = 'auto';
|
|
149
|
+
this.customGuidesConfig = [];
|
|
150
|
+
this.showEntitySearch = true;
|
|
114
151
|
this.disableNumberingConfig = false;
|
|
115
152
|
}
|
|
116
153
|
/**
|
|
@@ -406,6 +443,49 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
406
443
|
var _a;
|
|
407
444
|
(_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
|
|
408
445
|
}
|
|
446
|
+
async handlePredictiveSearch(argument, entityName) {
|
|
447
|
+
var _a, _b;
|
|
448
|
+
const response = await this._application.executePreparedSearchWithFullResponse(argument, this.buildSearchOptions(entityName, 5));
|
|
449
|
+
this._showMoreOnSearch = (_a = response === null || response === void 0 ? void 0 : response.hasMore) !== null && _a !== void 0 ? _a : false;
|
|
450
|
+
this._entityPKField = response === null || response === void 0 ? void 0 : response.pkField;
|
|
451
|
+
return (_b = response === null || response === void 0 ? void 0 : response.data) !== null && _b !== void 0 ? _b : [];
|
|
452
|
+
}
|
|
453
|
+
async refreshDataUnitByPk(pks) {
|
|
454
|
+
try {
|
|
455
|
+
const pkField = pks[0].name;
|
|
456
|
+
const pkValue = pks[0].value;
|
|
457
|
+
// Criar filtro para a busca específica
|
|
458
|
+
const quickFilter = {
|
|
459
|
+
term: '',
|
|
460
|
+
filter: {
|
|
461
|
+
name: '',
|
|
462
|
+
params: [],
|
|
463
|
+
expression: `(${pkField} = ${pkValue})`
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
// Carregar dados com o filtro aplicado diretamente
|
|
467
|
+
await this._dataUnit.loadData(quickFilter);
|
|
468
|
+
// Navegar para o formulário se houver apenas um registro
|
|
469
|
+
if (this._dataUnit.records.length === 1) {
|
|
470
|
+
this._dataUnit.selectFirst();
|
|
471
|
+
this.gridToForm(true);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
catch (error) {
|
|
475
|
+
console.error('Erro ao atualizar dataset:', error);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
buildSearchOptions(entityName, limit) {
|
|
479
|
+
return {
|
|
480
|
+
entity: entityName,
|
|
481
|
+
entityDescription: entityName,
|
|
482
|
+
executeOnOpen: true,
|
|
483
|
+
searchOptions: {
|
|
484
|
+
localEntityName: entityName,
|
|
485
|
+
limit,
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
}
|
|
409
489
|
async toggleView() {
|
|
410
490
|
const currentView = await this._viewStack.getSelectedIndex();
|
|
411
491
|
this.setViewMode(VIEW_MODE.GRID === currentView ? VIEW_MODE.FORM : VIEW_MODE.GRID);
|
|
@@ -512,12 +592,23 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
512
592
|
}
|
|
513
593
|
this.configuratorCancel.emit();
|
|
514
594
|
}
|
|
595
|
+
renderCustomGuideSlots() {
|
|
596
|
+
if (!this.customGuidesConfig)
|
|
597
|
+
return;
|
|
598
|
+
return this.customGuidesConfig.map(g => h("slot", { name: g.id }));
|
|
599
|
+
}
|
|
600
|
+
renderDynamicSearch(slotName) {
|
|
601
|
+
var _a;
|
|
602
|
+
if (!this.showEntitySearch || ((_a = this._dataState) === null || _a === void 0 ? void 0 : _a.insertionMode) === true)
|
|
603
|
+
return;
|
|
604
|
+
return (h("div", { slot: slotName, class: "entity-search-container", style: { position: 'relative', display: 'inline-block', marginLeft: '10px', minWidth: '200px' } }, h("ez-search", { label: "Buscar registros", optionLoader: this.loadEntitySuggestions, onEzChange: (evt) => this.searchEntitySelect(evt.detail), mode: "slim", showMore: this._showMoreOnSearch, suppressEmptyOption: true, suppressInputPersist: true })));
|
|
605
|
+
}
|
|
515
606
|
render() {
|
|
516
607
|
if (this._resourceID == undefined) {
|
|
517
608
|
return;
|
|
518
609
|
}
|
|
519
610
|
this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
|
|
520
|
-
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", { tabIndex: "0" }, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
611
|
+
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }), this.renderDynamicSearch("GRID_HEADER_DYNAMIC_SEARCH"))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderCustomGuideSlots(), this.renderDynamicSearch("GUIDES_VIEWER_DYNAMIC_SEARCH"), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", { tabIndex: "0" }, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
521
612
|
}
|
|
522
613
|
get _element() { return this; }
|
|
523
614
|
static get watchers() { return {
|
|
@@ -553,6 +644,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
553
644
|
"layoutFormConfig": [4, "layout-form-config"],
|
|
554
645
|
"multipleEditionEnabled": [4, "multiple-edition-enabled"],
|
|
555
646
|
"paginationCounterMode": [1, "pagination-counter-mode"],
|
|
647
|
+
"customGuidesConfig": [16],
|
|
648
|
+
"showEntitySearch": [4, "show-entity-search"],
|
|
556
649
|
"disableNumberingConfig": [4, "disable-numbering-config"],
|
|
557
650
|
"_dataUnit": [32],
|
|
558
651
|
"_dataState": [32],
|
|
@@ -562,6 +655,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
562
655
|
"_resourceID": [32],
|
|
563
656
|
"customContainerId": [32],
|
|
564
657
|
"numberingConfig": [32],
|
|
658
|
+
"_showMoreOnSearch": [32],
|
|
659
|
+
"_entityPKField": [32],
|
|
565
660
|
"goToView": [64],
|
|
566
661
|
"openConfigurator": [64],
|
|
567
662
|
"closeConfigurator": [64],
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkCustomSlotGuide extends Components.SnkCustomSlotGuide, HTMLElement {}
|
|
4
|
+
export const SnkCustomSlotGuide: {
|
|
5
|
+
prototype: SnkCustomSlotGuide;
|
|
6
|
+
new (): SnkCustomSlotGuide;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const snkCustomSlotGuideCss = ".sc-snk-custom-slot-guide-h{display:none}";
|
|
4
|
+
|
|
5
|
+
const SnkCustomSlotGuide$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.snkCustomSlotGuideLoaded = createEvent(this, "snkCustomSlotGuideLoaded", 7);
|
|
10
|
+
this.slotName = 'CUSTOM_SLOT_GUIDE';
|
|
11
|
+
}
|
|
12
|
+
onGuideChange(evt) {
|
|
13
|
+
const guideName = evt.detail;
|
|
14
|
+
if (guideName === this.slotName) {
|
|
15
|
+
this._element.style.setProperty('display', 'block');
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this._element.style.setProperty('display', 'none');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
onFormConfigVisibilityChange(evt) {
|
|
22
|
+
const isFormConfigVisible = evt.detail;
|
|
23
|
+
if (isFormConfigVisible) {
|
|
24
|
+
this._element.style.setProperty('display', 'none');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
componentDidLoad() {
|
|
28
|
+
this.snkCustomSlotGuideLoaded.emit(this.slotName);
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
return (h(Host, { slot: this.slotName, id: this.slotName, class: "custom-slot-guide-container" }, h("slot", null)));
|
|
32
|
+
}
|
|
33
|
+
get _element() { return this; }
|
|
34
|
+
static get style() { return snkCustomSlotGuideCss; }
|
|
35
|
+
}, [6, "snk-custom-slot-guide", {
|
|
36
|
+
"slotName": [1, "slot-name"]
|
|
37
|
+
}, [[8, "snkShowGuide", "onGuideChange"], [8, "formConfigVisibilityChanged", "onFormConfigVisibilityChange"]]]);
|
|
38
|
+
function defineCustomElement$1() {
|
|
39
|
+
if (typeof customElements === "undefined") {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const components = ["snk-custom-slot-guide"];
|
|
43
|
+
components.forEach(tagName => { switch (tagName) {
|
|
44
|
+
case "snk-custom-slot-guide":
|
|
45
|
+
if (!customElements.get(tagName)) {
|
|
46
|
+
customElements.define(tagName, SnkCustomSlotGuide$1);
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
} });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const SnkCustomSlotGuide = SnkCustomSlotGuide$1;
|
|
53
|
+
const defineCustomElement = defineCustomElement$1;
|
|
54
|
+
|
|
55
|
+
export { SnkCustomSlotGuide, defineCustomElement };
|
|
@@ -615,6 +615,8 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
615
615
|
return records;
|
|
616
616
|
const parentSelectedRecord = parentDataUnit.getSelectedRecord();
|
|
617
617
|
const selfInfo = parentDataUnit === null || parentDataUnit === void 0 ? void 0 : parentDataUnit.getChildInfo(this.getCleanDataUnitName());
|
|
618
|
+
if (!selfInfo)
|
|
619
|
+
return records;
|
|
618
620
|
const { links } = selfInfo;
|
|
619
621
|
if (!links || links.length === 0)
|
|
620
622
|
return records;
|