cat-qw-lib 1.0.13 → 1.0.15
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/fesm2022/cat-qw-lib.mjs
CHANGED
|
@@ -5809,11 +5809,11 @@ class QueueSearchComponent {
|
|
|
5809
5809
|
return !!this.searchText;
|
|
5810
5810
|
}
|
|
5811
5811
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: QueueSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5812
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: QueueSearchComponent, isStandalone: false, selector: "queue-search", inputs: { searchText: "searchText", placeholder: "placeholder", debounceTime: "debounceTime" }, outputs: { searchInputChanged: "searchInputChanged", searchRequested: "searchRequested", searchCleared: "searchCleared" }, ngImport: i0, template: "<div class=\"flex mt-5 xl:mt-0 xl:justify-content-between align-items-center bg-white\" style=\"border: 1px solid #e0e4ea; border-radius: 8px; height: 44px;\">\r\n <div class=\"p-field m-0 p-0 w-full bg-white border-round\" >\r\n <div class=\"p-inputgroup border-round bg-white\" style=\"height: 100%;\">\r\n <span class=\"p-inputgroup-addon bg-white\" style=\"height: 100%; display: flex; align-items: center;\">\r\n <i class=\"pi pi-search\"></i>\r\n </span>\r\n <input \r\n type=\"text\" \r\n [(ngModel)]=\"searchText\" \r\n class=\"border-none p-0 border-noround-right bg-white w-full outline-none\" \r\n style=\"height: 100
|
|
5812
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: QueueSearchComponent, isStandalone: false, selector: "queue-search", inputs: { searchText: "searchText", placeholder: "placeholder", debounceTime: "debounceTime" }, outputs: { searchInputChanged: "searchInputChanged", searchRequested: "searchRequested", searchCleared: "searchCleared" }, ngImport: i0, template: "<div class=\"flex mt-5 xl:mt-0 xl:justify-content-between align-items-center bg-white\" style=\"border: 1px solid #e0e4ea; border-radius: 8px; height: 44px;\">\r\n <div class=\"p-field m-0 p-0 w-full bg-white border-round\" >\r\n <div class=\"p-inputgroup border-round bg-white\" style=\"height: 100%;\">\r\n <span class=\"p-inputgroup-addon bg-white\" style=\"height: 100%; display: flex; align-items: center;\">\r\n <i class=\"pi pi-search\"></i>\r\n </span>\r\n <input \r\n type=\"text\" \r\n [(ngModel)]=\"searchText\" \r\n class=\"border-none p-0 border-noround-right bg-white w-full outline-none\" \r\n style=\"height: 100%;\" \r\n pInputText \r\n [placeholder]=\"placeholder\" \r\n (input)=\"onSearchInputChange()\"\r\n (keydown.enter)=\"onSearch()\" \r\n />\r\n <button \r\n *ngIf=\"hasSearchText\" \r\n type=\"button\" \r\n class=\"p-inputgroup-addon bg-white border-none cursor-pointer\" \r\n (click)=\"onClearSearch()\"\r\n pButton \r\n icon=\"pi pi-times\"\r\n [text]=\"true\"\r\n style=\"height: 100%; display: flex; align-items: center; border-radius: 8px;\"\r\n ></button>\r\n </div>\r\n </div>\r\n </div>\r\n ", styles: [".p-inputgroup{width:100%;display:flex;align-items:center;height:44px}.p-inputgroup-addon{display:flex;align-items:center;height:100%}input[type=text],input.p-inputtext{height:100%;display:flex;align-items:center;padding-top:0;padding-bottom:0;box-sizing:border-box}button.p-inputgroup-addon{display:flex;align-items:center;height:100%}.bg-primary{background-color:#d9d9d9}::ng-deep .left-arrow-dropdown .p-dropdown{direction:rtl;width:100%;height:44px;border-top-left-radius:0;border-bottom-left-radius:0}::ng-deep .left-arrow-dropdown .p-dropdown-label{display:flex;align-items:center}.h-44{height:44px}@media screen and (min-width: 1200px){.vh-100{height:calc(100vh - 170px)}}.bg-while{background-color:#fff}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3$3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5813
5813
|
}
|
|
5814
5814
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: QueueSearchComponent, decorators: [{
|
|
5815
5815
|
type: Component,
|
|
5816
|
-
args: [{ selector: 'queue-search', standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex mt-5 xl:mt-0 xl:justify-content-between align-items-center bg-white\" style=\"border: 1px solid #e0e4ea; border-radius: 8px; height: 44px;\">\r\n <div class=\"p-field m-0 p-0 w-full bg-white border-round\" >\r\n <div class=\"p-inputgroup border-round bg-white\" style=\"height: 100%;\">\r\n <span class=\"p-inputgroup-addon bg-white\" style=\"height: 100%; display: flex; align-items: center;\">\r\n <i class=\"pi pi-search\"></i>\r\n </span>\r\n <input \r\n type=\"text\" \r\n [(ngModel)]=\"searchText\" \r\n class=\"border-none p-0 border-noround-right bg-white w-full outline-none\" \r\n style=\"height: 100
|
|
5816
|
+
args: [{ selector: 'queue-search', standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex mt-5 xl:mt-0 xl:justify-content-between align-items-center bg-white\" style=\"border: 1px solid #e0e4ea; border-radius: 8px; height: 44px;\">\r\n <div class=\"p-field m-0 p-0 w-full bg-white border-round\" >\r\n <div class=\"p-inputgroup border-round bg-white\" style=\"height: 100%;\">\r\n <span class=\"p-inputgroup-addon bg-white\" style=\"height: 100%; display: flex; align-items: center;\">\r\n <i class=\"pi pi-search\"></i>\r\n </span>\r\n <input \r\n type=\"text\" \r\n [(ngModel)]=\"searchText\" \r\n class=\"border-none p-0 border-noround-right bg-white w-full outline-none\" \r\n style=\"height: 100%;\" \r\n pInputText \r\n [placeholder]=\"placeholder\" \r\n (input)=\"onSearchInputChange()\"\r\n (keydown.enter)=\"onSearch()\" \r\n />\r\n <button \r\n *ngIf=\"hasSearchText\" \r\n type=\"button\" \r\n class=\"p-inputgroup-addon bg-white border-none cursor-pointer\" \r\n (click)=\"onClearSearch()\"\r\n pButton \r\n icon=\"pi pi-times\"\r\n [text]=\"true\"\r\n style=\"height: 100%; display: flex; align-items: center; border-radius: 8px;\"\r\n ></button>\r\n </div>\r\n </div>\r\n </div>\r\n ", styles: [".p-inputgroup{width:100%;display:flex;align-items:center;height:44px}.p-inputgroup-addon{display:flex;align-items:center;height:100%}input[type=text],input.p-inputtext{height:100%;display:flex;align-items:center;padding-top:0;padding-bottom:0;box-sizing:border-box}button.p-inputgroup-addon{display:flex;align-items:center;height:100%}.bg-primary{background-color:#d9d9d9}::ng-deep .left-arrow-dropdown .p-dropdown{direction:rtl;width:100%;height:44px;border-top-left-radius:0;border-bottom-left-radius:0}::ng-deep .left-arrow-dropdown .p-dropdown-label{display:flex;align-items:center}.h-44{height:44px}@media screen and (min-width: 1200px){.vh-100{height:calc(100vh - 170px)}}.bg-while{background-color:#fff}\n"] }]
|
|
5817
5817
|
}], propDecorators: { searchText: [{
|
|
5818
5818
|
type: Input
|
|
5819
5819
|
}], placeholder: [{
|
|
@@ -6168,7 +6168,8 @@ class QueueContainerComponent extends BaseContainerComponent {
|
|
|
6168
6168
|
this.queueFilterDropdownService = queueFilterDropdownService;
|
|
6169
6169
|
}
|
|
6170
6170
|
ngOnInit() {
|
|
6171
|
-
this.
|
|
6171
|
+
const storedQueueId = this.getStoredQueueId();
|
|
6172
|
+
this.initializeComponent(storedQueueId ?? undefined);
|
|
6172
6173
|
this.setupSearchDebounce();
|
|
6173
6174
|
// Sync filter dropdown after initialization
|
|
6174
6175
|
setTimeout(() => {
|
|
@@ -6260,8 +6261,8 @@ class QueueContainerComponent extends BaseContainerComponent {
|
|
|
6260
6261
|
this.filterDropdown.syncWithAppliedFilters(this.appliedFilters);
|
|
6261
6262
|
}
|
|
6262
6263
|
}
|
|
6263
|
-
initializeComponent() {
|
|
6264
|
-
this.getAllQueueList();
|
|
6264
|
+
initializeComponent(preferredQueueId) {
|
|
6265
|
+
this.getAllQueueList(preferredQueueId);
|
|
6265
6266
|
this.userRole = this.queueBusinessService.getUserRole();
|
|
6266
6267
|
}
|
|
6267
6268
|
setupSearchDebounce() {
|
|
@@ -6274,14 +6275,14 @@ class QueueContainerComponent extends BaseContainerComponent {
|
|
|
6274
6275
|
}
|
|
6275
6276
|
});
|
|
6276
6277
|
}
|
|
6277
|
-
getAllQueueList() {
|
|
6278
|
+
getAllQueueList(preferredQueueId) {
|
|
6278
6279
|
this.loading = true;
|
|
6279
6280
|
this.error = null;
|
|
6280
6281
|
this.queueService.getAllQueue().subscribe({
|
|
6281
6282
|
next: (res) => {
|
|
6282
6283
|
this.queueList = Array.isArray(res) ? res : (res.data || res);
|
|
6283
6284
|
this.baseStore.setQueueList(this.queueList);
|
|
6284
|
-
this.filterQueues();
|
|
6285
|
+
this.filterQueues(preferredQueueId);
|
|
6285
6286
|
this.loading = false;
|
|
6286
6287
|
},
|
|
6287
6288
|
error: (err) => {
|
|
@@ -6294,24 +6295,35 @@ class QueueContainerComponent extends BaseContainerComponent {
|
|
|
6294
6295
|
handleQueueId(queueId) {
|
|
6295
6296
|
const newQueue = this.queueList.find((i) => i._id == queueId);
|
|
6296
6297
|
if (newQueue) {
|
|
6297
|
-
this.
|
|
6298
|
+
const isDifferentQueue = !this.selectedQueue || this.selectedQueue._id !== queueId;
|
|
6299
|
+
if (isDifferentQueue) {
|
|
6300
|
+
this.resetSearchState();
|
|
6301
|
+
this.clearSelection();
|
|
6302
|
+
this.clearFilters();
|
|
6303
|
+
this.resetPaginationState();
|
|
6304
|
+
}
|
|
6298
6305
|
this.selectedQueue = Object.assign({}, newQueue);
|
|
6299
6306
|
this.selectedQueueId = queueId;
|
|
6300
6307
|
this.queueBusinessService.storeSelectedQueue(queueId);
|
|
6301
6308
|
sessionStorage.setItem(SHARED.selectedQueue, JSON.stringify(this.selectedQueue));
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
this.getQueueRecordsData();
|
|
6309
|
+
if (isDifferentQueue) {
|
|
6310
|
+
this.getQueueRecordsData();
|
|
6311
|
+
}
|
|
6306
6312
|
this.syncFilterDropdown();
|
|
6307
6313
|
}
|
|
6308
6314
|
else {
|
|
6309
6315
|
console.warn(ERROR.NO_QUEUE_FOUND_WITH_ID);
|
|
6310
6316
|
}
|
|
6311
6317
|
}
|
|
6312
|
-
filterQueues() {
|
|
6318
|
+
filterQueues(preferredQueueId) {
|
|
6313
6319
|
this.filteredQueueData = this.queueBusinessService.filterQueuesByStatus(this.queueList, this.selectedStatus);
|
|
6314
|
-
|
|
6320
|
+
let queueIdToSelect = preferredQueueId;
|
|
6321
|
+
if (queueIdToSelect && this.filteredQueueData.some(q => q._id == queueIdToSelect)) {
|
|
6322
|
+
// keep the same queue if it exists
|
|
6323
|
+
this.selectedQueueId = queueIdToSelect;
|
|
6324
|
+
this.handleQueueId(this.selectedQueueId);
|
|
6325
|
+
}
|
|
6326
|
+
else if (this.filteredQueueData.length > 0) {
|
|
6315
6327
|
this.selectedQueueId = this.queueBusinessService.getFirstQueueId(this.filteredQueueData);
|
|
6316
6328
|
if (this.selectedQueueId) {
|
|
6317
6329
|
this.handleQueueId(this.selectedQueueId);
|
|
@@ -6396,7 +6408,8 @@ class QueueContainerComponent extends BaseContainerComponent {
|
|
|
6396
6408
|
}
|
|
6397
6409
|
onAssignmentComplete(event) {
|
|
6398
6410
|
if (event.success) {
|
|
6399
|
-
|
|
6411
|
+
// Pass the current selectedQueueId to preserve selection after refresh, but ensure it's not null
|
|
6412
|
+
this.getAllQueueList(this.selectedQueueId ?? undefined);
|
|
6400
6413
|
}
|
|
6401
6414
|
this.assignmentComplete.emit(event);
|
|
6402
6415
|
}
|
|
@@ -6406,6 +6419,14 @@ class QueueContainerComponent extends BaseContainerComponent {
|
|
|
6406
6419
|
isAssignButtonEnabled() {
|
|
6407
6420
|
return this.selectedRows && this.selectedRows.length > 0;
|
|
6408
6421
|
}
|
|
6422
|
+
getStoredQueueId() {
|
|
6423
|
+
try {
|
|
6424
|
+
return localStorage.getItem(SHARED.SELECTED_QUEUE_ID);
|
|
6425
|
+
}
|
|
6426
|
+
catch (e) {
|
|
6427
|
+
return null;
|
|
6428
|
+
}
|
|
6429
|
+
}
|
|
6409
6430
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: QueueContainerComponent, deps: [{ token: QueueStore }, { token: QueueService }, { token: BaseStore }, { token: QueueBusinessService }, { token: QueueRecordTableBuilderService }, { token: QueueFilterDropdownService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6410
6431
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: QueueContainerComponent, isStandalone: false, selector: "lib-queue-container", inputs: { tableHeight: "tableHeight", placeholder: "placeholder", selectedRowsInput: "selectedRowsInput" }, outputs: { assignmentComplete: "assignmentComplete", userAssigned: "userAssigned", selectedRowsData: "selectedRowsData", assignmentDataReady: "assignmentDataReady", rowClick: "rowClick", selectionChange: "selectionChange" }, viewQueries: [{ propertyName: "filterDropdown", first: true, predicate: ["filterDropdown"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"container grid m-0 h-full\">\r\n <div class=\"col-12 xl:col-2 md:col-12 py-0 h-full\">\r\n <app-queue-list\r\n [queueData]=\"filteredQueueData\"\r\n [selectedQueueId]=\"selectedQueueId\"\r\n [selectedStatus]=\"selectedStatus\"\r\n [userRole]=\"userRole\"\r\n [showQueueDataForm]=\"true\"\r\n (queueSelected)=\"onQueueSelected($event)\"\r\n (statusChanged)=\"onStatusChanged($event)\"\r\n (insertQueueRequested)=\"onInsertQueueRequested()\"\r\n ></app-queue-list>\r\n </div>\r\n <div class=\"col-12 xl:col-10 md:col-12 py-0 h-full\">\r\n \r\n @if(selectedQueue){\r\n <div class=\"flex justify-content-between align-items-center mb-3\">\r\n <div class=\"col-8 p-0 flex align-items-center \" >\r\n <div class=\"col-6 p-0 mr-3\">\r\n <queue-search \r\n [placeholder]=\"placeholder\"\r\n [searchText]=\"searchText\"\r\n (searchInputChanged)=\"onSearchInputChanged($event)\"\r\n (searchRequested)=\"onSearchRequested($event)\"\r\n (searchCleared)=\"onSearchCleared()\">\r\n </queue-search>\r\n </div>\r\n <div>\r\n <lib-queue-filter-dropdown \r\n #filterDropdown\r\n [appliedFilters]=\"appliedFilters\"\r\n (filterApplied)=\"onFilterDropdownApplied($event)\"\r\n (filtersCleared)=\"onFiltersCleared()\">\r\n </lib-queue-filter-dropdown>\r\n </div>\r\n <div>\r\n <button \r\n class=\"clear-filters-btn\"\r\n type=\"button\"\r\n (click)=\"onClearAllFilters()\">\r\n Clear <i class=\"pi pi-times ml-2\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n \r\n <div class=\"d-flex align-items-center gap-3 justify-content-end\">\r\n <ng-content select=\"[user-dropdown]\"></ng-content>\r\n </div>\r\n </div>\r\n\r\n <div class=\"animation-duration-500 associated-list h-full card mb-0 p-0\">\r\n <app-queue-record-table\r\n [table]=\"table\"\r\n [metaData]=\"metaData\"\r\n [loading]=\"loading\"\r\n [selectedRows]=\"selectedRows\"\r\n (selectionChange)=\"onTableSelectionChange($event)\"\r\n (selectedRowsData)=\"onTableSelectionChange($event)\"\r\n (assignmentDataReady)=\"onAssignmentDataReady($event)\"\r\n (rowClick)=\"onTableRowClick($event)\"\r\n (paginationChanged)=\"onPaginationChanged($event)\"\r\n (filterApplied)=\"onFilterApplied($event)\"\r\n (sortApplied)=\"onSortApplied($event)\">\r\n </app-queue-record-table>\r\n </div>\r\n\r\n }\r\n </div>\r\n\r\n </div>", styles: [".custom-scroll{overflow-y:hidden}.custom-scroll:hover{overflow-y:auto}.clear-filters-btn{background:none;border:none;color:#2196f3;font-size:1.1rem;cursor:pointer;margin-left:.5rem;display:inline-flex;align-items:center;padding:0}.clear-filters-btn .clear-x{font-size:1.2rem;margin-left:.2rem;line-height:1}\n"], dependencies: [{ kind: "component", type: QueueSearchComponent, selector: "queue-search", inputs: ["searchText", "placeholder", "debounceTime"], outputs: ["searchInputChanged", "searchRequested", "searchCleared"] }, { kind: "component", type: QueueListComponent, selector: "app-queue-list", inputs: ["queueData", "selectedQueueId", "selectedStatus", "userRole", "showQueueDataForm"], outputs: ["queueSelected", "statusChanged", "insertQueueRequested"] }, { kind: "component", type: QueueRecordTableComponent, selector: "app-queue-record-table", inputs: ["table", "metaData", "loading", "selectedRows", "tableHeight"], outputs: ["selectionChange", "selectedRowsData", "assignmentDataReady", "rowClick", "paginationChanged", "filterApplied", "sortApplied"] }, { kind: "component", type: QueueFilterDropdownComponent, selector: "lib-queue-filter-dropdown", inputs: ["appliedFilters"], outputs: ["filterApplied", "filtersCleared"] }] });
|
|
6411
6432
|
}
|