@main-class/componentes 1.18.8 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/arquivo/index.d.ts +6 -4
- package/arquivo/main-class-componentes-arquivo.d.ts +4 -0
- package/arquivo/main-class-componentes-arquivo.metadata.json +1 -0
- package/arquivo/package.json +11 -0
- package/arquivo/{download-arquivo.directive.d.ts → src/download-arquivo.directive.d.ts} +1 -1
- package/{core/imagem → arquivo/src}/imagem.directive.d.ts +1 -1
- package/arquivo/{preview-arquivo → src/preview-arquivo}/dialog-preview-arquivo/dialog-preview-arquivo.component.d.ts +1 -1
- package/arquivo/{preview-arquivo → src/preview-arquivo}/preview-arquivo.component.d.ts +1 -1
- package/bundles/main-class-componentes-arquivo.umd.js +687 -0
- package/bundles/main-class-componentes-arquivo.umd.js.map +1 -0
- package/bundles/main-class-componentes-arquivo.umd.min.js +16 -0
- package/bundles/main-class-componentes-arquivo.umd.min.js.map +1 -0
- package/bundles/main-class-componentes-core.umd.js +252 -0
- package/bundles/main-class-componentes-core.umd.js.map +1 -0
- package/bundles/main-class-componentes-core.umd.min.js +2 -0
- package/bundles/main-class-componentes-core.umd.min.js.map +1 -0
- package/bundles/main-class-componentes-crud.umd.js +543 -0
- package/bundles/main-class-componentes-crud.umd.js.map +1 -0
- package/bundles/main-class-componentes-crud.umd.min.js +16 -0
- package/bundles/main-class-componentes-crud.umd.min.js.map +1 -0
- package/bundles/main-class-componentes-date.umd.js +185 -0
- package/bundles/main-class-componentes-date.umd.js.map +1 -0
- package/bundles/main-class-componentes-date.umd.min.js +2 -0
- package/bundles/main-class-componentes-date.umd.min.js.map +1 -0
- package/bundles/main-class-componentes-dialog.umd.js +206 -0
- package/bundles/main-class-componentes-dialog.umd.js.map +1 -0
- package/bundles/main-class-componentes-dialog.umd.min.js +2 -0
- package/bundles/main-class-componentes-dialog.umd.min.js.map +1 -0
- package/bundles/main-class-componentes-form.umd.js +211 -0
- package/bundles/main-class-componentes-form.umd.js.map +1 -0
- package/bundles/main-class-componentes-form.umd.min.js +2 -0
- package/bundles/main-class-componentes-form.umd.min.js.map +1 -0
- package/bundles/main-class-componentes-input.umd.js +2244 -0
- package/bundles/main-class-componentes-input.umd.js.map +1 -0
- package/bundles/main-class-componentes-input.umd.min.js +17 -0
- package/bundles/main-class-componentes-input.umd.min.js.map +1 -0
- package/bundles/main-class-componentes-loader.umd.js +233 -0
- package/bundles/main-class-componentes-loader.umd.js.map +1 -0
- package/bundles/main-class-componentes-loader.umd.min.js +2 -0
- package/bundles/main-class-componentes-loader.umd.min.js.map +1 -0
- package/bundles/main-class-componentes-misc.umd.js +1122 -0
- package/bundles/main-class-componentes-misc.umd.js.map +1 -0
- package/bundles/main-class-componentes-misc.umd.min.js +16 -0
- package/bundles/main-class-componentes-misc.umd.min.js.map +1 -0
- package/bundles/main-class-componentes-model.umd.js +196 -0
- package/bundles/main-class-componentes-model.umd.js.map +1 -0
- package/bundles/main-class-componentes-model.umd.min.js +2 -0
- package/bundles/main-class-componentes-model.umd.min.js.map +1 -0
- package/bundles/main-class-componentes-pipe.umd.js +55 -0
- package/bundles/main-class-componentes-pipe.umd.js.map +1 -0
- package/bundles/main-class-componentes-pipe.umd.min.js +2 -0
- package/bundles/main-class-componentes-pipe.umd.min.js.map +1 -0
- package/bundles/main-class-componentes-scroll.umd.js +106 -0
- package/bundles/main-class-componentes-scroll.umd.js.map +1 -0
- package/bundles/main-class-componentes-scroll.umd.min.js +2 -0
- package/bundles/main-class-componentes-scroll.umd.min.js.map +1 -0
- package/bundles/main-class-componentes-table.umd.js +787 -0
- package/bundles/main-class-componentes-table.umd.js.map +1 -0
- package/bundles/main-class-componentes-table.umd.min.js +17 -0
- package/bundles/main-class-componentes-table.umd.min.js.map +1 -0
- package/bundles/main-class-componentes-util.umd.js +31 -0
- package/bundles/main-class-componentes-util.umd.js.map +1 -0
- package/bundles/main-class-componentes-util.umd.min.js +2 -0
- package/bundles/main-class-componentes-util.umd.min.js.map +1 -0
- package/bundles/main-class-componentes.umd.js +13 -5511
- package/bundles/main-class-componentes.umd.js.map +1 -1
- package/bundles/main-class-componentes.umd.min.js +1 -1
- package/bundles/main-class-componentes.umd.min.js.map +1 -1
- package/core/index.d.ts +5 -14
- package/core/main-class-componentes-core.d.ts +4 -0
- package/core/main-class-componentes-core.metadata.json +1 -0
- package/core/package.json +11 -0
- package/core/src/core.module.d.ts +4 -0
- package/core/{mensageria → src/mensageria}/mensageria.service.d.ts +1 -2
- package/crud/index.d.ts +4 -5
- package/crud/main-class-componentes-crud.d.ts +4 -0
- package/crud/main-class-componentes-crud.metadata.json +1 -0
- package/crud/package.json +11 -0
- package/crud/{abstract-consulta-component.d.ts → src/abstract-consulta-component.d.ts} +3 -2
- package/crud/{abstract-consulta-paginada-component.d.ts → src/abstract-consulta-paginada-component.d.ts} +3 -2
- package/crud/{abstract-edicao-component.d.ts → src/abstract-edicao-component.d.ts} +2 -1
- package/crud/{abstract-edicao-modal-component.d.ts → src/abstract-edicao-modal-component.d.ts} +3 -1
- package/date/index.d.ts +3 -3
- package/date/main-class-componentes-date.d.ts +4 -0
- package/date/main-class-componentes-date.metadata.json +1 -0
- package/date/package.json +11 -0
- package/dialog/index.d.ts +4 -0
- package/dialog/main-class-componentes-dialog.d.ts +4 -0
- package/dialog/main-class-componentes-dialog.metadata.json +1 -0
- package/dialog/package.json +11 -0
- package/dialog/src/dialog.module.d.ts +2 -0
- package/esm2015/arquivo/index.js +7 -5
- package/esm2015/arquivo/main-class-componentes-arquivo.js +5 -0
- package/esm2015/arquivo/src/arquivo-manager.service.js +3 -0
- package/esm2015/arquivo/src/arquivo.module.js +30 -0
- package/esm2015/arquivo/src/download-arquivo.directive.js +44 -0
- package/esm2015/arquivo/src/imagem.directive.js +80 -0
- package/esm2015/arquivo/src/preview-arquivo/dialog-preview-arquivo/dialog-preview-arquivo.component.js +56 -0
- package/esm2015/arquivo/src/preview-arquivo/preview-arquivo.component.js +136 -0
- package/esm2015/core/index.js +6 -15
- package/esm2015/core/main-class-componentes-core.js +5 -0
- package/esm2015/core/src/core.module.js +27 -0
- package/esm2015/core/src/criptografia/criptografia.service.js +13 -0
- package/esm2015/core/src/mensageria/mensageria.service.js +48 -0
- package/esm2015/core/src/mobile/mobile.service.js +45 -0
- package/esm2015/core/src/validator/valida-modulo11.service.js +92 -0
- package/esm2015/crud/index.js +5 -6
- package/esm2015/crud/main-class-componentes-crud.js +5 -0
- package/esm2015/crud/src/abstract-consulta-component.js +60 -0
- package/esm2015/crud/src/abstract-consulta-paginada-component.js +48 -0
- package/esm2015/crud/src/abstract-edicao-component.js +29 -0
- package/esm2015/crud/src/abstract-edicao-modal-component.js +24 -0
- package/esm2015/date/index.js +4 -4
- package/esm2015/date/main-class-componentes-date.js +5 -0
- package/esm2015/date/src/date.module.js +19 -0
- package/esm2015/date/src/validator/data-validator.directive.js +97 -0
- package/esm2015/date/src/validator/futuro.directive.js +26 -0
- package/esm2015/dialog/index.js +5 -0
- package/esm2015/dialog/main-class-componentes-dialog.js +5 -0
- package/esm2015/dialog/src/dialog-confirmacao/dialog-confirmacao.component.js +40 -0
- package/esm2015/dialog/src/dialog-iframe/dialog-iframe.component.js +59 -0
- package/esm2015/dialog/src/dialog.module.js +28 -0
- package/esm2015/dialog/src/dialog.service.js +55 -0
- package/esm2015/form/index.js +5 -5
- package/esm2015/form/main-class-componentes-form.js +5 -0
- package/esm2015/form/src/form.component.js +103 -0
- package/esm2015/form/src/form.module.js +25 -0
- package/esm2015/form/src/mensagens-erro/mensagens-erro.component.js +31 -0
- package/esm2015/form/src/single-click.directive.js +35 -0
- package/esm2015/input/index.js +22 -22
- package/esm2015/input/main-class-componentes-input.js +6 -0
- package/esm2015/input/src/abstract-mat-form-field-control.js +110 -0
- package/esm2015/input/src/input-datetime/input-datetime.component.js +114 -0
- package/esm2015/input/{input-datetime → src/input-datetime}/input-datetime.module.js +3 -3
- package/esm2015/input/src/input-fileupload/input-fileupload.component.js +324 -0
- package/esm2015/input/src/input-fileupload/input-fileupload.directive.js +34 -0
- package/esm2015/input/src/input-fileupload/input-fileupload.module.js +34 -0
- package/esm2015/input/src/input-telefone-internacional/input-telefone-internacional-validator.directive.js +22 -0
- package/esm2015/input/src/input-telefone-internacional/input-telefone-internacional.component.js +66 -0
- package/esm2015/input/src/input-telefone-internacional/input-telefone-internacional.module.js +23 -0
- package/esm2015/input/src/option-checkbox/all-option-checkbox.component.js +36 -0
- package/esm2015/input/src/option-checkbox/node-pool.js +93 -0
- package/esm2015/input/src/option-checkbox/option-checkbox-group.component.js +71 -0
- package/esm2015/input/src/option-checkbox/option-checkbox.component.js +59 -0
- package/esm2015/input/src/option-checkbox/option-checkbox.module.js +23 -0
- package/esm2015/input/src/option-checkbox/option-checkbox.service.js +52 -0
- package/esm2015/input/src/option-checkbox/option-node.js +24 -0
- package/esm2015/input/src/select-chips/select-chips.component.js +177 -0
- package/esm2015/input/src/select-chips/select-chips.module.js +25 -0
- package/esm2015/input/src/select-item/select-item.component.js +20 -0
- package/esm2015/input/src/select-item/select-item.module.js +15 -0
- package/esm2015/input/src/select-many-checkbox/select-many-checkbox.component.js +150 -0
- package/esm2015/input/src/select-many-checkbox/select-many-checkbox.module.js +21 -0
- package/esm2015/input/src/select-radio/select-radio.component.js +124 -0
- package/esm2015/input/src/select-radio/select-radio.module.js +21 -0
- package/esm2015/loader/index.js +4 -0
- package/esm2015/loader/main-class-componentes-loader.js +5 -0
- package/esm2015/loader/src/loader.component.js +112 -0
- package/esm2015/loader/src/loader.module.js +21 -0
- package/esm2015/loader/src/loader.service.js +70 -0
- package/esm2015/misc/index.js +27 -27
- package/esm2015/misc/main-class-componentes-misc.js +5 -0
- package/esm2015/misc/src/cnpj/cnpj-model.directive.js +13 -0
- package/esm2015/misc/src/cnpj/cnpj.directive.js +31 -0
- package/esm2015/misc/src/cnpj/cnpj.module.js +19 -0
- package/esm2015/misc/src/cnpj/cnpjs.pipe.js +15 -0
- package/esm2015/misc/src/cpf/cpf-model.directive.js +13 -0
- package/esm2015/misc/src/cpf/cpf.directive.js +31 -0
- package/esm2015/misc/src/cpf/cpf.module.js +19 -0
- package/esm2015/misc/src/cpf/cpf.pipe.js +15 -0
- package/esm2015/misc/src/cpf-cnpj/cpf-cnpj-model.directive.js +25 -0
- package/esm2015/misc/src/cpf-cnpj/cpf-cnpj.directive.js +32 -0
- package/esm2015/misc/src/cpf-cnpj/cpf-cnpj.module.js +19 -0
- package/esm2015/misc/src/cpf-cnpj/cpf-cnpj.pipe.js +18 -0
- package/esm2015/misc/{info → src/info}/info.component.js +1 -1
- package/esm2015/misc/src/info/info.module.js +17 -0
- package/esm2015/misc/src/monetario/monetario-mask.js +34 -0
- package/esm2015/misc/src/monetario/monetario-model.directive.js +124 -0
- package/esm2015/misc/src/monetario/monetario.module.js +16 -0
- package/esm2015/misc/src/monetario/monetario.pipe.js +13 -0
- package/esm2015/misc/src/porcentagem/porcentagem-mask.js +34 -0
- package/esm2015/misc/src/porcentagem/porcentagem-model.directive.js +99 -0
- package/esm2015/misc/src/porcentagem/porcentagem.module.js +16 -0
- package/esm2015/misc/src/porcentagem/porcentagem.pipe.js +13 -0
- package/esm2015/misc/src/telefone/telefone-model.directive.js +25 -0
- package/esm2015/misc/src/telefone/telefone.module.js +18 -0
- package/esm2015/misc/src/telefone/telefone.pipe.js +33 -0
- package/esm2015/misc/src/unsafe-inner-html/unsafe-inner-html.directive.js +23 -0
- package/esm2015/misc/src/unsafe-inner-html/unsafe-inner-html.module.js +15 -0
- package/esm2015/model/index.js +3 -0
- package/esm2015/model/main-class-componentes-model.js +5 -0
- package/esm2015/model/src/masked-model.directive.js +149 -0
- package/esm2015/model/src/model.module.js +19 -0
- package/esm2015/pipe/index.js +3 -0
- package/esm2015/pipe/main-class-componentes-pipe.js +5 -0
- package/esm2015/pipe/src/nome-resumido.pipe.js +16 -0
- package/esm2015/pipe/src/pipe.module.js +16 -0
- package/esm2015/public-api.js +2 -11
- package/esm2015/scroll/index.js +3 -3
- package/esm2015/scroll/main-class-componentes-scroll.js +5 -0
- package/esm2015/scroll/src/scroll-container/scroll-container.component.js +69 -0
- package/esm2015/scroll/src/scroll.module.js +17 -0
- package/esm2015/table/index.js +12 -12
- package/esm2015/table/main-class-componentes-table.js +6 -0
- package/esm2015/table/src/column/column-cell.directive.js +15 -0
- package/esm2015/table/src/column/column-footer.directive.js +15 -0
- package/esm2015/table/src/column/column-header.directive.js +15 -0
- package/esm2015/table/src/column/column.directive.js +28 -0
- package/esm2015/table/src/infinite-table/infinite-table.component.js +92 -0
- package/esm2015/table/src/paginated-table/paginated-table.component.js +43 -0
- package/esm2015/table/{paginator → src/paginator}/paginator.component.js +1 -1
- package/esm2015/table/src/paginator-i18n.js +23 -0
- package/esm2015/table/src/table/table.component.js +119 -0
- package/esm2015/table/src/table.module.js +74 -0
- package/esm2015/table/src/td/td.component.js +19 -0
- package/esm2015/table/src/th/th.component.js +19 -0
- package/esm2015/util/index.js +2 -2
- package/esm2015/util/main-class-componentes-util.js +5 -0
- package/esm2015/util/src/string.util.js +12 -0
- package/fesm2015/main-class-componentes-arquivo.js +338 -0
- package/fesm2015/main-class-componentes-arquivo.js.map +1 -0
- package/fesm2015/main-class-componentes-core.js +219 -0
- package/fesm2015/main-class-componentes-core.js.map +1 -0
- package/fesm2015/main-class-componentes-crud.js +162 -0
- package/fesm2015/main-class-componentes-crud.js.map +1 -0
- package/fesm2015/main-class-componentes-date.js +143 -0
- package/fesm2015/main-class-componentes-date.js.map +1 -0
- package/fesm2015/main-class-componentes-dialog.js +177 -0
- package/fesm2015/main-class-componentes-dialog.js.map +1 -0
- package/fesm2015/main-class-componentes-form.js +191 -0
- package/fesm2015/main-class-componentes-form.js.map +1 -0
- package/fesm2015/main-class-componentes-input.js +1604 -0
- package/fesm2015/main-class-componentes-input.js.map +1 -0
- package/fesm2015/main-class-componentes-loader.js +206 -0
- package/fesm2015/main-class-componentes-loader.js.map +1 -0
- package/fesm2015/main-class-componentes-misc.js +688 -0
- package/fesm2015/main-class-componentes-misc.js.map +1 -0
- package/fesm2015/main-class-componentes-model.js +173 -0
- package/fesm2015/main-class-componentes-model.js.map +1 -0
- package/fesm2015/main-class-componentes-pipe.js +37 -0
- package/fesm2015/main-class-componentes-pipe.js.map +1 -0
- package/fesm2015/main-class-componentes-scroll.js +91 -0
- package/fesm2015/main-class-componentes-scroll.js.map +1 -0
- package/fesm2015/main-class-componentes-table.js +446 -0
- package/fesm2015/main-class-componentes-table.js.map +1 -0
- package/fesm2015/main-class-componentes-util.js +18 -0
- package/fesm2015/main-class-componentes-util.js.map +1 -0
- package/fesm2015/main-class-componentes.js +1 -4308
- package/fesm2015/main-class-componentes.js.map +1 -1
- package/form/index.d.ts +4 -4
- package/form/main-class-componentes-form.d.ts +4 -0
- package/form/main-class-componentes-form.metadata.json +1 -0
- package/form/package.json +11 -0
- package/input/index.d.ts +21 -21
- package/input/main-class-componentes-input.d.ts +5 -0
- package/input/main-class-componentes-input.metadata.json +1 -0
- package/input/package.json +11 -0
- package/input/{input-fileupload → src/input-fileupload}/input-fileupload.component.d.ts +2 -2
- package/loader/index.d.ts +3 -0
- package/loader/main-class-componentes-loader.d.ts +4 -0
- package/loader/main-class-componentes-loader.metadata.json +1 -0
- package/loader/package.json +11 -0
- package/{core/loader → loader/src}/loader.component.d.ts +1 -1
- package/loader/src/loader.module.d.ts +2 -0
- package/main-class-componentes.metadata.json +1 -1
- package/misc/index.d.ts +26 -26
- package/misc/main-class-componentes-misc.d.ts +4 -0
- package/misc/main-class-componentes-misc.metadata.json +1 -0
- package/misc/package.json +11 -0
- package/misc/{cnpj → src/cnpj}/cnpj-model.directive.d.ts +1 -1
- package/misc/{cnpj → src/cnpj}/cnpj.directive.d.ts +1 -1
- package/misc/{cpf → src/cpf}/cpf-model.directive.d.ts +1 -1
- package/misc/{cpf → src/cpf}/cpf.directive.d.ts +1 -1
- package/misc/{cpf-cnpj → src/cpf-cnpj}/cpf-cnpj-model.directive.d.ts +1 -1
- package/misc/{cpf-cnpj → src/cpf-cnpj}/cpf-cnpj.directive.d.ts +1 -1
- package/misc/{telefone → src/telefone}/telefone-model.directive.d.ts +1 -1
- package/model/index.d.ts +2 -0
- package/model/main-class-componentes-model.d.ts +4 -0
- package/model/main-class-componentes-model.metadata.json +1 -0
- package/model/package.json +11 -0
- package/model/src/model.module.d.ts +2 -0
- package/package.json +1 -1
- package/pipe/index.d.ts +2 -0
- package/pipe/main-class-componentes-pipe.d.ts +4 -0
- package/pipe/main-class-componentes-pipe.metadata.json +1 -0
- package/pipe/package.json +11 -0
- package/pipe/src/pipe.module.d.ts +2 -0
- package/public-api.d.ts +2 -10
- package/scroll/index.d.ts +2 -2
- package/scroll/main-class-componentes-scroll.d.ts +4 -0
- package/scroll/main-class-componentes-scroll.metadata.json +1 -0
- package/scroll/package.json +11 -0
- package/table/index.d.ts +11 -11
- package/table/main-class-componentes-table.d.ts +5 -0
- package/table/main-class-componentes-table.metadata.json +1 -0
- package/table/package.json +11 -0
- package/table/{infinite-table → src/infinite-table}/infinite-table.component.d.ts +2 -1
- package/table/{paginated-table → src/paginated-table}/paginated-table.component.d.ts +2 -2
- package/table/{table → src/table}/table.component.d.ts +1 -1
- package/util/index.d.ts +1 -1
- package/util/main-class-componentes-util.d.ts +4 -0
- package/util/main-class-componentes-util.metadata.json +1 -0
- package/util/package.json +11 -0
- package/core/componentes.module.d.ts +0 -4
- package/crud/crud.module.d.ts +0 -2
- package/esm2015/arquivo/arquivo.module.js +0 -29
- package/esm2015/arquivo/download-arquivo.directive.js +0 -44
- package/esm2015/arquivo/preview-arquivo/dialog-preview-arquivo/dialog-preview-arquivo.component.js +0 -56
- package/esm2015/arquivo/preview-arquivo/preview-arquivo.component.js +0 -136
- package/esm2015/core/arquivo/arquivo-manager.service.js +0 -3
- package/esm2015/core/componentes.module.js +0 -65
- package/esm2015/core/criptografia/criptografia.service.js +0 -13
- package/esm2015/core/dialog/dialog-confirmacao/dialog-confirmacao.component.js +0 -40
- package/esm2015/core/dialog/dialog-iframe/dialog-iframe.component.js +0 -59
- package/esm2015/core/dialog/dialog.service.js +0 -56
- package/esm2015/core/form/model/masked-model.directive.js +0 -149
- package/esm2015/core/form/validator/valida-modulo11.service.js +0 -92
- package/esm2015/core/imagem/imagem.directive.js +0 -80
- package/esm2015/core/loader/loader.component.js +0 -112
- package/esm2015/core/loader/loader.service.js +0 -70
- package/esm2015/core/mensageria/mensageria.service.js +0 -49
- package/esm2015/core/mobile/mobile.service.js +0 -46
- package/esm2015/core/pipe/nome-resumido.pipe.js +0 -16
- package/esm2015/crud/abstract-consulta-component.js +0 -60
- package/esm2015/crud/abstract-consulta-paginada-component.js +0 -48
- package/esm2015/crud/abstract-edicao-component.js +0 -29
- package/esm2015/crud/abstract-edicao-modal-component.js +0 -24
- package/esm2015/crud/crud.module.js +0 -14
- package/esm2015/date/date.module.js +0 -19
- package/esm2015/date/validator/data-validator.directive.js +0 -96
- package/esm2015/date/validator/futuro.directive.js +0 -26
- package/esm2015/form/form.component.js +0 -103
- package/esm2015/form/form.module.js +0 -25
- package/esm2015/form/mensagens-erro/mensagens-erro.component.js +0 -31
- package/esm2015/form/single-click.directive.js +0 -35
- package/esm2015/input/abstract-mat-form-field-control.js +0 -110
- package/esm2015/input/input-datetime/input-datetime.component.js +0 -114
- package/esm2015/input/input-fileupload/input-fileupload.component.js +0 -324
- package/esm2015/input/input-fileupload/input-fileupload.directive.js +0 -34
- package/esm2015/input/input-fileupload/input-fileupload.module.js +0 -34
- package/esm2015/input/input-telefone-internacional/input-telefone-internacional-validator.directive.js +0 -22
- package/esm2015/input/input-telefone-internacional/input-telefone-internacional.component.js +0 -66
- package/esm2015/input/input-telefone-internacional/input-telefone-internacional.module.js +0 -23
- package/esm2015/input/option-checkbox/all-option-checkbox.component.js +0 -36
- package/esm2015/input/option-checkbox/node-pool.js +0 -93
- package/esm2015/input/option-checkbox/option-checkbox-group.component.js +0 -71
- package/esm2015/input/option-checkbox/option-checkbox.component.js +0 -59
- package/esm2015/input/option-checkbox/option-checkbox.module.js +0 -23
- package/esm2015/input/option-checkbox/option-checkbox.service.js +0 -52
- package/esm2015/input/option-checkbox/option-node.js +0 -24
- package/esm2015/input/select-chips/select-chips.component.js +0 -177
- package/esm2015/input/select-chips/select-chips.module.js +0 -25
- package/esm2015/input/select-item/select-item.component.js +0 -20
- package/esm2015/input/select-item/select-item.module.js +0 -15
- package/esm2015/input/select-many-checkbox/select-many-checkbox.component.js +0 -150
- package/esm2015/input/select-many-checkbox/select-many-checkbox.module.js +0 -21
- package/esm2015/input/select-radio/select-radio.component.js +0 -124
- package/esm2015/input/select-radio/select-radio.module.js +0 -21
- package/esm2015/misc/cnpj/cnpj-model.directive.js +0 -13
- package/esm2015/misc/cnpj/cnpj.directive.js +0 -31
- package/esm2015/misc/cnpj/cnpj.module.js +0 -19
- package/esm2015/misc/cnpj/cnpjs.pipe.js +0 -15
- package/esm2015/misc/cpf/cpf-model.directive.js +0 -13
- package/esm2015/misc/cpf/cpf.directive.js +0 -31
- package/esm2015/misc/cpf/cpf.module.js +0 -19
- package/esm2015/misc/cpf/cpf.pipe.js +0 -15
- package/esm2015/misc/cpf-cnpj/cpf-cnpj-model.directive.js +0 -25
- package/esm2015/misc/cpf-cnpj/cpf-cnpj.directive.js +0 -32
- package/esm2015/misc/cpf-cnpj/cpf-cnpj.module.js +0 -19
- package/esm2015/misc/cpf-cnpj/cpf-cnpj.pipe.js +0 -18
- package/esm2015/misc/info/info.module.js +0 -17
- package/esm2015/misc/monetario/monetario-mask.js +0 -34
- package/esm2015/misc/monetario/monetario-model.directive.js +0 -124
- package/esm2015/misc/monetario/monetario.module.js +0 -16
- package/esm2015/misc/monetario/monetario.pipe.js +0 -13
- package/esm2015/misc/porcentagem/porcentagem-mask.js +0 -34
- package/esm2015/misc/porcentagem/porcentagem-model.directive.js +0 -99
- package/esm2015/misc/porcentagem/porcentagem.module.js +0 -16
- package/esm2015/misc/porcentagem/porcentagem.pipe.js +0 -13
- package/esm2015/misc/telefone/telefone-model.directive.js +0 -25
- package/esm2015/misc/telefone/telefone.module.js +0 -18
- package/esm2015/misc/telefone/telefone.pipe.js +0 -33
- package/esm2015/misc/unsafe-inner-html/unsafe-inner-html.directive.js +0 -23
- package/esm2015/misc/unsafe-inner-html/unsafe-inner-html.module.js +0 -15
- package/esm2015/scroll/scroll-container/scroll-container.component.js +0 -69
- package/esm2015/scroll/scroll.module.js +0 -17
- package/esm2015/table/column/column-cell.directive.js +0 -15
- package/esm2015/table/column/column-footer.directive.js +0 -15
- package/esm2015/table/column/column-header.directive.js +0 -15
- package/esm2015/table/column/column.directive.js +0 -28
- package/esm2015/table/infinite-table/infinite-table.component.js +0 -91
- package/esm2015/table/paginated-table/paginated-table.component.js +0 -43
- package/esm2015/table/paginator-i18n.js +0 -23
- package/esm2015/table/table/table.component.js +0 -119
- package/esm2015/table/table.module.js +0 -74
- package/esm2015/table/td/td.component.js +0 -19
- package/esm2015/table/th/th.component.js +0 -19
- package/esm2015/util/string.util.js +0 -12
- /package/{core/arquivo → arquivo/src}/arquivo-manager.service.d.ts +0 -0
- /package/arquivo/{arquivo.module.d.ts → src/arquivo.module.d.ts} +0 -0
- /package/core/{criptografia → src/criptografia}/criptografia.service.d.ts +0 -0
- /package/core/{mobile → src/mobile}/mobile.service.d.ts +0 -0
- /package/core/{form → src}/validator/valida-modulo11.service.d.ts +0 -0
- /package/date/{date.module.d.ts → src/date.module.d.ts} +0 -0
- /package/date/{validator → src/validator}/data-validator.directive.d.ts +0 -0
- /package/date/{validator → src/validator}/futuro.directive.d.ts +0 -0
- /package/{core/dialog → dialog/src}/dialog-confirmacao/dialog-confirmacao.component.d.ts +0 -0
- /package/{core/dialog → dialog/src}/dialog-iframe/dialog-iframe.component.d.ts +0 -0
- /package/{core/dialog → dialog/src}/dialog.service.d.ts +0 -0
- /package/form/{form.component.d.ts → src/form.component.d.ts} +0 -0
- /package/form/{form.module.d.ts → src/form.module.d.ts} +0 -0
- /package/form/{mensagens-erro → src/mensagens-erro}/mensagens-erro.component.d.ts +0 -0
- /package/form/{single-click.directive.d.ts → src/single-click.directive.d.ts} +0 -0
- /package/input/{abstract-mat-form-field-control.d.ts → src/abstract-mat-form-field-control.d.ts} +0 -0
- /package/input/{input-datetime → src/input-datetime}/input-datetime.component.d.ts +0 -0
- /package/input/{input-datetime → src/input-datetime}/input-datetime.module.d.ts +0 -0
- /package/input/{input-fileupload → src/input-fileupload}/input-fileupload.directive.d.ts +0 -0
- /package/input/{input-fileupload → src/input-fileupload}/input-fileupload.module.d.ts +0 -0
- /package/input/{input-telefone-internacional → src/input-telefone-internacional}/input-telefone-internacional-validator.directive.d.ts +0 -0
- /package/input/{input-telefone-internacional → src/input-telefone-internacional}/input-telefone-internacional.component.d.ts +0 -0
- /package/input/{input-telefone-internacional → src/input-telefone-internacional}/input-telefone-internacional.module.d.ts +0 -0
- /package/input/{option-checkbox → src/option-checkbox}/all-option-checkbox.component.d.ts +0 -0
- /package/input/{option-checkbox → src/option-checkbox}/node-pool.d.ts +0 -0
- /package/input/{option-checkbox → src/option-checkbox}/option-checkbox-group.component.d.ts +0 -0
- /package/input/{option-checkbox → src/option-checkbox}/option-checkbox.component.d.ts +0 -0
- /package/input/{option-checkbox → src/option-checkbox}/option-checkbox.module.d.ts +0 -0
- /package/input/{option-checkbox → src/option-checkbox}/option-checkbox.service.d.ts +0 -0
- /package/input/{option-checkbox → src/option-checkbox}/option-node.d.ts +0 -0
- /package/input/{select-chips → src/select-chips}/select-chips.component.d.ts +0 -0
- /package/input/{select-chips → src/select-chips}/select-chips.module.d.ts +0 -0
- /package/input/{select-item → src/select-item}/select-item.component.d.ts +0 -0
- /package/input/{select-item → src/select-item}/select-item.module.d.ts +0 -0
- /package/input/{select-many-checkbox → src/select-many-checkbox}/select-many-checkbox.component.d.ts +0 -0
- /package/input/{select-many-checkbox → src/select-many-checkbox}/select-many-checkbox.module.d.ts +0 -0
- /package/input/{select-radio → src/select-radio}/select-radio.component.d.ts +0 -0
- /package/input/{select-radio → src/select-radio}/select-radio.module.d.ts +0 -0
- /package/{core/loader → loader/src}/loader.service.d.ts +0 -0
- /package/misc/{cnpj → src/cnpj}/cnpj.module.d.ts +0 -0
- /package/misc/{cnpj → src/cnpj}/cnpjs.pipe.d.ts +0 -0
- /package/misc/{cpf → src/cpf}/cpf.module.d.ts +0 -0
- /package/misc/{cpf → src/cpf}/cpf.pipe.d.ts +0 -0
- /package/misc/{cpf-cnpj → src/cpf-cnpj}/cpf-cnpj.module.d.ts +0 -0
- /package/misc/{cpf-cnpj → src/cpf-cnpj}/cpf-cnpj.pipe.d.ts +0 -0
- /package/misc/{info → src/info}/info.component.d.ts +0 -0
- /package/misc/{info → src/info}/info.module.d.ts +0 -0
- /package/misc/{monetario → src/monetario}/monetario-mask.d.ts +0 -0
- /package/misc/{monetario → src/monetario}/monetario-model.directive.d.ts +0 -0
- /package/misc/{monetario → src/monetario}/monetario.module.d.ts +0 -0
- /package/misc/{monetario → src/monetario}/monetario.pipe.d.ts +0 -0
- /package/misc/{porcentagem → src/porcentagem}/porcentagem-mask.d.ts +0 -0
- /package/misc/{porcentagem → src/porcentagem}/porcentagem-model.directive.d.ts +0 -0
- /package/misc/{porcentagem → src/porcentagem}/porcentagem.module.d.ts +0 -0
- /package/misc/{porcentagem → src/porcentagem}/porcentagem.pipe.d.ts +0 -0
- /package/misc/{telefone → src/telefone}/telefone.module.d.ts +0 -0
- /package/misc/{telefone → src/telefone}/telefone.pipe.d.ts +0 -0
- /package/misc/{unsafe-inner-html → src/unsafe-inner-html}/unsafe-inner-html.directive.d.ts +0 -0
- /package/misc/{unsafe-inner-html → src/unsafe-inner-html}/unsafe-inner-html.module.d.ts +0 -0
- /package/{core/form/model → model/src}/masked-model.directive.d.ts +0 -0
- /package/{core/pipe → pipe/src}/nome-resumido.pipe.d.ts +0 -0
- /package/scroll/{scroll-container → src/scroll-container}/scroll-container.component.d.ts +0 -0
- /package/scroll/{scroll.module.d.ts → src/scroll.module.d.ts} +0 -0
- /package/table/{column → src/column}/column-cell.directive.d.ts +0 -0
- /package/table/{column → src/column}/column-footer.directive.d.ts +0 -0
- /package/table/{column → src/column}/column-header.directive.d.ts +0 -0
- /package/table/{column → src/column}/column.directive.d.ts +0 -0
- /package/table/{paginator → src/paginator}/paginator.component.d.ts +0 -0
- /package/table/{paginator-i18n.d.ts → src/paginator-i18n.d.ts} +0 -0
- /package/table/{table.module.d.ts → src/table.module.d.ts} +0 -0
- /package/table/{td → src/td}/td.component.d.ts +0 -0
- /package/table/{th → src/th}/th.component.d.ts +0 -0
- /package/util/{string.util.d.ts → src/string.util.d.ts} +0 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { Component, Inject, ViewChild, NgModule, ɵɵdefineInjectable, ɵɵinject, Injectable } from '@angular/core';
|
|
2
|
+
import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule, MatDialog } from '@angular/material/dialog';
|
|
3
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
6
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
7
|
+
import { FormsModule } from '@angular/forms';
|
|
8
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
9
|
+
import { map } from 'rxjs/operators';
|
|
10
|
+
|
|
11
|
+
class DialogConfirmacaoComponent {
|
|
12
|
+
constructor(data, dialogRef) {
|
|
13
|
+
this.data = data;
|
|
14
|
+
this.dialogRef = dialogRef;
|
|
15
|
+
}
|
|
16
|
+
get titulo() {
|
|
17
|
+
return this.data.titulo;
|
|
18
|
+
}
|
|
19
|
+
get mensagem() {
|
|
20
|
+
return this.data.mensagem;
|
|
21
|
+
}
|
|
22
|
+
get okLabel() {
|
|
23
|
+
return this.data.okLabel;
|
|
24
|
+
}
|
|
25
|
+
get cancelLabel() {
|
|
26
|
+
return this.data.cancelLabel;
|
|
27
|
+
}
|
|
28
|
+
ngOnInit() {
|
|
29
|
+
}
|
|
30
|
+
confirma(form) {
|
|
31
|
+
if (!form.valid) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
this.dialogRef.close(true);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
DialogConfirmacaoComponent.decorators = [
|
|
38
|
+
{ type: Component, args: [{
|
|
39
|
+
selector: 'mcl-dialog-confirmacao',
|
|
40
|
+
template: "<div mat-dialog-title>\n {{titulo | translate}}\n</div>\n\n<form (ngSubmit)=\"confirma(form)\" #form=\"ngForm\">\n <div mat-dialog-content>\n\n <p [innerHTML]=\"mensagem | translate\"></p>\n\n </div>\n\n <div mat-dialog-actions>\n <button mat-stroked-button color=\"accent\">\n {{okLabel | translate}}\n </button>\n <button mat-flat-button color=\"warn\" type=\"button\" mat-dialog-close *ngIf=\"cancelLabel\">\n {{cancelLabel | translate}}\n </button>\n </div>\n</form>\n",
|
|
41
|
+
styles: [".mat-dialog-content{width:95vw;max-width:280px;min-width:auto;margin:10px 60px;text-align:center;min-height:120px;display:flex;flex-direction:column;justify-content:center}[mat-dialog-title]{text-align:center;margin:40px 60px 20px}[mat-dialog-actions]{justify-content:center;margin:20px 60px 40px;flex-direction:row}@media (max-width:750px){.mat-dialog-content{margin:10px 20px}}"]
|
|
42
|
+
},] }
|
|
43
|
+
];
|
|
44
|
+
DialogConfirmacaoComponent.ctorParameters = () => [
|
|
45
|
+
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
|
|
46
|
+
{ type: MatDialogRef }
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
class DialogIframeComponent {
|
|
50
|
+
constructor(dados, dialogRef, sanitizer) {
|
|
51
|
+
this.dialogRef = dialogRef;
|
|
52
|
+
this.titulo = dados.titulo;
|
|
53
|
+
this.url = sanitizer.bypassSecurityTrustResourceUrl(dados.url);
|
|
54
|
+
}
|
|
55
|
+
ngAfterViewInit() {
|
|
56
|
+
registerDialogOnIframe(this.iframe.nativeElement, () => this.close());
|
|
57
|
+
}
|
|
58
|
+
returnValue() {
|
|
59
|
+
var _a;
|
|
60
|
+
const fraContent = this.iframe.nativeElement.contentDocument || ((_a = this.iframe.nativeElement.contentWindow) === null || _a === void 0 ? void 0 : _a.document);
|
|
61
|
+
if (fraContent) {
|
|
62
|
+
const divRetornoValue = fraContent.getElementById('returnValue');
|
|
63
|
+
if (divRetornoValue) {
|
|
64
|
+
const returnValue = divRetornoValue.innerText;
|
|
65
|
+
if (returnValue) {
|
|
66
|
+
return JSON.parse(returnValue);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
close() {
|
|
73
|
+
this.dialogRef.close(this.returnValue());
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
DialogIframeComponent.decorators = [
|
|
77
|
+
{ type: Component, args: [{
|
|
78
|
+
selector: 'mcl-dialog-iframe',
|
|
79
|
+
template: "<div mat-dialog-title >\n <h2>{{titulo}}</h2>\n <button mat-icon-button mat-dialog-close class=\"pull-right\" tabindex=\"-1\">\n <mat-icon>close</mat-icon>\n </button>\n</div>\n<div mat-dialog-content>\n <iframe #iframe width=\"560\" height=\"315\" [src]=\"url\" (close)=\"close()\" frameborder=\"0\"\n ></iframe>\n</div>\n",
|
|
80
|
+
styles: ["[mat-dialog-title]{display:flex}[mat-dialog-title] h2{font-size:25px;flex:1 1 auto;margin:0 0 20px}[mat-dialog-title] mat-icon{vertical-align:middle}mat-dialog-content{margin:-24px;width:calc(100% + 48px);padding:0}mat-dialog-content iframe{width:100%;height:60vh;border:0}"]
|
|
81
|
+
},] }
|
|
82
|
+
];
|
|
83
|
+
DialogIframeComponent.ctorParameters = () => [
|
|
84
|
+
{ type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] },
|
|
85
|
+
{ type: MatDialogRef },
|
|
86
|
+
{ type: DomSanitizer }
|
|
87
|
+
];
|
|
88
|
+
DialogIframeComponent.propDecorators = {
|
|
89
|
+
iframe: [{ type: ViewChild, args: ['iframe',] }]
|
|
90
|
+
};
|
|
91
|
+
function registerDialogOnIframe(iframe, callback) {
|
|
92
|
+
window.addEventListener('dialogIframeClosed', () => callback());
|
|
93
|
+
}
|
|
94
|
+
function closeDialogIframe(returnValue) {
|
|
95
|
+
if (returnValue) {
|
|
96
|
+
const returnDiv = document.createElement('div');
|
|
97
|
+
returnDiv.id = 'returnValue';
|
|
98
|
+
returnDiv.innerText = JSON.stringify(returnValue);
|
|
99
|
+
returnDiv.style.display = 'none';
|
|
100
|
+
document.body.appendChild(returnDiv);
|
|
101
|
+
}
|
|
102
|
+
window.parent.dispatchEvent(new Event('dialogIframeClosed'));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
class DialogModule {
|
|
106
|
+
}
|
|
107
|
+
DialogModule.decorators = [
|
|
108
|
+
{ type: NgModule, args: [{
|
|
109
|
+
declarations: [
|
|
110
|
+
DialogConfirmacaoComponent,
|
|
111
|
+
DialogIframeComponent,
|
|
112
|
+
],
|
|
113
|
+
imports: [
|
|
114
|
+
CommonModule,
|
|
115
|
+
TranslateModule,
|
|
116
|
+
MatButtonModule,
|
|
117
|
+
FormsModule,
|
|
118
|
+
MatIconModule,
|
|
119
|
+
MatDialogModule,
|
|
120
|
+
]
|
|
121
|
+
},] }
|
|
122
|
+
];
|
|
123
|
+
|
|
124
|
+
class DialogService {
|
|
125
|
+
constructor(dialog) {
|
|
126
|
+
this.dialog = dialog;
|
|
127
|
+
}
|
|
128
|
+
confirma(mensagem, config = {}) {
|
|
129
|
+
return this.dialog.open(DialogConfirmacaoComponent, {
|
|
130
|
+
data: {
|
|
131
|
+
titulo: config.titulo || 'mcl.dialog.confirmacao',
|
|
132
|
+
mensagem,
|
|
133
|
+
okLabel: config.okLabel || 'mcl.dialog.sim',
|
|
134
|
+
cancelLabel: config.cancelLabel || 'mcl.dialog.nao'
|
|
135
|
+
}
|
|
136
|
+
}).afterClosed().pipe(map(result => !!result));
|
|
137
|
+
}
|
|
138
|
+
informa(mensagem, config = {}) {
|
|
139
|
+
return this.dialog.open(DialogConfirmacaoComponent, {
|
|
140
|
+
data: {
|
|
141
|
+
titulo: config.titulo || 'mcl.dialog.informacao',
|
|
142
|
+
mensagem,
|
|
143
|
+
okLabel: config.okLabel || 'mcl.dialog.ok',
|
|
144
|
+
}
|
|
145
|
+
}).afterClosed().pipe(map(result => !!result));
|
|
146
|
+
}
|
|
147
|
+
iframe(url, titulo) {
|
|
148
|
+
if (!!window.parent && window.parent !== window) {
|
|
149
|
+
window.location.href = url;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
return this.dialog.open(DialogIframeComponent, {
|
|
153
|
+
data: {
|
|
154
|
+
titulo,
|
|
155
|
+
url,
|
|
156
|
+
},
|
|
157
|
+
panelClass: 'dialog-frame',
|
|
158
|
+
}).afterClosed();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
DialogService.ɵprov = ɵɵdefineInjectable({ factory: function DialogService_Factory() { return new DialogService(ɵɵinject(MatDialog)); }, token: DialogService, providedIn: "root" });
|
|
163
|
+
DialogService.decorators = [
|
|
164
|
+
{ type: Injectable, args: [{
|
|
165
|
+
providedIn: 'root'
|
|
166
|
+
},] }
|
|
167
|
+
];
|
|
168
|
+
DialogService.ctorParameters = () => [
|
|
169
|
+
{ type: MatDialog }
|
|
170
|
+
];
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Generated bundle index. Do not edit.
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
export { DialogConfirmacaoComponent, DialogIframeComponent, DialogModule, DialogService, closeDialogIframe };
|
|
177
|
+
//# sourceMappingURL=main-class-componentes-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-class-componentes-dialog.js","sources":["../../../../projects/main-class/componentes/dialog/src/dialog-confirmacao/dialog-confirmacao.component.ts","../../../../projects/main-class/componentes/dialog/src/dialog-iframe/dialog-iframe.component.ts","../../../../projects/main-class/componentes/dialog/src/dialog.module.ts","../../../../projects/main-class/componentes/dialog/src/dialog.service.ts","../../../../projects/main-class/componentes/dialog/main-class-componentes-dialog.ts"],"sourcesContent":["import {Component, Inject, OnInit} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {NgForm} from '@angular/forms';\n\nexport interface DialogConfirmacaoData {\n titulo: string;\n mensagem: string;\n okLabel: string;\n cancelLabel?: string;\n}\n\n@Component({\n selector: 'mcl-dialog-confirmacao',\n templateUrl: './dialog-confirmacao.component.html',\n styleUrls: ['./dialog-confirmacao.component.scss']\n})\nexport class DialogConfirmacaoComponent implements OnInit {\n\n constructor(\n @Inject(MAT_DIALOG_DATA) private data: DialogConfirmacaoData,\n private dialogRef: MatDialogRef<any>,\n ) {\n }\n\n get titulo() {\n return this.data.titulo;\n }\n\n get mensagem() {\n return this.data.mensagem;\n }\n\n get okLabel() {\n return this.data.okLabel;\n }\n\n get cancelLabel() {\n return this.data.cancelLabel;\n }\n\n ngOnInit(): void {\n }\n\n confirma(form: NgForm) {\n if (!form.valid) {\n return;\n }\n\n this.dialogRef.close(true);\n }\n}\n","import {AfterViewInit, Component, ElementRef, Inject, ViewChild} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';\n\nexport interface DialogIframData {\n url: string;\n titulo: string;\n}\n\n@Component({\n selector: 'mcl-dialog-iframe',\n templateUrl: './dialog-iframe.component.html',\n styleUrls: ['./dialog-iframe.component.scss']\n})\nexport class DialogIframeComponent implements AfterViewInit {\n\n titulo: string;\n url: SafeResourceUrl;\n\n @ViewChild('iframe') iframe: ElementRef;\n\n constructor(\n @Inject(MAT_DIALOG_DATA) dados: DialogIframData,\n private dialogRef: MatDialogRef<any>,\n sanitizer: DomSanitizer,\n ) {\n this.titulo = dados.titulo;\n this.url = sanitizer.bypassSecurityTrustResourceUrl(dados.url);\n }\n\n ngAfterViewInit() {\n registerDialogOnIframe(this.iframe.nativeElement, () => this.close());\n }\n\n private returnValue() {\n const fraContent = this.iframe.nativeElement.contentDocument ||\n this.iframe.nativeElement.contentWindow?.document;\n\n if (fraContent) {\n const divRetornoValue = fraContent.getElementById('returnValue');\n\n if (divRetornoValue) {\n const returnValue = divRetornoValue.innerText;\n\n if (returnValue) {\n return JSON.parse(returnValue);\n }\n }\n }\n\n return undefined;\n }\n\n close() {\n this.dialogRef.close(this.returnValue());\n }\n}\n\nfunction registerDialogOnIframe(iframe, callback) {\n window.addEventListener('dialogIframeClosed', () => callback());\n}\n\nexport function closeDialogIframe(returnValue?: any) {\n if (returnValue) {\n const returnDiv = document.createElement('div');\n\n returnDiv.id = 'returnValue';\n returnDiv.innerText = JSON.stringify(returnValue);\n returnDiv.style.display = 'none';\n\n document.body.appendChild(returnDiv);\n }\n\n window.parent.dispatchEvent(new Event('dialogIframeClosed'));\n}\n","import {NgModule} from '@angular/core';\nimport {DialogConfirmacaoComponent} from './dialog-confirmacao/dialog-confirmacao.component';\nimport {DialogIframeComponent} from './dialog-iframe/dialog-iframe.component';\nimport {CommonModule} from '@angular/common';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {MatButtonModule} from '@angular/material/button';\nimport {FormsModule} from '@angular/forms';\nimport {MatIconModule} from '@angular/material/icon';\nimport {MatDialogModule} from '@angular/material/dialog';\n\n\n@NgModule({\n declarations: [\n DialogConfirmacaoComponent,\n DialogIframeComponent,\n ],\n imports: [\n CommonModule,\n TranslateModule,\n MatButtonModule,\n FormsModule,\n MatIconModule,\n MatDialogModule,\n ]\n})\nexport class DialogModule {\n\n}\n","import {Injectable} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {MatDialog} from '@angular/material/dialog';\nimport {DialogConfirmacaoComponent, DialogConfirmacaoData} from './dialog-confirmacao/dialog-confirmacao.component';\nimport {map} from 'rxjs/operators';\nimport {DialogIframeComponent} from './dialog-iframe/dialog-iframe.component';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DialogService {\n\n constructor(\n private dialog: MatDialog\n ) {\n }\n\n confirma(mensagem: string, config: {\n icon?: string,\n titulo?: string,\n okLabel?: string,\n cancelLabel?: string\n } = {}): Observable<boolean> {\n return this.dialog.open<DialogConfirmacaoComponent, DialogConfirmacaoData, boolean>(DialogConfirmacaoComponent, {\n data: {\n titulo: config.titulo || 'mcl.dialog.confirmacao',\n mensagem,\n okLabel: config.okLabel || 'mcl.dialog.sim',\n cancelLabel: config.cancelLabel || 'mcl.dialog.nao'\n }\n }).afterClosed().pipe(map(result => !!result));\n }\n\n informa(mensagem: string, config: {\n icon?: string,\n titulo?: string,\n okLabel?: string\n } = {}): Observable<boolean> {\n return this.dialog.open<DialogConfirmacaoComponent, DialogConfirmacaoData, boolean>(DialogConfirmacaoComponent, {\n data: {\n titulo: config.titulo || 'mcl.dialog.informacao',\n mensagem,\n okLabel: config.okLabel || 'mcl.dialog.ok',\n }\n }).afterClosed().pipe(map(result => !!result));\n }\n\n iframe(url: string, titulo: string): Observable<any> {\n if (!!window.parent && window.parent !== window) {\n window.location.href = url;\n } else {\n return this.dialog.open(DialogIframeComponent, {\n data: {\n titulo,\n url,\n },\n panelClass: 'dialog-frame',\n }).afterClosed();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAgBa,0BAA0B;IAErC,YACmC,IAA2B,EACpD,SAA4B;QADH,SAAI,GAAJ,IAAI,CAAuB;QACpD,cAAS,GAAT,SAAS,CAAmB;KAErC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;KACzB;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;KAC3B;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;KAC1B;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,IAAI,CAAC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BAC3C,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,gBAAgB;aACpD;SACF,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;KAChD;IAED,OAAO,CAAC,QAAgB,EAAE,SAItB,EAAE;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAA6D,0BAA0B,EAAE;YAC9G,IAAI,EAAE;gBACJ,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,uBAAuB;gBAChD,QAAQ;gBACR,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,eAAe;aAC3C;SACF,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;KAChD;IAED,MAAM,CAAC,GAAW,EAAE,MAAc;QAChC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,EAAE;YAC/C,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAC;SAC5B;aAAM;YACL,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE;gBAC7C,IAAI,EAAE;oBACJ,MAAM;oBACN,GAAG;iBACJ;gBACD,UAAU,EAAE,cAAc;aAC3B,CAAC,CAAC,WAAW,EAAE,CAAC;SAClB;KACF;;;;YApDF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;YAPO,SAAS;;;ACFjB;;;;;;"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { EventEmitter, Component, Output, Input, ContentChildren, ViewChild, Directive, ElementRef, Host, Optional, NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { NgModel, NgForm, FormsModule } from '@angular/forms';
|
|
4
|
+
import { throttleTime } from 'rxjs/operators';
|
|
5
|
+
import { Subject, Observable, fromEvent } from 'rxjs';
|
|
6
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
7
|
+
|
|
8
|
+
class FormComponent {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.submitted = new EventEmitter();
|
|
11
|
+
this.throttleMillis = 500;
|
|
12
|
+
this.eventSubject = new Subject();
|
|
13
|
+
this.currentModels = [];
|
|
14
|
+
}
|
|
15
|
+
ngOnInit() {
|
|
16
|
+
this.subscription = this.eventSubject
|
|
17
|
+
.pipe(throttleTime(this.throttleMillis))
|
|
18
|
+
.subscribe((v) => {
|
|
19
|
+
this.submitted.emit(v);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
ngOnDestroy() {
|
|
23
|
+
var _a;
|
|
24
|
+
this.eventSubject.complete();
|
|
25
|
+
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
26
|
+
this.submitted.unsubscribe();
|
|
27
|
+
}
|
|
28
|
+
ngAfterViewInit() {
|
|
29
|
+
this.models.changes.subscribe(() => {
|
|
30
|
+
this.atualizaModels();
|
|
31
|
+
});
|
|
32
|
+
this.atualizaModels();
|
|
33
|
+
}
|
|
34
|
+
atualizaModels() {
|
|
35
|
+
const ngContentModels = this.models.toArray();
|
|
36
|
+
for (let i = 0; i < this.currentModels.length;) {
|
|
37
|
+
const model = this.currentModels[i];
|
|
38
|
+
if (ngContentModels.indexOf(model) < 0) {
|
|
39
|
+
this.form.removeControl(model);
|
|
40
|
+
model.control.setParent(undefined);
|
|
41
|
+
this.currentModels.splice(i, 1);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
i++;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
ngContentModels.forEach(model => {
|
|
48
|
+
if (this.currentModels.indexOf(model) < 0) {
|
|
49
|
+
this.currentModels.push(model);
|
|
50
|
+
this.form.addControl(model);
|
|
51
|
+
model.control.setParent(this.form.form);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
touched() {
|
|
56
|
+
this.models.toArray().forEach((model) => {
|
|
57
|
+
model.control.markAsTouched();
|
|
58
|
+
model.control.markAsDirty();
|
|
59
|
+
model.control.updateValueAndValidity();
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
untouched() {
|
|
63
|
+
this.models.toArray().forEach((model) => {
|
|
64
|
+
model.control.markAsPristine();
|
|
65
|
+
model.control.markAsUntouched();
|
|
66
|
+
model.control.updateValueAndValidity();
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
reset() {
|
|
70
|
+
this.form.resetForm();
|
|
71
|
+
this.form.control.markAsPending();
|
|
72
|
+
this.models.toArray().forEach((model) => {
|
|
73
|
+
model.control.reset();
|
|
74
|
+
model.control.setErrors(null);
|
|
75
|
+
model.control.updateValueAndValidity();
|
|
76
|
+
});
|
|
77
|
+
return new Observable(observer => {
|
|
78
|
+
setTimeout(() => {
|
|
79
|
+
observer.next();
|
|
80
|
+
observer.complete();
|
|
81
|
+
}, 300);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
submit(form) {
|
|
85
|
+
if (!form.valid) {
|
|
86
|
+
this.touched();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this.eventSubject.next(form);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
FormComponent.decorators = [
|
|
93
|
+
{ type: Component, args: [{
|
|
94
|
+
selector: 'mcl-form',
|
|
95
|
+
template: "<form #form=\"ngForm\" (ngSubmit)=\"submit(form)\">\n <ng-content></ng-content>\n</form>\n",
|
|
96
|
+
styles: [""]
|
|
97
|
+
},] }
|
|
98
|
+
];
|
|
99
|
+
FormComponent.ctorParameters = () => [];
|
|
100
|
+
FormComponent.propDecorators = {
|
|
101
|
+
submitted: [{ type: Output }],
|
|
102
|
+
throttleMillis: [{ type: Input }],
|
|
103
|
+
models: [{ type: ContentChildren, args: [NgModel, { descendants: true },] }],
|
|
104
|
+
form: [{ type: ViewChild, args: [NgForm,] }]
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
class SingleClickDirective {
|
|
108
|
+
constructor(elementRef) {
|
|
109
|
+
this.elementRef = elementRef;
|
|
110
|
+
this.throttleMillis = 500;
|
|
111
|
+
this.singleClick = new EventEmitter();
|
|
112
|
+
}
|
|
113
|
+
ngOnInit() {
|
|
114
|
+
this.subscription = fromEvent(this.elementRef.nativeElement, 'click')
|
|
115
|
+
.pipe(throttleTime(this.throttleMillis))
|
|
116
|
+
.subscribe((v) => {
|
|
117
|
+
this.singleClick.emit(v);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
ngOnDestroy() {
|
|
121
|
+
var _a;
|
|
122
|
+
(_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
123
|
+
this.singleClick.unsubscribe();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
SingleClickDirective.decorators = [
|
|
127
|
+
{ type: Directive, args: [{
|
|
128
|
+
selector: '[mclSingleClick],[singleClick]'
|
|
129
|
+
},] }
|
|
130
|
+
];
|
|
131
|
+
SingleClickDirective.ctorParameters = () => [
|
|
132
|
+
{ type: ElementRef }
|
|
133
|
+
];
|
|
134
|
+
SingleClickDirective.propDecorators = {
|
|
135
|
+
throttleMillis: [{ type: Input }],
|
|
136
|
+
singleClick: [{ type: Output }]
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
class MensagensErroComponent {
|
|
140
|
+
constructor(form) {
|
|
141
|
+
this.form = form;
|
|
142
|
+
}
|
|
143
|
+
ngOnInit() {
|
|
144
|
+
}
|
|
145
|
+
get errors() {
|
|
146
|
+
var _a, _b, _c, _d, _e, _f;
|
|
147
|
+
if (((_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.form) === null || _b === void 0 ? void 0 : _b.controls) && ((_d = (_c = this.form) === null || _c === void 0 ? void 0 : _c.form) === null || _d === void 0 ? void 0 : _d.controls[this.name]) && ((_f = (_e = this.form) === null || _e === void 0 ? void 0 : _e.form) === null || _f === void 0 ? void 0 : _f.controls[this.name].errors)) {
|
|
148
|
+
return Object.keys(this.form.form.controls[this.name].errors);
|
|
149
|
+
}
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
MensagensErroComponent.decorators = [
|
|
154
|
+
{ type: Component, args: [{
|
|
155
|
+
selector: 'mcl-mensagens-erro,mat-error[name],[mat-error][name]',
|
|
156
|
+
template: "<span *ngFor=\"let error of errors\">\n {{'validation.' + error | translate:form.form.controls[name].errors[error]}}\n</span>\n",
|
|
157
|
+
styles: [""]
|
|
158
|
+
},] }
|
|
159
|
+
];
|
|
160
|
+
MensagensErroComponent.ctorParameters = () => [
|
|
161
|
+
{ type: FormComponent, decorators: [{ type: Host }, { type: Optional }] }
|
|
162
|
+
];
|
|
163
|
+
MensagensErroComponent.propDecorators = {
|
|
164
|
+
name: [{ type: Input }],
|
|
165
|
+
form: [{ type: Input }]
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
class FormModule {
|
|
169
|
+
}
|
|
170
|
+
FormModule.decorators = [
|
|
171
|
+
{ type: NgModule, args: [{
|
|
172
|
+
declarations: [FormComponent, SingleClickDirective, MensagensErroComponent],
|
|
173
|
+
exports: [
|
|
174
|
+
FormComponent,
|
|
175
|
+
SingleClickDirective,
|
|
176
|
+
MensagensErroComponent,
|
|
177
|
+
],
|
|
178
|
+
imports: [
|
|
179
|
+
CommonModule,
|
|
180
|
+
FormsModule,
|
|
181
|
+
TranslateModule
|
|
182
|
+
]
|
|
183
|
+
},] }
|
|
184
|
+
];
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Generated bundle index. Do not edit.
|
|
188
|
+
*/
|
|
189
|
+
|
|
190
|
+
export { FormComponent, FormModule, MensagensErroComponent, SingleClickDirective };
|
|
191
|
+
//# sourceMappingURL=main-class-componentes-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-class-componentes-form.js","sources":["../../../../projects/main-class/componentes/form/src/form.component.ts","../../../../projects/main-class/componentes/form/src/single-click.directive.ts","../../../../projects/main-class/componentes/form/src/mensagens-erro/mensagens-erro.component.ts","../../../../projects/main-class/componentes/form/src/form.module.ts","../../../../projects/main-class/componentes/form/main-class-componentes-form.ts"],"sourcesContent":["import {\n AfterViewInit,\n Component,\n ContentChildren,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n QueryList,\n ViewChild\n} from '@angular/core';\nimport {NgForm, NgModel} from '@angular/forms';\nimport {Subscription} from 'rxjs';\nimport {throttleTime} from 'rxjs/operators';\nimport {Observable, Subject} from 'rxjs';\n\n@Component({\n selector: 'mcl-form',\n templateUrl: './form.component.html',\n styleUrls: ['./form.component.scss']\n})\nexport class FormComponent implements OnInit, OnDestroy, AfterViewInit {\n\n @Output() submitted = new EventEmitter<NgForm>();\n\n @Input()\n throttleMillis = 500;\n\n private eventSubject = new Subject<NgForm>();\n private subscription: Subscription;\n\n @ContentChildren(NgModel, {descendants: true}) public models: QueryList<NgModel>;\n @ViewChild(NgForm) form: NgForm;\n\n private currentModels: Array<NgModel> = [];\n\n constructor() {\n }\n\n ngOnInit(): void {\n this.subscription = this.eventSubject\n .pipe(throttleTime(this.throttleMillis))\n .subscribe((v) => {\n this.submitted.emit(v);\n });\n }\n\n ngOnDestroy() {\n this.eventSubject.complete();\n this.subscription?.unsubscribe();\n this.submitted.unsubscribe();\n }\n\n ngAfterViewInit() {\n this.models.changes.subscribe(() => {\n this.atualizaModels();\n });\n\n this.atualizaModels();\n }\n\n private atualizaModels() {\n const ngContentModels = this.models.toArray();\n\n for (let i = 0; i < this.currentModels.length;) {\n const model = this.currentModels[i];\n if (ngContentModels.indexOf(model) < 0) {\n this.form.removeControl(model);\n model.control.setParent(undefined);\n this.currentModels.splice(i, 1);\n } else {\n i++;\n }\n }\n\n ngContentModels.forEach(model => {\n if (this.currentModels.indexOf(model) < 0) {\n this.currentModels.push(model);\n this.form.addControl(model);\n model.control.setParent(this.form.form);\n }\n });\n }\n\n touched() {\n this.models.toArray().forEach((model) => {\n model.control.markAsTouched();\n model.control.markAsDirty();\n model.control.updateValueAndValidity();\n });\n }\n\n untouched() {\n this.models.toArray().forEach((model) => {\n model.control.markAsPristine();\n model.control.markAsUntouched();\n model.control.updateValueAndValidity();\n });\n }\n\n reset(): Observable<any> {\n this.form.resetForm();\n this.form.control.markAsPending();\n this.models.toArray().forEach((model) => {\n model.control.reset();\n model.control.setErrors(null);\n model.control.updateValueAndValidity();\n });\n\n return new Observable(observer => {\n setTimeout(() => {\n observer.next();\n observer.complete();\n }, 300);\n });\n }\n\n submit(form: NgForm) {\n if (!form.valid) {\n this.touched();\n return;\n }\n\n this.eventSubject.next(form);\n }\n}\n","import {Directive, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output} from '@angular/core';\nimport {fromEvent, Subscription} from 'rxjs';\nimport {throttleTime} from 'rxjs/operators';\n\n@Directive({\n selector: '[mclSingleClick],[singleClick]'\n})\nexport class SingleClickDirective implements OnInit, OnDestroy {\n private subscription: Subscription;\n\n @Input()\n throttleMillis = 500;\n\n @Output()\n singleClick = new EventEmitter();\n\n constructor(private elementRef: ElementRef) {\n }\n\n ngOnInit(): void {\n this.subscription = fromEvent(this.elementRef.nativeElement, 'click')\n .pipe(throttleTime(this.throttleMillis))\n .subscribe((v) => {\n this.singleClick.emit(v);\n });\n }\n\n ngOnDestroy(): void {\n this.subscription?.unsubscribe();\n this.singleClick.unsubscribe();\n }\n\n}\n","import {Component, Host, Input, OnInit, Optional} from '@angular/core';\nimport {FormComponent} from '../form.component';\n\n@Component({\n selector: 'mcl-mensagens-erro,mat-error[name],[mat-error][name]',\n templateUrl: './mensagens-erro.component.html',\n styleUrls: ['./mensagens-erro.component.scss']\n})\nexport class MensagensErroComponent implements OnInit {\n\n @Input() name: string;\n @Input() form: FormComponent;\n\n constructor(\n @Host() @Optional() form: FormComponent\n ) {\n this.form = form;\n }\n\n ngOnInit(): void {\n }\n\n get errors() {\n if (this.form?.form?.controls && this.form?.form?.controls[this.name] && this.form?.form?.controls[this.name].errors) {\n return Object.keys(this.form.form.controls[this.name].errors);\n }\n\n return undefined;\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport {FormComponent} from './form.component';\nimport { SingleClickDirective } from './single-click.directive';\nimport {FormsModule} from '@angular/forms';\nimport {MensagensErroComponent} from './mensagens-erro/mensagens-erro.component';\nimport {TranslateModule} from '@ngx-translate/core';\n\n\n\n@NgModule({\n declarations: [FormComponent, SingleClickDirective, MensagensErroComponent],\n exports: [\n FormComponent,\n SingleClickDirective,\n MensagensErroComponent,\n ],\n imports: [\n CommonModule,\n FormsModule,\n TranslateModule\n ]\n})\nexport class FormModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAsBa,aAAa;IAexB;QAbU,cAAS,GAAG,IAAI,YAAY,EAAU,CAAC;QAGjD,mBAAc,GAAG,GAAG,CAAC;QAEb,iBAAY,GAAG,IAAI,OAAO,EAAU,CAAC;QAMrC,kBAAa,GAAmB,EAAE,CAAC;KAG1C;IAED,QAAQ;QACN,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY;aAClC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aACvC,SAAS,CAAC,CAAC,CAAC;YACX,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACxB,CAAC,CAAC;KACN;IAED,WAAW;;QACT,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC7B,MAAA,IAAI,CAAC,YAAY,0CAAE,WAAW,GAAG;QACjC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;KAC9B;IAED,eAAe;QACb,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;YAC5B,IAAI,CAAC,cAAc,EAAE,CAAC;SACvB,CAAC,CAAC;QAEH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