@dealpos-npm/ng-dealpos-library 22.0.3 → 22.0.5

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.
@@ -100,7 +100,7 @@ var ModalMaterialComponent = class ModalMaterialComponent {
100
100
  }],
101
101
  ngImport: i0,
102
102
  template: "<div\r\n (keyup)=\"onKeyup($event)\"\r\n class=\"modal-material d-flex align-items-start flex-column position-relative maxHeight\"\r\n id=\"modal_material\"\r\n [style.width]=\"config?.customWidth\"\r\n [class]=\"{\r\n bodyScrollable: config?.bodyScrollable,\r\n hideScrollbar: config?.hideScrollbar,\r\n }\"\r\n>\r\n <div\r\n mat-dialog-title\r\n class=\"d-flex w-100 justify-content-between modal-header position-relative\"\r\n [class]=\"{\r\n 'bg-success': headerType.Success == config?.headerType,\r\n 'bg-warning': headerType.Warning == config?.headerType,\r\n 'bg-info': headerType.Info == config?.headerType,\r\n 'bg-danger': headerType.Error == config?.headerType,\r\n 'bg-neutral': headerType.Neutral == config?.headerType,\r\n }\"\r\n >\r\n @if (config?.backButton) {\r\n <div\r\n class=\"back-button position-absolute pointer d-print-none\"\r\n (click)=\"onBack.emit(false)\"\r\n >\r\n <a class=\"btn back-button\"><i class=\"fa-solid fa-arrow-left\"></i></a>\r\n </div>\r\n }\r\n <div\r\n class=\"d-flex flex-row d-print-none align-items-center\"\r\n [class.mx-auto]=\"config?.backButton\"\r\n >\r\n <h4 class=\"fw-normal\">{{ config?.title }}</h4>\r\n <ng-content select=\"header\"></ng-content>\r\n </div>\r\n @if (!config?.hideClose) {\r\n <div>\r\n <a\r\n class=\"btn-light-blue btn-sm pointer close\"\r\n (click)=\"onClose.emit('')\"\r\n >\r\n <i class=\"fa-solid fa-xmark fa-lg text-primary\"></i>\r\n </a>\r\n </div>\r\n }\r\n </div>\r\n <mat-dialog-content\r\n class=\"modal-body w-100\"\r\n [class]=\"{\r\n 'show-footer': !config?.hideFooter,\r\n 'p-0': config?.noPadding,\r\n }\"\r\n >\r\n <ng-content select=\"content\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"modalContent\"></ng-container>\r\n </mat-dialog-content>\r\n @if (!config?.hideFooter) {\r\n <mat-dialog-actions\r\n class=\"w-100 py-7 border-top d-flex justify-content-end d-print-none\"\r\n >\r\n <ng-content select=\"footer\"></ng-content>\r\n @if (!config?.hideCancel) {\r\n <a\r\n class=\"btn btn-light-blue text-primary btn-lg fw-bold mx-3\"\r\n (click)=\"onCancel.emit('')\"\r\n [innerHTML]=\"config?.cancelText ? config?.cancelText : 'Cancel'\"\r\n >\r\n </a>\r\n }\r\n @if (!config?.hideOk) {\r\n <button\r\n class=\"btn btn-light-blue me-6 text-primary btn-lg fw-bold mx-3\"\r\n [disabled]=\"!config?.validated || !dynamicValidated()\"\r\n (click)=\"onOk.emit('')\"\r\n (keyup.F2)=\"onOk.emit('')\"\r\n data-cy=\"btn-ok\"\r\n [innerHTML]=\"config?.okText ? config?.okText : 'Ok (F2)'\"\r\n ></button>\r\n }\r\n </mat-dialog-actions>\r\n }\r\n</div>\r\n",
103
- styles: ["::ng-deep .mat-mdc-dialog-container{padding:0!important;border-radius:4px!important;overflow:visible!important}::ng-deep .mat-mdc-dialog-container [mat-dialog-title]{color:#fff;padding:15px;border:none}@media print{::ng-deep .mat-mdc-dialog-container{box-shadow:unset;width:100vw}}@media print{::ng-deep .cdk-overlay-pane{position:absolute!important;top:-30px;max-width:100vw!important}.modal-body{width:100vw!important}}body.modal-body{height:100%}mat-dialog-actions{bottom:15px}mat-dialog-actions a{padding:15px!important;margin-right:12px}mat-dialog-actions button{padding:15px!important}mat-dialog-actions .more{margin-right:auto;margin-top:-1rem;padding-top:.4rem!important;margin-left:1rem}.back-button{top:5px;left:0}.close{padding:.4rem .5rem}.no-padding{padding:0}.modal-material{width:40vw}@media(max-width:992px){.modal-material{width:50vw!important}}@media(max-width:576px){::ng-deep .dialog-filter .modal-material,::ng-deep .column-toggle .modal-material{width:100%!important}::ng-deep .dialog-filter mat-dialog-actions,::ng-deep .column-toggle mat-dialog-actions{position:sticky;bottom:0;background:#fff}::ng-deep .dialog-filter .modal-material.d-flex.align-items-start.flex-column.position-relative.maxHeight.bodyScrollable.maxHeight.bodyScrollable .modal-body,::ng-deep .column-toggle .modal-material.d-flex.align-items-start.flex-column.position-relative.maxHeight.bodyScrollable.maxHeight.bodyScrollable .modal-body{max-height:100%!important;overflow-y:auto}}.maxHeight.bodyScrollable .modal-body{max-height:70vh;overflow-y:auto}.maxHeight.hideScrollbar .modal-body{overflow-y:hidden}.modal-header,.modal-footer,.modal-footer .btn{padding:15px}.modal-dialog{max-width:none}.modal-content{width:auto;margin:auto;max-width:850px}.maxHeight .modal-body{max-height:70vh;overflow:auto}.modal-body{padding:1rem}.modal-body strong{display:block}.modal-body .more{margin:0;position:absolute;bottom:-20px}.modal-body input[type=text],.modal-body textarea,.modal-body input[type=password]{border:1px solid #c8d3df;padding:5px 7px}.modal-body table textarea{width:330px;height:90px}div.modal-header{color:#212529}div.modal-header.bg-success,div.modal-header.bg-warning,div.modal-header.bg-info,div.modal-header.bg-danger{color:#fff}div.modal-header.bg-neutral{background-color:#fff;border-bottom:1px solid #c8d3df;color:#212529}div.modal-header.bg-neutral .close{background-color:#fff!important;border:1px solid #c8d3df!important;border-radius:8px}\n"],
103
+ styles: ["::ng-deep .mat-mdc-dialog-container{padding:0!important;border-radius:4px!important;overflow:visible!important}::ng-deep .mat-mdc-dialog-container [mat-dialog-title]{color:#fff;padding:15px;border:none}@media print{::ng-deep .mat-mdc-dialog-container{box-shadow:unset;width:100vw}}@media print{::ng-deep .cdk-overlay-pane{position:absolute!important;top:-30px;max-width:100vw!important}.modal-body{width:100vw!important}}body.modal-body{height:100%}mat-dialog-actions{bottom:15px}mat-dialog-actions a{padding:15px!important;margin-right:12px}mat-dialog-actions button{padding:15px!important}mat-dialog-actions .more{margin-right:auto;margin-top:-1rem;padding-top:.4rem!important;margin-left:1rem}.back-button{top:5px;left:0}.close{padding:.4rem .5rem}.no-padding{padding:0}.modal-material{width:40vw}@media(max-width:992px){.modal-material{width:50vw!important}}@media(max-width:576px){::ng-deep .dialog-filter .modal-material,::ng-deep .column-toggle .modal-material{width:100%!important}::ng-deep .dialog-filter mat-dialog-actions,::ng-deep .column-toggle mat-dialog-actions{position:sticky;bottom:0;background:#fff}::ng-deep .dialog-filter .modal-material.d-flex.align-items-start.flex-column.position-relative.maxHeight.bodyScrollable.maxHeight.bodyScrollable .modal-body,::ng-deep .column-toggle .modal-material.d-flex.align-items-start.flex-column.position-relative.maxHeight.bodyScrollable.maxHeight.bodyScrollable .modal-body{max-height:100%!important;overflow-y:auto}}.maxHeight.bodyScrollable .modal-body{max-height:70vh;overflow-y:auto}.maxHeight.hideScrollbar .modal-body{overflow-y:hidden}.modal-header,.modal-footer,.modal-footer .btn{padding:15px}.modal-dialog{max-width:none}.modal-content{width:auto;margin:auto;max-width:850px}.maxHeight .modal-body{max-height:70vh;overflow:auto}.modal-body{padding:1rem}.modal-body strong{display:block}.modal-body .more{margin:0;position:absolute;bottom:-20px}.modal-body input[type=text],.modal-body textarea,.modal-body input[type=password]{border:1px solid #c8d3df;padding:5px 7px}.modal-body table textarea{width:330px;height:90px}div.modal-header{color:#212529}div.modal-header.bg-success,div.modal-header.bg-warning,div.modal-header.bg-info,div.modal-header.bg-danger{color:#fff}div.modal-header.bg-neutral{background-color:#fff;border-bottom:1px solid #c8d3df;color:#212529}div.modal-header.bg-neutral .close{background-color:#fff!important;border:1px solid #c8d3df!important;border-radius:8px}div.modal-header.bg-neutral .close i{font-size:.8rem;line-height:1;color:#737373}\n"],
104
104
  dependencies: [{
105
105
  kind: "directive",
106
106
  type: NgTemplateOutlet,
@@ -128,7 +128,7 @@ i0.ɵɵngDeclareClassMetadata({
128
128
  imports: [NgTemplateOutlet],
129
129
  schemas: [NO_ERRORS_SCHEMA],
130
130
  template: "<div\r\n (keyup)=\"onKeyup($event)\"\r\n class=\"modal-material d-flex align-items-start flex-column position-relative maxHeight\"\r\n id=\"modal_material\"\r\n [style.width]=\"config?.customWidth\"\r\n [class]=\"{\r\n bodyScrollable: config?.bodyScrollable,\r\n hideScrollbar: config?.hideScrollbar,\r\n }\"\r\n>\r\n <div\r\n mat-dialog-title\r\n class=\"d-flex w-100 justify-content-between modal-header position-relative\"\r\n [class]=\"{\r\n 'bg-success': headerType.Success == config?.headerType,\r\n 'bg-warning': headerType.Warning == config?.headerType,\r\n 'bg-info': headerType.Info == config?.headerType,\r\n 'bg-danger': headerType.Error == config?.headerType,\r\n 'bg-neutral': headerType.Neutral == config?.headerType,\r\n }\"\r\n >\r\n @if (config?.backButton) {\r\n <div\r\n class=\"back-button position-absolute pointer d-print-none\"\r\n (click)=\"onBack.emit(false)\"\r\n >\r\n <a class=\"btn back-button\"><i class=\"fa-solid fa-arrow-left\"></i></a>\r\n </div>\r\n }\r\n <div\r\n class=\"d-flex flex-row d-print-none align-items-center\"\r\n [class.mx-auto]=\"config?.backButton\"\r\n >\r\n <h4 class=\"fw-normal\">{{ config?.title }}</h4>\r\n <ng-content select=\"header\"></ng-content>\r\n </div>\r\n @if (!config?.hideClose) {\r\n <div>\r\n <a\r\n class=\"btn-light-blue btn-sm pointer close\"\r\n (click)=\"onClose.emit('')\"\r\n >\r\n <i class=\"fa-solid fa-xmark fa-lg text-primary\"></i>\r\n </a>\r\n </div>\r\n }\r\n </div>\r\n <mat-dialog-content\r\n class=\"modal-body w-100\"\r\n [class]=\"{\r\n 'show-footer': !config?.hideFooter,\r\n 'p-0': config?.noPadding,\r\n }\"\r\n >\r\n <ng-content select=\"content\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"modalContent\"></ng-container>\r\n </mat-dialog-content>\r\n @if (!config?.hideFooter) {\r\n <mat-dialog-actions\r\n class=\"w-100 py-7 border-top d-flex justify-content-end d-print-none\"\r\n >\r\n <ng-content select=\"footer\"></ng-content>\r\n @if (!config?.hideCancel) {\r\n <a\r\n class=\"btn btn-light-blue text-primary btn-lg fw-bold mx-3\"\r\n (click)=\"onCancel.emit('')\"\r\n [innerHTML]=\"config?.cancelText ? config?.cancelText : 'Cancel'\"\r\n >\r\n </a>\r\n }\r\n @if (!config?.hideOk) {\r\n <button\r\n class=\"btn btn-light-blue me-6 text-primary btn-lg fw-bold mx-3\"\r\n [disabled]=\"!config?.validated || !dynamicValidated()\"\r\n (click)=\"onOk.emit('')\"\r\n (keyup.F2)=\"onOk.emit('')\"\r\n data-cy=\"btn-ok\"\r\n [innerHTML]=\"config?.okText ? config?.okText : 'Ok (F2)'\"\r\n ></button>\r\n }\r\n </mat-dialog-actions>\r\n }\r\n</div>\r\n",
131
- styles: ["::ng-deep .mat-mdc-dialog-container{padding:0!important;border-radius:4px!important;overflow:visible!important}::ng-deep .mat-mdc-dialog-container [mat-dialog-title]{color:#fff;padding:15px;border:none}@media print{::ng-deep .mat-mdc-dialog-container{box-shadow:unset;width:100vw}}@media print{::ng-deep .cdk-overlay-pane{position:absolute!important;top:-30px;max-width:100vw!important}.modal-body{width:100vw!important}}body.modal-body{height:100%}mat-dialog-actions{bottom:15px}mat-dialog-actions a{padding:15px!important;margin-right:12px}mat-dialog-actions button{padding:15px!important}mat-dialog-actions .more{margin-right:auto;margin-top:-1rem;padding-top:.4rem!important;margin-left:1rem}.back-button{top:5px;left:0}.close{padding:.4rem .5rem}.no-padding{padding:0}.modal-material{width:40vw}@media(max-width:992px){.modal-material{width:50vw!important}}@media(max-width:576px){::ng-deep .dialog-filter .modal-material,::ng-deep .column-toggle .modal-material{width:100%!important}::ng-deep .dialog-filter mat-dialog-actions,::ng-deep .column-toggle mat-dialog-actions{position:sticky;bottom:0;background:#fff}::ng-deep .dialog-filter .modal-material.d-flex.align-items-start.flex-column.position-relative.maxHeight.bodyScrollable.maxHeight.bodyScrollable .modal-body,::ng-deep .column-toggle .modal-material.d-flex.align-items-start.flex-column.position-relative.maxHeight.bodyScrollable.maxHeight.bodyScrollable .modal-body{max-height:100%!important;overflow-y:auto}}.maxHeight.bodyScrollable .modal-body{max-height:70vh;overflow-y:auto}.maxHeight.hideScrollbar .modal-body{overflow-y:hidden}.modal-header,.modal-footer,.modal-footer .btn{padding:15px}.modal-dialog{max-width:none}.modal-content{width:auto;margin:auto;max-width:850px}.maxHeight .modal-body{max-height:70vh;overflow:auto}.modal-body{padding:1rem}.modal-body strong{display:block}.modal-body .more{margin:0;position:absolute;bottom:-20px}.modal-body input[type=text],.modal-body textarea,.modal-body input[type=password]{border:1px solid #c8d3df;padding:5px 7px}.modal-body table textarea{width:330px;height:90px}div.modal-header{color:#212529}div.modal-header.bg-success,div.modal-header.bg-warning,div.modal-header.bg-info,div.modal-header.bg-danger{color:#fff}div.modal-header.bg-neutral{background-color:#fff;border-bottom:1px solid #c8d3df;color:#212529}div.modal-header.bg-neutral .close{background-color:#fff!important;border:1px solid #c8d3df!important;border-radius:8px}\n"]
131
+ styles: ["::ng-deep .mat-mdc-dialog-container{padding:0!important;border-radius:4px!important;overflow:visible!important}::ng-deep .mat-mdc-dialog-container [mat-dialog-title]{color:#fff;padding:15px;border:none}@media print{::ng-deep .mat-mdc-dialog-container{box-shadow:unset;width:100vw}}@media print{::ng-deep .cdk-overlay-pane{position:absolute!important;top:-30px;max-width:100vw!important}.modal-body{width:100vw!important}}body.modal-body{height:100%}mat-dialog-actions{bottom:15px}mat-dialog-actions a{padding:15px!important;margin-right:12px}mat-dialog-actions button{padding:15px!important}mat-dialog-actions .more{margin-right:auto;margin-top:-1rem;padding-top:.4rem!important;margin-left:1rem}.back-button{top:5px;left:0}.close{padding:.4rem .5rem}.no-padding{padding:0}.modal-material{width:40vw}@media(max-width:992px){.modal-material{width:50vw!important}}@media(max-width:576px){::ng-deep .dialog-filter .modal-material,::ng-deep .column-toggle .modal-material{width:100%!important}::ng-deep .dialog-filter mat-dialog-actions,::ng-deep .column-toggle mat-dialog-actions{position:sticky;bottom:0;background:#fff}::ng-deep .dialog-filter .modal-material.d-flex.align-items-start.flex-column.position-relative.maxHeight.bodyScrollable.maxHeight.bodyScrollable .modal-body,::ng-deep .column-toggle .modal-material.d-flex.align-items-start.flex-column.position-relative.maxHeight.bodyScrollable.maxHeight.bodyScrollable .modal-body{max-height:100%!important;overflow-y:auto}}.maxHeight.bodyScrollable .modal-body{max-height:70vh;overflow-y:auto}.maxHeight.hideScrollbar .modal-body{overflow-y:hidden}.modal-header,.modal-footer,.modal-footer .btn{padding:15px}.modal-dialog{max-width:none}.modal-content{width:auto;margin:auto;max-width:850px}.maxHeight .modal-body{max-height:70vh;overflow:auto}.modal-body{padding:1rem}.modal-body strong{display:block}.modal-body .more{margin:0;position:absolute;bottom:-20px}.modal-body input[type=text],.modal-body textarea,.modal-body input[type=password]{border:1px solid #c8d3df;padding:5px 7px}.modal-body table textarea{width:330px;height:90px}div.modal-header{color:#212529}div.modal-header.bg-success,div.modal-header.bg-warning,div.modal-header.bg-info,div.modal-header.bg-danger{color:#fff}div.modal-header.bg-neutral{background-color:#fff;border-bottom:1px solid #c8d3df;color:#212529}div.modal-header.bg-neutral .close{background-color:#fff!important;border:1px solid #c8d3df!important;border-radius:8px}div.modal-header.bg-neutral .close i{font-size:.8rem;line-height:1;color:#737373}\n"]
132
132
  }]
133
133
  }],
134
134
  propDecorators: {
@@ -1 +1 @@
1
- {"version":3,"file":"dealpos-npm-ng-dealpos-library-components-modal-material.mjs","names":[],"sources":["../../../projects/dealpos-npm/ng-dealpos-library/components/modal-material/src/header-type.ts","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-material/src/modal-material-config.ts","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-material/src/modal-material.component.ts","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-material/src/modal-material.component.html"],"sourcesContent":["export const HeaderType = {\r\n Success: \"Success\",\r\n Info: \"Info\",\r\n Warning: \"Warning\",\r\n Error: \"Error\",\r\n Neutral: \"Neutral\"\r\n}","import { HeaderType } from \"./header-type\";\r\n\r\n/**\r\n * Control the modal UI and UX\r\n */\r\nexport class ModalMaterialConfig {\r\n /**\r\n * Text inside of mat-dialog-title in h4 tag\r\n */\r\n title = 'New Modal';\r\n /**\r\n * the name of the OK button to be displayed\r\n */\r\n okText = 'Ok (F2)';\r\n /**\r\n * the name of the CANCEL button to be displayed\r\n */\r\n cancelText = 'Cancel';\r\n /**\r\n * the condition of whether the footer is displayed\r\n */\r\n hideFooter = false;\r\n /**\r\n * the condition of whether the CANCEL Button is displayed\r\n */\r\n hideCancel = false;\r\n /**\r\n * the condition of whether the OK Button is displayed\r\n */\r\n hideOk = false;\r\n /**\r\n * the condition of whether the CLOSE Button is displayed\r\n */\r\n hideClose = false;\r\n /**\r\n * Indicates whether the back button is enabled or disabled.\r\n * When set to `true`, the back button is enabled.\r\n * When set to `false`, the back button is disabled.\r\n */\r\n backButton = false;\r\n /**\r\n * header type to change the color of the dialog. ex: Success for Green color, Danger for Red color\r\n */\r\n headerType = HeaderType.Success;\r\n /**\r\n * conditions for disable OK button\r\n */\r\n validated = true;\r\n /**\r\n * Customization width for the dialog\r\n */\r\n customWidth = 'initial';\r\n /**\r\n * condition whether the dialog body can be scrolled\r\n */\r\n bodyScrollable = false;\r\n /**\r\n * condition whether the scrollbar body is hide\r\n */\r\n hideScrollbar = false;\r\n /**\r\n *\r\n */\r\n disableKeyup? = false;\r\n /**\r\n * condition to remove the padding in the body of the dialog\r\n */\r\n noPadding = false;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n OnInit,\r\n Input,\r\n NO_ERRORS_SCHEMA,\r\n ContentChild,\r\n TemplateRef,\r\n input,\r\n output,\r\n} from '@angular/core';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { ModalMaterialConfig } from './modal-material-config';\r\nimport { HeaderType } from './header-type';\r\n\r\n@Component({\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n selector: 'modal-material',\r\n templateUrl: './modal-material.component.html',\r\n styleUrls: ['./modal-material.component.scss'],\r\n imports: [NgTemplateOutlet],\r\n schemas: [NO_ERRORS_SCHEMA],\r\n})\r\nexport class ModalMaterialComponent implements OnInit {\r\n @ContentChild('modalContent') modalContent: TemplateRef<any> | undefined;\r\n @Input() config?: ModalMaterialConfig;\r\n readonly dynamicValidated = input<boolean>(true);\r\n /**\r\n * use for prevent enter event,\r\n * usually used for barcode scanner, because barcode scanner will trigger enter event\r\n */\r\n readonly preventEnterEvent = input<boolean>(false);\r\n readonly onOk = output<any>();\r\n readonly onCancel = output<any>();\r\n readonly onClose = output<any>();\r\n readonly onBack = output<any>();\r\n public headerType = HeaderType;\r\n\r\n ngOnInit(): void {\r\n if (this.config == null) {\r\n this.config = new ModalMaterialConfig();\r\n }\r\n }\r\n\r\n onKeyup(event: KeyboardEvent): void {\r\n if (!this.config?.disableKeyup) {\r\n if (event.code == 'F2') {\r\n this.onOk.emit('F2');\r\n }\r\n if (\r\n (event.code == 'Enter' && !this.preventEnterEvent()) ||\r\n event.code == 'NumpadEnter'\r\n ) {\r\n this.onOk.emit('Enter');\r\n }\r\n }\r\n }\r\n}\r\n","<div\r\n (keyup)=\"onKeyup($event)\"\r\n class=\"modal-material d-flex align-items-start flex-column position-relative maxHeight\"\r\n id=\"modal_material\"\r\n [style.width]=\"config?.customWidth\"\r\n [class]=\"{\r\n bodyScrollable: config?.bodyScrollable,\r\n hideScrollbar: config?.hideScrollbar,\r\n }\"\r\n>\r\n <div\r\n mat-dialog-title\r\n class=\"d-flex w-100 justify-content-between modal-header position-relative\"\r\n [class]=\"{\r\n 'bg-success': headerType.Success == config?.headerType,\r\n 'bg-warning': headerType.Warning == config?.headerType,\r\n 'bg-info': headerType.Info == config?.headerType,\r\n 'bg-danger': headerType.Error == config?.headerType,\r\n 'bg-neutral': headerType.Neutral == config?.headerType,\r\n }\"\r\n >\r\n @if (config?.backButton) {\r\n <div\r\n class=\"back-button position-absolute pointer d-print-none\"\r\n (click)=\"onBack.emit(false)\"\r\n >\r\n <a class=\"btn back-button\"><i class=\"fa-solid fa-arrow-left\"></i></a>\r\n </div>\r\n }\r\n <div\r\n class=\"d-flex flex-row d-print-none align-items-center\"\r\n [class.mx-auto]=\"config?.backButton\"\r\n >\r\n <h4 class=\"fw-normal\">{{ config?.title }}</h4>\r\n <ng-content select=\"header\"></ng-content>\r\n </div>\r\n @if (!config?.hideClose) {\r\n <div>\r\n <a\r\n class=\"btn-light-blue btn-sm pointer close\"\r\n (click)=\"onClose.emit('')\"\r\n >\r\n <i class=\"fa-solid fa-xmark fa-lg text-primary\"></i>\r\n </a>\r\n </div>\r\n }\r\n </div>\r\n <mat-dialog-content\r\n class=\"modal-body w-100\"\r\n [class]=\"{\r\n 'show-footer': !config?.hideFooter,\r\n 'p-0': config?.noPadding,\r\n }\"\r\n >\r\n <ng-content select=\"content\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"modalContent\"></ng-container>\r\n </mat-dialog-content>\r\n @if (!config?.hideFooter) {\r\n <mat-dialog-actions\r\n class=\"w-100 py-7 border-top d-flex justify-content-end d-print-none\"\r\n >\r\n <ng-content select=\"footer\"></ng-content>\r\n @if (!config?.hideCancel) {\r\n <a\r\n class=\"btn btn-light-blue text-primary btn-lg fw-bold mx-3\"\r\n (click)=\"onCancel.emit('')\"\r\n [innerHTML]=\"config?.cancelText ? config?.cancelText : 'Cancel'\"\r\n >\r\n </a>\r\n }\r\n @if (!config?.hideOk) {\r\n <button\r\n class=\"btn btn-light-blue me-6 text-primary btn-lg fw-bold mx-3\"\r\n [disabled]=\"!config?.validated || !dynamicValidated()\"\r\n (click)=\"onOk.emit('')\"\r\n (keyup.F2)=\"onOk.emit('')\"\r\n data-cy=\"btn-ok\"\r\n [innerHTML]=\"config?.okText ? config?.okText : 'Ok (F2)'\"\r\n ></button>\r\n }\r\n </mat-dialog-actions>\r\n }\r\n</div>\r\n"],"mappings":";;;AAAA,MAAa,aAAa;CACtB,SAAS;CACT,MAAM;CACN,SAAS;CACT,OAAO;CACP,SAAS;AACZ;ACDD,IAAa,sBAAb,MAAgC;CAAhC,cAAA;EAIE,KAAA,QAAQ;EAIR,KAAA,SAAS;EA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AA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,kBAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,mBAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;GAAA;GAAA,SAAA;IAAA,MAAA;IAAA,UAAA;IAAA,SAAA;IAAA,QAAA;GAAA;GAAA,SAAA,CAAA;IAAA,cAAA;IAAA,OAAA;IAAA,WAAA,CAAA,cAAA;IAAA,aAAA;GAAA,CAAA;GAAA,UAAA;GAAA,UCvBnC;GAmFA,QAAA,CAAA,25EAAA;GAAA,cAAA,CAAA;IAAA,MAAA;IAAA,MD/DY;IAAgB,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;IAAA;GAAA,CAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAGf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EARlC,MAAA;EACkB,MAAA,CAAA;GAAA,iBAAA,wBAAwB;GAAK,UACpC;GAAgB,SAGjB,CAAC,gBAAgB;GAAC,SAClB,CAAC,gBAAgB;GAAC,UAAA;GAAA,QAAA,CAAA,25EAAA;EAAA,CAAA;;;;GAG1B,MAAA;GAAa,MAAA,CAAA,cAAc;;E,WAC3B,MAAA,M"}
1
+ {"version":3,"file":"dealpos-npm-ng-dealpos-library-components-modal-material.mjs","names":[],"sources":["../../../projects/dealpos-npm/ng-dealpos-library/components/modal-material/src/header-type.ts","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-material/src/modal-material-config.ts","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-material/src/modal-material.component.ts","../../../projects/dealpos-npm/ng-dealpos-library/components/modal-material/src/modal-material.component.html"],"sourcesContent":["export const HeaderType = {\r\n Success: \"Success\",\r\n Info: \"Info\",\r\n Warning: \"Warning\",\r\n Error: \"Error\",\r\n Neutral: \"Neutral\"\r\n}","import { HeaderType } from \"./header-type\";\r\n\r\n/**\r\n * Control the modal UI and UX\r\n */\r\nexport class ModalMaterialConfig {\r\n /**\r\n * Text inside of mat-dialog-title in h4 tag\r\n */\r\n title = 'New Modal';\r\n /**\r\n * the name of the OK button to be displayed\r\n */\r\n okText = 'Ok (F2)';\r\n /**\r\n * the name of the CANCEL button to be displayed\r\n */\r\n cancelText = 'Cancel';\r\n /**\r\n * the condition of whether the footer is displayed\r\n */\r\n hideFooter = false;\r\n /**\r\n * the condition of whether the CANCEL Button is displayed\r\n */\r\n hideCancel = false;\r\n /**\r\n * the condition of whether the OK Button is displayed\r\n */\r\n hideOk = false;\r\n /**\r\n * the condition of whether the CLOSE Button is displayed\r\n */\r\n hideClose = false;\r\n /**\r\n * Indicates whether the back button is enabled or disabled.\r\n * When set to `true`, the back button is enabled.\r\n * When set to `false`, the back button is disabled.\r\n */\r\n backButton = false;\r\n /**\r\n * header type to change the color of the dialog. ex: Success for Green color, Danger for Red color\r\n */\r\n headerType = HeaderType.Success;\r\n /**\r\n * conditions for disable OK button\r\n */\r\n validated = true;\r\n /**\r\n * Customization width for the dialog\r\n */\r\n customWidth = 'initial';\r\n /**\r\n * condition whether the dialog body can be scrolled\r\n */\r\n bodyScrollable = false;\r\n /**\r\n * condition whether the scrollbar body is hide\r\n */\r\n hideScrollbar = false;\r\n /**\r\n *\r\n */\r\n disableKeyup? = false;\r\n /**\r\n * condition to remove the padding in the body of the dialog\r\n */\r\n noPadding = false;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n OnInit,\r\n Input,\r\n NO_ERRORS_SCHEMA,\r\n ContentChild,\r\n TemplateRef,\r\n input,\r\n output,\r\n} from '@angular/core';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { ModalMaterialConfig } from './modal-material-config';\r\nimport { HeaderType } from './header-type';\r\n\r\n@Component({\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n selector: 'modal-material',\r\n templateUrl: './modal-material.component.html',\r\n styleUrls: ['./modal-material.component.scss'],\r\n imports: [NgTemplateOutlet],\r\n schemas: [NO_ERRORS_SCHEMA],\r\n})\r\nexport class ModalMaterialComponent implements OnInit {\r\n @ContentChild('modalContent') modalContent: TemplateRef<any> | undefined;\r\n @Input() config?: ModalMaterialConfig;\r\n readonly dynamicValidated = input<boolean>(true);\r\n /**\r\n * use for prevent enter event,\r\n * usually used for barcode scanner, because barcode scanner will trigger enter event\r\n */\r\n readonly preventEnterEvent = input<boolean>(false);\r\n readonly onOk = output<any>();\r\n readonly onCancel = output<any>();\r\n readonly onClose = output<any>();\r\n readonly onBack = output<any>();\r\n public headerType = HeaderType;\r\n\r\n ngOnInit(): void {\r\n if (this.config == null) {\r\n this.config = new ModalMaterialConfig();\r\n }\r\n }\r\n\r\n onKeyup(event: KeyboardEvent): void {\r\n if (!this.config?.disableKeyup) {\r\n if (event.code == 'F2') {\r\n this.onOk.emit('F2');\r\n }\r\n if (\r\n (event.code == 'Enter' && !this.preventEnterEvent()) ||\r\n event.code == 'NumpadEnter'\r\n ) {\r\n this.onOk.emit('Enter');\r\n }\r\n }\r\n }\r\n}\r\n","<div\r\n (keyup)=\"onKeyup($event)\"\r\n class=\"modal-material d-flex align-items-start flex-column position-relative maxHeight\"\r\n id=\"modal_material\"\r\n [style.width]=\"config?.customWidth\"\r\n [class]=\"{\r\n bodyScrollable: config?.bodyScrollable,\r\n hideScrollbar: config?.hideScrollbar,\r\n }\"\r\n>\r\n <div\r\n mat-dialog-title\r\n class=\"d-flex w-100 justify-content-between modal-header position-relative\"\r\n [class]=\"{\r\n 'bg-success': headerType.Success == config?.headerType,\r\n 'bg-warning': headerType.Warning == config?.headerType,\r\n 'bg-info': headerType.Info == config?.headerType,\r\n 'bg-danger': headerType.Error == config?.headerType,\r\n 'bg-neutral': headerType.Neutral == config?.headerType,\r\n }\"\r\n >\r\n @if (config?.backButton) {\r\n <div\r\n class=\"back-button position-absolute pointer d-print-none\"\r\n (click)=\"onBack.emit(false)\"\r\n >\r\n <a class=\"btn back-button\"><i class=\"fa-solid fa-arrow-left\"></i></a>\r\n </div>\r\n }\r\n <div\r\n class=\"d-flex flex-row d-print-none align-items-center\"\r\n [class.mx-auto]=\"config?.backButton\"\r\n >\r\n <h4 class=\"fw-normal\">{{ config?.title }}</h4>\r\n <ng-content select=\"header\"></ng-content>\r\n </div>\r\n @if (!config?.hideClose) {\r\n <div>\r\n <a\r\n class=\"btn-light-blue btn-sm pointer close\"\r\n (click)=\"onClose.emit('')\"\r\n >\r\n <i class=\"fa-solid fa-xmark fa-lg text-primary\"></i>\r\n </a>\r\n </div>\r\n }\r\n </div>\r\n <mat-dialog-content\r\n class=\"modal-body w-100\"\r\n [class]=\"{\r\n 'show-footer': !config?.hideFooter,\r\n 'p-0': config?.noPadding,\r\n }\"\r\n >\r\n <ng-content select=\"content\"></ng-content>\r\n <ng-container *ngTemplateOutlet=\"modalContent\"></ng-container>\r\n </mat-dialog-content>\r\n @if (!config?.hideFooter) {\r\n <mat-dialog-actions\r\n class=\"w-100 py-7 border-top d-flex justify-content-end d-print-none\"\r\n >\r\n <ng-content select=\"footer\"></ng-content>\r\n @if (!config?.hideCancel) {\r\n <a\r\n class=\"btn btn-light-blue text-primary btn-lg fw-bold mx-3\"\r\n (click)=\"onCancel.emit('')\"\r\n [innerHTML]=\"config?.cancelText ? config?.cancelText : 'Cancel'\"\r\n >\r\n </a>\r\n }\r\n @if (!config?.hideOk) {\r\n <button\r\n class=\"btn btn-light-blue me-6 text-primary btn-lg fw-bold mx-3\"\r\n [disabled]=\"!config?.validated || !dynamicValidated()\"\r\n (click)=\"onOk.emit('')\"\r\n (keyup.F2)=\"onOk.emit('')\"\r\n data-cy=\"btn-ok\"\r\n [innerHTML]=\"config?.okText ? config?.okText : 'Ok (F2)'\"\r\n ></button>\r\n }\r\n </mat-dialog-actions>\r\n }\r\n</div>\r\n"],"mappings":";;;AAAA,MAAa,aAAa;CACtB,SAAS;C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,qBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,MAAA;GAAsB,cAAA;GAAA,UAAA;GAAA,QAAA;IAAA,QAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,kBAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;IAAA,mBAAA;KAAA,mBAAA;KAAA,YAAA;KAAA,UAAA;KAAA,YAAA;KAAA,mBAAA;IAAA;GAAA;GAAA,SAAA;IAAA,MAAA;IAAA,UAAA;IAAA,SAAA;IAAA,QAAA;GAAA;GAAA,SAAA,CAAA;IAAA,cAAA;IAAA,OAAA;IAAA,WAAA,CAAA,cAAA;IAAA,aAAA;GAAA,CAAA;GAAA,UAAA;GAAA,UCvBnC;GAmFA,QAAA,CAAA,4+EAAA;GAAA,cAAA,CAAA;IAAA,MAAA;IAAA,MD/DY;IAAgB,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;IAAA;GAAA,CAAA;GAAA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;AAGf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EARlC,MAAA;EACkB,MAAA,CAAA;GAAA,iBAAA,wBAAwB;GAAK,UACpC;GAAgB,SAGjB,CAAC,gBAAgB;GAAC,SAClB,CAAC,gBAAgB;GAAC,UAAA;GAAA,QAAA,CAAA,4+EAAA;EAAA,CAAA;;;;GAG1B,MAAA;GAAa,MAAA,CAAA,cAAc;;E,WAC3B,MAAA,M"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dealpos-npm/ng-dealpos-library",
3
- "version": "22.0.3",
3
+ "version": "22.0.5",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.2.0",
6
6
  "@angular/core": "^22.2.0",