mis-crystal-design-system 4.0.39-test-R → 4.0.40
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/async-search-dropdown/mis-crystal-design-system-async-search-dropdown.metadata.json +1 -1
- package/bundles/mis-crystal-design-system-async-search-dropdown.umd.js +1 -1
- package/bundles/mis-crystal-design-system-async-search-dropdown.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-async-search-dropdown.umd.min.js.map +1 -1
- package/bundles/mis-crystal-design-system-tooltip.umd.js +12 -1
- package/bundles/mis-crystal-design-system-tooltip.umd.js.map +1 -1
- package/bundles/mis-crystal-design-system-tooltip.umd.min.js +1 -1
- package/bundles/mis-crystal-design-system-tooltip.umd.min.js.map +1 -1
- package/esm2015/async-search-dropdown/async-dropdown.component.js +1 -1
- package/esm2015/tooltip/tooltip-container/tooltip.component.js +3 -2
- package/esm2015/tooltip/tooltip.directive.js +7 -1
- package/fesm2015/mis-crystal-design-system-async-search-dropdown.js +1 -1
- package/fesm2015/mis-crystal-design-system-tooltip.js +8 -1
- package/fesm2015/mis-crystal-design-system-tooltip.js.map +1 -1
- package/package.json +1 -1
- package/tooltip/mis-crystal-design-system-tooltip.metadata.json +1 -1
- package/tooltip/tooltip-container/tooltip.component.d.ts +1 -0
- package/tooltip/tooltip.directive.d.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"AsyncDropdownComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":27,"character":1},"arguments":[{"selector":"mis-async-search-dropdown","template":"<div class=\"dd-wrapper\" [ngClass]=\"{ opened: opened, disabled: disabled, readonly: readonly }\" #ddBtn>\n <div class=\"selected-list\" *ngIf=\"multi && selections.size > 0\">\n <div class=\"chip\" [ngClass]=\"{'chip-md': size === 'md', 'chip-sm': size === 'sm'}\" *ngFor=\"let item of selectedItems\">\n <span [ngClass]=\"{'h6': size === 'md', 'h8-b': size === 'sm'}\" style=\"margin-right: 4px;\">{{item[displayKey]}}</span>\n <span style=\"cursor: pointer;\" (click)=\"removeItem(item)\" [ngStyle]=\"{'font-size': size === 'sm' ? '12px': '14px'}\" class=\"ic-navigation-cancel-24\"></span>\n </div>\n </div>\n <div class=\"search-input\">\n <span class=\"ic-action-search-24\"></span>\n <input *ngIf=\"disableCopyPaste; else enableCopyPaste\" [ngClass]=\"{'ip-md': size === 'md', 'ip-sm': size === 'sm'}\" oncopy=\"return false;\" onpaste=\"return false\" oncut=\"return false\" tabindex=\"0\" type=\"text\" class=\"black-text h6\" #input [placeholder]=\"placeholder\" [formControl]=\"searchInput\" (focus)=\"defaultCall()\"/>\n <ng-template #enableCopyPaste>\n <input [ngClass]=\"{'ip-md': size === 'md', 'ip-sm': size === 'sm'}\" tabindex=\"0\" type=\"text\" class=\"black-text h6\" #input [placeholder]=\"placeholder\" [formControl]=\"searchInput\" (focus)=\"defaultCall()\" />\n </ng-template>\n <div class=\"ic-navigation-cancel-24 croos-icon\" *ngIf=\"searchInput?.value?.length\" (click)=\"removeInputValue()\"></div>\n </div>\n</div>\n\n<ng-template #dd>\n <div class=\"dd-list\" [ngStyle]=\"{'max-height':height}\" [ngClass]=\"{'dd-list-pd':data.length === 0}\" >\n <ng-container *ngIf=\"loading\">\n <ng-container\n *ngIf=\"customLoader; else defaultLoader\"\n [ngTemplateOutlet]=\"customLoader\"\n ></ng-container>\n <ng-template #defaultLoader>\n <div class=\"status-container\" *ngIf=\"loading && !customLoader\">\n <mis-loader [mobileView]=\"true\"></mis-loader>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"error\">\n <div class=\"status-container\">\n <p>Unknown error has occurred, <br> Please try again later.</p>\n </div>\n </ng-container>\n <div *ngIf=\"!loading && !error && data.length > 0\">\n <ng-container *ngFor=\"let item of data\">\n <div (click)=\"selectData(item, false)\">\n <ng-container\n *ngIf=\"customItem; else standardItem\"\n [ngTemplateOutlet]=\"customItem\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-container>\n <ng-template #standardItem>\n <div class=\"item\">\n <div class=\"value\">\n <div class=\"primary\">\n {{ item[displayKey] }}\n </div>\n <div class=\"secondary\">\n {{ item[secondaryDisplayKey] }}\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </div>\n <div *ngIf=\"!loading && !error && data.length === 0 && searchInput.value\">\n <div class=\"data-not-found\">No Data Available</div>\n </div>\n </div>\n</ng-template>\n","styles":[".dd-wrapper{background:#fff;border:1px solid #e0e0e0;box-sizing:border-box;border-radius:4px;display:block;cursor:pointer;outline:none}.dd-wrapper.opened,.dd-wrapper:hover{background:#f5f5f5}.dd-wrapper .selected-list{display:flex;justify-content:flex-start;flex-wrap:wrap;gap:4px;padding:8px 16px}.dd-wrapper:focus-within{border-color:#0937b2;background:#f5f5f5}.dd-wrapper.disabled,.dd-wrapper.readonly{pointer-events:none}.search-input{position:relative;border-radius:8px}.search-input input{box-sizing:border-box;outline:none;padding-left:40px;padding-right:24px;background-color:transparent;color:#181f33;border-radius:inherit;border:1px solid transparent;width:100%}.search-input span{font-size:24px;line-height:24px;height:24px;left:8px;padding-top:2px}.search-input .croos-icon,.search-input span{position:absolute;top:50%;transform:translateY(-50%)}.search-input .croos-icon{font-size:16px;width:24px;line-height:16px;height:16px;right:0;z-index:1001}.dd-list{padding:8px 0;max-height:200px;background:#fff;box-shadow:0 12px 24px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.12);border-radius:8px;min-width:100%;overflow-y:auto}.dd-list::-webkit-scrollbar{width:8px;border-radius:4px}.dd-list::-webkit-scrollbar-track{background:#fff;border-radius:4px}.dd-list::-webkit-scrollbar-thumb{background:#929dab;border-radius:4px}.dd-list::-webkit-scrollbar-thumb:hover{background:#929dab}.dd-list .item{padding:8px 16px;cursor:pointer}.dd-list .item .disabled{color:#6a737d!important;pointer-events:none}.dd-list .item .value{display:flex;justify-content:space-between;align-items:center}.dd-list .item .value .primary,.dd-list .item .value .secondary{font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#181f33}.dd-list .item .reason{font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d}.dd-list .item:hover:not(.disabled){background:#f5f7fc}.dd-list .data-not-found{display:flex;justify-content:center;align-items:center;font-size:16px;padding:8px}.dd-list-pd{padding:unset}.chip{display:inline-flex;align-items:center;background:#e0e0e0;cursor:default}.chip span{color:#181f33}.chip-md{border-radius:16px;padding:4px 12px}.chip-sm{border-radius:6px;padding:4px 8px;text-transform:uppercase}.ip-md{padding-top:8px;padding-bottom:8px}.ip-sm{padding-top:3px;padding-bottom:3px}.status-container{display:flex;justify-content:center;align-items:center;height:128px}.status-container p{text-align:center}::ng-deep #spinner{position:relative!important}"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"Overlay","line":33,"character":31},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":33,"character":66},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":33,"character":101}]}],"height":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":3}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}}]}],"httpStream":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}}]}],"displayKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":3}}]}],"secondaryDisplayKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":38,"character":3}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":3}}]}],"debounceTime":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":3}}]}],"minInputLength":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":3}}]}],"multi":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":3}}]}],"uniqueKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":3}}]}],"control":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}}]}],"disableCopyPaste":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":47,"character":3}}]}],"origin":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":48,"character":3},"arguments":["ddBtn",{"static":false}]}]}],"input":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":49,"character":3},"arguments":["input",{"static":false}]}]}],"dd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":50,"character":3},"arguments":["dd",{"static":false}]}]}],"customItem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":51,"character":3},"arguments":["misCustomItem",{"static":false}]}]}],"customLoader":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":53,"character":3},"arguments":["asyncCustomLoader",{"static":false}]}]}],"onSelect":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":56,"character":3}}]}],"selections":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":63,"character":3}}]}],"searchValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":3}}]}],"searchQueryChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":69,"character":3}}]}],"clear":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":70,"character":3}}]}],"itemSelected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":71,"character":3}}]}],"itemRemoved":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":72,"character":3}}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"openDropdown":[{"__symbolic":"method"}],"closeDropdown":[{"__symbolic":"method"}],"selectData":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"setControlValue":[{"__symbolic":"method"}],"removeInputValue":[{"__symbolic":"method"}],"defaultCall":[{"__symbolic":"method"}]}},"AsyncDropdownModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"AsyncDropdownComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":9,"character":12},{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"OverlayModule","line":9,"character":26},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":9,"character":41},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":9,"character":62},{"__symbolic":"reference","module":"mis-crystal-design-system/loader","name":"LoaderModule","line":9,"character":75}],"exports":[{"__symbolic":"reference","name":"AsyncDropdownComponent"}]}]}],"members":{}}},"origins":{"AsyncDropdownComponent":"./async-dropdown.component","AsyncDropdownModule":"./async-dropdown.module"},"importAs":"mis-crystal-design-system/async-search-dropdown"}
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"AsyncDropdownComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":27,"character":1},"arguments":[{"selector":"mis-async-search-dropdown","template":"<div class=\"dd-wrapper\" [ngClass]=\"{ opened: opened, disabled: disabled, readonly: readonly }\" #ddBtn>\n <div class=\"selected-list\" *ngIf=\"multi && selections.size > 0\">\n <div class=\"chip\" [ngClass]=\"{'chip-md': size === 'md', 'chip-sm': size === 'sm'}\" *ngFor=\"let item of selectedItems\">\n <span [ngClass]=\"{'h6': size === 'md', 'h8-b': size === 'sm'}\" style=\"margin-right: 4px;\">{{item[displayKey]}}</span>\n <span style=\"cursor: pointer;\" (click)=\"removeItem(item)\" [ngStyle]=\"{'font-size': size === 'sm' ? '12px': '14px'}\" class=\"ic-navigation-cancel-24\"></span>\n </div>\n </div>\n <div class=\"search-input\">\n <span class=\"ic-action-search-24\"></span>\n <input *ngIf=\"disableCopyPaste; else enableCopyPaste\" [ngClass]=\"{'ip-md': size === 'md', 'ip-sm': size === 'sm'}\" oncopy=\"return false;\" onpaste=\"return false\" oncut=\"return false\" tabindex=\"0\" type=\"text\" class=\"black-text h6\" #input [placeholder]=\"placeholder\" [formControl]=\"searchInput\" (focus)=\"defaultCall()\"/>\n <ng-template #enableCopyPaste>\n <input [ngClass]=\"{'ip-md': size === 'md', 'ip-sm': size === 'sm'}\" tabindex=\"0\" type=\"text\" class=\"black-text h6\" #input [placeholder]=\"placeholder\" [formControl]=\"searchInput\" (focus)=\"defaultCall()\" />\n </ng-template>\n <div class=\"ic-navigation-cancel-24 croos-icon\" *ngIf=\"searchInput?.value?.length\" (click)=\"removeInputValue()\"></div>\n </div>\n</div>\n\n<ng-template #dd>\n <div class=\"dd-list\" [ngStyle]=\"{'max-height':height}\" [ngClass]=\"{'dd-list-pd':data.length === 0}\" >\n <ng-container *ngIf=\"loading\">\n <ng-container\n *ngIf=\"customLoader; else defaultLoader\"\n [ngTemplateOutlet]=\"customLoader\"\n ></ng-container>\n <ng-template #defaultLoader>\n <div class=\"status-container\" *ngIf=\"loading && !customLoader\">\n <mis-loader [mobileView]=\"true\"></mis-loader>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"error\">\n <div class=\"status-container\">\n <p>Unknown error has occurred, <br> Please try again later.</p>\n </div>\n </ng-container>\n <div *ngIf=\"!loading && !error && data.length > 0\">\n <ng-container *ngFor=\"let item of data\">\n <div (click)=\"selectData(item, false)\">\n <ng-container\n *ngIf=\"customItem; else standardItem\"\n [ngTemplateOutlet]=\"customItem\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-container>\n <ng-template #standardItem>\n <div class=\"item\">\n <div class=\"value\">\n <div class=\"primary\">\n {{ item[displayKey] }}\n </div>\n <div class=\"secondary\">\n {{ item[secondaryDisplayKey] }}\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </div>\n <div *ngIf=\"!loading && !error && data.length === 0 && searchInput.value\">\n <div class=\"data-not-found\">No Data Available</div>\n </div>\n </div>\n</ng-template>\n","styles":[".dd-wrapper{background:#fff;border:1px solid #e0e0e0;box-sizing:border-box;border-radius:4px;display:block;cursor:pointer;outline:none}.dd-wrapper.opened,.dd-wrapper:hover{background:#f5f5f5}.dd-wrapper .selected-list{display:flex;justify-content:flex-start;flex-wrap:wrap;gap:4px;padding:8px 16px}.dd-wrapper:focus-within{border-color:#0937b2;background:#f5f5f5}.dd-wrapper.disabled,.dd-wrapper.readonly{pointer-events:none}.search-input{position:relative;border-radius:8px}.search-input input{box-sizing:border-box;outline:none;padding-left:40px;padding-right:24px;background-color:transparent;color:#181f33;border-radius:inherit;border:1px solid transparent;width:100%}.search-input span{font-size:24px;line-height:24px;height:24px;left:8px;padding-top:2px}.search-input .croos-icon,.search-input span{position:absolute;top:50%;transform:translateY(-50%)}.search-input .croos-icon{font-size:16px;width:24px;line-height:16px;height:16px;right:0}.dd-list{padding:8px 0;max-height:200px;background:#fff;box-shadow:0 12px 24px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.12);border-radius:8px;min-width:100%;overflow-y:auto}.dd-list::-webkit-scrollbar{width:8px;border-radius:4px}.dd-list::-webkit-scrollbar-track{background:#fff;border-radius:4px}.dd-list::-webkit-scrollbar-thumb{background:#929dab;border-radius:4px}.dd-list::-webkit-scrollbar-thumb:hover{background:#929dab}.dd-list .item{padding:8px 16px;cursor:pointer}.dd-list .item .disabled{color:#6a737d!important;pointer-events:none}.dd-list .item .value{display:flex;justify-content:space-between;align-items:center}.dd-list .item .value .primary,.dd-list .item .value .secondary{font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#181f33}.dd-list .item .reason{font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d}.dd-list .item:hover:not(.disabled){background:#f5f7fc}.dd-list .data-not-found{display:flex;justify-content:center;align-items:center;font-size:16px;padding:8px}.dd-list-pd{padding:unset}.chip{display:inline-flex;align-items:center;background:#e0e0e0;cursor:default}.chip span{color:#181f33}.chip-md{border-radius:16px;padding:4px 12px}.chip-sm{border-radius:6px;padding:4px 8px;text-transform:uppercase}.ip-md{padding-top:8px;padding-bottom:8px}.ip-sm{padding-top:3px;padding-bottom:3px}.status-container{display:flex;justify-content:center;align-items:center;height:128px}.status-container p{text-align:center}::ng-deep #spinner{position:relative!important}"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"Overlay","line":33,"character":31},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":33,"character":66},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":33,"character":101}]}],"height":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":3}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}}]}],"httpStream":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}}]}],"displayKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":3}}]}],"secondaryDisplayKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":38,"character":3}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":3}}]}],"debounceTime":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":3}}]}],"minInputLength":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":3}}]}],"multi":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":3}}]}],"uniqueKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":3}}]}],"control":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}}]}],"disableCopyPaste":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":47,"character":3}}]}],"origin":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":48,"character":3},"arguments":["ddBtn",{"static":false}]}]}],"input":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":49,"character":3},"arguments":["input",{"static":false}]}]}],"dd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":50,"character":3},"arguments":["dd",{"static":false}]}]}],"customItem":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":51,"character":3},"arguments":["misCustomItem",{"static":false}]}]}],"customLoader":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":53,"character":3},"arguments":["asyncCustomLoader",{"static":false}]}]}],"onSelect":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":56,"character":3}}]}],"selections":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":63,"character":3}}]}],"searchValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":3}}]}],"searchQueryChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":69,"character":3}}]}],"clear":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":70,"character":3}}]}],"itemSelected":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":71,"character":3}}]}],"itemRemoved":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":72,"character":3}}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"openDropdown":[{"__symbolic":"method"}],"closeDropdown":[{"__symbolic":"method"}],"selectData":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"setControlValue":[{"__symbolic":"method"}],"removeInputValue":[{"__symbolic":"method"}],"defaultCall":[{"__symbolic":"method"}]}},"AsyncDropdownModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"AsyncDropdownComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":9,"character":12},{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"OverlayModule","line":9,"character":26},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":9,"character":41},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":9,"character":62},{"__symbolic":"reference","module":"mis-crystal-design-system/loader","name":"LoaderModule","line":9,"character":75}],"exports":[{"__symbolic":"reference","name":"AsyncDropdownComponent"}]}]}],"members":{}}},"origins":{"AsyncDropdownComponent":"./async-dropdown.component","AsyncDropdownModule":"./async-dropdown.module"},"importAs":"mis-crystal-design-system/async-search-dropdown"}
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
{ type: core.Component, args: [{
|
|
217
217
|
selector: "mis-async-search-dropdown",
|
|
218
218
|
template: "<div class=\"dd-wrapper\" [ngClass]=\"{ opened: opened, disabled: disabled, readonly: readonly }\" #ddBtn>\n <div class=\"selected-list\" *ngIf=\"multi && selections.size > 0\">\n <div class=\"chip\" [ngClass]=\"{'chip-md': size === 'md', 'chip-sm': size === 'sm'}\" *ngFor=\"let item of selectedItems\">\n <span [ngClass]=\"{'h6': size === 'md', 'h8-b': size === 'sm'}\" style=\"margin-right: 4px;\">{{item[displayKey]}}</span>\n <span style=\"cursor: pointer;\" (click)=\"removeItem(item)\" [ngStyle]=\"{'font-size': size === 'sm' ? '12px': '14px'}\" class=\"ic-navigation-cancel-24\"></span>\n </div>\n </div>\n <div class=\"search-input\">\n <span class=\"ic-action-search-24\"></span>\n <input *ngIf=\"disableCopyPaste; else enableCopyPaste\" [ngClass]=\"{'ip-md': size === 'md', 'ip-sm': size === 'sm'}\" oncopy=\"return false;\" onpaste=\"return false\" oncut=\"return false\" tabindex=\"0\" type=\"text\" class=\"black-text h6\" #input [placeholder]=\"placeholder\" [formControl]=\"searchInput\" (focus)=\"defaultCall()\"/>\n <ng-template #enableCopyPaste>\n <input [ngClass]=\"{'ip-md': size === 'md', 'ip-sm': size === 'sm'}\" tabindex=\"0\" type=\"text\" class=\"black-text h6\" #input [placeholder]=\"placeholder\" [formControl]=\"searchInput\" (focus)=\"defaultCall()\" />\n </ng-template>\n <div class=\"ic-navigation-cancel-24 croos-icon\" *ngIf=\"searchInput?.value?.length\" (click)=\"removeInputValue()\"></div>\n </div>\n</div>\n\n<ng-template #dd>\n <div class=\"dd-list\" [ngStyle]=\"{'max-height':height}\" [ngClass]=\"{'dd-list-pd':data.length === 0}\" >\n <ng-container *ngIf=\"loading\">\n <ng-container\n *ngIf=\"customLoader; else defaultLoader\"\n [ngTemplateOutlet]=\"customLoader\"\n ></ng-container>\n <ng-template #defaultLoader>\n <div class=\"status-container\" *ngIf=\"loading && !customLoader\">\n <mis-loader [mobileView]=\"true\"></mis-loader>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"error\">\n <div class=\"status-container\">\n <p>Unknown error has occurred, <br> Please try again later.</p>\n </div>\n </ng-container>\n <div *ngIf=\"!loading && !error && data.length > 0\">\n <ng-container *ngFor=\"let item of data\">\n <div (click)=\"selectData(item, false)\">\n <ng-container\n *ngIf=\"customItem; else standardItem\"\n [ngTemplateOutlet]=\"customItem\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-container>\n <ng-template #standardItem>\n <div class=\"item\">\n <div class=\"value\">\n <div class=\"primary\">\n {{ item[displayKey] }}\n </div>\n <div class=\"secondary\">\n {{ item[secondaryDisplayKey] }}\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </div>\n <div *ngIf=\"!loading && !error && data.length === 0 && searchInput.value\">\n <div class=\"data-not-found\">No Data Available</div>\n </div>\n </div>\n</ng-template>\n",
|
|
219
|
-
styles: [".dd-wrapper{background:#fff;border:1px solid #e0e0e0;box-sizing:border-box;border-radius:4px;display:block;cursor:pointer;outline:none}.dd-wrapper.opened,.dd-wrapper:hover{background:#f5f5f5}.dd-wrapper .selected-list{display:flex;justify-content:flex-start;flex-wrap:wrap;gap:4px;padding:8px 16px}.dd-wrapper:focus-within{border-color:#0937b2;background:#f5f5f5}.dd-wrapper.disabled,.dd-wrapper.readonly{pointer-events:none}.search-input{position:relative;border-radius:8px}.search-input input{box-sizing:border-box;outline:none;padding-left:40px;padding-right:24px;background-color:transparent;color:#181f33;border-radius:inherit;border:1px solid transparent;width:100%}.search-input span{font-size:24px;line-height:24px;height:24px;left:8px;padding-top:2px}.search-input .croos-icon,.search-input span{position:absolute;top:50%;transform:translateY(-50%)}.search-input .croos-icon{font-size:16px;width:24px;line-height:16px;height:16px;right:0
|
|
219
|
+
styles: [".dd-wrapper{background:#fff;border:1px solid #e0e0e0;box-sizing:border-box;border-radius:4px;display:block;cursor:pointer;outline:none}.dd-wrapper.opened,.dd-wrapper:hover{background:#f5f5f5}.dd-wrapper .selected-list{display:flex;justify-content:flex-start;flex-wrap:wrap;gap:4px;padding:8px 16px}.dd-wrapper:focus-within{border-color:#0937b2;background:#f5f5f5}.dd-wrapper.disabled,.dd-wrapper.readonly{pointer-events:none}.search-input{position:relative;border-radius:8px}.search-input input{box-sizing:border-box;outline:none;padding-left:40px;padding-right:24px;background-color:transparent;color:#181f33;border-radius:inherit;border:1px solid transparent;width:100%}.search-input span{font-size:24px;line-height:24px;height:24px;left:8px;padding-top:2px}.search-input .croos-icon,.search-input span{position:absolute;top:50%;transform:translateY(-50%)}.search-input .croos-icon{font-size:16px;width:24px;line-height:16px;height:16px;right:0}.dd-list{padding:8px 0;max-height:200px;background:#fff;box-shadow:0 12px 24px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.12);border-radius:8px;min-width:100%;overflow-y:auto}.dd-list::-webkit-scrollbar{width:8px;border-radius:4px}.dd-list::-webkit-scrollbar-track{background:#fff;border-radius:4px}.dd-list::-webkit-scrollbar-thumb{background:#929dab;border-radius:4px}.dd-list::-webkit-scrollbar-thumb:hover{background:#929dab}.dd-list .item{padding:8px 16px;cursor:pointer}.dd-list .item .disabled{color:#6a737d!important;pointer-events:none}.dd-list .item .value{display:flex;justify-content:space-between;align-items:center}.dd-list .item .value .primary,.dd-list .item .value .secondary{font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#181f33}.dd-list .item .reason{font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d}.dd-list .item:hover:not(.disabled){background:#f5f7fc}.dd-list .data-not-found{display:flex;justify-content:center;align-items:center;font-size:16px;padding:8px}.dd-list-pd{padding:unset}.chip{display:inline-flex;align-items:center;background:#e0e0e0;cursor:default}.chip span{color:#181f33}.chip-md{border-radius:16px;padding:4px 12px}.chip-sm{border-radius:6px;padding:4px 8px;text-transform:uppercase}.ip-md{padding-top:8px;padding-bottom:8px}.ip-sm{padding-top:3px;padding-bottom:3px}.status-container{display:flex;justify-content:center;align-items:center;height:128px}.status-container p{text-align:center}::ng-deep #spinner{position:relative!important}"]
|
|
220
220
|
},] }
|
|
221
221
|
];
|
|
222
222
|
AsyncDropdownComponent.ctorParameters = function () { return [
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/core"),require("@angular/forms"),require("rxjs/operators"),require("@angular/common"),require("mis-crystal-design-system/loader")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/async-search-dropdown",["exports","@angular/cdk/overlay","@angular/cdk/portal","@angular/core","@angular/forms","rxjs/operators","@angular/common","mis-crystal-design-system/loader"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["mis-crystal-design-system"]=e["mis-crystal-design-system"]||{},e["mis-crystal-design-system"]["async-search-dropdown"]={}),e.ng.cdk.overlay,e.ng.cdk.portal,e.ng.core,e.ng.forms,e.rxjs.operators,e.ng.common,e["mis-crystal-design-system"].loader)}(this,(function(e,t,n,i,o,s,a,r){"use strict";var l=function(){function e(e,t,n){var s=this;this.overlay=e,this.viewContainerRef=t,this._ngZone=n,this.size="md",this.placeholder="Select",this.debounceTime=400,this.minInputLength=2,this.multi=!1,this.disableCopyPaste=!1,this.onSelect=new i.EventEmitter(!0),this.searchInput=new o.FormControl,this.data=[],this.opened=!1,this.loading=!1,this.error=!1,this.selections=new Map,this.searchQueryChange=new i.EventEmitter,this.clear=new i.EventEmitter(!1),this.itemSelected=new i.EventEmitter,this.itemRemoved=new i.EventEmitter,this.handleControlChanges=function(e){e.forEach((function(e){s.selectData(e,!0)}))}}return e.prototype.ngOnInit=function(){var e,t,n=this;if(this.multi&&!this.uniqueKey)throw new Error("[uniqueKey] required in multi mode.");this.disabled&&this.searchInput.disable(),this.searchSubscription=this.searchInput.valueChanges.pipe(s.tap((function(e){return n.searchQueryChange.emit(e)})),s.debounceTime(this.debounceTime),s.distinctUntilChanged()).subscribe((function(e){n._ngZone.run((function(){var t;(null==e?void 0:e.length)<n.minInputLength||!(null==e?void 0:e.length)?n.closeDropdown():(null==e?void 0:e.length)>n.minInputLength&&n.httpStream&&(n.loading=!0,n.error=!1,(null===(t=n.overlayRef)||void 0===t?void 0:t.hasAttached())||n.openDropdown(n.dd,n.origin.nativeElement),n.httpStream(e).subscribe((function(e){var t;n.loading=!1,n.data=e,!(null===(t=n.overlayRef)||void 0===t?void 0:t.hasAttached())&&e.length>0&&n.openDropdown(n.dd,n.origin.nativeElement)}),(function(e){n.loading=!1,n.error=!0})))}))})),(null===(e=this.control)||void 0===e?void 0:e.value)&&this.handleControlChanges(this.control.value),this.controlSubscription=null===(t=this.control)||void 0===t?void 0:t.valueChanges.subscribe(this.handleControlChanges)},e.prototype.ngOnChanges=function(e){var t;e&&(null===(t=null==e?void 0:e.searchValue)||void 0===t?void 0:t.currentValue)&&this.searchInput.patchValue(e.searchValue.currentValue),e&&e.disabled&&(this.searchInput.enable(),this.disabled&&this.searchInput.disable())},e.prototype.ngOnDestroy=function(){var e,t;null===(e=this.searchSubscription)||void 0===e||e.unsubscribe(),null===(t=this.defaultCallSubscription)||void 0===t||t.unsubscribe()},e.prototype.openDropdown=function(e,i){var o=this,s=this.overlay.position().flexibleConnectedTo(i).withPositions([new t.ConnectionPositionPair({originX:"start",originY:"bottom"},{overlayX:"start",overlayY:"top"}),new t.ConnectionPositionPair({originX:"start",originY:"top"},{overlayX:"start",overlayY:"bottom"})]).withPush(!0),a=new t.OverlayConfig({hasBackdrop:!0,backdropClass:"cdk-overlay-transparent-backdrop",scrollStrategy:this.overlay.scrollStrategies.reposition(),positionStrategy:s,width:i.clientWidth});this.overlayRef=this.overlay.create(a),this.overlayRef.attach(new n.TemplatePortal(e,this.viewContainerRef)),this.overlayRef.backdropClick().subscribe((function(e){o.closeDropdown()}))},e.prototype.closeDropdown=function(){var e;this.opened=!1,null===(e=this.overlayRef)||void 0===e||e.detach(),this.data=[]},e.prototype.selectData=function(e,t){var n=this;void 0===t&&(t=!0),e.disabled||(this.itemSelected.emit(e),this.multi?(this.selections.has(e[this.uniqueKey])||this.selections.set(e[this.uniqueKey],e),this.setControlValue(this.selectedItems),t||setTimeout((function(){n.input.nativeElement.focus(),n.input.nativeElement.scrollIntoView()}),10),this.searchInput.patchValue(""),this.data=[]):(this.searchInput.patchValue(e[this.displayKey],{emitEvent:!1}),this.setControlValue(e)),this.closeDropdown())},e.prototype.removeItem=function(e){this.itemRemoved.emit(e),this.selections.delete(e[this.uniqueKey]),this.setControlValue(this.selectedItems),this.input.nativeElement.focus()},e.prototype.setControlValue=function(e){var t;this.onSelect.emit(e),null===(t=this.control)||void 0===t||t.patchValue(e,{emitEvent:!1})},Object.defineProperty(e.prototype,"selectedItems",{get:function(){return Array.from(this.selections.values())},enumerable:!1,configurable:!0}),e.prototype.removeInputValue=function(){this.searchInput.reset(),this.data=[],this.clear.emit(!0)},e.prototype.defaultCall=function(){var e=this;-1===this.minInputLength&&(this.loading=!0,this.defaultCallSubscription=this.httpStream(this.searchInput.value||"").subscribe((function(t){var n,i;e.loading=!1,e.data=t,!(null===(n=e.overlayRef)||void 0===n?void 0:n.hasAttached())&&(null===(i=e.data)||void 0===i?void 0:i.length)>0&&e.openDropdown(e.dd,e.origin.nativeElement)}),(function(t){e.loading=!1,e.error=!0})))},e}();l.decorators=[{type:i.Component,args:[{selector:"mis-async-search-dropdown",template:'<div class="dd-wrapper" [ngClass]="{ opened: opened, disabled: disabled, readonly: readonly }" #ddBtn>\n <div class="selected-list" *ngIf="multi && selections.size > 0">\n <div class="chip" [ngClass]="{\'chip-md\': size === \'md\', \'chip-sm\': size === \'sm\'}" *ngFor="let item of selectedItems">\n <span [ngClass]="{\'h6\': size === \'md\', \'h8-b\': size === \'sm\'}" style="margin-right: 4px;">{{item[displayKey]}}</span>\n <span style="cursor: pointer;" (click)="removeItem(item)" [ngStyle]="{\'font-size\': size === \'sm\' ? \'12px\': \'14px\'}" class="ic-navigation-cancel-24"></span>\n </div>\n </div>\n <div class="search-input">\n <span class="ic-action-search-24"></span>\n <input *ngIf="disableCopyPaste; else enableCopyPaste" [ngClass]="{\'ip-md\': size === \'md\', \'ip-sm\': size === \'sm\'}" oncopy="return false;" onpaste="return false" oncut="return false" tabindex="0" type="text" class="black-text h6" #input [placeholder]="placeholder" [formControl]="searchInput" (focus)="defaultCall()"/>\n <ng-template #enableCopyPaste>\n <input [ngClass]="{\'ip-md\': size === \'md\', \'ip-sm\': size === \'sm\'}" tabindex="0" type="text" class="black-text h6" #input [placeholder]="placeholder" [formControl]="searchInput" (focus)="defaultCall()" />\n </ng-template>\n <div class="ic-navigation-cancel-24 croos-icon" *ngIf="searchInput?.value?.length" (click)="removeInputValue()"></div>\n </div>\n</div>\n\n<ng-template #dd>\n <div class="dd-list" [ngStyle]="{\'max-height\':height}" [ngClass]="{\'dd-list-pd\':data.length === 0}" >\n <ng-container *ngIf="loading">\n <ng-container\n *ngIf="customLoader; else defaultLoader"\n [ngTemplateOutlet]="customLoader"\n ></ng-container>\n <ng-template #defaultLoader>\n <div class="status-container" *ngIf="loading && !customLoader">\n <mis-loader [mobileView]="true"></mis-loader>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf="error">\n <div class="status-container">\n <p>Unknown error has occurred, <br> Please try again later.</p>\n </div>\n </ng-container>\n <div *ngIf="!loading && !error && data.length > 0">\n <ng-container *ngFor="let item of data">\n <div (click)="selectData(item, false)">\n <ng-container\n *ngIf="customItem; else standardItem"\n [ngTemplateOutlet]="customItem"\n [ngTemplateOutletContext]="{ $implicit: item }"\n ></ng-container>\n <ng-template #standardItem>\n <div class="item">\n <div class="value">\n <div class="primary">\n {{ item[displayKey] }}\n </div>\n <div class="secondary">\n {{ item[secondaryDisplayKey] }}\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </div>\n <div *ngIf="!loading && !error && data.length === 0 && searchInput.value">\n <div class="data-not-found">No Data Available</div>\n </div>\n </div>\n</ng-template>\n',styles:[".dd-wrapper{background:#fff;border:1px solid #e0e0e0;box-sizing:border-box;border-radius:4px;display:block;cursor:pointer;outline:none}.dd-wrapper.opened,.dd-wrapper:hover{background:#f5f5f5}.dd-wrapper .selected-list{display:flex;justify-content:flex-start;flex-wrap:wrap;gap:4px;padding:8px 16px}.dd-wrapper:focus-within{border-color:#0937b2;background:#f5f5f5}.dd-wrapper.disabled,.dd-wrapper.readonly{pointer-events:none}.search-input{position:relative;border-radius:8px}.search-input input{box-sizing:border-box;outline:none;padding-left:40px;padding-right:24px;background-color:transparent;color:#181f33;border-radius:inherit;border:1px solid transparent;width:100%}.search-input span{font-size:24px;line-height:24px;height:24px;left:8px;padding-top:2px}.search-input .croos-icon,.search-input span{position:absolute;top:50%;transform:translateY(-50%)}.search-input .croos-icon{font-size:16px;width:24px;line-height:16px;height:16px;right:0;z-index:1001}.dd-list{padding:8px 0;max-height:200px;background:#fff;box-shadow:0 12px 24px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.12);border-radius:8px;min-width:100%;overflow-y:auto}.dd-list::-webkit-scrollbar{width:8px;border-radius:4px}.dd-list::-webkit-scrollbar-track{background:#fff;border-radius:4px}.dd-list::-webkit-scrollbar-thumb{background:#929dab;border-radius:4px}.dd-list::-webkit-scrollbar-thumb:hover{background:#929dab}.dd-list .item{padding:8px 16px;cursor:pointer}.dd-list .item .disabled{color:#6a737d!important;pointer-events:none}.dd-list .item .value{display:flex;justify-content:space-between;align-items:center}.dd-list .item .value .primary,.dd-list .item .value .secondary{font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#181f33}.dd-list .item .reason{font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d}.dd-list .item:hover:not(.disabled){background:#f5f7fc}.dd-list .data-not-found{display:flex;justify-content:center;align-items:center;font-size:16px;padding:8px}.dd-list-pd{padding:unset}.chip{display:inline-flex;align-items:center;background:#e0e0e0;cursor:default}.chip span{color:#181f33}.chip-md{border-radius:16px;padding:4px 12px}.chip-sm{border-radius:6px;padding:4px 8px;text-transform:uppercase}.ip-md{padding-top:8px;padding-bottom:8px}.ip-sm{padding-top:3px;padding-bottom:3px}.status-container{display:flex;justify-content:center;align-items:center;height:128px}.status-container p{text-align:center}::ng-deep #spinner{position:relative!important}"]}]}],l.ctorParameters=function(){return[{type:t.Overlay},{type:i.ViewContainerRef},{type:i.NgZone}]},l.propDecorators={height:[{type:i.Input}],size:[{type:i.Input}],httpStream:[{type:i.Input}],displayKey:[{type:i.Input}],secondaryDisplayKey:[{type:i.Input}],placeholder:[{type:i.Input}],debounceTime:[{type:i.Input}],minInputLength:[{type:i.Input}],multi:[{type:i.Input}],uniqueKey:[{type:i.Input}],control:[{type:i.Input}],disabled:[{type:i.Input}],readonly:[{type:i.Input}],disableCopyPaste:[{type:i.Input}],origin:[{type:i.ViewChild,args:["ddBtn",{static:!1}]}],input:[{type:i.ViewChild,args:["input",{static:!1}]}],dd:[{type:i.ViewChild,args:["dd",{static:!1}]}],customItem:[{type:i.ContentChild,args:["misCustomItem",{static:!1}]}],customLoader:[{type:i.ContentChild,args:["asyncCustomLoader",{static:!1}]}],onSelect:[{type:i.Output}],selections:[{type:i.Input}],searchValue:[{type:i.Input}],searchQueryChange:[{type:i.Output}],clear:[{type:i.Output}],itemSelected:[{type:i.Output}],itemRemoved:[{type:i.Output}]};var d=function(){};d.decorators=[{type:i.NgModule,args:[{declarations:[l],imports:[a.CommonModule,t.OverlayModule,o.ReactiveFormsModule,o.FormsModule,r.LoaderModule],exports:[l]}]}],e.AsyncDropdownComponent=l,e.AsyncDropdownModule=d,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/core"),require("@angular/forms"),require("rxjs/operators"),require("@angular/common"),require("mis-crystal-design-system/loader")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/async-search-dropdown",["exports","@angular/cdk/overlay","@angular/cdk/portal","@angular/core","@angular/forms","rxjs/operators","@angular/common","mis-crystal-design-system/loader"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["mis-crystal-design-system"]=e["mis-crystal-design-system"]||{},e["mis-crystal-design-system"]["async-search-dropdown"]={}),e.ng.cdk.overlay,e.ng.cdk.portal,e.ng.core,e.ng.forms,e.rxjs.operators,e.ng.common,e["mis-crystal-design-system"].loader)}(this,(function(e,t,n,i,o,s,a,r){"use strict";var l=function(){function e(e,t,n){var s=this;this.overlay=e,this.viewContainerRef=t,this._ngZone=n,this.size="md",this.placeholder="Select",this.debounceTime=400,this.minInputLength=2,this.multi=!1,this.disableCopyPaste=!1,this.onSelect=new i.EventEmitter(!0),this.searchInput=new o.FormControl,this.data=[],this.opened=!1,this.loading=!1,this.error=!1,this.selections=new Map,this.searchQueryChange=new i.EventEmitter,this.clear=new i.EventEmitter(!1),this.itemSelected=new i.EventEmitter,this.itemRemoved=new i.EventEmitter,this.handleControlChanges=function(e){e.forEach((function(e){s.selectData(e,!0)}))}}return e.prototype.ngOnInit=function(){var e,t,n=this;if(this.multi&&!this.uniqueKey)throw new Error("[uniqueKey] required in multi mode.");this.disabled&&this.searchInput.disable(),this.searchSubscription=this.searchInput.valueChanges.pipe(s.tap((function(e){return n.searchQueryChange.emit(e)})),s.debounceTime(this.debounceTime),s.distinctUntilChanged()).subscribe((function(e){n._ngZone.run((function(){var t;(null==e?void 0:e.length)<n.minInputLength||!(null==e?void 0:e.length)?n.closeDropdown():(null==e?void 0:e.length)>n.minInputLength&&n.httpStream&&(n.loading=!0,n.error=!1,(null===(t=n.overlayRef)||void 0===t?void 0:t.hasAttached())||n.openDropdown(n.dd,n.origin.nativeElement),n.httpStream(e).subscribe((function(e){var t;n.loading=!1,n.data=e,!(null===(t=n.overlayRef)||void 0===t?void 0:t.hasAttached())&&e.length>0&&n.openDropdown(n.dd,n.origin.nativeElement)}),(function(e){n.loading=!1,n.error=!0})))}))})),(null===(e=this.control)||void 0===e?void 0:e.value)&&this.handleControlChanges(this.control.value),this.controlSubscription=null===(t=this.control)||void 0===t?void 0:t.valueChanges.subscribe(this.handleControlChanges)},e.prototype.ngOnChanges=function(e){var t;e&&(null===(t=null==e?void 0:e.searchValue)||void 0===t?void 0:t.currentValue)&&this.searchInput.patchValue(e.searchValue.currentValue),e&&e.disabled&&(this.searchInput.enable(),this.disabled&&this.searchInput.disable())},e.prototype.ngOnDestroy=function(){var e,t;null===(e=this.searchSubscription)||void 0===e||e.unsubscribe(),null===(t=this.defaultCallSubscription)||void 0===t||t.unsubscribe()},e.prototype.openDropdown=function(e,i){var o=this,s=this.overlay.position().flexibleConnectedTo(i).withPositions([new t.ConnectionPositionPair({originX:"start",originY:"bottom"},{overlayX:"start",overlayY:"top"}),new t.ConnectionPositionPair({originX:"start",originY:"top"},{overlayX:"start",overlayY:"bottom"})]).withPush(!0),a=new t.OverlayConfig({hasBackdrop:!0,backdropClass:"cdk-overlay-transparent-backdrop",scrollStrategy:this.overlay.scrollStrategies.reposition(),positionStrategy:s,width:i.clientWidth});this.overlayRef=this.overlay.create(a),this.overlayRef.attach(new n.TemplatePortal(e,this.viewContainerRef)),this.overlayRef.backdropClick().subscribe((function(e){o.closeDropdown()}))},e.prototype.closeDropdown=function(){var e;this.opened=!1,null===(e=this.overlayRef)||void 0===e||e.detach(),this.data=[]},e.prototype.selectData=function(e,t){var n=this;void 0===t&&(t=!0),e.disabled||(this.itemSelected.emit(e),this.multi?(this.selections.has(e[this.uniqueKey])||this.selections.set(e[this.uniqueKey],e),this.setControlValue(this.selectedItems),t||setTimeout((function(){n.input.nativeElement.focus(),n.input.nativeElement.scrollIntoView()}),10),this.searchInput.patchValue(""),this.data=[]):(this.searchInput.patchValue(e[this.displayKey],{emitEvent:!1}),this.setControlValue(e)),this.closeDropdown())},e.prototype.removeItem=function(e){this.itemRemoved.emit(e),this.selections.delete(e[this.uniqueKey]),this.setControlValue(this.selectedItems),this.input.nativeElement.focus()},e.prototype.setControlValue=function(e){var t;this.onSelect.emit(e),null===(t=this.control)||void 0===t||t.patchValue(e,{emitEvent:!1})},Object.defineProperty(e.prototype,"selectedItems",{get:function(){return Array.from(this.selections.values())},enumerable:!1,configurable:!0}),e.prototype.removeInputValue=function(){this.searchInput.reset(),this.data=[],this.clear.emit(!0)},e.prototype.defaultCall=function(){var e=this;-1===this.minInputLength&&(this.loading=!0,this.defaultCallSubscription=this.httpStream(this.searchInput.value||"").subscribe((function(t){var n,i;e.loading=!1,e.data=t,!(null===(n=e.overlayRef)||void 0===n?void 0:n.hasAttached())&&(null===(i=e.data)||void 0===i?void 0:i.length)>0&&e.openDropdown(e.dd,e.origin.nativeElement)}),(function(t){e.loading=!1,e.error=!0})))},e}();l.decorators=[{type:i.Component,args:[{selector:"mis-async-search-dropdown",template:'<div class="dd-wrapper" [ngClass]="{ opened: opened, disabled: disabled, readonly: readonly }" #ddBtn>\n <div class="selected-list" *ngIf="multi && selections.size > 0">\n <div class="chip" [ngClass]="{\'chip-md\': size === \'md\', \'chip-sm\': size === \'sm\'}" *ngFor="let item of selectedItems">\n <span [ngClass]="{\'h6\': size === \'md\', \'h8-b\': size === \'sm\'}" style="margin-right: 4px;">{{item[displayKey]}}</span>\n <span style="cursor: pointer;" (click)="removeItem(item)" [ngStyle]="{\'font-size\': size === \'sm\' ? \'12px\': \'14px\'}" class="ic-navigation-cancel-24"></span>\n </div>\n </div>\n <div class="search-input">\n <span class="ic-action-search-24"></span>\n <input *ngIf="disableCopyPaste; else enableCopyPaste" [ngClass]="{\'ip-md\': size === \'md\', \'ip-sm\': size === \'sm\'}" oncopy="return false;" onpaste="return false" oncut="return false" tabindex="0" type="text" class="black-text h6" #input [placeholder]="placeholder" [formControl]="searchInput" (focus)="defaultCall()"/>\n <ng-template #enableCopyPaste>\n <input [ngClass]="{\'ip-md\': size === \'md\', \'ip-sm\': size === \'sm\'}" tabindex="0" type="text" class="black-text h6" #input [placeholder]="placeholder" [formControl]="searchInput" (focus)="defaultCall()" />\n </ng-template>\n <div class="ic-navigation-cancel-24 croos-icon" *ngIf="searchInput?.value?.length" (click)="removeInputValue()"></div>\n </div>\n</div>\n\n<ng-template #dd>\n <div class="dd-list" [ngStyle]="{\'max-height\':height}" [ngClass]="{\'dd-list-pd\':data.length === 0}" >\n <ng-container *ngIf="loading">\n <ng-container\n *ngIf="customLoader; else defaultLoader"\n [ngTemplateOutlet]="customLoader"\n ></ng-container>\n <ng-template #defaultLoader>\n <div class="status-container" *ngIf="loading && !customLoader">\n <mis-loader [mobileView]="true"></mis-loader>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf="error">\n <div class="status-container">\n <p>Unknown error has occurred, <br> Please try again later.</p>\n </div>\n </ng-container>\n <div *ngIf="!loading && !error && data.length > 0">\n <ng-container *ngFor="let item of data">\n <div (click)="selectData(item, false)">\n <ng-container\n *ngIf="customItem; else standardItem"\n [ngTemplateOutlet]="customItem"\n [ngTemplateOutletContext]="{ $implicit: item }"\n ></ng-container>\n <ng-template #standardItem>\n <div class="item">\n <div class="value">\n <div class="primary">\n {{ item[displayKey] }}\n </div>\n <div class="secondary">\n {{ item[secondaryDisplayKey] }}\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </div>\n <div *ngIf="!loading && !error && data.length === 0 && searchInput.value">\n <div class="data-not-found">No Data Available</div>\n </div>\n </div>\n</ng-template>\n',styles:[".dd-wrapper{background:#fff;border:1px solid #e0e0e0;box-sizing:border-box;border-radius:4px;display:block;cursor:pointer;outline:none}.dd-wrapper.opened,.dd-wrapper:hover{background:#f5f5f5}.dd-wrapper .selected-list{display:flex;justify-content:flex-start;flex-wrap:wrap;gap:4px;padding:8px 16px}.dd-wrapper:focus-within{border-color:#0937b2;background:#f5f5f5}.dd-wrapper.disabled,.dd-wrapper.readonly{pointer-events:none}.search-input{position:relative;border-radius:8px}.search-input input{box-sizing:border-box;outline:none;padding-left:40px;padding-right:24px;background-color:transparent;color:#181f33;border-radius:inherit;border:1px solid transparent;width:100%}.search-input span{font-size:24px;line-height:24px;height:24px;left:8px;padding-top:2px}.search-input .croos-icon,.search-input span{position:absolute;top:50%;transform:translateY(-50%)}.search-input .croos-icon{font-size:16px;width:24px;line-height:16px;height:16px;right:0}.dd-list{padding:8px 0;max-height:200px;background:#fff;box-shadow:0 12px 24px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.12);border-radius:8px;min-width:100%;overflow-y:auto}.dd-list::-webkit-scrollbar{width:8px;border-radius:4px}.dd-list::-webkit-scrollbar-track{background:#fff;border-radius:4px}.dd-list::-webkit-scrollbar-thumb{background:#929dab;border-radius:4px}.dd-list::-webkit-scrollbar-thumb:hover{background:#929dab}.dd-list .item{padding:8px 16px;cursor:pointer}.dd-list .item .disabled{color:#6a737d!important;pointer-events:none}.dd-list .item .value{display:flex;justify-content:space-between;align-items:center}.dd-list .item .value .primary,.dd-list .item .value .secondary{font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#181f33}.dd-list .item .reason{font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d}.dd-list .item:hover:not(.disabled){background:#f5f7fc}.dd-list .data-not-found{display:flex;justify-content:center;align-items:center;font-size:16px;padding:8px}.dd-list-pd{padding:unset}.chip{display:inline-flex;align-items:center;background:#e0e0e0;cursor:default}.chip span{color:#181f33}.chip-md{border-radius:16px;padding:4px 12px}.chip-sm{border-radius:6px;padding:4px 8px;text-transform:uppercase}.ip-md{padding-top:8px;padding-bottom:8px}.ip-sm{padding-top:3px;padding-bottom:3px}.status-container{display:flex;justify-content:center;align-items:center;height:128px}.status-container p{text-align:center}::ng-deep #spinner{position:relative!important}"]}]}],l.ctorParameters=function(){return[{type:t.Overlay},{type:i.ViewContainerRef},{type:i.NgZone}]},l.propDecorators={height:[{type:i.Input}],size:[{type:i.Input}],httpStream:[{type:i.Input}],displayKey:[{type:i.Input}],secondaryDisplayKey:[{type:i.Input}],placeholder:[{type:i.Input}],debounceTime:[{type:i.Input}],minInputLength:[{type:i.Input}],multi:[{type:i.Input}],uniqueKey:[{type:i.Input}],control:[{type:i.Input}],disabled:[{type:i.Input}],readonly:[{type:i.Input}],disableCopyPaste:[{type:i.Input}],origin:[{type:i.ViewChild,args:["ddBtn",{static:!1}]}],input:[{type:i.ViewChild,args:["input",{static:!1}]}],dd:[{type:i.ViewChild,args:["dd",{static:!1}]}],customItem:[{type:i.ContentChild,args:["misCustomItem",{static:!1}]}],customLoader:[{type:i.ContentChild,args:["asyncCustomLoader",{static:!1}]}],onSelect:[{type:i.Output}],selections:[{type:i.Input}],searchValue:[{type:i.Input}],searchQueryChange:[{type:i.Output}],clear:[{type:i.Output}],itemSelected:[{type:i.Output}],itemRemoved:[{type:i.Output}]};var d=function(){};d.decorators=[{type:i.NgModule,args:[{declarations:[l],imports:[a.CommonModule,t.OverlayModule,o.ReactiveFormsModule,o.FormsModule,r.LoaderModule],exports:[l]}]}],e.AsyncDropdownComponent=l,e.AsyncDropdownModule=d,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=mis-crystal-design-system-async-search-dropdown.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../projects/mis-components/async-search-dropdown/async-dropdown.component.ts","../../../projects/mis-components/async-search-dropdown/async-dropdown.module.ts"],"names":["AsyncDropdownComponent","overlay","viewContainerRef","_ngZone","_this","this","size","placeholder","debounceTime","minInputLength","multi","disableCopyPaste","onSelect","EventEmitter","searchInput","FormControl","data","opened","loading","error","selections","Map","searchQueryChange","clear","itemSelected","itemRemoved","handleControlChanges","values","forEach","el","selectData","prototype","ngOnInit","uniqueKey","Error","disabled","disable","searchSubscription","valueChanges","pipe","tap","val","emit","distinctUntilChanged","subscribe","res","run","length","closeDropdown","httpStream","_a","overlayRef","hasAttached","openDropdown","dd","origin","nativeElement","list","control","value","controlSubscription","_b","ngOnChanges","changes","searchValue","currentValue","patchValue","enable","ngOnDestroy","unsubscribe","defaultCallSubscription","template","positionStrategy","position","flexibleConnectedTo","withPositions","ConnectionPositionPair","originX","originY","overlayX","overlayY","withPush","configs","OverlayConfig","hasBackdrop","backdropClass","scrollStrategy","scrollStrategies","reposition","width","clientWidth","create","attach","TemplatePortal","backdropClick","detach","item","effectedFromOutside","has","set","setControlValue","selectedItems","setTimeout","input","focus","scrollIntoView","displayKey","emitEvent","removeItem","delete","Object","defineProperty","Array","from","removeInputValue","reset","defaultCall","Component","args","selector","Overlay","ViewContainerRef","NgZone","Input","ViewChild","static","ContentChild","Output","NgModule","declarations","imports","CommonModule","OverlayModule","ReactiveFormsModule","FormsModule","LoaderModule","exports"],"mappings":"k5BAiCE,SAAAA,EAAoBC,EAA0BC,EAA4CC,GAA1F,IAAAC,EAAAC,KAAoBA,KAAAJ,QAAAA,EAA0BI,KAAAH,iBAAAA,EAA4CG,KAAAF,QAAAA,EAEjFE,KAAAC,KAAoB,KAIpBD,KAAAE,YAAc,SACdF,KAAAG,aAAe,IACfH,KAAAI,eAAiB,EACjBJ,KAAAK,OAAQ,EAKRL,KAAAM,kBAA4B,EAS3BN,KAAAO,SAAkD,IAAIC,EAAAA,cAAa,GAC7ER,KAAAS,YAA2B,IAAIC,EAAAA,YAC/BV,KAAAW,KAAoB,GACpBX,KAAAY,QAAS,EACTZ,KAAAa,SAAmB,EACnBb,KAAAc,OAAiB,EAERd,KAAAe,WAA+B,IAAIC,IAMlChB,KAAAiB,kBAAoB,IAAIT,EAAAA,aACxBR,KAAAkB,MAA+B,IAAIV,EAAAA,cAAa,GAChDR,KAAAmB,aAAe,IAAIX,EAAAA,aACnBR,KAAAoB,YAAc,IAAIZ,EAAAA,aA6DpBR,KAAAqB,qBAAuB,SAACC,GAC9BA,EAAOC,SAAQ,SAAAC,GACbzB,EAAK0B,WAAWD,GAAI,cA9DxB7B,EAAA+B,UAAAC,SAAA,WAAA,QAAA5B,EAAAC,KACE,GAAIA,KAAKK,QAAUL,KAAK4B,UACtB,MAAM,IAAIC,MAAM,uCAEd7B,KAAK8B,UACP9B,KAAKS,YAAYsB,UAEnB/B,KAAKgC,mBAAqBhC,KAAKS,Y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,EAAAA,EAAEd,QAAS,GACzD3C,EAAKiD,aAAajD,EAAKkD,GAAIlD,EAAKmD,OAAOC,kBAExC,SAAArC,GACDf,EAAKc,SAAU,EACfd,EAAKe,OAAQ,gCAzNpBkG,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,4BACVhD,SAAA,4lLA7B+BiD,EAAAA,eAkB/BC,EAAAA,wBARAC,EAAAA,0CAwBCC,EAAAA,oBACAA,EAAAA,0BACAA,EAAAA,0BACAA,EAAAA,mCACAA,EAAAA,2BACAA,EAAAA,4BACAA,EAAAA,8BACAA,EAAAA,qBACAA,EAAAA,yBACAA,EAAAA,uBACAA,EAAAA,wBACAA,EAAAA,wBACAA,EAAAA,gCACAA,EAAAA,sBACAC,EAAAA,UAASN,KAAA,CAAC,QAAS,CAAEO,QAAQ,mBAC7BD,EAAAA,UAASN,KAAA,CAAC,QAAS,CAAEO,QAAQ,gBAC7BD,EAAAA,UAASN,KAAA,CAAC,KAAM,CAAEO,QAAQ,wBAC1BC,EAAAA,aAAYR,KAAA,CAAC,gBAAiB,CAAEO,QAAQ,0BAExCC,EAAAA,aAAYR,KAAA,CAAC,oBAAqB,CAAEO,QAAQ,sBAG5CE,EAAAA,2BAOAJ,EAAAA,2BAKAA,EAAAA,iCACAI,EAAAA,sBACAA,EAAAA,6BACAA,EAAAA,4BACAA,EAAAA,gBC5DH,iCALCC,EAAAA,SAAQV,KAAA,CAAC,CACRW,aAAc,CAACjI,GACfkI,QAAS,CAACC,EAAAA,aAAcC,EAAAA,cAAeC,EAAAA,oBAAqBC,EAAAA,YAAaC,EAAAA,cACzEC,QAAS,CAACxI","sourcesContent":["import { ConnectionPositionPair, Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport {\n AfterViewInit,\n Component,\n ContentChild,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n ViewContainerRef\n} from \"@angular/core\";\nimport { AbstractControl, FormControl } from \"@angular/forms\";\nimport { Observable, Subscription } from \"rxjs\";\nimport { debounceTime, distinctUntilChanged, filter, tap } from \"rxjs/operators\";\n\n// tslint:disable-next-line\ntype IListData = any;\n\n@Component({\n selector: \"mis-async-search-dropdown\",\n templateUrl: \"./async-dropdown.component.html\",\n styleUrls: [\"./async-dropdown.component.scss\"]\n})\nexport class AsyncDropdownComponent implements OnInit, OnChanges, OnDestroy {\n constructor(private overlay: Overlay, private viewContainerRef: ViewContainerRef, private _ngZone: NgZone) { }\n @Input() height;\n @Input() size: 'md' | 'sm' = 'md'\n @Input() httpStream!: (searchKey: string) => Observable<IListData>; // function that returns an httpobservable\n @Input() displayKey!: string; // string to show value in list\n @Input() secondaryDisplayKey!: string; // string to display secondary value\n @Input() placeholder = \"Select\"; // placeholder for input\n @Input() debounceTime = 400; // wait time till which API call is paused\n @Input() minInputLength = 2; // min length after which API call is made\n @Input() multi = false; // maintain a list or emit value\n @Input() uniqueKey: string; // for identifying unique values\n @Input() control: AbstractControl | null; // form control for reactive forms\n @Input() disabled: boolean; // disable actions on component\n @Input() readonly: boolean; // make component readonly\n @Input() disableCopyPaste: boolean = false;\n @ViewChild(\"ddBtn\", { static: false }) origin: ElementRef;\n @ViewChild(\"input\", { static: false }) input: ElementRef;\n @ViewChild(\"dd\", { static: false }) dd: TemplateRef<Element>;\n @ContentChild(\"misCustomItem\", { static: false })\n customItem: TemplateRef<Element>;\n @ContentChild(\"asyncCustomLoader\", { static: false})\n customLoader: TemplateRef<Element>;\n // tslint:disable-next-line\n @Output() onSelect: EventEmitter<IListData | IListData[]> = new EventEmitter(true); // emit selected values\n searchInput: FormControl = new FormControl();\n data: IListData[] = [];\n opened = false;\n loading: boolean = false;\n error: boolean = false;\n // tslint:disable-next-line\n @Input() selections: Map<string, any> = new Map();\n private searchSubscription: Subscription;\n private defaultCallSubscription: Subscription;\n private overlayRef: OverlayRef;\n controlSubscription: Subscription | undefined;\n @Input() searchValue;\n @Output() searchQueryChange = new EventEmitter<string>()\n @Output() clear: EventEmitter<boolean> = new EventEmitter(false);\n @Output() itemSelected = new EventEmitter<IListData>()\n @Output() itemRemoved = new EventEmitter<IListData>()\n ngOnInit(): void {\n if (this.multi && !this.uniqueKey) {\n throw new Error(\"[uniqueKey] required in multi mode.\");\n }\n if (this.disabled) {\n this.searchInput.disable();\n }\n this.searchSubscription = this.searchInput.valueChanges\n .pipe(\n // filter(val => val && val.length >= this.minInputLength),\n tap((val) => this.searchQueryChange.emit(val)),\n debounceTime(this.debounceTime),\n distinctUntilChanged()\n )\n .subscribe(res => {\n this._ngZone.run(() => {\n if (res?.length < this.minInputLength || !res?.length) {\n this.closeDropdown();\n return;\n } else if (res?.length > this.minInputLength && this.httpStream) {\n this.loading = true;\n this.error = false;\n if(!this.overlayRef?.hasAttached())\n this.openDropdown(this.dd, this.origin.nativeElement);\n this.httpStream(res).subscribe(list => {\n this.loading = false;\n this.data = list;\n if (!this.overlayRef?.hasAttached() && list.length > 0) {\n this.openDropdown(this.dd, this.origin.nativeElement);\n }\n }, error => {\n this.loading = false;\n this.error = true;\n });\n }\n })\n });\n if (this.control?.value) {\n this.handleControlChanges(this.control.value);\n }\n this.controlSubscription = this.control?.valueChanges.subscribe(this.handleControlChanges);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes && changes?.searchValue?.currentValue) {\n this.searchInput.patchValue(changes.searchValue.currentValue);\n }\n if (changes && changes.disabled) {\n this.searchInput.enable();\n if (this.disabled) {\n this.searchInput.disable();\n }\n }\n }\n\n ngOnDestroy(): void {\n this.searchSubscription?.unsubscribe();\n this.defaultCallSubscription?.unsubscribe();\n }\n\n private handleControlChanges = (values: IListData[]) => {\n values.forEach(el => {\n this.selectData(el, true);\n });\n // tslint:disable-next-line\n };\n\n private openDropdown(template: TemplateRef<Element>, origin: HTMLElement): void {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(origin)\n .withPositions([\n new ConnectionPositionPair({ originX: \"start\", originY: \"bottom\" }, { overlayX: \"start\", overlayY: \"top\" }),\n new ConnectionPositionPair({ originX: \"start\", originY: \"top\" }, { overlayX: \"start\", overlayY: \"bottom\" })\n ])\n .withPush(true);\n\n const configs = new OverlayConfig({\n hasBackdrop: true,\n backdropClass: \"cdk-overlay-transparent-backdrop\",\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n positionStrategy,\n width: origin.clientWidth\n });\n this.overlayRef = this.overlay.create(configs);\n this.overlayRef.attach(new TemplatePortal(template, this.viewContainerRef));\n this.overlayRef.backdropClick().subscribe(res => {\n this.closeDropdown();\n });\n }\n\n /**\n * closes the dropdown\n */\n closeDropdown(): void {\n this.opened = false;\n this.overlayRef?.detach();\n this.data = [];\n }\n\n /**\n *\n * @param item item to select\n * if item property disabled is set to true, selection will be disabled\n * @param effectedFromOutside set to true if calling from parent component, if true will focus on search input\n */\n selectData(item: IListData, effectedFromOutside = true): void {\n if (item.disabled) {\n return;\n }\n this.itemSelected.emit(item)\n if (!this.multi) {\n this.searchInput.patchValue(item[this.displayKey], { emitEvent: false });\n this.setControlValue(item);\n } else {\n if (!this.selections.has(item[this.uniqueKey])) {\n this.selections.set(item[this.uniqueKey], item);\n }\n this.setControlValue(this.selectedItems);\n if (!effectedFromOutside) {\n setTimeout(() => {\n this.input.nativeElement.focus();\n this.input.nativeElement.scrollIntoView();\n }, 10);\n }\n this.searchInput.patchValue(\"\");\n this.data = [];\n }\n this.closeDropdown();\n }\n\n /**\n *\n * @param item remove item from selected list\n */\n removeItem(item: IListData): void {\n this.itemRemoved.emit(item)\n this.selections.delete(item[this.uniqueKey]);\n this.setControlValue(this.selectedItems);\n // tslint:disable-next-line\n this.input[\"nativeElement\"].focus();\n }\n\n private setControlValue(value: IListData): void {\n this.onSelect.emit(value);\n this.control?.patchValue(value, { emitEvent: false });\n }\n\n /**\n * @returns list of selected items\n */\n get selectedItems(): Array<IListData> {\n return Array.from(this.selections.values());\n }\n\n removeInputValue() {\n this.searchInput.reset();\n this.data = [];\n this.clear.emit(true);\n }\n defaultCall(): void {\n if (this.minInputLength === -1) {\n this.loading = true;\n this.defaultCallSubscription = this.httpStream(this.searchInput.value || '').subscribe(list => {\n this.loading = false;\n this.data = list;\n if (!this.overlayRef?.hasAttached() && this.data?.length > 0) {\n this.openDropdown(this.dd, this.origin.nativeElement);\n }\n }, error => {\n this.loading = false;\n this.error = true;\n });\n }\n }\n}\n","import { OverlayModule } from \"@angular/cdk/overlay\";\nimport { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\nimport { FormsModule, ReactiveFormsModule } from \"@angular/forms\";\nimport { LoaderModule } from \"mis-crystal-design-system/loader\";\nimport { AsyncDropdownComponent } from \"./async-dropdown.component\";\n\n@NgModule({\n declarations: [AsyncDropdownComponent],\n imports: [CommonModule, OverlayModule, ReactiveFormsModule, FormsModule, LoaderModule],\n exports: [AsyncDropdownComponent]\n})\nexport class AsyncDropdownModule {}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../projects/mis-components/async-search-dropdown/async-dropdown.component.ts","../../../projects/mis-components/async-search-dropdown/async-dropdown.module.ts"],"names":["AsyncDropdownComponent","overlay","viewContainerRef","_ngZone","_this","this","size","placeholder","debounceTime","minInputLength","multi","disableCopyPaste","onSelect","EventEmitter","searchInput","FormControl","data","opened","loading","error","selections","Map","searchQueryChange","clear","itemSelected","itemRemoved","handleControlChanges","values","forEach","el","selectData","prototype","ngOnInit","uniqueKey","Error","disabled","disable","searchSubscription","valueChanges","pipe","tap","val","emit","distinctUntilChanged","subscribe","res","run","length","closeDropdown","httpStream","_a","overlayRef","hasAttached","openDropdown","dd","origin","nativeElement","list","control","value","controlSubscription","_b","ngOnChanges","changes","searchValue","currentValue","patchValue","enable","ngOnDestroy","unsubscribe","defaultCallSubscription","template","positionStrategy","position","flexibleConnectedTo","withPositions","ConnectionPositionPair","originX","originY","overlayX","overlayY","withPush","configs","OverlayConfig","hasBackdrop","backdropClass","scrollStrategy","scrollStrategies","reposition","width","clientWidth","create","attach","TemplatePortal","backdropClick","detach","item","effectedFromOutside","has","set","setControlValue","selectedItems","setTimeout","input","focus","scrollIntoView","displayKey","emitEvent","removeItem","delete","Object","defineProperty","Array","from","removeInputValue","reset","defaultCall","Component","args","selector","Overlay","ViewContainerRef","NgZone","Input","ViewChild","static","ContentChild","Output","NgModule","declarations","imports","CommonModule","OverlayModule","ReactiveFormsModule","FormsModule","LoaderModule","exports"],"mappings":"k5BAiCE,SAAAA,EAAoBC,EAA0BC,EAA4CC,GAA1F,IAAAC,EAAAC,KAAoBA,KAAAJ,QAAAA,EAA0BI,KAAAH,iBAAAA,EAA4CG,KAAAF,QAAAA,EAEjFE,KAAAC,KAAoB,KAIpBD,KAAAE,YAAc,SACdF,KAAAG,aAAe,IACfH,KAAAI,eAAiB,EACjBJ,KAAAK,OAAQ,EAKRL,KAAAM,kBAA4B,EAS3BN,KAAAO,SAAkD,IAAIC,EAAAA,cAAa,GAC7ER,KAAAS,YAA2B,IAAIC,EAAAA,YAC/BV,KAAAW,KAAoB,GACpBX,KAAAY,QAAS,EACTZ,KAAAa,SAAmB,EACnBb,KAAAc,OAAiB,EAERd,KAAAe,WAA+B,IAAIC,IAMlChB,KAAAiB,kBAAoB,IAAIT,EAAAA,aACxBR,KAAAkB,MAA+B,IAAIV,EAAAA,cAAa,GAChDR,KAAAmB,aAAe,IAAIX,EAAAA,aACnBR,KAAAoB,YAAc,IAAIZ,EAAAA,aA6DpBR,KAAAqB,qBAAuB,SAACC,GAC9BA,EAAOC,SAAQ,SAAAC,GACbzB,EAAK0B,WAAWD,GAAI,cA9DxB7B,EAAA+B,UAAAC,SAAA,WAAA,QAAA5B,EAAAC,KACE,GAAIA,KAAKK,QAAUL,KAAK4B,UACtB,MAAM,IAAIC,MAAM,uCAEd7B,KAAK8B,UACP9B,KAAKS,YAAYsB,UAEnB/B,KAAKgC,mBAAqBhC,KAAKS,YAAYwB,aACxCC,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,QAAS,GACzD3C,EAAKiD,aAAajD,EAAKkD,GAAIlD,EAAKmD,OAAOC,kBAExC,SAAArC,GACDf,EAAKc,SAAU,EACfd,EAAKe,OAAQ,gCAzNpBkG,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,4BACVhD,SAAA,+kLA7B+BiD,EAAAA,eAkB/BC,EAAAA,wBARAC,EAAAA,0CAwBCC,EAAAA,oBACAA,EAAAA,0BACAA,EAAAA,0BACAA,EAAAA,mCACAA,EAAAA,2BACAA,EAAAA,4BACAA,EAAAA,8BACAA,EAAAA,qBACAA,EAAAA,yBACAA,EAAAA,uBACAA,EAAAA,wBACAA,EAAAA,wBACAA,EAAAA,gCACAA,EAAAA,sBACAC,EAAAA,UAASN,KAAA,CAAC,QAAS,CAAEO,QAAQ,mBAC7BD,EAAAA,UAASN,KAAA,CAAC,QAAS,CAAEO,QAAQ,gBAC7BD,EAAAA,UAASN,KAAA,CAAC,KAAM,CAAEO,QAAQ,wBAC1BC,EAAAA,aAAYR,KAAA,CAAC,gBAAiB,CAAEO,QAAQ,0BAExCC,EAAAA,aAAYR,KAAA,CAAC,oBAAqB,CAAEO,QAAQ,sBAG5CE,EAAAA,2BAOAJ,EAAAA,2BAKAA,EAAAA,iCACAI,EAAAA,sBACAA,EAAAA,6BACAA,EAAAA,4BACAA,EAAAA,gBC5DH,iCALCC,EAAAA,SAAQV,KAAA,CAAC,CACRW,aAAc,CAACjI,GACfkI,QAAS,CAACC,EAAAA,aAAcC,EAAAA,cAAeC,EAAAA,oBAAqBC,EAAAA,YAAaC,EAAAA,cACzEC,QAAS,CAACxI","sourcesContent":["import { ConnectionPositionPair, Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { TemplatePortal } from \"@angular/cdk/portal\";\nimport {\n AfterViewInit,\n Component,\n ContentChild,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewChild,\n ViewContainerRef\n} from \"@angular/core\";\nimport { AbstractControl, FormControl } from \"@angular/forms\";\nimport { Observable, Subscription } from \"rxjs\";\nimport { debounceTime, distinctUntilChanged, filter, tap } from \"rxjs/operators\";\n\n// tslint:disable-next-line\ntype IListData = any;\n\n@Component({\n selector: \"mis-async-search-dropdown\",\n templateUrl: \"./async-dropdown.component.html\",\n styleUrls: [\"./async-dropdown.component.scss\"]\n})\nexport class AsyncDropdownComponent implements OnInit, OnChanges, OnDestroy {\n constructor(private overlay: Overlay, private viewContainerRef: ViewContainerRef, private _ngZone: NgZone) { }\n @Input() height;\n @Input() size: 'md' | 'sm' = 'md'\n @Input() httpStream!: (searchKey: string) => Observable<IListData>; // function that returns an httpobservable\n @Input() displayKey!: string; // string to show value in list\n @Input() secondaryDisplayKey!: string; // string to display secondary value\n @Input() placeholder = \"Select\"; // placeholder for input\n @Input() debounceTime = 400; // wait time till which API call is paused\n @Input() minInputLength = 2; // min length after which API call is made\n @Input() multi = false; // maintain a list or emit value\n @Input() uniqueKey: string; // for identifying unique values\n @Input() control: AbstractControl | null; // form control for reactive forms\n @Input() disabled: boolean; // disable actions on component\n @Input() readonly: boolean; // make component readonly\n @Input() disableCopyPaste: boolean = false;\n @ViewChild(\"ddBtn\", { static: false }) origin: ElementRef;\n @ViewChild(\"input\", { static: false }) input: ElementRef;\n @ViewChild(\"dd\", { static: false }) dd: TemplateRef<Element>;\n @ContentChild(\"misCustomItem\", { static: false })\n customItem: TemplateRef<Element>;\n @ContentChild(\"asyncCustomLoader\", { static: false})\n customLoader: TemplateRef<Element>;\n // tslint:disable-next-line\n @Output() onSelect: EventEmitter<IListData | IListData[]> = new EventEmitter(true); // emit selected values\n searchInput: FormControl = new FormControl();\n data: IListData[] = [];\n opened = false;\n loading: boolean = false;\n error: boolean = false;\n // tslint:disable-next-line\n @Input() selections: Map<string, any> = new Map();\n private searchSubscription: Subscription;\n private defaultCallSubscription: Subscription;\n private overlayRef: OverlayRef;\n controlSubscription: Subscription | undefined;\n @Input() searchValue;\n @Output() searchQueryChange = new EventEmitter<string>()\n @Output() clear: EventEmitter<boolean> = new EventEmitter(false);\n @Output() itemSelected = new EventEmitter<IListData>()\n @Output() itemRemoved = new EventEmitter<IListData>()\n ngOnInit(): void {\n if (this.multi && !this.uniqueKey) {\n throw new Error(\"[uniqueKey] required in multi mode.\");\n }\n if (this.disabled) {\n this.searchInput.disable();\n }\n this.searchSubscription = this.searchInput.valueChanges\n .pipe(\n // filter(val => val && val.length >= this.minInputLength),\n tap((val) => this.searchQueryChange.emit(val)),\n debounceTime(this.debounceTime),\n distinctUntilChanged()\n )\n .subscribe(res => {\n this._ngZone.run(() => {\n if (res?.length < this.minInputLength || !res?.length) {\n this.closeDropdown();\n return;\n } else if (res?.length > this.minInputLength && this.httpStream) {\n this.loading = true;\n this.error = false;\n if(!this.overlayRef?.hasAttached())\n this.openDropdown(this.dd, this.origin.nativeElement);\n this.httpStream(res).subscribe(list => {\n this.loading = false;\n this.data = list;\n if (!this.overlayRef?.hasAttached() && list.length > 0) {\n this.openDropdown(this.dd, this.origin.nativeElement);\n }\n }, error => {\n this.loading = false;\n this.error = true;\n });\n }\n })\n });\n if (this.control?.value) {\n this.handleControlChanges(this.control.value);\n }\n this.controlSubscription = this.control?.valueChanges.subscribe(this.handleControlChanges);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes && changes?.searchValue?.currentValue) {\n this.searchInput.patchValue(changes.searchValue.currentValue);\n }\n if (changes && changes.disabled) {\n this.searchInput.enable();\n if (this.disabled) {\n this.searchInput.disable();\n }\n }\n }\n\n ngOnDestroy(): void {\n this.searchSubscription?.unsubscribe();\n this.defaultCallSubscription?.unsubscribe();\n }\n\n private handleControlChanges = (values: IListData[]) => {\n values.forEach(el => {\n this.selectData(el, true);\n });\n // tslint:disable-next-line\n };\n\n private openDropdown(template: TemplateRef<Element>, origin: HTMLElement): void {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(origin)\n .withPositions([\n new ConnectionPositionPair({ originX: \"start\", originY: \"bottom\" }, { overlayX: \"start\", overlayY: \"top\" }),\n new ConnectionPositionPair({ originX: \"start\", originY: \"top\" }, { overlayX: \"start\", overlayY: \"bottom\" })\n ])\n .withPush(true);\n\n const configs = new OverlayConfig({\n hasBackdrop: true,\n backdropClass: \"cdk-overlay-transparent-backdrop\",\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n positionStrategy,\n width: origin.clientWidth\n });\n this.overlayRef = this.overlay.create(configs);\n this.overlayRef.attach(new TemplatePortal(template, this.viewContainerRef));\n this.overlayRef.backdropClick().subscribe(res => {\n this.closeDropdown();\n });\n }\n\n /**\n * closes the dropdown\n */\n closeDropdown(): void {\n this.opened = false;\n this.overlayRef?.detach();\n this.data = [];\n }\n\n /**\n *\n * @param item item to select\n * if item property disabled is set to true, selection will be disabled\n * @param effectedFromOutside set to true if calling from parent component, if true will focus on search input\n */\n selectData(item: IListData, effectedFromOutside = true): void {\n if (item.disabled) {\n return;\n }\n this.itemSelected.emit(item)\n if (!this.multi) {\n this.searchInput.patchValue(item[this.displayKey], { emitEvent: false });\n this.setControlValue(item);\n } else {\n if (!this.selections.has(item[this.uniqueKey])) {\n this.selections.set(item[this.uniqueKey], item);\n }\n this.setControlValue(this.selectedItems);\n if (!effectedFromOutside) {\n setTimeout(() => {\n this.input.nativeElement.focus();\n this.input.nativeElement.scrollIntoView();\n }, 10);\n }\n this.searchInput.patchValue(\"\");\n this.data = [];\n }\n this.closeDropdown();\n }\n\n /**\n *\n * @param item remove item from selected list\n */\n removeItem(item: IListData): void {\n this.itemRemoved.emit(item)\n this.selections.delete(item[this.uniqueKey]);\n this.setControlValue(this.selectedItems);\n // tslint:disable-next-line\n this.input[\"nativeElement\"].focus();\n }\n\n private setControlValue(value: IListData): void {\n this.onSelect.emit(value);\n this.control?.patchValue(value, { emitEvent: false });\n }\n\n /**\n * @returns list of selected items\n */\n get selectedItems(): Array<IListData> {\n return Array.from(this.selections.values());\n }\n\n removeInputValue() {\n this.searchInput.reset();\n this.data = [];\n this.clear.emit(true);\n }\n defaultCall(): void {\n if (this.minInputLength === -1) {\n this.loading = true;\n this.defaultCallSubscription = this.httpStream(this.searchInput.value || '').subscribe(list => {\n this.loading = false;\n this.data = list;\n if (!this.overlayRef?.hasAttached() && this.data?.length > 0) {\n this.openDropdown(this.dd, this.origin.nativeElement);\n }\n }, error => {\n this.loading = false;\n this.error = true;\n });\n }\n }\n}\n","import { OverlayModule } from \"@angular/cdk/overlay\";\nimport { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\nimport { FormsModule, ReactiveFormsModule } from \"@angular/forms\";\nimport { LoaderModule } from \"mis-crystal-design-system/loader\";\nimport { AsyncDropdownComponent } from \"./async-dropdown.component\";\n\n@NgModule({\n declarations: [AsyncDropdownComponent],\n imports: [CommonModule, OverlayModule, ReactiveFormsModule, FormsModule, LoaderModule],\n exports: [AsyncDropdownComponent]\n})\nexport class AsyncDropdownModule {}\n"]}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
function ToolTipComponent() {
|
|
9
9
|
this.toolTipText = "";
|
|
10
10
|
this.toolTipPosition = "bottom";
|
|
11
|
+
this.toolTipTextAlignment = "";
|
|
11
12
|
}
|
|
12
13
|
ToolTipComponent.prototype.ngOnInit = function () { };
|
|
13
14
|
ToolTipComponent.prototype.ngAfterViewInit = function () {
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
ToolTipComponent.decorators = [
|
|
30
31
|
{ type: core.Component, args: [{
|
|
31
32
|
selector: "mis-tooltip",
|
|
32
|
-
template: "<div id=\"tooltip-container\" *ngIf=\"toolTipText.length > 0\" #container>\n <div id=\"tooltip\">\n <div id=\"tooltip-text\"
|
|
33
|
+
template: "<div id=\"tooltip-container\" *ngIf=\"toolTipText.length > 0\" #container>\n <div id=\"tooltip\">\n <div id=\"tooltip-text\" [innerHTML]=\"toolTipText\" \n [ngStyle]=\"{'text-align' : toolTipTextAlignment ? toolTipTextAlignment : '' }\"></div>\n <span\n id=\"arrow\"\n [ngClass]=\"{\n 'arrow-left': toolTipPosition === 'left',\n 'arrow-right': toolTipPosition === 'right',\n 'arrow-top': toolTipPosition === 'top',\n 'arrow-bottom': toolTipPosition === 'bottom'\n }\"\n ></span>\n </div>\n</div>\n",
|
|
33
34
|
styles: ["#tooltip-container{position:absolute;z-index:1}#tooltip{position:relative;display:block;padding:8px 12px;border-radius:8px;color:#fff;background:#181f33;font-family:Lato,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:20px;text-align:center;letter-spacing:.2px}#tooltip-text{width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#arrow{position:absolute;height:12px;width:12px;background:#181f33;z-index:1}.arrow-top{bottom:-6px}.arrow-bottom,.arrow-top{left:50%;transform:translateX(-50%) rotate(-45deg);-webkit-transform:translateX(-50%) rotate(-45deg)}.arrow-bottom{top:-6px}.arrow-left{right:-6px}.arrow-left,.arrow-right{top:50%;transform:translateY(-50%) rotate(-45deg);-webkit-transform:translateY(-50%) rotate(-45deg)}.arrow-right{left:-6px}"]
|
|
34
35
|
},] }
|
|
35
36
|
];
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
this.viewContainerRef = viewContainerRef;
|
|
46
47
|
this.isToolTipDisplayed = false;
|
|
47
48
|
this.toolTipText = "";
|
|
49
|
+
this.toolTipTextAlignment = "";
|
|
48
50
|
this.toolTipPosition = "bottom";
|
|
49
51
|
this.showOnHover = true;
|
|
50
52
|
}
|
|
@@ -73,6 +75,13 @@
|
|
|
73
75
|
enumerable: false,
|
|
74
76
|
configurable: true
|
|
75
77
|
});
|
|
78
|
+
Object.defineProperty(ToolTipDirective.prototype, "alignText", {
|
|
79
|
+
set: function (value) {
|
|
80
|
+
this.toolTipTextAlignment = value;
|
|
81
|
+
},
|
|
82
|
+
enumerable: false,
|
|
83
|
+
configurable: true
|
|
84
|
+
});
|
|
76
85
|
ToolTipDirective.prototype.onMouseEnter = function () {
|
|
77
86
|
if (this.showOnHover)
|
|
78
87
|
this.displayToolTip();
|
|
@@ -110,6 +119,7 @@
|
|
|
110
119
|
var tooltipRef = this.overlayRef.attach(tempRef);
|
|
111
120
|
tooltipRef.instance.toolTipText = this.toolTipText;
|
|
112
121
|
tooltipRef.instance.toolTipPosition = this.toolTipPosition;
|
|
122
|
+
tooltipRef.instance.toolTipTextAlignment = this.toolTipTextAlignment;
|
|
113
123
|
this.overlayRef
|
|
114
124
|
.backdropClick()
|
|
115
125
|
.pipe(operators.take(1))
|
|
@@ -159,6 +169,7 @@
|
|
|
159
169
|
showToolTip: [{ type: core.Input }],
|
|
160
170
|
text: [{ type: core.Input }],
|
|
161
171
|
position: [{ type: core.Input }],
|
|
172
|
+
alignText: [{ type: core.Input }],
|
|
162
173
|
onMouseEnter: [{ type: core.HostListener, args: ["mouseenter",] }],
|
|
163
174
|
onMouseLeave: [{ type: core.HostListener, args: ["mouseleave",] }]
|
|
164
175
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mis-crystal-design-system-tooltip.umd.js","sources":["../../../projects/mis-components/tooltip/tooltip-container/tooltip.component.ts","../../../projects/mis-components/tooltip/tooltip.directive.ts","../../../projects/mis-components/tooltip/tooltip.module.ts","../../../projects/mis-components/tooltip/mis-crystal-design-system-tooltip.ts"],"sourcesContent":["import { AfterViewInit, Component, ElementRef, Inject, OnInit, ViewChild } from \"@angular/core\";\nimport { ITooltipPositions } from \"../models/tooltip.model\";\n\n@Component({\n selector: \"mis-tooltip\",\n templateUrl: \"./tooltip.component.html\",\n styleUrls: [\"./tooltip.component.scss\"]\n})\nexport class ToolTipComponent implements OnInit, AfterViewInit {\n public toolTipText: string = \"\";\n public toolTipPosition: ITooltipPositions = \"bottom\";\n\n @ViewChild(\"container\") container: ElementRef;\n\n constructor() {}\n ngOnInit() {}\n ngAfterViewInit() {\n if (!this.container?.nativeElement) return;\n if (this.toolTipPosition === \"top\" || this.toolTipPosition === \"bottom\") {\n const eleWidth = this.container.nativeElement.getBoundingClientRect();\n this.container.nativeElement.style.left = eleWidth.width / -2 + \"px\";\n return;\n }\n if (this.toolTipPosition === \"left\") {\n const eleWidth = this.container.nativeElement.getBoundingClientRect();\n this.container.nativeElement.style.left = -eleWidth.width + \"px\";\n }\n }\n}\n","import { AfterViewInit, Directive, ElementRef, HostListener, Input, OnInit, ViewContainerRef } from \"@angular/core\";\nimport { Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { take } from \"rxjs/operators\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { ToolTipComponent } from \"./tooltip-container/tooltip.component\";\nimport { genPositionPairs } from \"mis-crystal-design-system/utils\";\nimport { ITooltipPositions } from \"./models/tooltip.model\";\n\n@Directive({\n selector: \"[misToolTip]\"\n})\nexport class ToolTipDirective implements OnInit, AfterViewInit {\n public isToolTipDisplayed: boolean = false;\n public toolTipText: string = \"\";\n public toolTipPosition: ITooltipPositions = \"bottom\";\n private overlayRef: OverlayRef;\n\n @Input() showOnHover: boolean = true;\n @Input() set showToolTip(value: boolean) {\n this.isToolTipDisplayed = value;\n if (value) this.displayToolTip();\n else this.hideToolTip();\n }\n @Input() set text(value: string) {\n this.toolTipText = value;\n }\n @Input() set position(value: ITooltipPositions) {\n this.toolTipPosition = value;\n }\n\n @HostListener(\"mouseenter\") onMouseEnter() {\n if (this.showOnHover) this.displayToolTip();\n }\n @HostListener(\"mouseleave\") onMouseLeave() {\n if (this.showOnHover) this.hideToolTip();\n }\n\n constructor(private element: ElementRef, private overlay: Overlay, private viewContainerRef: ViewContainerRef) {}\n\n ngOnInit() {}\n ngAfterViewInit() {\n if (this.isToolTipDisplayed) this.displayToolTip();\n else this.hideToolTip();\n }\n\n displayToolTip() {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.element)\n .withPositions(\n genPositionPairs(\n {\n positionX: \"center\",\n positionY: this.toolTipPosition === \"top\" ? \"top\" : \"center\",\n offsetX: this.positionTooltip(\"OFFSET_X\"),\n offsetY: this.positionTooltip(\"OFFSET_Y\")\n },\n false\n )\n )\n .withPush(true);\n const config = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition()\n });\n this.overlayRef = this.overlay.create(config);\n const tempRef = new ComponentPortal(ToolTipComponent, this.viewContainerRef);\n const tooltipRef = this.overlayRef.attach(tempRef);\n tooltipRef.instance.toolTipText = this.toolTipText;\n tooltipRef.instance.toolTipPosition = this.toolTipPosition;\n this.overlayRef\n .backdropClick()\n .pipe(take(1))\n .subscribe(() => {\n this.hideToolTip();\n });\n }\n\n positionTooltip(type: \"OFFSET_X\" | \"OFFSET_Y\") {\n if (type === \"OFFSET_X\") {\n return this.toolTipPosition === \"right\"\n ? this.element.nativeElement.offsetWidth / 2 + 8\n : this.toolTipPosition === \"left\"\n ? (this.element.nativeElement.offsetWidth / 2 + 8) * -1\n : this.toolTipPosition === \"top\" || this.toolTipPosition === \"bottom\"\n ? 0\n : 8;\n }\n if (type !== \"OFFSET_Y\") return;\n return this.toolTipPosition === \"right\" || this.toolTipPosition === \"left\"\n ? -18\n : this.toolTipPosition === \"top\"\n ? -44\n : this.toolTipPosition === \"bottom\"\n ? this.element.nativeElement.offsetHeight / 2 + 8\n : 8;\n }\n\n hideToolTip() {\n this.overlayRef?.detach();\n this.overlayRef?.dispose();\n }\n}\n","import { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { ToolTipDirective } from \"./tooltip.directive\";\nimport { ToolTipComponent } from \"./tooltip-container/tooltip.component\";\n\n@NgModule({\n declarations: [ToolTipDirective, ToolTipComponent],\n imports: [CommonModule, OverlayModule],\n exports: [ToolTipDirective, ToolTipComponent],\n entryComponents: [ToolTipComponent]\n})\nexport class ToolTipModule {\n static forRoot(): ModuleWithProviders<ToolTipModule> {\n return { ngModule: ToolTipModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["Component","ViewChild","genPositionPairs","OverlayConfig","ComponentPortal","take","Directive","ElementRef","Overlay","ViewContainerRef","Input","HostListener","NgModule","CommonModule","OverlayModule"],"mappings":";;;;;;;QAcE;YALO,gBAAW,GAAW,EAAE,CAAC;YACzB,oBAAe,GAAsB,QAAQ,CAAC;SAIrC;QAChB,mCAAQ,GAAR,eAAa;QACb,0CAAe,GAAf;;YACE,IAAI,QAAC,IAAI,CAAC,SAAS,0CAAE,aAAa,CAAA;gBAAE,OAAO;YAC3C,IAAI,IAAI,CAAC,eAAe,KAAK,KAAK,IAAI,IAAI,CAAC,eAAe,KAAK,QAAQ,EAAE;gBACvE,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;gBACtE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;gBACrE,OAAO;aACR;YACD,IAAI,IAAI,CAAC,eAAe,KAAK,MAAM,EAAE;gBACnC,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;gBACtE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;aAClE;SACF;;;;gBAxBFA,cAAS,SAAC;oBACT,QAAQ,EAAE,aAAa;oBACvB,odAAuC;;iBAExC;;;;4BAKEC,cAAS,SAAC,WAAW;;;;QCyBtB,0BAAoB,OAAmB,EAAU,OAAgB,EAAU,gBAAkC;YAAzF,YAAO,GAAP,OAAO,CAAY;YAAU,YAAO,GAAP,OAAO,CAAS;YAAU,qBAAgB,GAAhB,gBAAgB,CAAkB;YAzBtG,uBAAkB,GAAY,KAAK,CAAC;YACpC,gBAAW,GAAW,EAAE,CAA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ACD,IAAI,IAAI,KAAK,UAAU;gBAAE,OAAO;YAChC,OAAO,IAAI,CAAC,eAAe,KAAK,OAAO,IAAI,IAAI,CAAC,eAAe,KAAK,MAAM;kBACtE,CAAC,EAAE;kBACH,IAAI,CAAC,eAAe,KAAK,KAAK;sBAC9B,CAAC,EAAE;sBACH,IAAI,CAAC,eAAe,KAAK,QAAQ;0BACjC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,YAAY,GAAG,CAAC,GAAG,CAAC;0BAC/C,CAAC,CAAC;SACP;QAED,sCAAW,GAAX;;YACE,MAAA,IAAI,CAAC,UAAU,0CAAE,MAAM,GAAG;YAC1B,MAAA,IAAI,CAAC,UAAU,0CAAE,OAAO,GAAG;SAC5B;;;;gBA9FFC,cAAS,SAAC;oBACT,QAAQ,EAAE,cAAc;iBACzB;;;gBAVkCC,eAAU;gBACpCC,eAAO;gBAD4DC,qBAAgB;;;8BAiBzFC,UAAK;8BACLA,UAAK;uBAKLA,UAAK;2BAGLA,UAAK;+BAILC,iBAAY,SAAC,YAAY;+BAGzBA,iBAAY,SAAC,YAAY;;;;QCrB5B;;QACS,qBAAO,GAAd;YACE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;SACnD;;;;gBATFC,aAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;oBAClD,OAAO,EAAE,CAACC,mBAAY,EAAEC,qBAAa,CAAC;oBACtC,OAAO,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;oBAC7C,eAAe,EAAE,CAAC,gBAAgB,CAAC;iBACpC;;;ICXD;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-tooltip.umd.js","sources":["../../../projects/mis-components/tooltip/tooltip-container/tooltip.component.ts","../../../projects/mis-components/tooltip/tooltip.directive.ts","../../../projects/mis-components/tooltip/tooltip.module.ts","../../../projects/mis-components/tooltip/mis-crystal-design-system-tooltip.ts"],"sourcesContent":["import { AfterViewInit, Component, ElementRef, Inject, OnInit, ViewChild } from \"@angular/core\";\nimport { ITooltipPositions } from \"../models/tooltip.model\";\n\n@Component({\n selector: \"mis-tooltip\",\n templateUrl: \"./tooltip.component.html\",\n styleUrls: [\"./tooltip.component.scss\"]\n})\nexport class ToolTipComponent implements OnInit, AfterViewInit {\n public toolTipText: string = \"\";\n public toolTipPosition: ITooltipPositions = \"bottom\";\n public toolTipTextAlignment: string = \"\";\n\n @ViewChild(\"container\") container: ElementRef;\n\n constructor() {}\n ngOnInit() {}\n ngAfterViewInit() {\n if (!this.container?.nativeElement) return;\n if (this.toolTipPosition === \"top\" || this.toolTipPosition === \"bottom\") {\n const eleWidth = this.container.nativeElement.getBoundingClientRect();\n this.container.nativeElement.style.left = eleWidth.width / -2 + \"px\";\n return;\n }\n if (this.toolTipPosition === \"left\") {\n const eleWidth = this.container.nativeElement.getBoundingClientRect();\n this.container.nativeElement.style.left = -eleWidth.width + \"px\";\n }\n }\n}\n","import { AfterViewInit, Directive, ElementRef, HostListener, Input, OnInit, ViewContainerRef } from \"@angular/core\";\nimport { Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { take } from \"rxjs/operators\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { ToolTipComponent } from \"./tooltip-container/tooltip.component\";\nimport { genPositionPairs } from \"mis-crystal-design-system/utils\";\nimport { ITooltipPositions } from \"./models/tooltip.model\";\n\n@Directive({\n selector: \"[misToolTip]\"\n})\nexport class ToolTipDirective implements OnInit, AfterViewInit {\n public isToolTipDisplayed: boolean = false;\n public toolTipText: string = \"\";\n public toolTipTextAlignment: string = \"\";\n public toolTipPosition: ITooltipPositions = \"bottom\";\n private overlayRef: OverlayRef;\n\n @Input() showOnHover: boolean = true;\n @Input() set showToolTip(value: boolean) {\n this.isToolTipDisplayed = value;\n if (value) this.displayToolTip();\n else this.hideToolTip();\n }\n @Input() set text(value: string) {\n this.toolTipText = value;\n }\n @Input() set position(value: ITooltipPositions) {\n this.toolTipPosition = value;\n }\n @Input() set alignText(value: string) {\n this.toolTipTextAlignment = value;\n }\n\n @HostListener(\"mouseenter\") onMouseEnter() {\n if (this.showOnHover) this.displayToolTip();\n }\n @HostListener(\"mouseleave\") onMouseLeave() {\n if (this.showOnHover) this.hideToolTip();\n }\n\n constructor(private element: ElementRef, private overlay: Overlay, private viewContainerRef: ViewContainerRef) {}\n\n ngOnInit() {}\n ngAfterViewInit() {\n if (this.isToolTipDisplayed) this.displayToolTip();\n else this.hideToolTip();\n }\n\n displayToolTip() {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.element)\n .withPositions(\n genPositionPairs(\n {\n positionX: \"center\",\n positionY: this.toolTipPosition === \"top\" ? \"top\" : \"center\",\n offsetX: this.positionTooltip(\"OFFSET_X\"),\n offsetY: this.positionTooltip(\"OFFSET_Y\")\n },\n false\n )\n )\n .withPush(true);\n const config = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition()\n });\n this.overlayRef = this.overlay.create(config);\n const tempRef = new ComponentPortal(ToolTipComponent, this.viewContainerRef);\n const tooltipRef = this.overlayRef.attach(tempRef);\n tooltipRef.instance.toolTipText = this.toolTipText;\n tooltipRef.instance.toolTipPosition = this.toolTipPosition;\n tooltipRef.instance.toolTipTextAlignment = this.toolTipTextAlignment;\n this.overlayRef\n .backdropClick()\n .pipe(take(1))\n .subscribe(() => {\n this.hideToolTip();\n });\n }\n\n positionTooltip(type: \"OFFSET_X\" | \"OFFSET_Y\") {\n if (type === \"OFFSET_X\") {\n return this.toolTipPosition === \"right\"\n ? this.element.nativeElement.offsetWidth / 2 + 8\n : this.toolTipPosition === \"left\"\n ? (this.element.nativeElement.offsetWidth / 2 + 8) * -1\n : this.toolTipPosition === \"top\" || this.toolTipPosition === \"bottom\"\n ? 0\n : 8;\n }\n if (type !== \"OFFSET_Y\") return;\n return this.toolTipPosition === \"right\" || this.toolTipPosition === \"left\"\n ? -18\n : this.toolTipPosition === \"top\"\n ? -44\n : this.toolTipPosition === \"bottom\"\n ? this.element.nativeElement.offsetHeight / 2 + 8\n : 8;\n }\n\n hideToolTip() {\n this.overlayRef?.detach();\n this.overlayRef?.dispose();\n }\n}\n","import { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { ToolTipDirective } from \"./tooltip.directive\";\nimport { ToolTipComponent } from \"./tooltip-container/tooltip.component\";\n\n@NgModule({\n declarations: [ToolTipDirective, ToolTipComponent],\n imports: [CommonModule, OverlayModule],\n exports: [ToolTipDirective, ToolTipComponent],\n entryComponents: [ToolTipComponent]\n})\nexport class ToolTipModule {\n static forRoot(): ModuleWithProviders<ToolTipModule> {\n return { ngModule: ToolTipModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["Component","ViewChild","genPositionPairs","OverlayConfig","ComponentPortal","take","Directive","ElementRef","Overlay","ViewContainerRef","Input","HostListener","NgModule","CommonModule","OverlayModule"],"mappings":";;;;;;;QAeE;YANO,gBAAW,GAAW,EAAE,CAAC;YACzB,oBAAe,GAAsB,QAAQ,CAAC;YAC9C,yBAAoB,GAAW,EAAE,CAAC;SAIzB;QAChB,mCAAQ,GAAR,eAAa;QACb,0CAAe,GAAf;;YACE,IAAI,QAAC,IAAI,CAAC,SAAS,0CAAE,aAAa,CAAA;gBAAE,OAAO;YAC3C,IAAI,IAAI,CAAC,eAAe,KAAK,KAAK,IAAI,IAAI,CAAC,eAAe,KAAK,QAAQ,EAAE;gBACvE,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;gBACtE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,GAA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AAC,UAAU,0CAAE,OAAO,GAAG;SAC5B;;;;gBAnGFC,cAAS,SAAC;oBACT,QAAQ,EAAE,cAAc;iBACzB;;;gBAVkCC,eAAU;gBACpCC,eAAO;gBAD4DC,qBAAgB;;;8BAkBzFC,UAAK;8BACLA,UAAK;uBAKLA,UAAK;2BAGLA,UAAK;4BAGLA,UAAK;+BAILC,iBAAY,SAAC,YAAY;+BAGzBA,iBAAY,SAAC,YAAY;;;;QCzB5B;;QACS,qBAAO,GAAd;YACE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;SACnD;;;;gBATFC,aAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;oBAClD,OAAO,EAAE,CAACC,mBAAY,EAAEC,qBAAa,CAAC;oBACtC,OAAO,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;oBAC7C,eAAe,EAAE,CAAC,gBAAgB,CAAC;iBACpC;;;ICXD;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@angular/core"),require("@angular/cdk/overlay"),require("rxjs/operators"),require("@angular/cdk/portal"),require("mis-crystal-design-system/utils"),require("@angular/common")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/tooltip",["exports","@angular/core","@angular/cdk/overlay","rxjs/operators","@angular/cdk/portal","mis-crystal-design-system/utils","@angular/common"],o):o(((t="undefined"!=typeof globalThis?globalThis:t||self)["mis-crystal-design-system"]=t["mis-crystal-design-system"]||{},t["mis-crystal-design-system"].tooltip={}),t.ng.core,t.ng.cdk.overlay,t.rxjs.operators,t.ng.cdk.portal,t["mis-crystal-design-system"].utils,t.ng.common)}(this,(function(t,o,i,
|
|
1
|
+
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("@angular/core"),require("@angular/cdk/overlay"),require("rxjs/operators"),require("@angular/cdk/portal"),require("mis-crystal-design-system/utils"),require("@angular/common")):"function"==typeof define&&define.amd?define("mis-crystal-design-system/tooltip",["exports","@angular/core","@angular/cdk/overlay","rxjs/operators","@angular/cdk/portal","mis-crystal-design-system/utils","@angular/common"],o):o(((t="undefined"!=typeof globalThis?globalThis:t||self)["mis-crystal-design-system"]=t["mis-crystal-design-system"]||{},t["mis-crystal-design-system"].tooltip={}),t.ng.core,t.ng.cdk.overlay,t.rxjs.operators,t.ng.cdk.portal,t["mis-crystal-design-system"].utils,t.ng.common)}(this,(function(t,o,e,i,n,r,s){"use strict";var l=function(){function t(){this.toolTipText="",this.toolTipPosition="bottom",this.toolTipTextAlignment=""}return t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){var t;if(null===(t=this.container)||void 0===t?void 0:t.nativeElement)if("top"!==this.toolTipPosition&&"bottom"!==this.toolTipPosition){if("left"===this.toolTipPosition){o=this.container.nativeElement.getBoundingClientRect();this.container.nativeElement.style.left=-o.width+"px"}}else{var o=this.container.nativeElement.getBoundingClientRect();this.container.nativeElement.style.left=o.width/-2+"px"}},t}();l.decorators=[{type:o.Component,args:[{selector:"mis-tooltip",template:"<div id=\"tooltip-container\" *ngIf=\"toolTipText.length > 0\" #container>\n <div id=\"tooltip\">\n <div id=\"tooltip-text\" [innerHTML]=\"toolTipText\" \n [ngStyle]=\"{'text-align' : toolTipTextAlignment ? toolTipTextAlignment : '' }\"></div>\n <span\n id=\"arrow\"\n [ngClass]=\"{\n 'arrow-left': toolTipPosition === 'left',\n 'arrow-right': toolTipPosition === 'right',\n 'arrow-top': toolTipPosition === 'top',\n 'arrow-bottom': toolTipPosition === 'bottom'\n }\"\n ></span>\n </div>\n</div>\n",styles:["#tooltip-container{position:absolute;z-index:1}#tooltip{position:relative;display:block;padding:8px 12px;border-radius:8px;color:#fff;background:#181f33;font-family:Lato,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:20px;text-align:center;letter-spacing:.2px}#tooltip-text{width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#arrow{position:absolute;height:12px;width:12px;background:#181f33;z-index:1}.arrow-top{bottom:-6px}.arrow-bottom,.arrow-top{left:50%;transform:translateX(-50%) rotate(-45deg);-webkit-transform:translateX(-50%) rotate(-45deg)}.arrow-bottom{top:-6px}.arrow-left{right:-6px}.arrow-left,.arrow-right{top:50%;transform:translateY(-50%) rotate(-45deg);-webkit-transform:translateY(-50%) rotate(-45deg)}.arrow-right{left:-6px}"]}]}],l.ctorParameters=function(){return[]},l.propDecorators={container:[{type:o.ViewChild,args:["container"]}]};var p=function(){function t(t,o,e){this.element=t,this.overlay=o,this.viewContainerRef=e,this.isToolTipDisplayed=!1,this.toolTipText="",this.toolTipTextAlignment="",this.toolTipPosition="bottom",this.showOnHover=!0}return Object.defineProperty(t.prototype,"showToolTip",{set:function(t){this.isToolTipDisplayed=t,t?this.displayToolTip():this.hideToolTip()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"text",{set:function(t){this.toolTipText=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{set:function(t){this.toolTipPosition=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alignText",{set:function(t){this.toolTipTextAlignment=t},enumerable:!1,configurable:!0}),t.prototype.onMouseEnter=function(){this.showOnHover&&this.displayToolTip()},t.prototype.onMouseLeave=function(){this.showOnHover&&this.hideToolTip()},t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){this.isToolTipDisplayed?this.displayToolTip():this.hideToolTip()},t.prototype.displayToolTip=function(){var t=this,o=this.overlay.position().flexibleConnectedTo(this.element).withPositions(r.genPositionPairs({positionX:"center",positionY:"top"===this.toolTipPosition?"top":"center",offsetX:this.positionTooltip("OFFSET_X"),offsetY:this.positionTooltip("OFFSET_Y")},!1)).withPush(!0),s=new e.OverlayConfig({hasBackdrop:!1,positionStrategy:o,scrollStrategy:this.overlay.scrollStrategies.reposition()});this.overlayRef=this.overlay.create(s);var p=new n.ComponentPortal(l,this.viewContainerRef),a=this.overlayRef.attach(p);a.instance.toolTipText=this.toolTipText,a.instance.toolTipPosition=this.toolTipPosition,a.instance.toolTipTextAlignment=this.toolTipTextAlignment,this.overlayRef.backdropClick().pipe(i.take(1)).subscribe((function(){t.hideToolTip()}))},t.prototype.positionTooltip=function(t){return"OFFSET_X"===t?"right"===this.toolTipPosition?this.element.nativeElement.offsetWidth/2+8:"left"===this.toolTipPosition?-1*(this.element.nativeElement.offsetWidth/2+8):"top"===this.toolTipPosition||"bottom"===this.toolTipPosition?0:8:"OFFSET_Y"===t?"right"===this.toolTipPosition||"left"===this.toolTipPosition?-18:"top"===this.toolTipPosition?-44:"bottom"===this.toolTipPosition?this.element.nativeElement.offsetHeight/2+8:8:void 0},t.prototype.hideToolTip=function(){var t,o;null===(t=this.overlayRef)||void 0===t||t.detach(),null===(o=this.overlayRef)||void 0===o||o.dispose()},t}();p.decorators=[{type:o.Directive,args:[{selector:"[misToolTip]"}]}],p.ctorParameters=function(){return[{type:o.ElementRef},{type:e.Overlay},{type:o.ViewContainerRef}]},p.propDecorators={showOnHover:[{type:o.Input}],showToolTip:[{type:o.Input}],text:[{type:o.Input}],position:[{type:o.Input}],alignText:[{type:o.Input}],onMouseEnter:[{type:o.HostListener,args:["mouseenter"]}],onMouseLeave:[{type:o.HostListener,args:["mouseleave"]}]};var a=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[]}},t}();a.decorators=[{type:o.NgModule,args:[{declarations:[p,l],imports:[s.CommonModule,e.OverlayModule],exports:[p,l],entryComponents:[l]}]}],t.ToolTipComponent=l,t.ToolTipDirective=p,t.ToolTipModule=a,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=mis-crystal-design-system-tooltip.umd.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../projects/mis-components/tooltip/tooltip-container/tooltip.component.ts","../../../projects/mis-components/tooltip/tooltip.directive.ts","../../../projects/mis-components/tooltip/tooltip.module.ts"],"names":["ToolTipComponent","this","toolTipText","toolTipPosition","prototype","ngOnInit","ngAfterViewInit","_a","container","nativeElement","eleWidth","getBoundingClientRect","style","left","width","Component","args","selector","template","ViewChild","ToolTipDirective","element","overlay","viewContainerRef","isToolTipDisplayed","showOnHover","Object","defineProperty","value","displayToolTip","hideToolTip","onMouseEnter","onMouseLeave","_this","positionStrategy","position","flexibleConnectedTo","withPositions","genPositionPairs","positionX","positionY","offsetX","positionTooltip","offsetY","withPush","config","OverlayConfig","hasBackdrop","scrollStrategy","scrollStrategies","reposition","overlayRef","create","tempRef","ComponentPortal","tooltipRef","attach","instance","backdropClick","pipe","take","subscribe","type","offsetWidth","offsetHeight","detach","_b","dispose","Directive","ElementRef","Overlay","ViewContainerRef","Input","HostListener","ToolTipModule","forRoot","ngModule","providers","NgModule","declarations","imports","CommonModule","OverlayModule","exports","entryComponents"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../projects/mis-components/tooltip/tooltip-container/tooltip.component.ts","../../../projects/mis-components/tooltip/tooltip.directive.ts","../../../projects/mis-components/tooltip/tooltip.module.ts"],"names":["ToolTipComponent","this","toolTipText","toolTipPosition","toolTipTextAlignment","prototype","ngOnInit","ngAfterViewInit","_a","container","nativeElement","eleWidth","getBoundingClientRect","style","left","width","Component","args","selector","template","ViewChild","ToolTipDirective","element","overlay","viewContainerRef","isToolTipDisplayed","showOnHover","Object","defineProperty","value","displayToolTip","hideToolTip","onMouseEnter","onMouseLeave","_this","positionStrategy","position","flexibleConnectedTo","withPositions","genPositionPairs","positionX","positionY","offsetX","positionTooltip","offsetY","withPush","config","OverlayConfig","hasBackdrop","scrollStrategy","scrollStrategies","reposition","overlayRef","create","tempRef","ComponentPortal","tooltipRef","attach","instance","backdropClick","pipe","take","subscribe","type","offsetWidth","offsetHeight","detach","_b","dispose","Directive","ElementRef","Overlay","ViewContainerRef","Input","HostListener","ToolTipModule","forRoot","ngModule","providers","NgModule","declarations","imports","Common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B/D,KAAKE,iBAAsD,WAAzBF,KAAKE,gBACvC,EACA,EAEO,aAAT4D,EAC4B,UAAzB9D,KAAKE,iBAAwD,SAAzBF,KAAKE,iBAC3C,GACwB,QAAzBF,KAAKE,iBACJ,GACwB,WAAzBF,KAAKE,gBACLF,KAAKqB,QAAQZ,cAAcuD,aAAe,EAAI,EAC9C,OAPJ,GAUF5C,EAAAhB,UAAA0B,YAAA,mBACiB,QAAfvB,EAAAP,KAAKmD,kBAAU,IAAA5C,GAAAA,EAAE0D,SACF,QAAfC,EAAAlE,KAAKmD,kBAAU,IAAAe,GAAAA,EAAEC,oCAlGpBC,EAAAA,UAASpD,KAAA,CAAC,CACTC,SAAU,4DATuBoD,EAAAA,kBAC1BC,EAAAA,eADmEC,EAAAA,yDAkBzEC,EAAAA,2BACAA,EAAAA,oBAKAA,EAAAA,wBAGAA,EAAAA,yBAGAA,EAAAA,4BAIAC,EAAAA,aAAYzD,KAAA,CAAC,oCAGbyD,EAAAA,aAAYzD,KAAA,CAAC,kCCzBhB,SAAA0D,YACSA,EAAAC,QAAP,WACE,MAAO,CAAEC,SAAUF,EAAeG,UAAW,8BARhDC,EAAAA,SAAQ9D,KAAA,CAAC,CACR+D,aAAc,CAAC3D,EAAkBrB,GACjCiF,QAAS,CAACC,EAAAA,aAAcC,EAAAA,eACxBC,QAAS,CAAC/D,EAAkBrB,GAC5BqF,gBAAiB,CAACrF","sourcesContent":["import { AfterViewInit, Component, ElementRef, Inject, OnInit, ViewChild } from \"@angular/core\";\nimport { ITooltipPositions } from \"../models/tooltip.model\";\n\n@Component({\n selector: \"mis-tooltip\",\n templateUrl: \"./tooltip.component.html\",\n styleUrls: [\"./tooltip.component.scss\"]\n})\nexport class ToolTipComponent implements OnInit, AfterViewInit {\n public toolTipText: string = \"\";\n public toolTipPosition: ITooltipPositions = \"bottom\";\n public toolTipTextAlignment: string = \"\";\n\n @ViewChild(\"container\") container: ElementRef;\n\n constructor() {}\n ngOnInit() {}\n ngAfterViewInit() {\n if (!this.container?.nativeElement) return;\n if (this.toolTipPosition === \"top\" || this.toolTipPosition === \"bottom\") {\n const eleWidth = this.container.nativeElement.getBoundingClientRect();\n this.container.nativeElement.style.left = eleWidth.width / -2 + \"px\";\n return;\n }\n if (this.toolTipPosition === \"left\") {\n const eleWidth = this.container.nativeElement.getBoundingClientRect();\n this.container.nativeElement.style.left = -eleWidth.width + \"px\";\n }\n }\n}\n","import { AfterViewInit, Directive, ElementRef, HostListener, Input, OnInit, ViewContainerRef } from \"@angular/core\";\nimport { Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { take } from \"rxjs/operators\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { ToolTipComponent } from \"./tooltip-container/tooltip.component\";\nimport { genPositionPairs } from \"mis-crystal-design-system/utils\";\nimport { ITooltipPositions } from \"./models/tooltip.model\";\n\n@Directive({\n selector: \"[misToolTip]\"\n})\nexport class ToolTipDirective implements OnInit, AfterViewInit {\n public isToolTipDisplayed: boolean = false;\n public toolTipText: string = \"\";\n public toolTipTextAlignment: string = \"\";\n public toolTipPosition: ITooltipPositions = \"bottom\";\n private overlayRef: OverlayRef;\n\n @Input() showOnHover: boolean = true;\n @Input() set showToolTip(value: boolean) {\n this.isToolTipDisplayed = value;\n if (value) this.displayToolTip();\n else this.hideToolTip();\n }\n @Input() set text(value: string) {\n this.toolTipText = value;\n }\n @Input() set position(value: ITooltipPositions) {\n this.toolTipPosition = value;\n }\n @Input() set alignText(value: string) {\n this.toolTipTextAlignment = value;\n }\n\n @HostListener(\"mouseenter\") onMouseEnter() {\n if (this.showOnHover) this.displayToolTip();\n }\n @HostListener(\"mouseleave\") onMouseLeave() {\n if (this.showOnHover) this.hideToolTip();\n }\n\n constructor(private element: ElementRef, private overlay: Overlay, private viewContainerRef: ViewContainerRef) {}\n\n ngOnInit() {}\n ngAfterViewInit() {\n if (this.isToolTipDisplayed) this.displayToolTip();\n else this.hideToolTip();\n }\n\n displayToolTip() {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.element)\n .withPositions(\n genPositionPairs(\n {\n positionX: \"center\",\n positionY: this.toolTipPosition === \"top\" ? \"top\" : \"center\",\n offsetX: this.positionTooltip(\"OFFSET_X\"),\n offsetY: this.positionTooltip(\"OFFSET_Y\")\n },\n false\n )\n )\n .withPush(true);\n const config = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition()\n });\n this.overlayRef = this.overlay.create(config);\n const tempRef = new ComponentPortal(ToolTipComponent, this.viewContainerRef);\n const tooltipRef = this.overlayRef.attach(tempRef);\n tooltipRef.instance.toolTipText = this.toolTipText;\n tooltipRef.instance.toolTipPosition = this.toolTipPosition;\n tooltipRef.instance.toolTipTextAlignment = this.toolTipTextAlignment;\n this.overlayRef\n .backdropClick()\n .pipe(take(1))\n .subscribe(() => {\n this.hideToolTip();\n });\n }\n\n positionTooltip(type: \"OFFSET_X\" | \"OFFSET_Y\") {\n if (type === \"OFFSET_X\") {\n return this.toolTipPosition === \"right\"\n ? this.element.nativeElement.offsetWidth / 2 + 8\n : this.toolTipPosition === \"left\"\n ? (this.element.nativeElement.offsetWidth / 2 + 8) * -1\n : this.toolTipPosition === \"top\" || this.toolTipPosition === \"bottom\"\n ? 0\n : 8;\n }\n if (type !== \"OFFSET_Y\") return;\n return this.toolTipPosition === \"right\" || this.toolTipPosition === \"left\"\n ? -18\n : this.toolTipPosition === \"top\"\n ? -44\n : this.toolTipPosition === \"bottom\"\n ? this.element.nativeElement.offsetHeight / 2 + 8\n : 8;\n }\n\n hideToolTip() {\n this.overlayRef?.detach();\n this.overlayRef?.dispose();\n }\n}\n","import { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { ToolTipDirective } from \"./tooltip.directive\";\nimport { ToolTipComponent } from \"./tooltip-container/tooltip.component\";\n\n@NgModule({\n declarations: [ToolTipDirective, ToolTipComponent],\n imports: [CommonModule, OverlayModule],\n exports: [ToolTipDirective, ToolTipComponent],\n entryComponents: [ToolTipComponent]\n})\nexport class ToolTipModule {\n static forRoot(): ModuleWithProviders<ToolTipModule> {\n return { ngModule: ToolTipModule, providers: [] };\n }\n}\n"]}
|
|
@@ -204,7 +204,7 @@ AsyncDropdownComponent.decorators = [
|
|
|
204
204
|
{ type: Component, args: [{
|
|
205
205
|
selector: "mis-async-search-dropdown",
|
|
206
206
|
template: "<div class=\"dd-wrapper\" [ngClass]=\"{ opened: opened, disabled: disabled, readonly: readonly }\" #ddBtn>\n <div class=\"selected-list\" *ngIf=\"multi && selections.size > 0\">\n <div class=\"chip\" [ngClass]=\"{'chip-md': size === 'md', 'chip-sm': size === 'sm'}\" *ngFor=\"let item of selectedItems\">\n <span [ngClass]=\"{'h6': size === 'md', 'h8-b': size === 'sm'}\" style=\"margin-right: 4px;\">{{item[displayKey]}}</span>\n <span style=\"cursor: pointer;\" (click)=\"removeItem(item)\" [ngStyle]=\"{'font-size': size === 'sm' ? '12px': '14px'}\" class=\"ic-navigation-cancel-24\"></span>\n </div>\n </div>\n <div class=\"search-input\">\n <span class=\"ic-action-search-24\"></span>\n <input *ngIf=\"disableCopyPaste; else enableCopyPaste\" [ngClass]=\"{'ip-md': size === 'md', 'ip-sm': size === 'sm'}\" oncopy=\"return false;\" onpaste=\"return false\" oncut=\"return false\" tabindex=\"0\" type=\"text\" class=\"black-text h6\" #input [placeholder]=\"placeholder\" [formControl]=\"searchInput\" (focus)=\"defaultCall()\"/>\n <ng-template #enableCopyPaste>\n <input [ngClass]=\"{'ip-md': size === 'md', 'ip-sm': size === 'sm'}\" tabindex=\"0\" type=\"text\" class=\"black-text h6\" #input [placeholder]=\"placeholder\" [formControl]=\"searchInput\" (focus)=\"defaultCall()\" />\n </ng-template>\n <div class=\"ic-navigation-cancel-24 croos-icon\" *ngIf=\"searchInput?.value?.length\" (click)=\"removeInputValue()\"></div>\n </div>\n</div>\n\n<ng-template #dd>\n <div class=\"dd-list\" [ngStyle]=\"{'max-height':height}\" [ngClass]=\"{'dd-list-pd':data.length === 0}\" >\n <ng-container *ngIf=\"loading\">\n <ng-container\n *ngIf=\"customLoader; else defaultLoader\"\n [ngTemplateOutlet]=\"customLoader\"\n ></ng-container>\n <ng-template #defaultLoader>\n <div class=\"status-container\" *ngIf=\"loading && !customLoader\">\n <mis-loader [mobileView]=\"true\"></mis-loader>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"error\">\n <div class=\"status-container\">\n <p>Unknown error has occurred, <br> Please try again later.</p>\n </div>\n </ng-container>\n <div *ngIf=\"!loading && !error && data.length > 0\">\n <ng-container *ngFor=\"let item of data\">\n <div (click)=\"selectData(item, false)\">\n <ng-container\n *ngIf=\"customItem; else standardItem\"\n [ngTemplateOutlet]=\"customItem\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-container>\n <ng-template #standardItem>\n <div class=\"item\">\n <div class=\"value\">\n <div class=\"primary\">\n {{ item[displayKey] }}\n </div>\n <div class=\"secondary\">\n {{ item[secondaryDisplayKey] }}\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </div>\n <div *ngIf=\"!loading && !error && data.length === 0 && searchInput.value\">\n <div class=\"data-not-found\">No Data Available</div>\n </div>\n </div>\n</ng-template>\n",
|
|
207
|
-
styles: [".dd-wrapper{background:#fff;border:1px solid #e0e0e0;box-sizing:border-box;border-radius:4px;display:block;cursor:pointer;outline:none}.dd-wrapper.opened,.dd-wrapper:hover{background:#f5f5f5}.dd-wrapper .selected-list{display:flex;justify-content:flex-start;flex-wrap:wrap;gap:4px;padding:8px 16px}.dd-wrapper:focus-within{border-color:#0937b2;background:#f5f5f5}.dd-wrapper.disabled,.dd-wrapper.readonly{pointer-events:none}.search-input{position:relative;border-radius:8px}.search-input input{box-sizing:border-box;outline:none;padding-left:40px;padding-right:24px;background-color:transparent;color:#181f33;border-radius:inherit;border:1px solid transparent;width:100%}.search-input span{font-size:24px;line-height:24px;height:24px;left:8px;padding-top:2px}.search-input .croos-icon,.search-input span{position:absolute;top:50%;transform:translateY(-50%)}.search-input .croos-icon{font-size:16px;width:24px;line-height:16px;height:16px;right:0
|
|
207
|
+
styles: [".dd-wrapper{background:#fff;border:1px solid #e0e0e0;box-sizing:border-box;border-radius:4px;display:block;cursor:pointer;outline:none}.dd-wrapper.opened,.dd-wrapper:hover{background:#f5f5f5}.dd-wrapper .selected-list{display:flex;justify-content:flex-start;flex-wrap:wrap;gap:4px;padding:8px 16px}.dd-wrapper:focus-within{border-color:#0937b2;background:#f5f5f5}.dd-wrapper.disabled,.dd-wrapper.readonly{pointer-events:none}.search-input{position:relative;border-radius:8px}.search-input input{box-sizing:border-box;outline:none;padding-left:40px;padding-right:24px;background-color:transparent;color:#181f33;border-radius:inherit;border:1px solid transparent;width:100%}.search-input span{font-size:24px;line-height:24px;height:24px;left:8px;padding-top:2px}.search-input .croos-icon,.search-input span{position:absolute;top:50%;transform:translateY(-50%)}.search-input .croos-icon{font-size:16px;width:24px;line-height:16px;height:16px;right:0}.dd-list{padding:8px 0;max-height:200px;background:#fff;box-shadow:0 12px 24px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.12);border-radius:8px;min-width:100%;overflow-y:auto}.dd-list::-webkit-scrollbar{width:8px;border-radius:4px}.dd-list::-webkit-scrollbar-track{background:#fff;border-radius:4px}.dd-list::-webkit-scrollbar-thumb{background:#929dab;border-radius:4px}.dd-list::-webkit-scrollbar-thumb:hover{background:#929dab}.dd-list .item{padding:8px 16px;cursor:pointer}.dd-list .item .disabled{color:#6a737d!important;pointer-events:none}.dd-list .item .value{display:flex;justify-content:space-between;align-items:center}.dd-list .item .value .primary,.dd-list .item .value .secondary{font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#181f33}.dd-list .item .reason{font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d}.dd-list .item:hover:not(.disabled){background:#f5f7fc}.dd-list .data-not-found{display:flex;justify-content:center;align-items:center;font-size:16px;padding:8px}.dd-list-pd{padding:unset}.chip{display:inline-flex;align-items:center;background:#e0e0e0;cursor:default}.chip span{color:#181f33}.chip-md{border-radius:16px;padding:4px 12px}.chip-sm{border-radius:6px;padding:4px 8px;text-transform:uppercase}.ip-md{padding-top:8px;padding-bottom:8px}.ip-sm{padding-top:3px;padding-bottom:3px}.status-container{display:flex;justify-content:center;align-items:center;height:128px}.status-container p{text-align:center}::ng-deep #spinner{position:relative!important}"]
|
|
208
208
|
},] }
|
|
209
209
|
];
|
|
210
210
|
AsyncDropdownComponent.ctorParameters = () => [
|
|
@@ -3,6 +3,7 @@ export class ToolTipComponent {
|
|
|
3
3
|
constructor() {
|
|
4
4
|
this.toolTipText = "";
|
|
5
5
|
this.toolTipPosition = "bottom";
|
|
6
|
+
this.toolTipTextAlignment = "";
|
|
6
7
|
}
|
|
7
8
|
ngOnInit() { }
|
|
8
9
|
ngAfterViewInit() {
|
|
@@ -23,7 +24,7 @@ export class ToolTipComponent {
|
|
|
23
24
|
ToolTipComponent.decorators = [
|
|
24
25
|
{ type: Component, args: [{
|
|
25
26
|
selector: "mis-tooltip",
|
|
26
|
-
template: "<div id=\"tooltip-container\" *ngIf=\"toolTipText.length > 0\" #container>\n <div id=\"tooltip\">\n <div id=\"tooltip-text\"
|
|
27
|
+
template: "<div id=\"tooltip-container\" *ngIf=\"toolTipText.length > 0\" #container>\n <div id=\"tooltip\">\n <div id=\"tooltip-text\" [innerHTML]=\"toolTipText\" \n [ngStyle]=\"{'text-align' : toolTipTextAlignment ? toolTipTextAlignment : '' }\"></div>\n <span\n id=\"arrow\"\n [ngClass]=\"{\n 'arrow-left': toolTipPosition === 'left',\n 'arrow-right': toolTipPosition === 'right',\n 'arrow-top': toolTipPosition === 'top',\n 'arrow-bottom': toolTipPosition === 'bottom'\n }\"\n ></span>\n </div>\n</div>\n",
|
|
27
28
|
styles: ["#tooltip-container{position:absolute;z-index:1}#tooltip{position:relative;display:block;padding:8px 12px;border-radius:8px;color:#fff;background:#181f33;font-family:Lato,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:20px;text-align:center;letter-spacing:.2px}#tooltip-text{width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#arrow{position:absolute;height:12px;width:12px;background:#181f33;z-index:1}.arrow-top{bottom:-6px}.arrow-bottom,.arrow-top{left:50%;transform:translateX(-50%) rotate(-45deg);-webkit-transform:translateX(-50%) rotate(-45deg)}.arrow-bottom{top:-6px}.arrow-left{right:-6px}.arrow-left,.arrow-right{top:50%;transform:translateY(-50%) rotate(-45deg);-webkit-transform:translateY(-50%) rotate(-45deg)}.arrow-right{left:-6px}"]
|
|
28
29
|
},] }
|
|
29
30
|
];
|
|
@@ -31,4 +32,4 @@ ToolTipComponent.ctorParameters = () => [];
|
|
|
31
32
|
ToolTipComponent.propDecorators = {
|
|
32
33
|
container: [{ type: ViewChild, args: ["container",] }]
|
|
33
34
|
};
|
|
34
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbHRpcC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9taXMtY29tcG9uZW50cy90b29sdGlwL3Rvb2x0aXAtY29udGFpbmVyL3Rvb2x0aXAuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBaUIsU0FBUyxFQUE4QixTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFRaEcsTUFBTSxPQUFPLGdCQUFnQjtJQU8zQjtRQU5PLGdCQUFXLEdBQVcsRUFBRSxDQUFDO1FBQ3pCLG9CQUFlLEdBQXNCLFFBQVEsQ0FBQztRQUM5Qyx5QkFBb0IsR0FBVyxFQUFFLENBQUM7SUFJMUI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ICAgcmV0dXJuO1xuICAgIH1cbiAgICBpZiAodGhpcy50b29sVGlwUG9zaXRpb24gPT09IFwibGVmdFwiKSB7XG4gICAgICBjb25zdCBlbGVXaWR0aCA9IHRoaXMuY29udGFpbmVyLm5hdGl2ZUVsZW1lbnQuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7XG4gICAgICB0aGlzLmNvbnRhaW5lci5uYXRpdmVFbGVtZW50LnN0eWxlLmxlZnQgPSAtZWxlV2lkdGgud2lkdGggKyBcInB4XCI7XG4gICAgfVxuICB9XG59XG4iXX0=
|
|
@@ -11,6 +11,7 @@ export class ToolTipDirective {
|
|
|
11
11
|
this.viewContainerRef = viewContainerRef;
|
|
12
12
|
this.isToolTipDisplayed = false;
|
|
13
13
|
this.toolTipText = "";
|
|
14
|
+
this.toolTipTextAlignment = "";
|
|
14
15
|
this.toolTipPosition = "bottom";
|
|
15
16
|
this.showOnHover = true;
|
|
16
17
|
}
|
|
@@ -27,6 +28,9 @@ export class ToolTipDirective {
|
|
|
27
28
|
set position(value) {
|
|
28
29
|
this.toolTipPosition = value;
|
|
29
30
|
}
|
|
31
|
+
set alignText(value) {
|
|
32
|
+
this.toolTipTextAlignment = value;
|
|
33
|
+
}
|
|
30
34
|
onMouseEnter() {
|
|
31
35
|
if (this.showOnHover)
|
|
32
36
|
this.displayToolTip();
|
|
@@ -63,6 +67,7 @@ export class ToolTipDirective {
|
|
|
63
67
|
const tooltipRef = this.overlayRef.attach(tempRef);
|
|
64
68
|
tooltipRef.instance.toolTipText = this.toolTipText;
|
|
65
69
|
tooltipRef.instance.toolTipPosition = this.toolTipPosition;
|
|
70
|
+
tooltipRef.instance.toolTipTextAlignment = this.toolTipTextAlignment;
|
|
66
71
|
this.overlayRef
|
|
67
72
|
.backdropClick()
|
|
68
73
|
.pipe(take(1))
|
|
@@ -111,7 +116,8 @@ ToolTipDirective.propDecorators = {
|
|
|
111
116
|
showToolTip: [{ type: Input }],
|
|
112
117
|
text: [{ type: Input }],
|
|
113
118
|
position: [{ type: Input }],
|
|
119
|
+
alignText: [{ type: Input }],
|
|
114
120
|
onMouseEnter: [{ type: HostListener, args: ["mouseenter",] }],
|
|
115
121
|
onMouseLeave: [{ type: HostListener, args: ["mouseleave",] }]
|
|
116
122
|
};
|
|
117
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
123
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbHRpcC5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9taXMtY29tcG9uZW50cy90b29sdGlwL3Rvb2x0aXAuZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBaUIsU0FBUyxFQUFFLFVBQVUsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFVLGdCQUFnQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3BILE9BQU8sRUFBRSxPQUFPLEVBQUUsYUFBYSxFQUFjLE1BQU0sc0JBQXNCLENBQUM7QUFDMUUsT0FBTyxFQUFFLElBQUksRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3RDLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUN0RCxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx1Q0FBdUMsQ0FBQztBQUN6RSxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQU1uRSxNQUFNLE9BQU8sZ0JBQWdCO0lBOEIzQixZQUFvQixPQUFtQixFQUFVLE9BQWdCLEVBQVUsZ0JBQWtDO1FBQXpGLFlBQU8sR0FBUCxPQUFPLENBQVk7UUFBVSxZQUFPLEdBQVAsT0FBTyxDQUFTO1FBQVUscUJBQWdCLEdBQWhCLGdCQUFnQixDQUFrQjtRQTdCdEcs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mlnaHRcIiB8fCB0aGlzLnRvb2xUaXBQb3NpdGlvbiA9PT0gXCJsZWZ0XCJcbiAgICAgID8gLTE4XG4gICAgICA6IHRoaXMudG9vbFRpcFBvc2l0aW9uID09PSBcInRvcFwiXG4gICAgICA/IC00NFxuICAgICAgOiB0aGlzLnRvb2xUaXBQb3NpdGlvbiA9PT0gXCJib3R0b21cIlxuICAgICAgPyB0aGlzLmVsZW1lbnQubmF0aXZlRWxlbWVudC5vZmZzZXRIZWlnaHQgLyAyICsgOFxuICAgICAgOiA4O1xuICB9XG5cbiAgaGlkZVRvb2xUaXAoKSB7XG4gICAgdGhpcy5vdmVybGF5UmVmPy5kZXRhY2goKTtcbiAgICB0aGlzLm92ZXJsYXlSZWY/LmRpc3Bvc2UoKTtcbiAgfVxufVxuIl19
|
|
@@ -207,7 +207,7 @@ AsyncDropdownComponent.decorators = [
|
|
|
207
207
|
{ type: Component, args: [{
|
|
208
208
|
selector: "mis-async-search-dropdown",
|
|
209
209
|
template: "<div class=\"dd-wrapper\" [ngClass]=\"{ opened: opened, disabled: disabled, readonly: readonly }\" #ddBtn>\n <div class=\"selected-list\" *ngIf=\"multi && selections.size > 0\">\n <div class=\"chip\" [ngClass]=\"{'chip-md': size === 'md', 'chip-sm': size === 'sm'}\" *ngFor=\"let item of selectedItems\">\n <span [ngClass]=\"{'h6': size === 'md', 'h8-b': size === 'sm'}\" style=\"margin-right: 4px;\">{{item[displayKey]}}</span>\n <span style=\"cursor: pointer;\" (click)=\"removeItem(item)\" [ngStyle]=\"{'font-size': size === 'sm' ? '12px': '14px'}\" class=\"ic-navigation-cancel-24\"></span>\n </div>\n </div>\n <div class=\"search-input\">\n <span class=\"ic-action-search-24\"></span>\n <input *ngIf=\"disableCopyPaste; else enableCopyPaste\" [ngClass]=\"{'ip-md': size === 'md', 'ip-sm': size === 'sm'}\" oncopy=\"return false;\" onpaste=\"return false\" oncut=\"return false\" tabindex=\"0\" type=\"text\" class=\"black-text h6\" #input [placeholder]=\"placeholder\" [formControl]=\"searchInput\" (focus)=\"defaultCall()\"/>\n <ng-template #enableCopyPaste>\n <input [ngClass]=\"{'ip-md': size === 'md', 'ip-sm': size === 'sm'}\" tabindex=\"0\" type=\"text\" class=\"black-text h6\" #input [placeholder]=\"placeholder\" [formControl]=\"searchInput\" (focus)=\"defaultCall()\" />\n </ng-template>\n <div class=\"ic-navigation-cancel-24 croos-icon\" *ngIf=\"searchInput?.value?.length\" (click)=\"removeInputValue()\"></div>\n </div>\n</div>\n\n<ng-template #dd>\n <div class=\"dd-list\" [ngStyle]=\"{'max-height':height}\" [ngClass]=\"{'dd-list-pd':data.length === 0}\" >\n <ng-container *ngIf=\"loading\">\n <ng-container\n *ngIf=\"customLoader; else defaultLoader\"\n [ngTemplateOutlet]=\"customLoader\"\n ></ng-container>\n <ng-template #defaultLoader>\n <div class=\"status-container\" *ngIf=\"loading && !customLoader\">\n <mis-loader [mobileView]=\"true\"></mis-loader>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"error\">\n <div class=\"status-container\">\n <p>Unknown error has occurred, <br> Please try again later.</p>\n </div>\n </ng-container>\n <div *ngIf=\"!loading && !error && data.length > 0\">\n <ng-container *ngFor=\"let item of data\">\n <div (click)=\"selectData(item, false)\">\n <ng-container\n *ngIf=\"customItem; else standardItem\"\n [ngTemplateOutlet]=\"customItem\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n ></ng-container>\n <ng-template #standardItem>\n <div class=\"item\">\n <div class=\"value\">\n <div class=\"primary\">\n {{ item[displayKey] }}\n </div>\n <div class=\"secondary\">\n {{ item[secondaryDisplayKey] }}\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </div>\n <div *ngIf=\"!loading && !error && data.length === 0 && searchInput.value\">\n <div class=\"data-not-found\">No Data Available</div>\n </div>\n </div>\n</ng-template>\n",
|
|
210
|
-
styles: [".dd-wrapper{background:#fff;border:1px solid #e0e0e0;box-sizing:border-box;border-radius:4px;display:block;cursor:pointer;outline:none}.dd-wrapper.opened,.dd-wrapper:hover{background:#f5f5f5}.dd-wrapper .selected-list{display:flex;justify-content:flex-start;flex-wrap:wrap;gap:4px;padding:8px 16px}.dd-wrapper:focus-within{border-color:#0937b2;background:#f5f5f5}.dd-wrapper.disabled,.dd-wrapper.readonly{pointer-events:none}.search-input{position:relative;border-radius:8px}.search-input input{box-sizing:border-box;outline:none;padding-left:40px;padding-right:24px;background-color:transparent;color:#181f33;border-radius:inherit;border:1px solid transparent;width:100%}.search-input span{font-size:24px;line-height:24px;height:24px;left:8px;padding-top:2px}.search-input .croos-icon,.search-input span{position:absolute;top:50%;transform:translateY(-50%)}.search-input .croos-icon{font-size:16px;width:24px;line-height:16px;height:16px;right:0
|
|
210
|
+
styles: [".dd-wrapper{background:#fff;border:1px solid #e0e0e0;box-sizing:border-box;border-radius:4px;display:block;cursor:pointer;outline:none}.dd-wrapper.opened,.dd-wrapper:hover{background:#f5f5f5}.dd-wrapper .selected-list{display:flex;justify-content:flex-start;flex-wrap:wrap;gap:4px;padding:8px 16px}.dd-wrapper:focus-within{border-color:#0937b2;background:#f5f5f5}.dd-wrapper.disabled,.dd-wrapper.readonly{pointer-events:none}.search-input{position:relative;border-radius:8px}.search-input input{box-sizing:border-box;outline:none;padding-left:40px;padding-right:24px;background-color:transparent;color:#181f33;border-radius:inherit;border:1px solid transparent;width:100%}.search-input span{font-size:24px;line-height:24px;height:24px;left:8px;padding-top:2px}.search-input .croos-icon,.search-input span{position:absolute;top:50%;transform:translateY(-50%)}.search-input .croos-icon{font-size:16px;width:24px;line-height:16px;height:16px;right:0}.dd-list{padding:8px 0;max-height:200px;background:#fff;box-shadow:0 12px 24px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.12);border-radius:8px;min-width:100%;overflow-y:auto}.dd-list::-webkit-scrollbar{width:8px;border-radius:4px}.dd-list::-webkit-scrollbar-track{background:#fff;border-radius:4px}.dd-list::-webkit-scrollbar-thumb{background:#929dab;border-radius:4px}.dd-list::-webkit-scrollbar-thumb:hover{background:#929dab}.dd-list .item{padding:8px 16px;cursor:pointer}.dd-list .item .disabled{color:#6a737d!important;pointer-events:none}.dd-list .item .value{display:flex;justify-content:space-between;align-items:center}.dd-list .item .value .primary,.dd-list .item .value .secondary{font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#181f33}.dd-list .item .reason{font-weight:400;font-size:14px;line-height:20px;letter-spacing:.2px;color:#6a737d}.dd-list .item:hover:not(.disabled){background:#f5f7fc}.dd-list .data-not-found{display:flex;justify-content:center;align-items:center;font-size:16px;padding:8px}.dd-list-pd{padding:unset}.chip{display:inline-flex;align-items:center;background:#e0e0e0;cursor:default}.chip span{color:#181f33}.chip-md{border-radius:16px;padding:4px 12px}.chip-sm{border-radius:6px;padding:4px 8px;text-transform:uppercase}.ip-md{padding-top:8px;padding-bottom:8px}.ip-sm{padding-top:3px;padding-bottom:3px}.status-container{display:flex;justify-content:center;align-items:center;height:128px}.status-container p{text-align:center}::ng-deep #spinner{position:relative!important}"]
|
|
211
211
|
},] }
|
|
212
212
|
];
|
|
213
213
|
AsyncDropdownComponent.ctorParameters = () => [
|
|
@@ -9,6 +9,7 @@ class ToolTipComponent {
|
|
|
9
9
|
constructor() {
|
|
10
10
|
this.toolTipText = "";
|
|
11
11
|
this.toolTipPosition = "bottom";
|
|
12
|
+
this.toolTipTextAlignment = "";
|
|
12
13
|
}
|
|
13
14
|
ngOnInit() { }
|
|
14
15
|
ngAfterViewInit() {
|
|
@@ -29,7 +30,7 @@ class ToolTipComponent {
|
|
|
29
30
|
ToolTipComponent.decorators = [
|
|
30
31
|
{ type: Component, args: [{
|
|
31
32
|
selector: "mis-tooltip",
|
|
32
|
-
template: "<div id=\"tooltip-container\" *ngIf=\"toolTipText.length > 0\" #container>\n <div id=\"tooltip\">\n <div id=\"tooltip-text\"
|
|
33
|
+
template: "<div id=\"tooltip-container\" *ngIf=\"toolTipText.length > 0\" #container>\n <div id=\"tooltip\">\n <div id=\"tooltip-text\" [innerHTML]=\"toolTipText\" \n [ngStyle]=\"{'text-align' : toolTipTextAlignment ? toolTipTextAlignment : '' }\"></div>\n <span\n id=\"arrow\"\n [ngClass]=\"{\n 'arrow-left': toolTipPosition === 'left',\n 'arrow-right': toolTipPosition === 'right',\n 'arrow-top': toolTipPosition === 'top',\n 'arrow-bottom': toolTipPosition === 'bottom'\n }\"\n ></span>\n </div>\n</div>\n",
|
|
33
34
|
styles: ["#tooltip-container{position:absolute;z-index:1}#tooltip{position:relative;display:block;padding:8px 12px;border-radius:8px;color:#fff;background:#181f33;font-family:Lato,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:20px;text-align:center;letter-spacing:.2px}#tooltip-text{width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#arrow{position:absolute;height:12px;width:12px;background:#181f33;z-index:1}.arrow-top{bottom:-6px}.arrow-bottom,.arrow-top{left:50%;transform:translateX(-50%) rotate(-45deg);-webkit-transform:translateX(-50%) rotate(-45deg)}.arrow-bottom{top:-6px}.arrow-left{right:-6px}.arrow-left,.arrow-right{top:50%;transform:translateY(-50%) rotate(-45deg);-webkit-transform:translateY(-50%) rotate(-45deg)}.arrow-right{left:-6px}"]
|
|
34
35
|
},] }
|
|
35
36
|
];
|
|
@@ -45,6 +46,7 @@ class ToolTipDirective {
|
|
|
45
46
|
this.viewContainerRef = viewContainerRef;
|
|
46
47
|
this.isToolTipDisplayed = false;
|
|
47
48
|
this.toolTipText = "";
|
|
49
|
+
this.toolTipTextAlignment = "";
|
|
48
50
|
this.toolTipPosition = "bottom";
|
|
49
51
|
this.showOnHover = true;
|
|
50
52
|
}
|
|
@@ -61,6 +63,9 @@ class ToolTipDirective {
|
|
|
61
63
|
set position(value) {
|
|
62
64
|
this.toolTipPosition = value;
|
|
63
65
|
}
|
|
66
|
+
set alignText(value) {
|
|
67
|
+
this.toolTipTextAlignment = value;
|
|
68
|
+
}
|
|
64
69
|
onMouseEnter() {
|
|
65
70
|
if (this.showOnHover)
|
|
66
71
|
this.displayToolTip();
|
|
@@ -97,6 +102,7 @@ class ToolTipDirective {
|
|
|
97
102
|
const tooltipRef = this.overlayRef.attach(tempRef);
|
|
98
103
|
tooltipRef.instance.toolTipText = this.toolTipText;
|
|
99
104
|
tooltipRef.instance.toolTipPosition = this.toolTipPosition;
|
|
105
|
+
tooltipRef.instance.toolTipTextAlignment = this.toolTipTextAlignment;
|
|
100
106
|
this.overlayRef
|
|
101
107
|
.backdropClick()
|
|
102
108
|
.pipe(take(1))
|
|
@@ -145,6 +151,7 @@ ToolTipDirective.propDecorators = {
|
|
|
145
151
|
showToolTip: [{ type: Input }],
|
|
146
152
|
text: [{ type: Input }],
|
|
147
153
|
position: [{ type: Input }],
|
|
154
|
+
alignText: [{ type: Input }],
|
|
148
155
|
onMouseEnter: [{ type: HostListener, args: ["mouseenter",] }],
|
|
149
156
|
onMouseLeave: [{ type: HostListener, args: ["mouseleave",] }]
|
|
150
157
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mis-crystal-design-system-tooltip.js","sources":["../../../projects/mis-components/tooltip/tooltip-container/tooltip.component.ts","../../../projects/mis-components/tooltip/tooltip.directive.ts","../../../projects/mis-components/tooltip/tooltip.module.ts","../../../projects/mis-components/tooltip/mis-crystal-design-system-tooltip.ts"],"sourcesContent":["import { AfterViewInit, Component, ElementRef, Inject, OnInit, ViewChild } from \"@angular/core\";\nimport { ITooltipPositions } from \"../models/tooltip.model\";\n\n@Component({\n selector: \"mis-tooltip\",\n templateUrl: \"./tooltip.component.html\",\n styleUrls: [\"./tooltip.component.scss\"]\n})\nexport class ToolTipComponent implements OnInit, AfterViewInit {\n public toolTipText: string = \"\";\n public toolTipPosition: ITooltipPositions = \"bottom\";\n\n @ViewChild(\"container\") container: ElementRef;\n\n constructor() {}\n ngOnInit() {}\n ngAfterViewInit() {\n if (!this.container?.nativeElement) return;\n if (this.toolTipPosition === \"top\" || this.toolTipPosition === \"bottom\") {\n const eleWidth = this.container.nativeElement.getBoundingClientRect();\n this.container.nativeElement.style.left = eleWidth.width / -2 + \"px\";\n return;\n }\n if (this.toolTipPosition === \"left\") {\n const eleWidth = this.container.nativeElement.getBoundingClientRect();\n this.container.nativeElement.style.left = -eleWidth.width + \"px\";\n }\n }\n}\n","import { AfterViewInit, Directive, ElementRef, HostListener, Input, OnInit, ViewContainerRef } from \"@angular/core\";\nimport { Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { take } from \"rxjs/operators\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { ToolTipComponent } from \"./tooltip-container/tooltip.component\";\nimport { genPositionPairs } from \"mis-crystal-design-system/utils\";\nimport { ITooltipPositions } from \"./models/tooltip.model\";\n\n@Directive({\n selector: \"[misToolTip]\"\n})\nexport class ToolTipDirective implements OnInit, AfterViewInit {\n public isToolTipDisplayed: boolean = false;\n public toolTipText: string = \"\";\n public toolTipPosition: ITooltipPositions = \"bottom\";\n private overlayRef: OverlayRef;\n\n @Input() showOnHover: boolean = true;\n @Input() set showToolTip(value: boolean) {\n this.isToolTipDisplayed = value;\n if (value) this.displayToolTip();\n else this.hideToolTip();\n }\n @Input() set text(value: string) {\n this.toolTipText = value;\n }\n @Input() set position(value: ITooltipPositions) {\n this.toolTipPosition = value;\n }\n\n @HostListener(\"mouseenter\") onMouseEnter() {\n if (this.showOnHover) this.displayToolTip();\n }\n @HostListener(\"mouseleave\") onMouseLeave() {\n if (this.showOnHover) this.hideToolTip();\n }\n\n constructor(private element: ElementRef, private overlay: Overlay, private viewContainerRef: ViewContainerRef) {}\n\n ngOnInit() {}\n ngAfterViewInit() {\n if (this.isToolTipDisplayed) this.displayToolTip();\n else this.hideToolTip();\n }\n\n displayToolTip() {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.element)\n .withPositions(\n genPositionPairs(\n {\n positionX: \"center\",\n positionY: this.toolTipPosition === \"top\" ? \"top\" : \"center\",\n offsetX: this.positionTooltip(\"OFFSET_X\"),\n offsetY: this.positionTooltip(\"OFFSET_Y\")\n },\n false\n )\n )\n .withPush(true);\n const config = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition()\n });\n this.overlayRef = this.overlay.create(config);\n const tempRef = new ComponentPortal(ToolTipComponent, this.viewContainerRef);\n const tooltipRef = this.overlayRef.attach(tempRef);\n tooltipRef.instance.toolTipText = this.toolTipText;\n tooltipRef.instance.toolTipPosition = this.toolTipPosition;\n this.overlayRef\n .backdropClick()\n .pipe(take(1))\n .subscribe(() => {\n this.hideToolTip();\n });\n }\n\n positionTooltip(type: \"OFFSET_X\" | \"OFFSET_Y\") {\n if (type === \"OFFSET_X\") {\n return this.toolTipPosition === \"right\"\n ? this.element.nativeElement.offsetWidth / 2 + 8\n : this.toolTipPosition === \"left\"\n ? (this.element.nativeElement.offsetWidth / 2 + 8) * -1\n : this.toolTipPosition === \"top\" || this.toolTipPosition === \"bottom\"\n ? 0\n : 8;\n }\n if (type !== \"OFFSET_Y\") return;\n return this.toolTipPosition === \"right\" || this.toolTipPosition === \"left\"\n ? -18\n : this.toolTipPosition === \"top\"\n ? -44\n : this.toolTipPosition === \"bottom\"\n ? this.element.nativeElement.offsetHeight / 2 + 8\n : 8;\n }\n\n hideToolTip() {\n this.overlayRef?.detach();\n this.overlayRef?.dispose();\n }\n}\n","import { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { ToolTipDirective } from \"./tooltip.directive\";\nimport { ToolTipComponent } from \"./tooltip-container/tooltip.component\";\n\n@NgModule({\n declarations: [ToolTipDirective, ToolTipComponent],\n imports: [CommonModule, OverlayModule],\n exports: [ToolTipDirective, ToolTipComponent],\n entryComponents: [ToolTipComponent]\n})\nexport class ToolTipModule {\n static forRoot(): ModuleWithProviders<ToolTipModule> {\n return { ngModule: ToolTipModule, providers: [] };\n }\n}\n","/**\n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AAC,YAAY,GAAG,CAAC,GAAG,CAAC;sBAC/C,CAAC,CAAC;KACP;IAED,WAAW;;QACT,MAAA,IAAI,CAAC,UAAU,0CAAE,MAAM,GAAG;QAC1B,MAAA,IAAI,CAAC,UAAU,0CAAE,OAAO,GAAG;KAC5B;;;YA9FF,SAAS,SAAC;gBACT,QAAQ,EAAE,cAAc;aACzB;;;YAVkC,UAAU;YACpC,OAAO;YAD4D,gBAAgB;;;0BAiBzF,KAAK;0BACL,KAAK;mBAKL,KAAK;uBAGL,KAAK;2BAIL,YAAY,SAAC,YAAY;2BAGzB,YAAY,SAAC,YAAY;;;MCrBf,aAAa;IACxB,OAAO,OAAO;QACZ,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;KACnD;;;YATF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;gBAClD,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;gBACtC,OAAO,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;gBAC7C,eAAe,EAAE,CAAC,gBAAgB,CAAC;aACpC;;;ACXD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"mis-crystal-design-system-tooltip.js","sources":["../../../projects/mis-components/tooltip/tooltip-container/tooltip.component.ts","../../../projects/mis-components/tooltip/tooltip.directive.ts","../../../projects/mis-components/tooltip/tooltip.module.ts","../../../projects/mis-components/tooltip/mis-crystal-design-system-tooltip.ts"],"sourcesContent":["import { AfterViewInit, Component, ElementRef, Inject, OnInit, ViewChild } from \"@angular/core\";\nimport { ITooltipPositions } from \"../models/tooltip.model\";\n\n@Component({\n selector: \"mis-tooltip\",\n templateUrl: \"./tooltip.component.html\",\n styleUrls: [\"./tooltip.component.scss\"]\n})\nexport class ToolTipComponent implements OnInit, AfterViewInit {\n public toolTipText: string = \"\";\n public toolTipPosition: ITooltipPositions = \"bottom\";\n public toolTipTextAlignment: string = \"\";\n\n @ViewChild(\"container\") container: ElementRef;\n\n constructor() {}\n ngOnInit() {}\n ngAfterViewInit() {\n if (!this.container?.nativeElement) return;\n if (this.toolTipPosition === \"top\" || this.toolTipPosition === \"bottom\") {\n const eleWidth = this.container.nativeElement.getBoundingClientRect();\n this.container.nativeElement.style.left = eleWidth.width / -2 + \"px\";\n return;\n }\n if (this.toolTipPosition === \"left\") {\n const eleWidth = this.container.nativeElement.getBoundingClientRect();\n this.container.nativeElement.style.left = -eleWidth.width + \"px\";\n }\n }\n}\n","import { AfterViewInit, Directive, ElementRef, HostListener, Input, OnInit, ViewContainerRef } from \"@angular/core\";\nimport { Overlay, OverlayConfig, OverlayRef } from \"@angular/cdk/overlay\";\nimport { take } from \"rxjs/operators\";\nimport { ComponentPortal } from \"@angular/cdk/portal\";\nimport { ToolTipComponent } from \"./tooltip-container/tooltip.component\";\nimport { genPositionPairs } from \"mis-crystal-design-system/utils\";\nimport { ITooltipPositions } from \"./models/tooltip.model\";\n\n@Directive({\n selector: \"[misToolTip]\"\n})\nexport class ToolTipDirective implements OnInit, AfterViewInit {\n public isToolTipDisplayed: boolean = false;\n public toolTipText: string = \"\";\n public toolTipTextAlignment: string = \"\";\n public toolTipPosition: ITooltipPositions = \"bottom\";\n private overlayRef: OverlayRef;\n\n @Input() showOnHover: boolean = true;\n @Input() set showToolTip(value: boolean) {\n this.isToolTipDisplayed = value;\n if (value) this.displayToolTip();\n else this.hideToolTip();\n }\n @Input() set text(value: string) {\n this.toolTipText = value;\n }\n @Input() set position(value: ITooltipPositions) {\n this.toolTipPosition = value;\n }\n @Input() set alignText(value: string) {\n this.toolTipTextAlignment = value;\n }\n\n @HostListener(\"mouseenter\") onMouseEnter() {\n if (this.showOnHover) this.displayToolTip();\n }\n @HostListener(\"mouseleave\") onMouseLeave() {\n if (this.showOnHover) this.hideToolTip();\n }\n\n constructor(private element: ElementRef, private overlay: Overlay, private viewContainerRef: ViewContainerRef) {}\n\n ngOnInit() {}\n ngAfterViewInit() {\n if (this.isToolTipDisplayed) this.displayToolTip();\n else this.hideToolTip();\n }\n\n displayToolTip() {\n const positionStrategy = this.overlay\n .position()\n .flexibleConnectedTo(this.element)\n .withPositions(\n genPositionPairs(\n {\n positionX: \"center\",\n positionY: this.toolTipPosition === \"top\" ? \"top\" : \"center\",\n offsetX: this.positionTooltip(\"OFFSET_X\"),\n offsetY: this.positionTooltip(\"OFFSET_Y\")\n },\n false\n )\n )\n .withPush(true);\n const config = new OverlayConfig({\n hasBackdrop: false,\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition()\n });\n this.overlayRef = this.overlay.create(config);\n const tempRef = new ComponentPortal(ToolTipComponent, this.viewContainerRef);\n const tooltipRef = this.overlayRef.attach(tempRef);\n tooltipRef.instance.toolTipText = this.toolTipText;\n tooltipRef.instance.toolTipPosition = this.toolTipPosition;\n tooltipRef.instance.toolTipTextAlignment = this.toolTipTextAlignment;\n this.overlayRef\n .backdropClick()\n .pipe(take(1))\n .subscribe(() => {\n this.hideToolTip();\n });\n }\n\n positionTooltip(type: \"OFFSET_X\" | \"OFFSET_Y\") {\n if (type === \"OFFSET_X\") {\n return this.toolTipPosition === \"right\"\n ? this.element.nativeElement.offsetWidth / 2 + 8\n : this.toolTipPosition === \"left\"\n ? (this.element.nativeElement.offsetWidth / 2 + 8) * -1\n : this.toolTipPosition === \"top\" || this.toolTipPosition === \"bottom\"\n ? 0\n : 8;\n }\n if (type !== \"OFFSET_Y\") return;\n return this.toolTipPosition === \"right\" || this.toolTipPosition === \"left\"\n ? -18\n : this.toolTipPosition === \"top\"\n ? -44\n : this.toolTipPosition === \"bottom\"\n ? this.element.nativeElement.offsetHeight / 2 + 8\n : 8;\n }\n\n hideToolTip() {\n this.overlayRef?.detach();\n this.overlayRef?.dispose();\n }\n}\n","import { NgModule, ModuleWithProviders } from \"@angular/core\";\nimport { CommonModule } from \"@angular/common\";\nimport { OverlayModule } from \"@angular/cdk/overlay\";\nimport { ToolTipDirective } from \"./tooltip.directive\";\nimport { ToolTipComponent } from \"./tooltip-container/tooltip.component\";\n\n@NgModule({\n declarations: [ToolTipDirective, ToolTipComponent],\n imports: [CommonModule, OverlayModule],\n exports: [ToolTipDirective, ToolTipComponent],\n entryComponents: [ToolTipComponent]\n})\nexport class ToolTipModule {\n static forRoot(): ModuleWithProviders<ToolTipModule> {\n return { ngModule: ToolTipModule, providers: [] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAQa,gBAAgB;IAO3B;QANO,gBAAW,GAAW,EAAE,CAAC;QACzB,oBAAe,GAAsB,QAAQ,CAAC;QAC9C,yBAAoB,GAAW,EAAE,CAAC;KAIzB;IAChB,QAAQ,MAAK;IACb,eAAe;;QACb,IAAI,QAAC,IAAI,CAAC,SAAS,0CAAE,aAAa,CAAA;YAAE,OAAO;QAC3C,IAAI,IAAI,CAAC,eAAe,KAAK,KAAK,IAAI,IAAI,CAAC,eAAe,KAAK,QAAQ,EAAE;YACvE,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;YACtE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;YACrE,OAAO;SACR;QACD,IAAI,IAAI,CAAC,eAAe,KAAK,MAAM,EAAE;YACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;YACtE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;SAClE;KACF;;;YAzBF,SAAS,SAAC;gBACT,QAAQ,EAAE,aAAa;gBACvB,2jBAAuC;;aAExC;;;;wBAME,SAAS,SAAC,WAAW;;;MCFX,gBAAgB;IA8B3B,YAAoB,OAAmB,EA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HANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"ToolTipDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":8,"character":1},"arguments":[{"selector":"[misToolTip]"}]}],"members":{"showOnHover":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"ToolTipDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":8,"character":1},"arguments":[{"selector":"[misToolTip]"}]}],"members":{"showOnHover":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}}]}],"showToolTip":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":3}}]}],"text":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":24,"character":3}}]}],"position":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":3}}]}],"alignText":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":3}}]}],"onMouseEnter":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":34,"character":3},"arguments":["mouseenter"]}]}],"onMouseLeave":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":37,"character":3},"arguments":["mouseleave"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":41,"character":31},{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"Overlay","line":41,"character":60},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":41,"character":95}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"displayToolTip":[{"__symbolic":"method"}],"positionTooltip":[{"__symbolic":"method"}],"hideToolTip":[{"__symbolic":"method"}]}},"ToolTipComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"mis-tooltip","template":"<div id=\"tooltip-container\" *ngIf=\"toolTipText.length > 0\" #container>\n <div id=\"tooltip\">\n <div id=\"tooltip-text\" [innerHTML]=\"toolTipText\" \n [ngStyle]=\"{'text-align' : toolTipTextAlignment ? toolTipTextAlignment : '' }\"></div>\n <span\n id=\"arrow\"\n [ngClass]=\"{\n 'arrow-left': toolTipPosition === 'left',\n 'arrow-right': toolTipPosition === 'right',\n 'arrow-top': toolTipPosition === 'top',\n 'arrow-bottom': toolTipPosition === 'bottom'\n }\"\n ></span>\n </div>\n</div>\n","styles":["#tooltip-container{position:absolute;z-index:1}#tooltip{position:relative;display:block;padding:8px 12px;border-radius:8px;color:#fff;background:#181f33;font-family:Lato,sans-serif;font-style:normal;font-weight:400;font-size:14px;line-height:20px;text-align:center;letter-spacing:.2px}#tooltip-text{width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#arrow{position:absolute;height:12px;width:12px;background:#181f33;z-index:1}.arrow-top{bottom:-6px}.arrow-bottom,.arrow-top{left:50%;transform:translateX(-50%) rotate(-45deg);-webkit-transform:translateX(-50%) rotate(-45deg)}.arrow-bottom{top:-6px}.arrow-left{right:-6px}.arrow-left,.arrow-right{top:50%;transform:translateY(-50%) rotate(-45deg);-webkit-transform:translateY(-50%) rotate(-45deg)}.arrow-right{left:-6px}"]}]}],"members":{"container":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":13,"character":3},"arguments":["container"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}]}},"ToolTipModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ToolTipDirective"},{"__symbolic":"reference","name":"ToolTipComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":12},{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"OverlayModule","line":8,"character":26}],"exports":[{"__symbolic":"reference","name":"ToolTipDirective"},{"__symbolic":"reference","name":"ToolTipComponent"}],"entryComponents":[{"__symbolic":"reference","name":"ToolTipComponent"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"ToolTipModule"},"providers":[]}}}},"ITooltipPositions":{"__symbolic":"interface"}},"origins":{"ToolTipDirective":"./tooltip.directive","ToolTipComponent":"./tooltip-container/tooltip.component","ToolTipModule":"./tooltip.module","ITooltipPositions":"./models/tooltip.model"},"importAs":"mis-crystal-design-system/tooltip"}
|
|
@@ -3,6 +3,7 @@ import { ITooltipPositions } from "../models/tooltip.model";
|
|
|
3
3
|
export declare class ToolTipComponent implements OnInit, AfterViewInit {
|
|
4
4
|
toolTipText: string;
|
|
5
5
|
toolTipPosition: ITooltipPositions;
|
|
6
|
+
toolTipTextAlignment: string;
|
|
6
7
|
container: ElementRef;
|
|
7
8
|
constructor();
|
|
8
9
|
ngOnInit(): void;
|
|
@@ -7,12 +7,14 @@ export declare class ToolTipDirective implements OnInit, AfterViewInit {
|
|
|
7
7
|
private viewContainerRef;
|
|
8
8
|
isToolTipDisplayed: boolean;
|
|
9
9
|
toolTipText: string;
|
|
10
|
+
toolTipTextAlignment: string;
|
|
10
11
|
toolTipPosition: ITooltipPositions;
|
|
11
12
|
private overlayRef;
|
|
12
13
|
showOnHover: boolean;
|
|
13
14
|
set showToolTip(value: boolean);
|
|
14
15
|
set text(value: string);
|
|
15
16
|
set position(value: ITooltipPositions);
|
|
17
|
+
set alignText(value: string);
|
|
16
18
|
onMouseEnter(): void;
|
|
17
19
|
onMouseLeave(): void;
|
|
18
20
|
constructor(element: ElementRef, overlay: Overlay, viewContainerRef: ViewContainerRef);
|