@sankhyalabs/sankhyablocks 9.2.0-dev.17 → 9.2.0-dev.19
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-0ebc800f.js → ConfigStorage-52c38bb9.js} +2 -2
- package/dist/cjs/{DataFetcher-602cdc72.js → DataFetcher-9af55840.js} +15 -0
- package/dist/cjs/{ISave-18205d86.js → ISave-c4918000.js} +1 -1
- package/dist/cjs/{SnkFormConfigManager-4b651537.js → SnkFormConfigManager-cef663d1.js} +2 -2
- package/dist/cjs/{ClientSideExporterProvider-bb0b2273.js → SnkMultiSelectionListDataSource-58ded10c.js} +78 -78
- package/dist/cjs/{auth-fetcher-82317d4d.js → auth-fetcher-a3a3bb16.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-93077a2f.js → dataunit-fetcher-ae454648.js} +1 -1
- package/dist/cjs/filter-validate-6993f6f2.js +30 -0
- package/dist/cjs/{form-config-fetcher-05d210e7.js → form-config-fetcher-d7bb4f41.js} +1 -1
- package/dist/cjs/index-1cf293c1.js +8 -8
- 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_8.cjs.entry.js +5 -5
- package/dist/cjs/snk-application.cjs.entry.js +6 -6
- package/dist/cjs/snk-attach.cjs.entry.js +5 -5
- package/dist/cjs/snk-crud.cjs.entry.js +5 -5
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
- package/dist/cjs/{snk-data-unit-28d629e4.js → snk-data-unit-a59a7ade.js} +2 -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-entity-list.cjs.entry.js +10 -3
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +164 -100
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +23 -2
- package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +20 -2
- package/dist/cjs/snk-filter-detail.cjs.entry.js +25 -8
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +9 -14
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +16 -3
- package/dist/cjs/snk-filter-number.cjs.entry.js +34 -3
- package/dist/cjs/snk-filter-period.cjs.entry.js +59 -14
- package/dist/cjs/snk-filter-search.cjs.entry.js +14 -3
- package/dist/cjs/snk-filter-text.cjs.entry.js +18 -1
- package/dist/cjs/snk-form_2.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid.cjs.entry.js +38 -21
- package/dist/cjs/{snk-guides-viewer-73d40f42.js → snk-guides-viewer-e7c08c71.js} +5 -5
- 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 +4 -4
- package/dist/cjs/snk-simple-crud.cjs.entry.js +13 -13
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +28 -4
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +72 -2
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +73 -2
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +51 -5
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +83 -3
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +118 -27
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +49 -5
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +71 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +62 -11
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +70 -8
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +0 -4
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +112 -16
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +8 -16
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +106 -52
- package/dist/collection/components/snk-filter-bar/utils/SnkFilterModalFactory.js +3 -1
- package/dist/collection/components/snk-filter-bar/utils/filter-validate.js +24 -0
- package/dist/collection/components/snk-grid/snk-grid.js +89 -11
- package/dist/collection/lib/message/resources/en-us/snk-filter-bar.msg.js +1 -0
- package/dist/collection/lib/message/resources/en-us/snk-grid.msg.js +4 -0
- package/dist/collection/lib/message/resources/es-es/snk-filter-bar.msg.js +1 -0
- package/dist/collection/lib/message/resources/es-es/snk-grid.msg.js +4 -0
- package/dist/collection/lib/message/resources/pt-br/snk-filter-bar.msg.js +1 -0
- package/dist/collection/lib/message/resources/pt-br/snk-grid.msg.js +4 -0
- package/dist/components/DataFetcher.js +15 -0
- package/dist/components/snk-crud.js +62 -44
- package/dist/components/snk-detail-view2.js +89 -56
- package/dist/components/snk-entity-list.js +11 -3
- package/dist/components/snk-filter-bar2.js +77 -93
- package/dist/components/snk-filter-binary-select.js +27 -3
- package/dist/components/snk-filter-checkbox-list.js +24 -3
- package/dist/components/snk-filter-detail2.js +28 -9
- package/dist/components/snk-filter-item2.js +70 -8
- package/dist/components/snk-filter-modal-item2.js +7 -12
- package/dist/components/snk-filter-modal.js +1 -325
- package/dist/components/snk-filter-modal2.js +391 -0
- package/dist/components/snk-filter-multi-select.js +19 -4
- package/dist/components/snk-filter-number.js +38 -4
- package/dist/components/snk-filter-period.js +64 -16
- package/dist/components/snk-filter-search.js +17 -4
- package/dist/components/snk-filter-text.js +22 -2
- package/dist/components/snk-grid2.js +65 -29
- package/dist/esm/{ConfigStorage-fc4e3a42.js → ConfigStorage-1e758486.js} +2 -2
- package/dist/esm/{DataFetcher-01ce1a4f.js → DataFetcher-2f7ba7ae.js} +15 -0
- package/dist/esm/{ISave-d36bade4.js → ISave-4c9742c1.js} +1 -1
- package/dist/esm/{SnkFormConfigManager-71dae34e.js → SnkFormConfigManager-d7031fcb.js} +2 -2
- package/dist/esm/{ClientSideExporterProvider-21a99af1.js → SnkMultiSelectionListDataSource-eace25fd.js} +83 -83
- package/dist/esm/{auth-fetcher-2e565c35.js → auth-fetcher-d8169b9c.js} +1 -1
- package/dist/esm/{dataunit-fetcher-14ba162b.js → dataunit-fetcher-1f7a73df.js} +1 -1
- package/dist/esm/filter-validate-d765d450.js +27 -0
- package/dist/esm/{form-config-fetcher-a1ccc944.js → form-config-fetcher-eb03ac08.js} +1 -1
- package/dist/esm/index-479e1293.js +8 -8
- 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_8.entry.js +5 -5
- package/dist/esm/snk-application.entry.js +6 -6
- package/dist/esm/snk-attach.entry.js +5 -5
- package/dist/esm/snk-crud.entry.js +5 -5
- package/dist/esm/snk-data-exporter.entry.js +5 -5
- package/dist/esm/{snk-data-unit-3977725e.js → snk-data-unit-a94dd52a.js} +2 -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-entity-list.entry.js +10 -3
- package/dist/esm/snk-filter-bar_4.entry.js +165 -101
- package/dist/esm/snk-filter-binary-select.entry.js +23 -2
- package/dist/esm/snk-filter-checkbox-list.entry.js +20 -2
- package/dist/esm/snk-filter-detail.entry.js +25 -8
- package/dist/esm/snk-filter-modal-item.entry.js +9 -14
- package/dist/esm/snk-filter-multi-select.entry.js +16 -3
- package/dist/esm/snk-filter-number.entry.js +34 -3
- package/dist/esm/snk-filter-period.entry.js +59 -14
- package/dist/esm/snk-filter-search.entry.js +14 -3
- package/dist/esm/snk-filter-text.entry.js +18 -1
- package/dist/esm/snk-form_2.entry.js +4 -4
- package/dist/esm/snk-grid.entry.js +31 -14
- package/dist/esm/{snk-guides-viewer-f800c9aa.js → snk-guides-viewer-e716659f.js} +5 -5
- 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 +4 -4
- package/dist/esm/snk-simple-crud.entry.js +8 -8
- package/dist/sankhyablocks/p-093f58fa.entry.js +1 -0
- package/dist/sankhyablocks/{p-e63cc25f.js → p-0dc071de.js} +1 -1
- package/dist/sankhyablocks/{p-f4bf0517.entry.js → p-0f6f2a84.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2b2c2718.js → p-1129ded7.js} +1 -1
- package/dist/sankhyablocks/p-12cba660.entry.js +1 -0
- package/dist/sankhyablocks/{p-51209229.js → p-12db5588.js} +1 -1
- package/dist/sankhyablocks/{p-65517fcf.js → p-3d4a3965.js} +1 -1
- package/dist/sankhyablocks/p-3ed04f0d.entry.js +1 -0
- package/dist/sankhyablocks/{p-b6b42620.entry.js → p-4033a6e3.entry.js} +1 -1
- package/dist/sankhyablocks/p-49ddc27a.entry.js +1 -0
- package/dist/sankhyablocks/{p-c3eea705.entry.js → p-4a42d004.entry.js} +1 -1
- package/dist/sankhyablocks/p-4c763b10.entry.js +1 -0
- package/dist/sankhyablocks/p-4eeb06fc.js +1 -0
- package/dist/sankhyablocks/{p-dc8bb41f.js → p-552bdfdc.js} +1 -1
- package/dist/sankhyablocks/{p-3cdfd7fb.js → p-66e6569e.js} +1 -1
- package/dist/sankhyablocks/p-6909c146.entry.js +1 -0
- package/dist/sankhyablocks/p-69d0afa4.js +1 -0
- package/dist/sankhyablocks/{p-c3bab5f4.js → p-75b80a92.js} +1 -1
- package/dist/sankhyablocks/p-7f7fe6c4.entry.js +1 -0
- package/dist/sankhyablocks/{p-e5571279.entry.js → p-86009ea5.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7b97f9af.entry.js → p-864066bb.entry.js} +1 -1
- package/dist/sankhyablocks/p-96d45943.entry.js +1 -0
- package/dist/sankhyablocks/{p-34222890.entry.js → p-a0b4c940.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a60028f1.entry.js → p-a4be272f.entry.js} +1 -1
- package/dist/sankhyablocks/p-ab2ba522.entry.js +1 -0
- package/dist/sankhyablocks/p-ac9488fd.entry.js +1 -0
- package/dist/sankhyablocks/{p-7a1d3cb6.entry.js → p-b1d8cbf7.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7535d592.js → p-b393f1df.js} +1 -1
- package/dist/sankhyablocks/{p-dfbe4d7f.entry.js → p-c5d281ad.entry.js} +1 -1
- package/dist/sankhyablocks/{p-41e5a485.entry.js → p-c6d8c86b.entry.js} +1 -1
- package/dist/sankhyablocks/p-cb4343c4.entry.js +1 -0
- package/dist/sankhyablocks/p-d235314c.entry.js +1 -0
- package/dist/sankhyablocks/{p-dde9da7a.entry.js → p-d76f1aa5.entry.js} +1 -1
- package/dist/sankhyablocks/{p-aba06047.entry.js → p-de58a26f.entry.js} +1 -1
- package/dist/sankhyablocks/p-e258de96.entry.js +1 -0
- package/dist/sankhyablocks/p-fd8047b8.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +8 -4
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +12 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.d.ts +12 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +12 -4
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +16 -4
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +17 -3
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +10 -2
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +12 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +8 -3
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +27 -4
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +17 -3
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +2 -3
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +15 -2
- package/dist/types/components/snk-filter-bar/utils/SnkFilterModalFactory.d.ts +4 -2
- package/dist/types/components/snk-filter-bar/utils/filter-validate.d.ts +11 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +21 -8
- package/dist/types/components.d.ts +202 -17
- package/package.json +1 -1
- package/dist/sankhyablocks/p-07b14811.entry.js +0 -1
- package/dist/sankhyablocks/p-082e7ba8.entry.js +0 -1
- package/dist/sankhyablocks/p-25209340.entry.js +0 -1
- package/dist/sankhyablocks/p-295b83ae.entry.js +0 -1
- package/dist/sankhyablocks/p-3143bb44.entry.js +0 -1
- package/dist/sankhyablocks/p-353b4a74.js +0 -1
- package/dist/sankhyablocks/p-398cdd67.entry.js +0 -1
- package/dist/sankhyablocks/p-5bab470d.entry.js +0 -1
- package/dist/sankhyablocks/p-9fd87bfd.entry.js +0 -1
- package/dist/sankhyablocks/p-a76e6d51.entry.js +0 -1
- package/dist/sankhyablocks/p-ae2ebab7.js +0 -1
- package/dist/sankhyablocks/p-b21aa190.entry.js +0 -1
- package/dist/sankhyablocks/p-c6a8a8bc.entry.js +0 -1
- package/dist/sankhyablocks/p-c8932b14.entry.js +0 -1
- package/dist/sankhyablocks/p-dff65083.entry.js +0 -1
@@ -53,12 +53,12 @@ import { IExpressionGroup, IExpressionItem } from "./components/snk-personalized
|
|
53
53
|
import { IPersonalizedFilter } from "./components/snk-personalized-filter/interfaces/IPersonalizedFilter";
|
54
54
|
import { SnkApplication } from "./components/snk-application/snk-application";
|
55
55
|
import { Filter as Filter1 } from "@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";
|
56
|
-
import { SnkFilterModalFactoryParams } from "./components/snk-filter-bar/utils/SnkFilterModalFactory";
|
57
56
|
import { EPresentationMode } from "./components/snk-filter-bar/filter-item/editors/enum/presentationMode";
|
58
57
|
import { FilterFieldsDataSource, IFilterField, IFilterLink } from "./components/snk-filter-field-search/interfaces";
|
59
58
|
import { IEzPopoverAnchorOptions } from "@sankhyalabs/ezui/dist/types/components/ez-popover/ez-popover";
|
60
59
|
import { SnkFilterItemConfig as SnkFilterItemConfig1 } from "./components/snk-filter-bar/filter-item/snk-filter-item";
|
61
60
|
import { ListItem as ListItem1 } from "./components/snk-filter-bar/filter-list/snk-filter-list";
|
61
|
+
import { Period } from "./components/snk-filter-bar/filter-item/editors/snk-filter-period";
|
62
62
|
import { IFormViewField } from "@sankhyalabs/ezui/dist/types/components/ez-form-view/interfaces/IFormViewField";
|
63
63
|
import { FormMetadata } from "@sankhyalabs/ezui/dist/collection/utils/form";
|
64
64
|
import { ICustomEditor as ICustomEditor1 } from "@sankhyalabs/ezui/dist/types/utils/customEditor/interfaces/ICustomEditor";
|
@@ -1094,6 +1094,10 @@ export namespace Components {
|
|
1094
1094
|
* Configurações para carregar os dados do componente
|
1095
1095
|
*/
|
1096
1096
|
"config": SnkFilterItemConfig;
|
1097
|
+
/**
|
1098
|
+
* Usado para exibir mensagens de erro.
|
1099
|
+
*/
|
1100
|
+
"errorMessage": string;
|
1097
1101
|
/**
|
1098
1102
|
* Permite definir uma altura máxima para o ez-list, adicionando um scroll ao atingir esta medida
|
1099
1103
|
*/
|
@@ -1246,6 +1250,17 @@ export namespace Components {
|
|
1246
1250
|
* @description Lista todos os filtros disponíveis ao usuário.
|
1247
1251
|
*/
|
1248
1252
|
"filterConfig": Array<SnkFilterItemConfig>;
|
1253
|
+
/**
|
1254
|
+
* @description Configuração customizada dos filtros.
|
1255
|
+
* @param config - Lista de configurações de filtros.
|
1256
|
+
*/
|
1257
|
+
"filterCustomConfig"?: Array<SnkFilterItemConfig>;
|
1258
|
+
/**
|
1259
|
+
* @description Intercepta a configuração dos filtros antes de serem aplicadas.
|
1260
|
+
* @param config - Lista de configurações de filtros.
|
1261
|
+
* @returns Retorna a lista de configurações de filtros.
|
1262
|
+
*/
|
1263
|
+
"filterCustomConfigInterceptor"?: (config: Array<SnkFilterItemConfig>) => Array<SnkFilterItemConfig>;
|
1249
1264
|
/**
|
1250
1265
|
* @description Retorna um item de filtro pelo ID.
|
1251
1266
|
* @async
|
@@ -1297,10 +1312,18 @@ export namespace Components {
|
|
1297
1312
|
"updateFilterItem": (newFilterItem: SnkFilterItemConfig) => Promise<void>;
|
1298
1313
|
}
|
1299
1314
|
interface SnkFilterBinarySelect {
|
1315
|
+
/**
|
1316
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
1317
|
+
*/
|
1318
|
+
"clearValue": () => Promise<void>;
|
1300
1319
|
/**
|
1301
1320
|
* Define as configurações do componente snk-filter-binary-select
|
1302
1321
|
*/
|
1303
1322
|
"config": SnkFilterItemConfig;
|
1323
|
+
/**
|
1324
|
+
* Usado para exibir mensagens de erro.
|
1325
|
+
*/
|
1326
|
+
"errorMessage": string;
|
1304
1327
|
/**
|
1305
1328
|
* Define a variação do componente
|
1306
1329
|
*/
|
@@ -1309,18 +1332,35 @@ export namespace Components {
|
|
1309
1332
|
* Redefine os valores padrão do componente.
|
1310
1333
|
*/
|
1311
1334
|
"resetValues": () => Promise<void>;
|
1335
|
+
/**
|
1336
|
+
* Define o foco no componente snk-filter-binary-select.
|
1337
|
+
*/
|
1338
|
+
"setFocus": () => Promise<void>;
|
1312
1339
|
/**
|
1313
1340
|
* Define o valor do componente snk-filter-binary-select
|
1314
1341
|
*/
|
1315
1342
|
"value": any;
|
1316
1343
|
}
|
1317
1344
|
interface SnkFilterCheckboxList {
|
1345
|
+
/**
|
1346
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
1347
|
+
*/
|
1348
|
+
"clearValue": () => Promise<void>;
|
1318
1349
|
/**
|
1319
1350
|
* Define as configurações do componente snk-filter-multi-select
|
1320
1351
|
*/
|
1321
1352
|
"config": SnkFilterItemConfig;
|
1353
|
+
/**
|
1354
|
+
* Usado para exibir mensagens de erro.
|
1355
|
+
*/
|
1356
|
+
"errorMessage": string;
|
1357
|
+
/**
|
1358
|
+
* Define o foco no componente snk-filter-checkbox-list.
|
1359
|
+
*/
|
1360
|
+
"setFocus": () => Promise<void>;
|
1322
1361
|
}
|
1323
1362
|
interface SnkFilterDetail {
|
1363
|
+
"clearValue": () => Promise<void>;
|
1324
1364
|
/**
|
1325
1365
|
* Define as configurações do componente snk-filter-detail.
|
1326
1366
|
*/
|
@@ -1330,9 +1370,13 @@ export namespace Components {
|
|
1330
1370
|
*/
|
1331
1371
|
"getMessage": (key: string, props?: any) => string;
|
1332
1372
|
/**
|
1333
|
-
*
|
1373
|
+
* Define se o filtro pode ser removido.
|
1334
1374
|
*/
|
1335
|
-
"
|
1375
|
+
"removalBlocked": boolean;
|
1376
|
+
/**
|
1377
|
+
* Define o foco no campo do editor.
|
1378
|
+
*/
|
1379
|
+
"setFocusField": () => Promise<void>;
|
1336
1380
|
/**
|
1337
1381
|
* Controla a visibilidade do botão de fixar elemento
|
1338
1382
|
*/
|
@@ -1446,13 +1490,19 @@ export namespace Components {
|
|
1446
1490
|
*/
|
1447
1491
|
"editPersonalizedFilter": (id:string, isDefault?: boolean) => void;
|
1448
1492
|
/**
|
1449
|
-
*
|
1493
|
+
* Filtros a serem apresentados
|
1450
1494
|
*/
|
1451
|
-
"
|
1495
|
+
"filterConfig": Array<SnkFilterItemConfig>;
|
1452
1496
|
/**
|
1453
|
-
*
|
1497
|
+
* @description Intercepta a configuração dos filtros antes de serem aplicadas.
|
1498
|
+
* @param config - Lista de configurações de filtros.
|
1499
|
+
* @returns Retorna a lista de configurações de filtros.
|
1454
1500
|
*/
|
1455
|
-
"
|
1501
|
+
"filterCustomConfigInterceptor"?: (config: Array<SnkFilterItemConfig>) => Array<SnkFilterItemConfig>;
|
1502
|
+
/**
|
1503
|
+
* Guarda o filtro a ser deletado no Apply do modal
|
1504
|
+
*/
|
1505
|
+
"filterDefaultToDelete": SnkFilterItemConfig;
|
1456
1506
|
/**
|
1457
1507
|
* Guarda filtros a serem deletados no Apply do modal
|
1458
1508
|
*/
|
@@ -1461,6 +1511,10 @@ export namespace Components {
|
|
1461
1511
|
* Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder.
|
1462
1512
|
*/
|
1463
1513
|
"getMessage": (key: string, props?: any) => string;
|
1514
|
+
/**
|
1515
|
+
* Define se o modal está aberto ou não.
|
1516
|
+
*/
|
1517
|
+
"opened": boolean;
|
1464
1518
|
}
|
1465
1519
|
interface SnkFilterModalItem {
|
1466
1520
|
/**
|
@@ -1474,24 +1528,40 @@ export namespace Components {
|
|
1474
1528
|
"resourceID": string;
|
1475
1529
|
}
|
1476
1530
|
interface SnkFilterMultiSelect {
|
1531
|
+
/**
|
1532
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
1533
|
+
*/
|
1534
|
+
"clearValue": () => Promise<void>;
|
1477
1535
|
/**
|
1478
1536
|
* Define as configurações do componente snk-filter-multi-select
|
1479
1537
|
*/
|
1480
1538
|
"config": SnkFilterItemConfig;
|
1481
1539
|
/**
|
1482
|
-
*
|
1540
|
+
* Usado para exibir mensagens de erro.
|
1483
1541
|
*/
|
1484
|
-
"
|
1542
|
+
"errorMessage": string;
|
1543
|
+
/**
|
1544
|
+
* Define o foco no componente snk-filter-multi-select.
|
1545
|
+
*/
|
1546
|
+
"setFocus": () => Promise<void>;
|
1485
1547
|
/**
|
1486
1548
|
* Define o valor do componente snk-filter-multi-select
|
1487
1549
|
*/
|
1488
1550
|
"value": any;
|
1489
1551
|
}
|
1490
1552
|
interface SnkFilterNumber {
|
1553
|
+
/**
|
1554
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
1555
|
+
*/
|
1556
|
+
"clearValue": () => Promise<void>;
|
1491
1557
|
/**
|
1492
1558
|
* Define as configurações do componente snk-filter-number
|
1493
1559
|
*/
|
1494
1560
|
"config": SnkFilterItemConfig;
|
1561
|
+
/**
|
1562
|
+
* Usado para exibir mensagens de erro.
|
1563
|
+
*/
|
1564
|
+
"errorMessage": string;
|
1495
1565
|
/**
|
1496
1566
|
* Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder.
|
1497
1567
|
*/
|
@@ -1500,6 +1570,10 @@ export namespace Components {
|
|
1500
1570
|
* Define a variação do componente
|
1501
1571
|
*/
|
1502
1572
|
"presentationMode": EPresentationMode;
|
1573
|
+
/**
|
1574
|
+
* Define o foco no componente snk-filter-number
|
1575
|
+
*/
|
1576
|
+
"setFocus": () => Promise<void>;
|
1503
1577
|
/**
|
1504
1578
|
* Exibe o componente snk-filter-number
|
1505
1579
|
*/
|
@@ -1524,10 +1598,18 @@ export namespace Components {
|
|
1524
1598
|
"open": (expressionItem: IExpressionItem) => Promise<IExpressionItem>;
|
1525
1599
|
}
|
1526
1600
|
interface SnkFilterPeriod {
|
1601
|
+
/**
|
1602
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
1603
|
+
*/
|
1604
|
+
"clearValue": () => Promise<void>;
|
1527
1605
|
/**
|
1528
1606
|
* Define as configurações do componente snk-filter-period
|
1529
1607
|
*/
|
1530
1608
|
"config": SnkFilterItemConfig;
|
1609
|
+
/**
|
1610
|
+
* Usado para exibir mensagens de erro.
|
1611
|
+
*/
|
1612
|
+
"errorMessage": string;
|
1531
1613
|
/**
|
1532
1614
|
* Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder.
|
1533
1615
|
*/
|
@@ -1536,6 +1618,10 @@ export namespace Components {
|
|
1536
1618
|
* Define a variação do componente
|
1537
1619
|
*/
|
1538
1620
|
"presentationMode": EPresentationMode;
|
1621
|
+
/**
|
1622
|
+
* Define o foco no componente snk-filter-period.
|
1623
|
+
*/
|
1624
|
+
"setFocus": () => Promise<void>;
|
1539
1625
|
/**
|
1540
1626
|
* Exibe o componente snk-filter-period
|
1541
1627
|
*/
|
@@ -1543,27 +1629,47 @@ export namespace Components {
|
|
1543
1629
|
/**
|
1544
1630
|
* Define o valor do componente snk-filter-period
|
1545
1631
|
*/
|
1546
|
-
"value":
|
1632
|
+
"value": Period;
|
1547
1633
|
}
|
1548
1634
|
interface SnkFilterSearch {
|
1635
|
+
/**
|
1636
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
1637
|
+
*/
|
1638
|
+
"clearValue": () => Promise<void>;
|
1549
1639
|
/**
|
1550
1640
|
* Define as configurações do componente snk-filter-search
|
1551
1641
|
*/
|
1552
1642
|
"config": SnkFilterItemConfig;
|
1553
1643
|
/**
|
1554
|
-
*
|
1644
|
+
* Usado para exibir mensagens de erro.
|
1555
1645
|
*/
|
1556
|
-
"
|
1646
|
+
"errorMessage": string;
|
1647
|
+
/**
|
1648
|
+
* Define o foco no componente snk-filter-search.
|
1649
|
+
*/
|
1650
|
+
"setFocus": () => Promise<void>;
|
1557
1651
|
/**
|
1558
1652
|
* Define o valor do componente snk-filter-search
|
1559
1653
|
*/
|
1560
1654
|
"value": IOption2;
|
1561
1655
|
}
|
1562
1656
|
interface SnkFilterText {
|
1657
|
+
/**
|
1658
|
+
* Limpa o valor do componente restaurando o valor original da configuração.
|
1659
|
+
*/
|
1660
|
+
"clearValue": () => Promise<void>;
|
1563
1661
|
/**
|
1564
1662
|
* Define as configurações do componente snk-filter-text.
|
1565
1663
|
*/
|
1566
1664
|
"config": SnkFilterItemConfig;
|
1665
|
+
/**
|
1666
|
+
* Usado para exibir mensagens de erro.
|
1667
|
+
*/
|
1668
|
+
"errorMessage": string;
|
1669
|
+
/**
|
1670
|
+
* Define o foco no componente snk-filter-text.
|
1671
|
+
*/
|
1672
|
+
"setFocus": () => Promise<void>;
|
1567
1673
|
/**
|
1568
1674
|
* Define o valor do componente snk-filter-text.
|
1569
1675
|
*/
|
@@ -1817,6 +1923,17 @@ export namespace Components {
|
|
1817
1923
|
* Título que será apresentado na barra de filtros.
|
1818
1924
|
*/
|
1819
1925
|
"filterBarTitle": string;
|
1926
|
+
/**
|
1927
|
+
* @description Configuração customizada dos filtros.
|
1928
|
+
* @param config - Lista de configurações de filtros.
|
1929
|
+
*/
|
1930
|
+
"filterCustomConfig"?: Array<SnkFilterItemConfig>;
|
1931
|
+
/**
|
1932
|
+
* @description Intercepta a configuração dos filtros antes de serem aplicadas.
|
1933
|
+
* @param config - Lista de configurações de filtros.
|
1934
|
+
* @returns Retorna a lista de configurações de filtros.
|
1935
|
+
*/
|
1936
|
+
"filterCustomConfigInterceptor"?: (config: Array<SnkFilterItemConfig>) => Array<SnkFilterItemConfig>;
|
1820
1937
|
/**
|
1821
1938
|
* Retorna o elemento da barra de filtros da grade.
|
1822
1939
|
* @async
|
@@ -3823,6 +3940,10 @@ declare namespace LocalJSX {
|
|
3823
3940
|
* Configurações para carregar os dados do componente
|
3824
3941
|
*/
|
3825
3942
|
"config"?: SnkFilterItemConfig;
|
3943
|
+
/**
|
3944
|
+
* Usado para exibir mensagens de erro.
|
3945
|
+
*/
|
3946
|
+
"errorMessage"?: string;
|
3826
3947
|
/**
|
3827
3948
|
* Permite definir uma altura máxima para o ez-list, adicionando um scroll ao atingir esta medida
|
3828
3949
|
*/
|
@@ -3993,6 +4114,17 @@ declare namespace LocalJSX {
|
|
3993
4114
|
* @description Lista todos os filtros disponíveis ao usuário.
|
3994
4115
|
*/
|
3995
4116
|
"filterConfig"?: Array<SnkFilterItemConfig>;
|
4117
|
+
/**
|
4118
|
+
* @description Configuração customizada dos filtros.
|
4119
|
+
* @param config - Lista de configurações de filtros.
|
4120
|
+
*/
|
4121
|
+
"filterCustomConfig"?: Array<SnkFilterItemConfig>;
|
4122
|
+
/**
|
4123
|
+
* @description Intercepta a configuração dos filtros antes de serem aplicadas.
|
4124
|
+
* @param config - Lista de configurações de filtros.
|
4125
|
+
* @returns Retorna a lista de configurações de filtros.
|
4126
|
+
*/
|
4127
|
+
"filterCustomConfigInterceptor"?: (config: Array<SnkFilterItemConfig>) => Array<SnkFilterItemConfig>;
|
3996
4128
|
/**
|
3997
4129
|
* @description Responsável por flexibilizar e padronizar o uso de mensagens nos blocos de construção.
|
3998
4130
|
*/
|
@@ -4021,6 +4153,10 @@ declare namespace LocalJSX {
|
|
4021
4153
|
* Define as configurações do componente snk-filter-binary-select
|
4022
4154
|
*/
|
4023
4155
|
"config"?: SnkFilterItemConfig;
|
4156
|
+
/**
|
4157
|
+
* Usado para exibir mensagens de erro.
|
4158
|
+
*/
|
4159
|
+
"errorMessage"?: string;
|
4024
4160
|
/**
|
4025
4161
|
* Emitido quando o valor do filtro é alterado.
|
4026
4162
|
*/
|
@@ -4039,6 +4175,10 @@ declare namespace LocalJSX {
|
|
4039
4175
|
* Define as configurações do componente snk-filter-multi-select
|
4040
4176
|
*/
|
4041
4177
|
"config"?: SnkFilterItemConfig;
|
4178
|
+
/**
|
4179
|
+
* Usado para exibir mensagens de erro.
|
4180
|
+
*/
|
4181
|
+
"errorMessage"?: string;
|
4042
4182
|
/**
|
4043
4183
|
* Emite um evento customizado ao realizar alteração nos valores do componente
|
4044
4184
|
*/
|
@@ -4057,6 +4197,10 @@ declare namespace LocalJSX {
|
|
4057
4197
|
* Emitido quando há uma alteração nos filtros.
|
4058
4198
|
*/
|
4059
4199
|
"onFilterChange"?: (event: SnkFilterDetailCustomEvent<SnkFilterItemConfig>) => void;
|
4200
|
+
/**
|
4201
|
+
* Define se o filtro pode ser removido.
|
4202
|
+
*/
|
4203
|
+
"removalBlocked"?: boolean;
|
4060
4204
|
/**
|
4061
4205
|
* Controla a visibilidade do botão de fixar elemento
|
4062
4206
|
*/
|
@@ -4163,13 +4307,19 @@ declare namespace LocalJSX {
|
|
4163
4307
|
*/
|
4164
4308
|
"editPersonalizedFilter"?: (id:string, isDefault?: boolean) => void;
|
4165
4309
|
/**
|
4166
|
-
*
|
4310
|
+
* Filtros a serem apresentados
|
4167
4311
|
*/
|
4168
|
-
"
|
4312
|
+
"filterConfig"?: Array<SnkFilterItemConfig>;
|
4169
4313
|
/**
|
4170
|
-
*
|
4314
|
+
* @description Intercepta a configuração dos filtros antes de serem aplicadas.
|
4315
|
+
* @param config - Lista de configurações de filtros.
|
4316
|
+
* @returns Retorna a lista de configurações de filtros.
|
4317
|
+
*/
|
4318
|
+
"filterCustomConfigInterceptor"?: (config: Array<SnkFilterItemConfig>) => Array<SnkFilterItemConfig>;
|
4319
|
+
/**
|
4320
|
+
* Guarda o filtro a ser deletado no Apply do modal
|
4171
4321
|
*/
|
4172
|
-
"
|
4322
|
+
"filterDefaultToDelete"?: SnkFilterItemConfig;
|
4173
4323
|
/**
|
4174
4324
|
* Guarda filtros a serem deletados no Apply do modal
|
4175
4325
|
*/
|
@@ -4178,6 +4328,10 @@ declare namespace LocalJSX {
|
|
4178
4328
|
* Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder.
|
4179
4329
|
*/
|
4180
4330
|
"getMessage"?: (key: string, props?: any) => string;
|
4331
|
+
/**
|
4332
|
+
* Define se o modal está aberto ou não.
|
4333
|
+
*/
|
4334
|
+
"opened"?: boolean;
|
4181
4335
|
}
|
4182
4336
|
interface SnkFilterModalItem {
|
4183
4337
|
/**
|
@@ -4198,6 +4352,10 @@ declare namespace LocalJSX {
|
|
4198
4352
|
* Define as configurações do componente snk-filter-multi-select
|
4199
4353
|
*/
|
4200
4354
|
"config"?: SnkFilterItemConfig;
|
4355
|
+
/**
|
4356
|
+
* Usado para exibir mensagens de erro.
|
4357
|
+
*/
|
4358
|
+
"errorMessage"?: string;
|
4201
4359
|
/**
|
4202
4360
|
* Emitido quando o valor do filtro é alterado.
|
4203
4361
|
*/
|
@@ -4212,6 +4370,10 @@ declare namespace LocalJSX {
|
|
4212
4370
|
* Define as configurações do componente snk-filter-number
|
4213
4371
|
*/
|
4214
4372
|
"config"?: SnkFilterItemConfig;
|
4373
|
+
/**
|
4374
|
+
* Usado para exibir mensagens de erro.
|
4375
|
+
*/
|
4376
|
+
"errorMessage"?: string;
|
4215
4377
|
/**
|
4216
4378
|
* Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder.
|
4217
4379
|
*/
|
@@ -4240,6 +4402,10 @@ declare namespace LocalJSX {
|
|
4240
4402
|
* Define as configurações do componente snk-filter-period
|
4241
4403
|
*/
|
4242
4404
|
"config"?: SnkFilterItemConfig;
|
4405
|
+
/**
|
4406
|
+
* Usado para exibir mensagens de erro.
|
4407
|
+
*/
|
4408
|
+
"errorMessage"?: string;
|
4243
4409
|
/**
|
4244
4410
|
* Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder.
|
4245
4411
|
*/
|
@@ -4255,13 +4421,17 @@ declare namespace LocalJSX {
|
|
4255
4421
|
/**
|
4256
4422
|
* Define o valor do componente snk-filter-period
|
4257
4423
|
*/
|
4258
|
-
"value"?:
|
4424
|
+
"value"?: Period;
|
4259
4425
|
}
|
4260
4426
|
interface SnkFilterSearch {
|
4261
4427
|
/**
|
4262
4428
|
* Define as configurações do componente snk-filter-search
|
4263
4429
|
*/
|
4264
4430
|
"config"?: SnkFilterItemConfig;
|
4431
|
+
/**
|
4432
|
+
* Usado para exibir mensagens de erro.
|
4433
|
+
*/
|
4434
|
+
"errorMessage"?: string;
|
4265
4435
|
/**
|
4266
4436
|
* Emitido quando o valor do filtro é alterado.
|
4267
4437
|
*/
|
@@ -4276,6 +4446,10 @@ declare namespace LocalJSX {
|
|
4276
4446
|
* Define as configurações do componente snk-filter-text.
|
4277
4447
|
*/
|
4278
4448
|
"config"?: SnkFilterItemConfig;
|
4449
|
+
/**
|
4450
|
+
* Usado para exibir mensagens de erro.
|
4451
|
+
*/
|
4452
|
+
"errorMessage"?: string;
|
4279
4453
|
/**
|
4280
4454
|
* Emitido quando o valor do filtro é alterado.
|
4281
4455
|
*/
|
@@ -4487,6 +4661,17 @@ declare namespace LocalJSX {
|
|
4487
4661
|
* Título que será apresentado na barra de filtros.
|
4488
4662
|
*/
|
4489
4663
|
"filterBarTitle"?: string;
|
4664
|
+
/**
|
4665
|
+
* @description Configuração customizada dos filtros.
|
4666
|
+
* @param config - Lista de configurações de filtros.
|
4667
|
+
*/
|
4668
|
+
"filterCustomConfig"?: Array<SnkFilterItemConfig>;
|
4669
|
+
/**
|
4670
|
+
* @description Intercepta a configuração dos filtros antes de serem aplicadas.
|
4671
|
+
* @param config - Lista de configurações de filtros.
|
4672
|
+
* @returns Retorna a lista de configurações de filtros.
|
4673
|
+
*/
|
4674
|
+
"filterCustomConfigInterceptor"?: (config: Array<SnkFilterItemConfig>) => Array<SnkFilterItemConfig>;
|
4490
4675
|
/**
|
4491
4676
|
* Define o nome do slot para elementos customizados na `Taskbar` do cabeçalho da grade.
|
4492
4677
|
*/
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
import{r as t,c as i,h as s,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as a}from"@sankhyalabs/core";import{F as r}from"./p-ff1990ad.js";import{E as h}from"./p-1a68fb59.js";const n=class{constructor(s){t(this,s),this.valueChanged=i(this,"valueChanged",7),this._startDateLabel="Inicial",this._endDateLabel="Final",this._toLabel="até",this.config=void 0,this.getMessage=void 0,this.value=void 0,this.presentationMode=h.CHIP}ezChangeListener(){const t=this._startDate.value,i=this._endDate.value;this.value=t||i?{start:t,end:i}:void 0,this.valueChanged.emit(this.value)}componentDidLoad(){this._element&&a.addIDInfo(this._element,"filterContentEditor")}getDate(t){const i=this.value?this.value[t]:null;if(i instanceof Date)return i;if("string"==typeof i){let t=new Date(i);return t.setMinutes(t.getMinutes()+t.getTimezoneOffset()),t}return null}async show(){this._startDate.setFocus()}buildLabel(){if(this.presentationMode===h.CHIP)return s("label",{class:"ez-text ez-text--medium ez-text--primary ez-margin--medium"},this._toLabel)}componentWillLoad(){this.getMessage&&(this._startDateLabel=this.getMessage("snkFilterBar.labelStart"),this._endDateLabel=this.getMessage("snkFilterBar.labelEnd"),this._toLabel=this.getMessage("snkFilterBar.labelTo"))}render(){if(this.config&&this.config.type===r.PERIOD)return s("div",{class:"ez-col ez-col--nowrap"},s("ez-date-input",{id:`${this.config.id}_start`,class:this.presentationMode===h.MODAL?"ez-padding--small":"",label:this._startDateLabel,ref:t=>this._startDate=t,value:this.getDate("start")}),this.buildLabel(),s("ez-date-input",{id:`${this.config.id}_end`,class:this.presentationMode===h.MODAL?"ez-padding--small":"",label:this._endDateLabel,ref:t=>this._endDate=t,value:this.getDate("end")}))}get _element(){return e(this)}};export{n as snk_filter_period}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as t,c as i,h as e,H as s,g as r}from"./p-d8d8169b.js";import{ElementIDUtils as o,ObjectUtils as l}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";import{E as n}from"./p-1a68fb59.js";import{C as d}from"./p-3cdfd7fb.js";import{F as h}from"./p-b568c1d4.js";import"./p-51209229.js";import"./p-65517fcf.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";const c=class{constructor(e){t(this,e),this.filterChange=i(this,"filterChange",7),this.editPersonalizedFilter=i(this,"editPersonalizedFilter",7),this.addPersonalizedFilter=i(this,"addPersonalizedFilter",7),this.filterItem=void 0,this.configName=void 0,this.resourceID=void 0}observeFilterItem(t){var i,e;this._editor&&(this._editor.config=t),null===(e=null===(i=this._editor)||void 0===i?void 0:i.reloadList)||void 0===e||e.call(i),this.filterChange.emit(t)}getContentEditorConfig(){const t={presentationMode:n.MODAL};switch(this.filterItem.type){case a.BINARY_SELECT:return{tag:"snk-filter-binary-select",props:t};case a.MULTI_SELECT:return{tag:"snk-filter-multi-select"};case a.PERIOD:return{tag:"snk-filter-period",props:t};case a.SEARCH:return{tag:"snk-filter-search"};case a.NUMBER:return{tag:"snk-filter-number",props:t};case a.PERSONALIZED:return this.buildSnkFilterPersonalizedProps();case a.CHECK_BOX_LIST:return{tag:"snk-filter-checkbox-list",props:t};case a.MULTI_LIST:return{tag:"snk-entity-list",props:{maxHeightList:"640px",rightListSlotBuilder:t=>this.buildRightSlot(t)}}}return{tag:"snk-filter-text"}}buildSnkFilterPersonalizedProps(){return{tag:"snk-personalized-filter-editor",props:{onEditFilter:t=>this.editPersonalizedFilter.emit(t.detail),onAddFilter:()=>this.addPersonalizedFilter.emit()}}}isVisible(t){return!!this.filterItem.visible||void 0!==t}updateFilterValue(t){const i=void 0!==(null==t?void 0:t.value)?t.value:t;this.filterItem=Object.assign(Object.assign({},this.filterItem),null!=this.filterItem.groupedItems?{visible:i>0,value:i,groupedItems:t.items}:{value:this.filterItem.type===(a.SEARCH||a.CHECK_BOX_LIST)?t:i,visible:this.isVisible(i)})}handleDeleteFilter(t,i){i===a.PERSONALIZED&&d.removePersonalizedFilter(t,this.resourceID,this.configName)}componentDidLoad(){if(this._element){o.addIDInfo(this._element);const t=this._element.getAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME);this._idContentEditor=`${t}_${this.filterItem.id}`}}buildRightSlot(t){return e("ez-icon",{iconName:"delete",onClick:()=>this.removeValueFromConfig(t)})}removeValueFromConfig(t){var i,e,s;const r=null===(e=null===(i=this.filterItem)||void 0===i?void 0:i.value)||void 0===e?void 0:e.findIndex((({id:i})=>i===t.id)),o=l.copy(this.filterItem);null===(s=null==o?void 0:o.value)||void 0===s||s.splice(r,1),this.updateFilterValue(o.value)}canShowDetailModal(){const{CUSTOM_FILTER:t,OTHER_FILTERS:i}=h;return![t,i].includes(this.filterItem.filterType)&&this.filterItem.type!==a.BINARY_SELECT}render(){const{tag:t,props:i}=this.getContentEditorConfig();return e(s,null,e("div",{class:"ez-flex ez-flex--column grow"},this.canShowDetailModal()&&e("div",{class:"col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center"},e("div",{class:"ez-title ez-title--small ez-title--primary grow"},this.filterItem.detailModal)),e(t,Object.assign({ref:t=>this._editor=t,config:this.filterItem,value:this.filterItem.value,onValueChanged:t=>this.updateFilterValue(t.detail),"data-element-id":this._idContentEditor},i))))}get _element(){return r(this)}static get watchers(){return{filterItem:["observeFilterItem"]}}};c.style=".grow{flex-grow:1}.gap{gap:4px}";export{c as snk_filter_modal_item}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as t,c as i,h as e,F as s,H as l,g as r}from"./p-d8d8169b.js";import{ApplicationUtils as n}from"@sankhyalabs/ezui/dist/collection/utils";import{F as a}from"./p-ff1990ad.js";import{ElementIDUtils as o,ObjectUtils as h}from"@sankhyalabs/core";import{E as c}from"./p-1a68fb59.js";import{P as d}from"./p-988afe78.js";import"./p-84345e7a.js";const u=class{constructor(e){t(this,e),this.filterChange=i(this,"filterChange",7),this.config=void 0,this.getMessage=void 0,this.showHardFixed=!0}async show(){var t,i;null===(i=null===(t=this._editor)||void 0===t?void 0:t.show)||void 0===i||i.call(t)}observeConfig(t){var i,e;this._editor&&(this._editor.config=t),null===(e=null===(i=this._editor)||void 0===i?void 0:i.reloadList)||void 0===e||e.call(i),this._customElementObject=this.getContentEditor()}componentDidLoad(){if(this._element){o.addIDInfo(this._element);const t=this._element.getAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME);this._idContentEditor=`${t}_${this.config.id}`}}changeConfig(t){this.filterChange.emit(t)}getContentEditor(){switch(this.config.type){case a.BINARY_SELECT:return{tag:"snk-filter-binary-select"};case a.MULTI_SELECT:return{tag:"snk-filter-multi-select"};case a.PERIOD:return{tag:"snk-filter-period"};case a.SEARCH:return{tag:"snk-filter-search"};case a.NUMBER:return{tag:"snk-filter-number"};case a.PERSONALIZED:return{tag:"snk-personalized-filter-editor",props:{presentationMode:c.CHIP,onValueChanged:t=>this.handleValueChanged(t)}};case a.CHECK_BOX_LIST:return{tag:"snk-filter-checkbox-list",props:{onValueChanged:t=>this.config=Object.assign(Object.assign({},this.config),{value:t.detail})}};case a.MULTI_LIST:return{tag:"snk-entity-list",props:{onValueChanged:t=>this.config=Object.assign(Object.assign({},this.config),{value:t.detail})}}}return{tag:"snk-filter-text"}}handleValueChanged({detail:t}){const i=(null==t?void 0:t.items)||this.config.groupedItems;this.config=Object.assign(Object.assign({},this.config),{groupedItems:i,visible:(i||[]).filter((t=>t.visible)).length>0})}removeItem(){const t=this.config.type===a.MULTI_LIST&&Array.isArray(this.config.value)?this.config.value.map((t=>Object.assign(Object.assign({},t),{check:!1}))):void 0,i=Object.assign(Object.assign({},this.config),{visible:!1,fixed:!1,value:t});null!=i.groupedItems&&(i.groupedItems=i.groupedItems.map((t=>Object.assign(Object.assign({},t),{visible:!1,fixed:!1,value:void 0})))),this.changeConfig(i)}removeItemFromGroup(t){return Object.assign(Object.assign({},t),{visible:!1,fixed:!1,value:void 0})}getPopUpHeaderButtons(){return e(s,null,!this.config.removalBlocked&&this.buildIcon(this.getMessage("snkFilterBar.removeFilter"),"delete",(()=>this.removeItem())),this.showHardFixed&&!this.config.hardFixed&&this.buildIcon(this.getMessage(this.config.fixed?"snkFilterBar.unpinFilter":"snkFilterBar.pinFilter"),this.config.fixed?"un-pin":"push-pin",(()=>this.changeConfig(Object.assign(Object.assign({},this.config),{fixed:!this.config.fixed})))))}buildIcon(t,i,s){return e("button",{onClick:()=>s(),class:"sc-snk-filter-bar snk-filter-item__editor-header-button",ref:i=>i&&this.buildIdButton(i,t)},e("ez-icon",Object.assign({title:t,iconName:i},{[o.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${o.getInternalIDInfo(`_${t}`)}`})))}buildIdButton(t,i){if(!t)return;const e={id:i};t.removeAttribute(o.DATA_ELEMENT_ID_ATTRIBUTE_NAME),o.addIDInfoIfNotExists(t,"button",e)}clearBinarySelectValues(){var t;const i=this._editor||{};null===(t=i.resetValues)||void 0===t||t.call(i),this.config=h.copy(this.originalConfig),this.changeConfig(Object.assign(Object.assign({},this.config),{value:void 0}))}apply(){if(!d.validateVariableValues(this.config,this._editor.value))return n.alert(this.getMessage("snkFilterBar.filterModal.validations.notFullFilled.title"),this.getMessage("snkFilterBar.filterModal.validations.notFullFilled.message"));const t=void 0!==this._editor.value?this._editor.value:this.config.value;this.changeConfig(Object.assign(Object.assign({},this.config),{visible:this.isVisible(),value:t}))}isVisible(){return!(this.config.groupedItems&&this.config.groupedItems.length>0)||this.config.groupedItems.filter((t=>t.visible)).length>0}clear(){var t;if(this.config.type!==a.BINARY_SELECT){if(a.MULTI_LIST===this.config.type){const i=h.copy(this.config);return null===(t=i.value)||void 0===t||t.forEach((t=>!!t&&(t.check=!1))),void(this.config=h.copy(i))}this.changeConfig(Object.assign(Object.assign({},this.config),{value:void 0}))}else this.clearBinarySelectValues()}filterCanBeCleared(){return this.config.type!==a.PERSONALIZED}onKeyDonwListener(t){"Enter"===t.key&&this._applyButton.setFocus().then((()=>this.apply()))}buildRightSlot(t){return e("ez-icon",{iconName:"delete",onClick:()=>this.removeValueFromConfig(t)})}removeValueFromConfig(t){var i,e;if(this.config){const s=h.copy(this.config),l=null===(i=s.value)||void 0===i?void 0:i.findIndex((i=>(null==i?void 0:i.id)===t.id));null===(e=s.value)||void 0===e||e.splice(l,1),this.config=h.copy(s)}}componentWillLoad(){this.originalConfig=h.copy(this.config),this._customElementObject=this.getContentEditor()}render(){const{tag:t,props:i}=this._customElementObject;return e(l,null,e("div",{class:"col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center"},e("div",{class:"ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header"},this.config.detailTitle),this.getPopUpHeaderButtons()),e(t,Object.assign({maxHeightList:"240px",ref:t=>this._editor=t,value:this.config.value,config:this.config,onKeyDown:t=>this.onKeyDonwListener(t),"data-element-id":this._idContentEditor,getMessage:this.getMessage,rightListSlotBuilder:t=>this.buildRightSlot(t)},i)),e("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),e("div",{class:"ez-col ez-col--sd-12 ez-align--right"},this.filterCanBeCleared()&&e("ez-button",{label:this.getMessage("snkFilterBar.cleanFilter"),onClick:()=>this.clear(),size:"small"}),e("ez-button",{ref:t=>this._applyButton=t,label:this.getMessage("snkFilterBar.applyFilter"),onClick:()=>this.apply(),size:"small",class:"ez-button--primary ez-padding-left--medium"})))}get _element(){return r(this)}static get watchers(){return{config:["observeConfig"]}}};export{u as snk_filter_detail}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as i,c as t,h as l,H as s}from"./p-d8d8169b.js";import{ObjectUtils as o,ApplicationContext as e}from"@sankhyalabs/core";const n=class{constructor(l){i(this,l),this.valueChanged=t(this,"valueChanged",7),this._ezListSource=[],this.config=void 0,this.rightListSlotBuilder=void 0,this.maxHeightList="",this.value=void 0}async reloadList(){this.loadListSource()}observeConfig(){var i,t;null===(t=null===(i=this._searchElement)||void 0===i?void 0:i.clearValue)||void 0===t||t.call(i)}ezListChangeListener(i){var t,l;const s=o.copy(this.config);null===(t=this.getListConfigValue(s))||void 0===t||t.forEach((t=>{var l,s;t&&t.id===(null===(l=i.detail)||void 0===l?void 0:l.id)&&(t.check=null===(s=i.detail)||void 0===s?void 0:s.check)})),this.config=o.copy(s),this.valueChanged.emit(null===(l=this.config)||void 0===l?void 0:l.value)}loadListSource(){var i;this._ezListSource=[],null===(i=this.getListConfigValue(this.config))||void 0===i||i.forEach((i=>{i&&this._ezListSource.push({label:`${i.id} - ${i.label}`,check:i.check,id:i.id})}))}componentDidLoad(){var i,t,l,s,o;let n=this.getListConfigValue(this.config),a=[];Array.isArray(n)?a=n:a.push(null===(t=null===(i=this.config)||void 0===i?void 0:i.value)||void 0===t?void 0:t.members),this.config.value=a,this._entityName=null===(o=null===(s=null===(l=this.config)||void 0===l?void 0:l.props)||void 0===s?void 0:s.searchContext)||void 0===o?void 0:o.entity,this._application=e.getContextValue("__SNK__APPLICATION__"),this.loadListSource()}optionLoader(i){var t,l,s,o,e,n;const{mode:a,argument:v}=i;if(void 0===this._application)return;const d=null!==(s=null===(l=null===(t=this.config)||void 0===t?void 0:t.props)||void 0===l?void 0:l.searchContext)&&void 0!==s?s:{},r=null===(e=null===(o=this.config)||void 0===o?void 0:o.props)||void 0===e?void 0:e.criteria,h=Object.assign(Object.assign({criteria:r},d),{entityDescription:null===(n=this.config)||void 0===n?void 0:n.label,entity:this._entityName});return this._application.executePreparedSearch(a,v,h)}onEzSearchChange(i){var t,l,s,e;const n=o.isEmptySafetyCheck(i.detail),a=null===(t=this.getListConfigValue(this.config))||void 0===t?void 0:t.find((t=>{var l;return(null==t?void 0:t.id)===(null===(l=i.detail)||void 0===l?void 0:l.value)}));n||a||(this.config=Object.assign(Object.assign({},this.config),{value:[...null!==(s=null===(l=this.config)||void 0===l?void 0:l.value)&&void 0!==s?s:[],{id:i.detail.value,check:!0,label:i.detail.label}]}),this.loadListSource(),this.value=this.config.value,this.valueChanged.emit(null===(e=this.config)||void 0===e?void 0:e.value))}getMessage(i,t){var l;return null===(l=this._application)||void 0===l?void 0:l.messagesBuilder.getMessage(i,t)}getListConfigValue(i){var t,l,s,o;return null!==(o=null!==(l=null===(t=i.value)||void 0===t?void 0:t.elements)&&void 0!==l?l:null===(s=null==i?void 0:i.value)||void 0===s?void 0:s.members)&&void 0!==o?o:null==i?void 0:i.value}render(){var i,t,o;const e=1==(null===(i=this.config.props)||void 0===i?void 0:i.useSearchPlus);return l(s,null,l(e?"ez-search-plus":"ez-search",{ref:i=>this._searchElement=i,optionLoader:i=>this.optionLoader(i),label:null===(t=this.config)||void 0===t?void 0:t.label,onEzChange:i=>this.onEzSearchChange(i),suppressEmptyOption:!0,stopPropagateEnterKeyEvent:!0}),(null===(o=this._ezListSource)||void 0===o?void 0:o.length)>0&&l("label",{class:"label"},this.getMessage("snkEntityList.selected")),l("div",{style:this.maxHeightList?{"max-height":this.maxHeightList}:{},class:{"snk-entity-list--overflow":!!this.maxHeightList}},l("ez-list",{ref:i=>this._ezList=i,id:"snkEntityList",listMode:"check",dataSource:this._ezListSource,hoverFeedback:!0,itemSlotBuilder:this.rightListSlotBuilder,onEzCheckChange:i=>this.ezListChangeListener(i)})))}static get watchers(){return{config:["observeConfig"]}}};n.style=".sc-snk-entity-list-h{--snk-entity-list--label--font-size:var(--text--medium, 14px);--snk-entity-list--label--font-family:var(--font-pattern, Arial);--snk-entity-list--label--color:var(--title--primary, #000);--snk-entity-list--label--disabled--color:var(--text--disable, #AFB6C0)}.label.sc-snk-entity-list{flex-shrink:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--snk-entity-list--label--color);font-size:var(--snk-entity-list--label--font-size);font-family:var(--snk-entity-list--label--font-family);cursor:default;padding-left:var(--space--small);padding-bottom:var(--space--extra-small)}.snk-entity-list--overflow.sc-snk-entity-list{overflow:auto}.snk-entity-list--overflow.sc-snk-entity-list::-webkit-scrollbar{width:var(--space--small);min-width:var(--space--small);max-width:var(--space--small)}";export{n as snk_entity_list}
|
@@ -1 +0,0 @@
|
|
1
|
-
export{S as snk_guides_viewer}from"./p-c3bab5f4.js";import"./p-d8d8169b.js";import"@sankhyalabs/core";import"./p-ae2ebab7.js";import"./p-3cdfd7fb.js";import"./p-51209229.js";import"./p-65517fcf.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-9019a32f.js";import"@sankhyalabs/ezui/dist/collection/utils/form";import"./p-1a0caadb.js";import"./p-b987e15d.js";import"./p-0f3698af.js";import"./p-55798617.js";import"./p-7535d592.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"./p-e63cc25f.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"@sankhyalabs/core/dist/dataunit/DataUnit";import"@sankhyalabs/ezui/dist/collection/utils";
|
@@ -1 +0,0 @@
|
|
1
|
-
import{D as t}from"./p-65517fcf.js";import"./p-7535d592.js";import{SortMode as i,ApplicationContext as s,UserInterface as e,DateUtils as r,ObjectUtils as n,StringUtils as o,NumberUtils as l,DataType as a}from"@sankhyalabs/core";import{D as u}from"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import{UserInterface as d}from"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{P as c}from"./p-e63cc25f.js";import"./p-ff1990ad.js";import"./p-51209229.js";import"./p-9019a32f.js";import h from"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";import{h as v}from"./p-d8d8169b.js";import{g as f}from"./p-7dd49d15.js";import{I as m}from"./p-8f3f2306.js";class p{static assertDefaultSorting(t,s){t&&s&&(s.defaultSorting=t.columns.filter((t=>null!=t.ascending)).sort(((t,i)=>t.orderIndex-i.orderIndex)).map((({name:t,ascending:e})=>{const{dataType:r}=s.getField(t);return{field:t,dataType:r,mode:e?i.ASC:i.DESC}})))}static parseCrudResults(t,i){Array.isArray(t)||(t=[t]);const s=[];for(const e of t){let t={fields:new Map};for(let s in e){let r=e[s];if(r.hasOwnProperty("$")&&t.fields.set(s,r.$),i)break}s.push(t)}return s.length>1?s:s[0]}static find(i,e,r,n=!0,o,l){let a=[],u=[],d={},c=s.getContextValue("__SNK__APPLICATION__");if(e){if(!Array.isArray(e))throw new Error(c.messagesBuilder.getMessage("crudUtils.errorArray",null));e.forEach((t=>{a.push({name:t})}))}if(r)for(const t in r)r.hasOwnProperty(t)&&u.push({nome:t,valor:r[t]});o&&(d={expression:{$:o}});let h={requestBody:{entity:{name:i,criterio:u,fields:{field:a},literalCriteria:d,orderby:l}}};return new Promise((i=>{t.get().callServiceBroker("mge@crud.find",JSON.stringify(h)).then((t=>{var s;let e=null===(s=t.entidades)||void 0===s?void 0:s.entidade;e||i(null);const r=this.parseCrudResults(e,n);i(r)}))}))}}class b{setDataUnit(t){this._dataUnit=t}setApplication(t){this._application=t}formatLabel(t,i){const{userInterface:s}=this._dataUnit.getField(t);return s===e.DATETIME?r.formatDate(this._dataUnit.valueFromString(t,i)):String(this._dataUnit.getFormattedValue(t,i))}async getStaticOptions(t,i){return Promise.resolve(null==t?void 0:await c.getDistinct(this._dataUnit,t,null==i?void 0:i.onlyLabel))}fetchData(t,i){return new Promise((s=>{this._application.executeSelectDistinct(this._dataUnit,i,t).then((t=>{s(t.map((t=>this._dataUnit.getField(i).userInterface===e.SEARCH?Object.assign(Object.assign({},JSON.parse(t)),{check:!0}):{value:t,label:this.formatLabel(i,t),check:!0})))}))}))}sortItems(t,i){return h.defaultSorterMultSelectionOption(this._dataUnit,t,i)}}class g{setGrid(t){this._grid||(this._grid=t,this.refreshSelectedRows())}setDataState(t){this._dataState&&n.equals(null==t?void 0:t.metadataByRow,this._dataState.metadataByRow)||(this._dataState=t,this.refreshSelectedRows())}format(t,i,s){var e;if(o.isEmpty(t))return t;const r=null===(e=this._dataState)||void 0===e?void 0:e.metadataByRow.get(s),n=null==r?void 0:r.getProp("rm_precision",i.name);if(n||0===n)return l.format(t,n,n);if(null==i?void 0:i.props){const s=null==i?void 0:i.props.get("precision"),e=null==i?void 0:i.props.get("prettyPrecision");if(void 0!==s&&void 0!==e)return l.format(t,s,e)}return t}refreshSelectedRows(){var t;null===(t=this._grid)||void 0===t||t.refreshSelectedRows()}}class y{constructor(t,i){this.MAX_WIDTH_COD=60,this.MIN_WIDTH_COD=10,this.DEFAULT_FONT_SIZE=13,this.dataUnit=t,this.grid=i}async getColumnsMetadata(){var t;return this.columnsState=await(null===(t=this.grid)||void 0===t?void 0:t.getColumnsState())||[],await this.buildColumnsMetadata(this.columnsState)}getColumnsState(){return this.columnsState}async buildColumnsMetadata(t){var i,s,e;const r=[];for(const n of t){if(n.hidden&&"RECDESP"!==n.name)continue;const t=null===(i=this.dataUnit)||void 0===i?void 0:i.getField(n.name),o=await this.grid.getCustomValueFormatter(n.name),l=(null==t?void 0:t.userInterface)===d.SEARCH,u=l?"Cód. ":n.label;let c,h={id:n.name,label:u,width:l?u.length*this.DEFAULT_FONT_SIZE:n.width,type:null==t?void 0:t.dataType,userInterface:null==t?void 0:t.userInterface,customFormatter:o};if(l&&null!=(null===(s=null==t?void 0:t.properties)||void 0===s?void 0:s.DESCRIPTIONFIELD)){const i=null===(e=null==t?void 0:t.properties)||void 0===e?void 0:e.DESCRIPTIONENTITY,s=t.properties.mergedFrom;c={id:`${s?s+".":""}${t.properties.ENTITYNAME}.${t.properties.DESCRIPTIONFIELD}`,label:i,width:l&&i?i.length*this.DEFAULT_FONT_SIZE-60:n.width,type:a.TEXT,userInterface:d.LONGTEXT,descriptionFrom:t.name};const r=this.getWidthByMetaData(null==n?void 0:n.width,null==h?void 0:h.width,null==c?void 0:c.width);h=Object.assign(Object.assign({},h),{width:null==r?void 0:r.codWidth}),c=Object.assign(Object.assign({},c),{width:null==r?void 0:r.descWidth,label:(null==c?void 0:c.label)||(null==n?void 0:n.label)})}r.push(h),c&&r.push(c)}return r||[]}getWidthByMetaData(t,i,s){const e=i+s,r=s/e;let n=Math.round(t*(i/e)),o=Math.round(t*r);return n>this.MAX_WIDTH_COD?(n=this.MAX_WIDTH_COD,o=t-this.MAX_WIDTH_COD):n<this.MIN_WIDTH_COD&&(n=this.MIN_WIDTH_COD,o=t-this.MIN_WIDTH_COD),{codWidth:n,descWidth:o}}}class w{constructor(t,i,s){this.snkApplication=t,this.keyConfigEnableContinuousInsert=`${i}enableContinuousInsert${s||""}`}handleSaveConfig(t){return this.snkApplication.saveConfig(this.keyConfigEnableContinuousInsert,t)}getConfig(){return this.snkApplication.getConfig(this.keyConfigEnableContinuousInsert).then((t=>!!t&&"true"==t)).catch((()=>!1))}getMessage(t,i){var s,e;return null===(e=null===(s=this.snkApplication)||void 0===s?void 0:s.messagesBuilder)||void 0===e?void 0:e.getMessage(t,i)}actionContinuousInsert(t,i){return{value:o.generateUUID(),label:this.getMessage(t?"continuousInsertUtils.actions.disable":"continuousInsertUtils.actions.enable"),enabled:!0,itemBuilder:()=>v("div",{class:"ez-dropdown__item-wrapper",onClick:i},v("span",{class:"ez-dropdown__item-label"},this.getMessage(t?"continuousInsertUtils.actions.disable":"continuousInsertUtils.actions.enable")))}}}class I extends y{getSelectedNumber(){return this.dataUnit.getSelectionInfo().length}getTotalRecords(){var t,i,s;const{total:e}=(null===(t=this.dataUnit)||void 0===t?void 0:t.getPaginationInfo())||{};return null!=e?e:null===(s=null===(i=this.dataUnit)||void 0===i?void 0:i.records)||void 0===s?void 0:s.length}getSelectedIDs(){return f(this.dataUnit)}getRecordID(){var t,i,s;return null===(s=null===(i=null===(t=this.dataUnit)||void 0===t?void 0:t.records)||void 0===i?void 0:i[0])||void 0===s?void 0:s.__record__id__}async getRecords(t){if(0===this.dataUnit.records.length)return[];switch(t){case m.ALL:return this.dataUnit.getSelectionInfo().getAllRecords();case m.SELECTION:return this.resolveRecordsFromSelection();case m.PAGE:return this.dataUnit.records;default:return this.resolveRecordsFromSelection()}}resolveRecordsFromSelection(){const t=this.dataUnit.getSelectionInfo();if(t.isEmpty())return this.dataUnit.records;const i=t.isAllRecords()?t.getAllRecords():t.records;return i.length?i:this.dataUnit.records}getHiddenOptions(){return[u.EXPORT_BY_EMAIL,u.EXPORT_PDF_TO_EMAIL,u.EXPORT_XLS_TO_EMAIL,u.EXPORT_PAGE_TO_PDF,u.EXPORT_PAGE_TO_XLS]}formatValue(t,i){const{id:s,descriptionFrom:r}=i,n=t[r||s];if(null==n)return"";if(null!=r)return n.label;if(this.dataUnit.getField(s).userInterface===e.SEARCH)return n.value;if(i.customFormatter){const s=this.getColumnsState().find((t=>i.id===t.name));return i.customFormatter.format(n,s,t.__record__id__)}return this.dataUnit.getFormattedValue(s,n)}}export{y as C,g as R,b as S,p as a,w as b,I as c}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as t,c as s,h as i,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as r}from"@sankhyalabs/core";const h=class{constructor(i){t(this,i),this.valueChanged=s(this,"valueChanged",7),this.config=void 0,this.value=void 0}ezChangeListener(t){this.value=t.detail,this.valueChanged.emit(this.value)}componentDidLoad(){this._element&&r.addIDInfo(this._element,"filterContentEditor")}render(){var t;if(this.config)return i("ez-text-input",{id:this.config.id,ref:t=>this._textInputElement=t,label:this.config.label,value:this.config.value,mask:null===(t=this.config)||void 0===t?void 0:t.mask,cleanValueMask:!0})}get _element(){return e(this)}};export{h as snk_filter_text}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as i,c as t,h as s,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as h}from"@sankhyalabs/core";import{F as r}from"./p-ff1990ad.js";import{E as a}from"./p-1a68fb59.js";import{F as l}from"./p-fa80e546.js";const n=class{constructor(s){i(this,s),this.valueChanged=t(this,"valueChanged",7),this._startIntervalLabel="Inicial",this._endIntervalLabel="Final",this._toLabel="até",this.config=void 0,this.getMessage=void 0,this.value=void 0,this.presentationMode=a.CHIP}ezChangeListener(i){if(this.getVariation()===l.INTERVAL){const i=this._startInterval.value,t=this._endInterval.value;return this.value=isNaN(i)&&isNaN(t)?void 0:{start:i,end:t},void this.valueChanged.emit(this.value)}this.value=i.detail,this.valueChanged.emit(this.value)}async show(){this.getVariation()!==l.INTERVAL?this._numberElement.setFocus():this._startInterval.setFocus()}getIntervalValue(i){const t=this.value?this.value[i]:null;return null!=t?t:null}buildLabel(){if(this.presentationMode===a.CHIP)return s("label",{class:"ez-text ez-text--medium ez-text--primary ez-margin--medium"},this._toLabel)}getVariation(){var i,t;return null!==(t=null===(i=this.config.props)||void 0===i?void 0:i.variation)&&void 0!==t?t:l.DEFAULT}componentWillLoad(){this.getMessage&&(this._startIntervalLabel=this.getMessage("snkFilterBar.labelStart"),this._endIntervalLabel=this.getMessage("snkFilterBar.labelEnd"),this._toLabel=this.getMessage("snkFilterBar.labelTo"))}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}render(){var i,t,e;if(this.config&&this.config.type===r.NUMBER)return this.getVariation()===l.INTERVAL?s("div",{class:"ez-col ez-col--nowrap"},s("ez-number-input",{id:`${this.config.id}_start`,class:this.presentationMode===a.MODAL?"ez-padding--small":"",label:this._startIntervalLabel,ref:i=>this._startInterval=i,value:this.getIntervalValue("start"),precision:null===(i=this.config.props)||void 0===i?void 0:i.precision}),this.buildLabel(),s("ez-number-input",{id:`${this.config.id}_end`,class:this.presentationMode===a.MODAL?"ez-padding--small":"",label:this._endIntervalLabel,ref:i=>this._endInterval=i,value:this.getIntervalValue("end"),precision:null===(t=this.config.props)||void 0===t?void 0:t.precision})):s("ez-number-input",{id:this.config.id,ref:i=>this._numberElement=i,label:this.config.label,value:this.config.value,precision:null===(e=this.config.props)||void 0===e?void 0:e.precision})}get _element(){return e(this)}};export{n as snk_filter_number}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as t,c as s,h as i,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as h,ApplicationContext as r}from"@sankhyalabs/core";import{F as o}from"./p-ff1990ad.js";const a=class{constructor(i){t(this,i),this.valueChanged=s(this,"valueChanged",7),this._isSearchPlus=!1,this.config=void 0,this.value=void 0}async ezChangeListener(t){this.value=this._isSearchPlus?await this._searchInput.getValueAsync():this._searchInput.value,this.valueChanged.emit(this.value)}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}doSearch(t,s,i=!1){const e=r.getContextValue("__SNK__APPLICATION__"),h=i?e.executePreparedSearchPlus:e.executePreparedSearch;return new Promise(((i,r)=>{h.bind(e)(t,s,this.config.props.searchContext).then((t=>{i(t)})).catch((t=>{r(t)}))}))}async show(){this._searchInput.setFocus()}getInputItem(){var t;return this._isSearchPlus=1==(null===(t=this.config.props)||void 0===t?void 0:t.useSearchPlus),i(this._isSearchPlus?"ez-search-plus":"ez-search",{id:this.config.id,suppressEmptyOption:!0,value:this.config.value,label:this.config.label,ref:t=>this._searchInput=t,optionLoader:({mode:t,argument:s})=>this.doSearch(t,s,this._isSearchPlus)})}render(){if(this.config&&this.config.type===o.SEARCH)return this.getInputItem()}get _element(){return e(this)}};export{a as snk_filter_search}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as t,c as s,h as i,H as e,g as l}from"./p-d8d8169b.js";import{ElementIDUtils as o}from"@sankhyalabs/core";import{F as h}from"./p-ff1990ad.js";import{E as a}from"./p-1a68fb59.js";const r=class{constructor(i){t(this,i),this.valueChanged=s(this,"valueChanged",7),this._noOptionValue="NO_VALUE",this._radioButtonValue=void 0,this.value=void 0,this.config=void 0,this.presentationMode=a.CHIP}isSelected(t){return null==this.value||this.value===t}ezChangeListener(t){if(this.presentationMode===a.MODAL)return t.detail||this.assertCheckedOption(t.target),void this.updateValue();this.value=t.detail===this._noOptionValue?void 0:t.detail,this._radioButtonValue=t.detail}async resetValues(){this.ezChangeListener({detail:this._noOptionValue})}assertCheckedOption(t){t===this._checkOne?this._checkTwo.value=!0:this._checkOne.value=!0}updateValue(){if(this._checkOne.value&&this._checkTwo.value)this.value=void 0;else{const[t,s]=this.config.props.options;this.value=this._checkOne.value?t.name:s.name}this.valueChanged.emit(this.value)}setRadioValue(){this._radioButtonValue=this.value||this._noOptionValue}componentDidLoad(){this._element&&o.addIDInfo(this._element,"filterContentEditor")}componentWillLoad(){this.setRadioValue()}componentShouldUpdate(){this.setRadioValue()}disconnectedCallback(){this.value=this.config.value}render(){if(!this.config||this.config.type!==h.BINARY_SELECT)return;const[t,s]=this.config.props.options;return i(e,null,this.presentationMode===a.MODAL?i("div",{class:"ez-row ez-size-height--full"},i("label",{class:"ez-text ez-title--small ez-title--primary ez-size-height--full ez-flex ez-flex--row ez-flex--align-items-center ez-col ez-col--sd-4"},this.config.detailModal),i("div",{class:"ez-col ez-col--sd-4"},i("ez-check",{ref:t=>this._checkOne=t,id:`${this.config.id}_${t.name||"option1"}`,class:"sc-snk-filter-bar editor__ez-check",label:t.label,value:this.isSelected(t.name)})),i("div",{class:"ez-col ez-col--sd-4"},i("ez-check",{ref:t=>this._checkTwo=t,id:`${this.config.id}_${s.name||"option2"}`,class:"sc-snk-filter-bar editor__ez-check",label:s.label,value:this.isSelected(s.name)}))):i("ez-radio-button",{value:this._radioButtonValue},i("ez-radio-button-option",{id:`${this.config.id}_${t.name||"option1"}`,class:"sc-snk-filter-bar editor__ez-check",label:t.label,value:t.name}),i("ez-radio-button-option",{id:`${this.config.id}_${s.name||"option2"}`,class:"sc-snk-filter-bar editor__ez-check",label:s.label,value:s.name}),i("ez-radio-button-option",{id:`${this.config.id}_option3`,class:"sc-snk-filter-bar editor__ez-check",label:`${t.label} + ${s.label}`,value:this._noOptionValue})))}get _element(){return l(this)}};export{r as snk_filter_binary_select}
|
@@ -1 +0,0 @@
|
|
1
|
-
import{C as t}from"./p-3cdfd7fb.js";import{ObjectUtils as i,StringUtils as e}from"@sankhyalabs/core";import{F as s}from"./p-51209229.js";import{a as r}from"./p-9019a32f.js";class n{constructor(t,i,e,s){this._resourceID=i,this._configName=t,this._onConfigChange=e,this._dataUnit=s}addFormLegacyConfig(i){this._configName&&t.addFormLegacyConfig(this._configName,i)}async loadConfig(){return new Promise((i=>{t.loadFormConfig(this._configName,this._resourceID).then((t=>{t=this.buildFormMetadataUITabs(t),this.setConfig(t),i(t)})).catch((t=>{console.warn(t)}))}))}getEmptyConfig(){return this.buildFormMetadataUITabs({fields:[],emptyConfig:!0},!0)}saveConfig(e){const s=i.copy(e);return new Promise((i=>{t.saveFormConfig(e,this._configName,this._resourceID).then((t=>{this.setConfig(Object.assign(Object.assign({},s),t)),i(Object.assign(Object.assign({},s),t))}))}))}saveCardState(i,e,s){return new Promise((r=>{var n;const l=(null===(n=this._config)||void 0===n?void 0:n.cardsState)||new Map,o=l.get(i);l.set(i,"fixed"===s?this.updateFixSequence(Object.assign(Object.assign({},o),{fixed:e.fixed}),l):Object.assign(Object.assign({},o),{[s]:e[s]})),t.saveCardState(l,this._configName,this._resourceID).then((t=>{this._config=Object.assign(Object.assign({},this._config),{cardsState:l}),r(t)}))}))}updateFixSequence(t,i){let e=-1;return Array.from(i.values()).forEach((i=>{i.fixed||delete t.fixSequence,null!=i.fixSequence&&(e=Math.max(e,i.fixSequence))})),t.fixed?t.fixSequence=e+1:delete t.fixSequence,t}hasConfig(t){var i;const e=null!=t?t:this._config;return!(!e||!(null===(i=e.fields)||void 0===i?void 0:i.length))}getFieldsList(t,i=!1){var e;const s=null===(e=this._config)||void 0===e?void 0:e.fields;return this.hasConfig()&&!i?s.map((({label:t,name:i,readOnly:e,visible:s,required:r,tab:n,group:l})=>{var o;if(null==t){const t=null===(o=this._dataUnit)||void 0===o?void 0:o.getField(i);if(!t)return;return Object.assign(Object.assign({},t),{name:null!=i?i:t.name,readOnly:null!=e?e:t.readOnly,visible:null!=s?s:t.visible,required:null!=r?r:t.required,tab:n,group:l})}return{name:i,label:t,readOnly:e,visible:s,required:r,tab:n,group:l}})).filter((i=>this.isFieldVisible(i,t))):this._dataUnit?this._dataUnit.metadata.fields.filter((i=>this.isFieldVisible(i,t))).map((({label:t,name:i,readOnly:e,visible:s,required:r,properties:n})=>({label:t,name:i,readOnly:e,visible:s,required:r,tab:null==n?void 0:n.UITabName}))):[]}isFieldVisible(t,i){if(void 0===t||!1===t.visible)return!1;if(null==i)return!0;const s=e.replaceAccentuatedCharsLower((t.label||t.name).toLocaleLowerCase()),r=e.replaceAccentuatedCharsLower(i.toLocaleLowerCase());return s.includes(r)}getFormConfig(t,i,e=!1){let s=this.getFieldsList(void 0,e);return i&&(s=s.filter((i=>{if(t){const e=t.getField(i.name);if(e&&e.readOnly)return!1}return!i.readOnly}))),Object.assign(Object.assign({},this._config),{fields:s})}setConfig(t){this.isLoaded=!0;const{cardsState:i,summary:e,defaultVars:s}=this._config||{};this._config=Object.assign({},t),i&&(this._config.cardsState=i),e&&(this._config.summary=e),s&&(this._config.defaultVars=s),this._onConfigChange&&this._onConfigChange(Object.assign({},this._config))}getConfig(t,i){return this.getFormConfig(t,i)}getFormConfigFetcher(){return null==this._formConfigFetcher&&(this._formConfigFetcher=new s),this._formConfigFetcher}async fetchUserAvailableConfigs(){return null!=this._configName?Promise.resolve(void 0):this.getFormConfigFetcher().fetchUserAvailableConfigs(this._configName,this._resourceID)}async fetchLegacyConfig(){return this.getFormConfigFetcher().fetchLegacyConfig(this._configName,this._resourceID)}async fetchDefaultConfig(){return this.getFormConfigFetcher().fetchDefaultConfig(this._configName,this._resourceID)}parseObjectList(t){return t?Array.isArray(t)?t:[t]:[]}buildFormMetadataUITabs(t,i=!1){var e;const s=this.hasConfig(t);if(!i&&(!this._dataUnit||s))return t;(t=this.getFormConfig(this._dataUnit,!1,!0)).tabs=this.parseObjectList(t.tabs),t.emptyConfig=!1,t.defaultConfiguration=!0;const n=this._dataUnit.metadata.fields;for(const i of n){const s=t.fields.find((t=>t.name===i.name)),n=null===(e=i.properties)||void 0===e?void 0:e.UITabName;n&&n!==r.main&&(t.tabs.some((t=>t.label===n))||t.tabs.push({label:n,name:n,order:0,visible:!0}),s&&(s.tab=n))}return t}}export{n as S}
|