verben-workflow-ui 0.5.84 → 0.5.86
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/esm2022/src/lib/components/my-queue/my-queue.columns.mjs +6 -1
- package/esm2022/src/lib/components/my-queue/my-queue.component.mjs +8 -7
- package/esm2022/src/lib/components/my-queue/my-queue.facade.mjs +15 -6
- package/esm2022/src/lib/components/my-queue/my-queue.state.mjs +4 -4
- package/esm2022/src/lib/components/tasks/tasks.columns.mjs +6 -1
- package/esm2022/src/lib/components/tasks/tasks.component.mjs +11 -5
- package/esm2022/src/lib/components/tasks/tasks.facade.mjs +32 -11
- package/esm2022/src/lib/components/tasks/tasks.state.mjs +11 -3
- package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs +24 -9
- package/fesm2022/verben-workflow-ui-src-lib-components-my-queue.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs +52 -12
- package/fesm2022/verben-workflow-ui-src-lib-components-tasks.mjs.map +1 -1
- package/package.json +52 -52
- package/src/lib/components/tasks/tasks.component.d.ts +2 -1
- package/src/lib/components/tasks/tasks.facade.d.ts +5 -2
- package/src/lib/components/tasks/tasks.state.d.ts +10 -3
|
@@ -21,6 +21,11 @@ import { FormTimerModule } from 'verben-workflow-ui/src/lib/components/form-time
|
|
|
21
21
|
import { TaskFormModule } from 'verben-workflow-ui/src/lib/components/task-form';
|
|
22
22
|
|
|
23
23
|
const columns = [
|
|
24
|
+
{
|
|
25
|
+
id: 'code',
|
|
26
|
+
header: 'CODE',
|
|
27
|
+
accessorKey: 'Code',
|
|
28
|
+
},
|
|
24
29
|
{
|
|
25
30
|
id: 'task',
|
|
26
31
|
header: 'TASK',
|
|
@@ -163,7 +168,7 @@ class TaskState {
|
|
|
163
168
|
searchTerm$ = new BehaviorSubject('');
|
|
164
169
|
queryParams$ = new BehaviorSubject({
|
|
165
170
|
skip: 0,
|
|
166
|
-
limit:
|
|
171
|
+
limit: 50,
|
|
167
172
|
sortParam: 'CreatedAt',
|
|
168
173
|
sortOrder: SortDirection.Desc,
|
|
169
174
|
});
|
|
@@ -242,6 +247,14 @@ class TaskState {
|
|
|
242
247
|
const currentRequests = this.tasks$.getValue();
|
|
243
248
|
this.tasks$.next([...currentRequests, ...newRequests]);
|
|
244
249
|
}
|
|
250
|
+
resetQueryParams() {
|
|
251
|
+
this.queryParams$.next({
|
|
252
|
+
skip: 0,
|
|
253
|
+
limit: 50,
|
|
254
|
+
sortParam: 'CreatedAt',
|
|
255
|
+
sortOrder: SortDirection.Desc,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
245
258
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TaskState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
246
259
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TaskState });
|
|
247
260
|
}
|
|
@@ -286,7 +299,7 @@ class TaskFacade {
|
|
|
286
299
|
await this.loadRequestsWithParam(searchTerm);
|
|
287
300
|
}
|
|
288
301
|
else {
|
|
289
|
-
await this.loadRequests(
|
|
302
|
+
await this.loadRequests();
|
|
290
303
|
}
|
|
291
304
|
}
|
|
292
305
|
catch (error) {
|
|
@@ -317,18 +330,25 @@ class TaskFacade {
|
|
|
317
330
|
addNewRequest(task) {
|
|
318
331
|
this.taskState.addRequest(task);
|
|
319
332
|
}
|
|
320
|
-
async loadRequests(
|
|
333
|
+
async loadRequests() {
|
|
321
334
|
try {
|
|
322
335
|
this.taskState.setUpdating(true);
|
|
323
336
|
const params = this.taskState.getQueryParamsValue();
|
|
324
|
-
const requests =
|
|
337
|
+
const requests = params.user
|
|
338
|
+
? await this.taskService.getPossibleTasksForUser(params.user, params.skip, params.limit, params.sortParam || 'createdDate', params.sortOrder)
|
|
339
|
+
: await this.taskService.getTasks(params.skip, params.limit, params.sortParam || 'createdDate', params.sortOrder);
|
|
325
340
|
if (requests instanceof ErrorResponse) {
|
|
326
341
|
this.utilService.showError(requests.ErrorMsg);
|
|
327
342
|
return;
|
|
328
343
|
}
|
|
329
344
|
if (requests?.Result) {
|
|
345
|
+
requests.Result.forEach((x) => {
|
|
346
|
+
x.Id = x.Code;
|
|
347
|
+
});
|
|
330
348
|
this.taskState.setRequests(requests.Result);
|
|
331
|
-
this.taskState.updateQueryParams({
|
|
349
|
+
this.taskState.updateQueryParams({
|
|
350
|
+
skip: requests.Skip > 0 ? requests.Skip : requests.Result.length,
|
|
351
|
+
});
|
|
332
352
|
}
|
|
333
353
|
}
|
|
334
354
|
catch (error) {
|
|
@@ -347,8 +367,13 @@ class TaskFacade {
|
|
|
347
367
|
this.utilService.showError(requests.ErrorMsg);
|
|
348
368
|
return;
|
|
349
369
|
}
|
|
370
|
+
requests.Result.forEach((x) => {
|
|
371
|
+
x.Id = x.Code;
|
|
372
|
+
});
|
|
350
373
|
this.taskState.setRequests(requests.Result);
|
|
351
|
-
this.taskState.updateQueryParams({
|
|
374
|
+
this.taskState.updateQueryParams({
|
|
375
|
+
skip: requests.Skip > 0 ? requests.Skip : requests.Result.length,
|
|
376
|
+
});
|
|
352
377
|
}
|
|
353
378
|
catch (error) {
|
|
354
379
|
throw error;
|
|
@@ -383,6 +408,9 @@ class TaskFacade {
|
|
|
383
408
|
this.taskState.setUpdating(false);
|
|
384
409
|
}
|
|
385
410
|
}
|
|
411
|
+
resetQueryParams() {
|
|
412
|
+
this.taskState.resetQueryParams();
|
|
413
|
+
}
|
|
386
414
|
async updateRequest(request) {
|
|
387
415
|
try {
|
|
388
416
|
this.taskState.setUpdating(true);
|
|
@@ -524,18 +552,24 @@ class TaskFacade {
|
|
|
524
552
|
const searchTerm = this.taskState.getSearchTermValue();
|
|
525
553
|
// The first page is already loaded at skip=0 without advancing the
|
|
526
554
|
// pointer, so fetch the *next* page starting at newSkip.
|
|
527
|
-
const newSkip = currentParams.skip + currentParams.limit;
|
|
555
|
+
// const newSkip = currentParams.skip + currentParams.limit;
|
|
528
556
|
// Load and append data, honouring any active search term
|
|
529
557
|
const response = searchTerm
|
|
530
|
-
? await this.taskService.getTaskWithParam(searchTerm,
|
|
531
|
-
:
|
|
558
|
+
? await this.taskService.getTaskWithParam(searchTerm, currentParams.skip, currentParams.limit, currentParams.sortParam || 'createdDate', currentParams.sortOrder)
|
|
559
|
+
: currentParams.user
|
|
560
|
+
? await this.taskService.getPossibleTasksForUser(currentParams.user, currentParams.skip, currentParams.limit, currentParams.sortParam || 'createdDate', currentParams.sortOrder)
|
|
561
|
+
: await this.taskService.getTasks(currentParams.skip, currentParams.limit, currentParams.sortParam || 'createdDate', currentParams.sortOrder);
|
|
532
562
|
if (response instanceof ErrorResponse) {
|
|
533
563
|
this.utilService.showError(response.ErrorMsg);
|
|
534
564
|
return;
|
|
535
565
|
}
|
|
566
|
+
const { Skip, PageSize, Result } = response;
|
|
567
|
+
response.Result.forEach((x) => {
|
|
568
|
+
x.Id = x.Code;
|
|
569
|
+
});
|
|
536
570
|
this.taskState.appendRequests(response.Result);
|
|
537
571
|
this.taskState.updateQueryParams({
|
|
538
|
-
skip:
|
|
572
|
+
skip: Skip > 0 ? Skip : Result.length,
|
|
539
573
|
limit: currentParams.limit,
|
|
540
574
|
});
|
|
541
575
|
}
|
|
@@ -721,6 +755,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
721
755
|
class TasksComponent extends BaseDataViewComponent {
|
|
722
756
|
cdr;
|
|
723
757
|
taskFacade;
|
|
758
|
+
pageSize = input(50);
|
|
724
759
|
user = input('');
|
|
725
760
|
config = {
|
|
726
761
|
dataSource: [], // Populate from service
|
|
@@ -748,8 +783,12 @@ class TasksComponent extends BaseDataViewComponent {
|
|
|
748
783
|
});
|
|
749
784
|
}
|
|
750
785
|
loadInitialData() {
|
|
786
|
+
this.taskFacade.resetQueryParams();
|
|
787
|
+
if (this.user() && this.user().trim().length > 0) {
|
|
788
|
+
this.taskFacade.updateQueryParams({ user: this.user() });
|
|
789
|
+
}
|
|
751
790
|
try {
|
|
752
|
-
this.taskFacade.loadRequests(
|
|
791
|
+
this.taskFacade.loadRequests();
|
|
753
792
|
}
|
|
754
793
|
catch (error) {
|
|
755
794
|
// Handle error
|
|
@@ -772,6 +811,7 @@ class TasksComponent extends BaseDataViewComponent {
|
|
|
772
811
|
FlowablePath: '',
|
|
773
812
|
CurrentActors: [],
|
|
774
813
|
DataState: ObjectState.New,
|
|
814
|
+
Id: (this.data().length + 1).toString(),
|
|
775
815
|
});
|
|
776
816
|
this.taskFacade.addNewRequest(newItem);
|
|
777
817
|
this.dataView.isTableView = false;
|
|
@@ -809,7 +849,7 @@ class TasksComponent extends BaseDataViewComponent {
|
|
|
809
849
|
await this.taskFacade.addRequest(payload);
|
|
810
850
|
}
|
|
811
851
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TasksComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: TaskFacade }], target: i0.ɵɵFactoryTarget.Component });
|
|
812
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TasksComponent, selector: "lib-tasks", inputs: { user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: false, transformFunction: null } }, providers: [TasksService, TaskFacade, TaskState], usesInheritance: true, ngImport: i0, template: "<div class=\"space-y-8\">\n <verben-data-view #vdv [viewState]=\"{\n isSearch: true,\n isColumn: true,\n isFilter: true,\n isSort: true,\n isExport: true,\n isSelect: true,\n isCreate: true,\n isToggle: true,\n }\" [buttonClass]=\"'my-custom-button-class'\" [iconClass]=\"'my-icon-class'\"\n [activeIconClass]=\"'my-active-icon-class'\" [selectedColumnCount]=\"0\" [selectedSortCount]=\"0\"\n [selectedFilterTableCount]=\"0\" (viewChange)=\"onViewChange($event)\" (stateChange)=\"onStateChange($event)\"\n (onSearchChange)=\"handleSearch($event)\">\n <div table-content>\n <lib-data-table [data]=\"data()\" [columns]=\"config.columns\" [styleConfig]=\"styles\"\n (selectionChange)=\"onSelectionChange($event)\">\n <ng-container libColumn=\"history\">\n <ng-template #cell let-value>\n <a [routerLink]=\"['/workflow/task-history', value]\" routerLinkActive=\"router-link-active\"\n class=\"underline text-[var(--vbn-color-border-focus)]\">view history</a>\n </ng-template>\n </ng-container>\n\n <ng-container libColumn=\"workflow\">\n <ng-template #cell let-value>\n <a [routerLink]=\"['/workflow/workflows', value]\" routerLinkActive=\"router-link-active\"\n class=\"underline text-[var(--vbn-color-border-focus)]\">view Workflow</a>\n </ng-template>\n </ng-container>\n\n <ng-container libColumn=\"actions\">\n <ng-template #cell let-row=\"row\">\n <lib-operation-popup [user]=\"user()\" [task]=\"row\" [allowedActions]=\"getActionNamesForTask(row)\"\n (actionComplete)=\"loadInitialData()\">\n <div trigger class=\"cursor-pointer p-2 -m-2 inline-flex items-center justify-center\">\n <verben-svg icon=\"dots\" [width]=\"3\" [height]=\"18\" class=\"w-auto\"></verben-svg>\n </div>\n </lib-operation-popup>\n </ng-template>\n <ng-template #header>\n <strong>Actions</strong>\n </ng-template>\n </ng-container>\n </lib-data-table>\n </div>\n\n <div card-content>\n <verben-card-data-view borderRadius=\"12px\" (loadMoreClick)=\"loadMore()\" #vdcv dataId=\"Id\" border=\"5px\"\n [cardDataList]=\"cardData()\" rbgColor=\"var(--vbn-color-surface-alt)\" mg=\"20px\">\n <verben-left-card-data-view class=\"space-y-7\">\n <verben-left-card-data #vlcd [parent]=\"vdcv\" dataId=\"Code\"\n class=\"bg-secondary-100 rounded-xl border-primary border-[1px]\" [cardDataList]=\"cardData()\">\n <ng-template #card let-cardItem>\n <div (click)=\"currentData = vdcv.onItemClick(cardItem)\" class=\"flex\">\n <div (click)=\"currentData = vdcv.onItemClick(cardItem)\"\n class=\"flex cursor-pointer w-full bg-secondary rounded-xl\">\n <div class=\"w-3 rounded-xl rounded-tr-none rounded-br-none\" [ngClass]=\"\n cardItem.selected ? 'bg-primary' : 'bg-secondary-200'\n \"></div>\n <div class=\"flex flex-col py-2 px-4 w-full\">\n <div class=\"flex items-center gap-4 justify-between\">\n <div class=\"grid gap-y-2\">\n <span class=\"font-semibold text-[var(--vbn-color-on-primary)]\">{{\n cardItem.title\n }}</span>\n <p class=\"flex items-center\">\n <!-- <label for=\"phone\" class=\"text-[10px] font-light\">Current Actors:</label> -->\n @if (cardItem.data.CurrentActors && cardItem.data.CurrentActors.length > 0) {\n @if (cardItem.data.CurrentActors.length === 1) {\n <span id=\"phone\" class=\"text-sm\">{{ cardItem.data.CurrentActors[0].Identifier }}</span>\n } @else {\n <verben-tooltip [top]=\"'0px'\" [textColor]=\"'var(--vbn-color-text)'\" [backgroundColor]=\"'var(--vbn-color-border)'\" [left]=\"'0'\"\n [tooltipContent]=\"actorsTooltipTemplate\" #actorsTooltip>\n <span id=\"phone\" class=\"text-sm cursor-pointer\">\n {{ cardItem.data.CurrentActors[0].Identifier }} and {{ cardItem.data.CurrentActors.length\n - 1 }} others\n </span>\n </verben-tooltip>\n\n <ng-template #actorsTooltipTemplate>\n <div class=\"p-2\">\n <p class=\"text-xs font-semibold mb-1\">Current Actors:</p>\n <ul class=\"list-disc list-inside\">\n @for (actor of cardItem.data.CurrentActors; track actor.Identifier) {\n <li class=\"text-xs\">{{ actor.Identifier }}</li>\n }\n </ul>\n </div>\n </ng-template>\n }\n } @else {\n <span id=\"phone\" class=\"text-sm text-gray-400\">No actors assigned</span>\n }\n </p>\n </div>\n\n <div class=\"grid gap-y-2\">\n <span for=\"role\" class=\"font-light\">{{\n cardItem.data.Code\n }}</span>\n\n <div (click)=\"$event.stopPropagation();\" class=\"flex items-end gap-4\">\n <a [routerLink]=\"[\n '/workflow/task-history',\n cardItem.data.Code\n ]\" routerLinkActive=\"router-link-active\"\n class=\"underline text-[var(--vbn-color-border-focus)] text-xs relative z-10\">view\n history</a>\n\n <lib-operation-popup [user]=\"user()\" [task]=\"cardItem.data\"\n [allowedActions]=\"getActionNamesForTask(cardItem.data)\" (actionComplete)=\"loadInitialData()\">\n <div trigger class=\"cursor-pointer p-2 -m-2 inline-flex items-center justify-center\">\n <verben-svg icon=\"dots\" [width]=\"3\" [height]=\"18\" class=\"w-auto\"></verben-svg>\n </div>\n </lib-operation-popup>\n </div>\n </div>\n </div>\n\n <!-- <div class=\"flex\">\n <span class=\"font-normal text-sm\">{{ item.title }}</span>\n </div>\n @for (ciItem of item.body; track ciItem.value) {\n <div class=\"\">\n <span class=\"text-muted font-light text-xs\"\n >{{ ciItem.title }}:</span\n >\n <span class=\"text-black\">{{ ciItem.value }}</span>\n </div>\n } -->\n </div>\n </div>\n </div>\n </ng-template>\n </verben-left-card-data>\n </verben-left-card-data-view>\n\n <verben-right-card-data-view>\n <ng-template #parent>\n <!-- <lib-user-request-form\n [currentData]=\"currentData\"\n (switchView)=\"vdv.toggleView()\"\n (onApproval)=\"onApprove($event)\"\n ></lib-user-request-form> -->\n <tasks-form [currentData]=\"currentData\" (switchView)=\"vdv.toggleView()\"\n (onSave)=\"onSave($event)\"></tasks-form>\n </ng-template>\n </verben-right-card-data-view>\n\n <verben-card-data-view-footer class=\"w-full\">\n <div [ngClass]=\"{\n 'flex gap-2 items-center': true,\n 'justify-end': true\n }\">\n <!-- <verbena-button\n *ngIf=\"!vdcv.hasCurrentItem()\"\n [fontWeight]=\"'bold'\"\n [bgColor]=\"'var(--vbn-color-text-muted)'\"\n [borderRadius]=\"'4px'\"\n [textColor]=\"'var(--vbn-color-surface)'\"\n [pd]=\"'9.79px 37.28px'\"\n [text]=\"'Delete'\"\n >\n </verbena-button> -->\n <div class=\"flex {{\n vdcv.hasCurrentItem() ? 'flex-1' : ''\n }} justify-end items-center gap-5\">\n <span class=\"paginator-text\">{{ cardData().length }} records loaded</span>\n <button (click)=\"loadMore()\" class=\"load-more view-links text-[var(--vbn-color-border-focus)] underline\">\n Load more\n </button>\n </div>\n </div>\n </verben-card-data-view-footer>\n </verben-card-data-view>\n </div>\n <div column-content>\n <lib-data-columns [columns]=\"config.columns\" (columnsUpdated)=\"onColumnsUpdated($event)\"></lib-data-columns>\n </div>\n <div filter-content>\n <verben-table-filter [border]=\"'1px solid var(--vbn-color-primary)'\" borderRadius=\"10px\"\n boxShadow=\"2px 2px 2px 0px silver\" bgColor=\"white\" width=\"420px\" textColor=\"black\" pd=\"1rem\"\n primaryColor=\"var(--vbn-color-primary)\" secondaryColor=\"var(--vbn-color-border-focus)\" tertiaryColor=\"var(--vbn-color-on-primary)\" [filterOptions]=\"filterArray\"\n [maxFilterLength]=\"3\"></verben-table-filter>\n </div>\n <div sort-content>\n <lib-data-sort [columns]=\"config.columns\" [data]=\"data()\" (sortApplied)=\"onSortUpdated($event)\"></lib-data-sort>\n </div>\n <div export-content>\n <lib-data-export [data]=\"data()\" (exportDataEvent)=\"handleExport($event)\">\n </lib-data-export>\n </div>\n </verben-data-view>\n\n <div *ngIf=\"vdv.isTableView\" class=\"flex gap-2 justify-between\">\n <div class=\"message-log-button-container flex justify-between\">\n <!-- <verbena-button\n [fontWeight]=\"'bold'\"\n [bgColor]=\"'var(--vbn-color-text-muted)'\"\n [borderRadius]=\"'4px'\"\n [textColor]=\"'var(--vbn-color-surface)'\"\n [pd]=\"'9.79px 37.28px'\"\n [text]=\"'Delete'\"\n >\n </verbena-button> -->\n </div>\n <div class=\"flex justify-end items-center gap-5\">\n <span class=\"paginator-text\">{{ cardData().length }} records loaded</span>\n <button (click)=\"loadMore()\" class=\"load-more view-links text-[var(--vbn-color-border-focus)] underline\">\n Load more\n </button>\n </div>\n </div>\n</div>\n", styles: [".view-links{color:var(--vbn-color-border-focus);cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.DataTableComponent, selector: "lib-data-table", inputs: ["data", "columns", "dataKey", "formGroupConfig", "groupBy", "useVirtualScroll", "virtualScrollItemSize", "styleConfig"], outputs: ["rowEdit", "rowSave", "rowRevert", "rowDelete", "selectionChange"] }, { kind: "directive", type: i3$1.ColumnDirective, selector: "[libColumn]", inputs: ["libColumn"] }, { kind: "component", type: i3$1.SvgComponent, selector: "verben-svg", inputs: ["icon", "width", "height", "fill", "stroke", "type", "size"] }, { kind: "component", type: i3$1.DataViewComponent, selector: "verben-data-view", inputs: ["buttonClass", "iconClass", "activeIconClass", "columnCustomClass", "filterCustomClass", "sortCustomClass", "extendCustomClass", "exportCustomClass", "selectCustomClass", "importCustomClass", "zIndex", "createCustomClass", "tableIcon", "cardIcon", "cardClass", "tableClass", "searchKey", "searchValue", "viewState", "searchTemplate", "importTemplate", "columnTemplate", "extendTemplate", "filterTemplate", "sortTemplate", "children", "exportTemplate", "createTemplate", "selectedColumnCount", "selectedSortCount", "selectedFilterTableCount", "inputWidth", "milliseconds", "showColumnChild", "showSortChild", "showFilterChild", "showImportChild", "showExportChild", "showExtendChild", "create", "showSelected", "isTableView"], outputs: ["viewChange", "stateChange", "onSearchChange"] }, { kind: "component", type: i3$1.CardDataViewComponent, selector: "verben-card-data-view", inputs: ["pd", "mg", "lHeight", "rHeight", "rWidth", "lWidth", "textColor", "lbgColor", "rbgColor", "border", "display", "borderRadius", "activeCss", "inActiveCss", "displayAsRow", "cardDataList", "dataId", "totalRecords", "footer", "noOfVisibleChildren", "showEditIcon", "useVirtualScroll", "virtualScrollItemSize", "onItemClick", "onCardChildClick"], outputs: ["editClicked", "loadMoreClick"] }, { kind: "component", type: i3$1.LeftCardDataComponent, selector: "verben-left-card-data", inputs: ["pd", "mg", "height", "weight", "activeCss", "inActiveCss", "cardDataList", "iconCollapse", "iconExpanded", "parent", "useVirtualScroll", "virtualScrollItemSize", "dataId"] }, { kind: "component", type: i3$1.LeftCardDataViewComponent, selector: "verben-left-card-data-view", inputs: ["cardDataList"] }, { kind: "component", type: i3$1.RightCardDataViewComponent, selector: "verben-right-card-data-view", inputs: ["parentData", "chilData", "meth"] }, { kind: "component", type: i3$1.CardDataViewFooterComponent, selector: "verben-card-data-view-footer" }, { kind: "component", type: i3$1.TableFilterComponent, selector: "verben-table-filter", inputs: ["filterOptions", "pd", "mg", "height", "width", "bgColor", "boxShadow", "textColor", "primaryColor", "secondaryColor", "tertiaryColor", "border", "borderRadius", "selectWidth", "maxFilterLength", "savedFilters", "tooltip", "saveCallback"], outputs: ["filtersApplied", "resetSortData"] }, { kind: "component", type: i3$1.DataExportComponent, selector: "lib-data-export", inputs: ["columns", "data", "dataFetchUrl", "dataQueryParameters"], outputs: ["exportDataEvent"] }, { kind: "component", type: i3$1.DataColumnsComponent, selector: "lib-data-columns", inputs: ["columns", "enableDragAndDrop", "maxVisibleItems", "selectedColumns"], outputs: ["columnsUpdated"] }, { kind: "component", type: i3$1.DataSortComponent, selector: "lib-data-sort", inputs: ["columns", "data", "enableDragAndDrop"], outputs: ["sortApplied", "resetFilter"] }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3$1.TooltipComponent, selector: "verben-tooltip", inputs: ["tooltipContent", "customClass", "backgroundColor", "textColor", "padding", "borderRadius", "zIndex", "border", "width", "top", "bottom", "left", "right"] }, { kind: "component", type: i5$1.OperationPopupComponent, selector: "lib-operation-popup", inputs: ["user", "task", "allowedActions"], outputs: ["actionComplete"] }, { kind: "component", type: TasksFormComponent, selector: "tasks-form", inputs: ["currentData"], outputs: ["onTaskFormSave", "onSave"] }] });
|
|
852
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TasksComponent, selector: "lib-tasks", inputs: { pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: false, transformFunction: null } }, providers: [TasksService, TaskFacade, TaskState], usesInheritance: true, ngImport: i0, template: "<div class=\"space-y-8\">\n <verben-data-view #vdv [viewState]=\"{\n isSearch: true,\n isColumn: true,\n isFilter: true,\n isSort: true,\n isExport: true,\n isSelect: true,\n isCreate: true,\n isToggle: true,\n }\" [buttonClass]=\"'my-custom-button-class'\" [iconClass]=\"'my-icon-class'\"\n [activeIconClass]=\"'my-active-icon-class'\" [selectedColumnCount]=\"0\" [selectedSortCount]=\"0\"\n [selectedFilterTableCount]=\"0\" (viewChange)=\"onViewChange($event)\" (stateChange)=\"onStateChange($event)\"\n (onSearchChange)=\"handleSearch($event)\">\n <div table-content>\n <lib-data-table [data]=\"data()\" [columns]=\"config.columns\" [styleConfig]=\"styles\"\n (selectionChange)=\"onSelectionChange($event)\">\n <ng-container libColumn=\"history\">\n <ng-template #cell let-value>\n <a [routerLink]=\"['/workflow/task-history', value]\" routerLinkActive=\"router-link-active\"\n class=\"underline text-[var(--vbn-color-border-focus)]\">view history</a>\n </ng-template>\n </ng-container>\n\n <ng-container libColumn=\"workflow\">\n <ng-template #cell let-value>\n <a [routerLink]=\"['/workflow/workflows', value]\" routerLinkActive=\"router-link-active\"\n class=\"underline text-[var(--vbn-color-border-focus)]\">view Workflow</a>\n </ng-template>\n </ng-container>\n\n <ng-container libColumn=\"actions\">\n <ng-template #cell let-row=\"row\">\n <lib-operation-popup [user]=\"user()\" [task]=\"row\" [allowedActions]=\"getActionNamesForTask(row)\"\n (actionComplete)=\"loadInitialData()\">\n <div trigger class=\"cursor-pointer p-2 -m-2 inline-flex items-center justify-center\">\n <verben-svg icon=\"dots\" [width]=\"3\" [height]=\"18\" class=\"w-auto\"></verben-svg>\n </div>\n </lib-operation-popup>\n </ng-template>\n <ng-template #header>\n <strong>Actions</strong>\n </ng-template>\n </ng-container>\n </lib-data-table>\n </div>\n\n <div card-content>\n <verben-card-data-view borderRadius=\"12px\" (loadMoreClick)=\"loadMore()\" #vdcv dataId=\"Id\" border=\"5px\"\n [cardDataList]=\"cardData()\" rbgColor=\"var(--vbn-color-surface-alt)\" mg=\"20px\">\n <verben-left-card-data-view class=\"space-y-7\">\n <verben-left-card-data #vlcd [parent]=\"vdcv\" dataId=\"Code\"\n class=\"bg-secondary-100 rounded-xl border-primary border-[1px]\" [cardDataList]=\"cardData()\">\n <ng-template #card let-cardItem>\n <div (click)=\"currentData = vdcv.onItemClick(cardItem)\" class=\"flex\">\n <div (click)=\"currentData = vdcv.onItemClick(cardItem)\"\n class=\"flex cursor-pointer w-full bg-secondary rounded-xl\">\n <div class=\"w-3 rounded-xl rounded-tr-none rounded-br-none\" [ngClass]=\"\n cardItem.selected ? 'bg-primary' : 'bg-secondary-200'\n \"></div>\n <div class=\"flex flex-col py-2 px-4 w-full\">\n <div class=\"flex items-center gap-4 justify-between\">\n <div class=\"grid gap-y-2\">\n <span class=\"font-semibold text-[var(--vbn-color-on-primary)]\">{{\n cardItem.title\n }}</span>\n <p class=\"flex items-center\">\n <!-- <label for=\"phone\" class=\"text-[10px] font-light\">Current Actors:</label> -->\n @if (cardItem.data.CurrentActors && cardItem.data.CurrentActors.length > 0) {\n @if (cardItem.data.CurrentActors.length === 1) {\n <span id=\"phone\" class=\"text-sm\">{{ cardItem.data.CurrentActors[0].Identifier }}</span>\n } @else {\n <verben-tooltip [top]=\"'0px'\" [textColor]=\"'var(--vbn-color-text)'\" [backgroundColor]=\"'var(--vbn-color-border)'\" [left]=\"'0'\"\n [tooltipContent]=\"actorsTooltipTemplate\" #actorsTooltip>\n <span id=\"phone\" class=\"text-sm cursor-pointer\">\n {{ cardItem.data.CurrentActors[0].Identifier }} and {{ cardItem.data.CurrentActors.length\n - 1 }} others\n </span>\n </verben-tooltip>\n\n <ng-template #actorsTooltipTemplate>\n <div class=\"p-2\">\n <p class=\"text-xs font-semibold mb-1\">Current Actors:</p>\n <ul class=\"list-disc list-inside\">\n @for (actor of cardItem.data.CurrentActors; track actor.Identifier) {\n <li class=\"text-xs\">{{ actor.Identifier }}</li>\n }\n </ul>\n </div>\n </ng-template>\n }\n } @else {\n <span id=\"phone\" class=\"text-sm text-gray-400\">No actors assigned</span>\n }\n </p>\n </div>\n\n <div class=\"grid gap-y-2\">\n <span for=\"role\" class=\"font-light\">{{\n cardItem.data.Code\n }}</span>\n\n <div (click)=\"$event.stopPropagation();\" class=\"flex items-end gap-4\">\n <a [routerLink]=\"[\n '/workflow/task-history',\n cardItem.data.Code\n ]\" routerLinkActive=\"router-link-active\"\n class=\"underline text-[var(--vbn-color-border-focus)] text-xs relative z-10\">view\n history</a>\n\n <lib-operation-popup [user]=\"user()\" [task]=\"cardItem.data\"\n [allowedActions]=\"getActionNamesForTask(cardItem.data)\" (actionComplete)=\"loadInitialData()\">\n <div trigger class=\"cursor-pointer p-2 -m-2 inline-flex items-center justify-center\">\n <verben-svg icon=\"dots\" [width]=\"3\" [height]=\"18\" class=\"w-auto\"></verben-svg>\n </div>\n </lib-operation-popup>\n </div>\n </div>\n </div>\n\n <!-- <div class=\"flex\">\n <span class=\"font-normal text-sm\">{{ item.title }}</span>\n </div>\n @for (ciItem of item.body; track ciItem.value) {\n <div class=\"\">\n <span class=\"text-muted font-light text-xs\"\n >{{ ciItem.title }}:</span\n >\n <span class=\"text-black\">{{ ciItem.value }}</span>\n </div>\n } -->\n </div>\n </div>\n </div>\n </ng-template>\n </verben-left-card-data>\n </verben-left-card-data-view>\n\n <verben-right-card-data-view>\n <ng-template #parent>\n <!-- <lib-user-request-form\n [currentData]=\"currentData\"\n (switchView)=\"vdv.toggleView()\"\n (onApproval)=\"onApprove($event)\"\n ></lib-user-request-form> -->\n <tasks-form [currentData]=\"currentData\" (switchView)=\"vdv.toggleView()\"\n (onSave)=\"onSave($event)\"></tasks-form>\n </ng-template>\n </verben-right-card-data-view>\n\n <verben-card-data-view-footer class=\"w-full\">\n <div [ngClass]=\"{\n 'flex gap-2 items-center': true,\n 'justify-end': true\n }\">\n <!-- <verbena-button\n *ngIf=\"!vdcv.hasCurrentItem()\"\n [fontWeight]=\"'bold'\"\n [bgColor]=\"'var(--vbn-color-text-muted)'\"\n [borderRadius]=\"'4px'\"\n [textColor]=\"'var(--vbn-color-surface)'\"\n [pd]=\"'9.79px 37.28px'\"\n [text]=\"'Delete'\"\n >\n </verbena-button> -->\n <div class=\"flex {{\n vdcv.hasCurrentItem() ? 'flex-1' : ''\n }} justify-end items-center gap-5\">\n <span class=\"paginator-text\">{{ cardData().length }} records loaded</span>\n <button (click)=\"loadMore()\" class=\"load-more view-links text-[var(--vbn-color-border-focus)] underline\">\n Load more\n </button>\n </div>\n </div>\n </verben-card-data-view-footer>\n </verben-card-data-view>\n </div>\n <div column-content>\n <lib-data-columns [columns]=\"config.columns\" (columnsUpdated)=\"onColumnsUpdated($event)\"></lib-data-columns>\n </div>\n <div filter-content>\n <verben-table-filter [border]=\"'1px solid var(--vbn-color-primary)'\" borderRadius=\"10px\"\n boxShadow=\"2px 2px 2px 0px silver\" bgColor=\"white\" width=\"420px\" textColor=\"black\" pd=\"1rem\"\n primaryColor=\"var(--vbn-color-primary)\" secondaryColor=\"var(--vbn-color-border-focus)\" tertiaryColor=\"var(--vbn-color-on-primary)\" [filterOptions]=\"filterArray\"\n [maxFilterLength]=\"3\"></verben-table-filter>\n </div>\n <div sort-content>\n <lib-data-sort [columns]=\"config.columns\" [data]=\"data()\" (sortApplied)=\"onSortUpdated($event)\"></lib-data-sort>\n </div>\n <div export-content>\n <lib-data-export [data]=\"data()\" (exportDataEvent)=\"handleExport($event)\">\n </lib-data-export>\n </div>\n </verben-data-view>\n\n <div *ngIf=\"vdv.isTableView\" class=\"flex gap-2 justify-between\">\n <div class=\"message-log-button-container flex justify-between\">\n <!-- <verbena-button\n [fontWeight]=\"'bold'\"\n [bgColor]=\"'var(--vbn-color-text-muted)'\"\n [borderRadius]=\"'4px'\"\n [textColor]=\"'var(--vbn-color-surface)'\"\n [pd]=\"'9.79px 37.28px'\"\n [text]=\"'Delete'\"\n >\n </verbena-button> -->\n </div>\n <div class=\"flex justify-end items-center gap-5\">\n <span class=\"paginator-text\">{{ cardData().length }} records loaded</span>\n <button (click)=\"loadMore()\" class=\"load-more view-links text-[var(--vbn-color-border-focus)] underline\">\n Load more\n </button>\n </div>\n </div>\n</div>\n", styles: [".view-links{color:var(--vbn-color-border-focus);cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.DataTableComponent, selector: "lib-data-table", inputs: ["data", "columns", "dataKey", "formGroupConfig", "groupBy", "useVirtualScroll", "virtualScrollItemSize", "styleConfig"], outputs: ["rowEdit", "rowSave", "rowRevert", "rowDelete", "selectionChange"] }, { kind: "directive", type: i3$1.ColumnDirective, selector: "[libColumn]", inputs: ["libColumn"] }, { kind: "component", type: i3$1.SvgComponent, selector: "verben-svg", inputs: ["icon", "width", "height", "fill", "stroke", "type", "size"] }, { kind: "component", type: i3$1.DataViewComponent, selector: "verben-data-view", inputs: ["buttonClass", "iconClass", "activeIconClass", "columnCustomClass", "filterCustomClass", "sortCustomClass", "extendCustomClass", "exportCustomClass", "selectCustomClass", "importCustomClass", "zIndex", "createCustomClass", "tableIcon", "cardIcon", "cardClass", "tableClass", "searchKey", "searchValue", "viewState", "searchTemplate", "importTemplate", "columnTemplate", "extendTemplate", "filterTemplate", "sortTemplate", "children", "exportTemplate", "createTemplate", "selectedColumnCount", "selectedSortCount", "selectedFilterTableCount", "inputWidth", "milliseconds", "showColumnChild", "showSortChild", "showFilterChild", "showImportChild", "showExportChild", "showExtendChild", "create", "showSelected", "isTableView"], outputs: ["viewChange", "stateChange", "onSearchChange"] }, { kind: "component", type: i3$1.CardDataViewComponent, selector: "verben-card-data-view", inputs: ["pd", "mg", "lHeight", "rHeight", "rWidth", "lWidth", "textColor", "lbgColor", "rbgColor", "border", "display", "borderRadius", "activeCss", "inActiveCss", "displayAsRow", "cardDataList", "dataId", "totalRecords", "footer", "noOfVisibleChildren", "showEditIcon", "useVirtualScroll", "virtualScrollItemSize", "onItemClick", "onCardChildClick"], outputs: ["editClicked", "loadMoreClick"] }, { kind: "component", type: i3$1.LeftCardDataComponent, selector: "verben-left-card-data", inputs: ["pd", "mg", "height", "weight", "activeCss", "inActiveCss", "cardDataList", "iconCollapse", "iconExpanded", "parent", "useVirtualScroll", "virtualScrollItemSize", "dataId"] }, { kind: "component", type: i3$1.LeftCardDataViewComponent, selector: "verben-left-card-data-view", inputs: ["cardDataList"] }, { kind: "component", type: i3$1.RightCardDataViewComponent, selector: "verben-right-card-data-view", inputs: ["parentData", "chilData", "meth"] }, { kind: "component", type: i3$1.CardDataViewFooterComponent, selector: "verben-card-data-view-footer" }, { kind: "component", type: i3$1.TableFilterComponent, selector: "verben-table-filter", inputs: ["filterOptions", "pd", "mg", "height", "width", "bgColor", "boxShadow", "textColor", "primaryColor", "secondaryColor", "tertiaryColor", "border", "borderRadius", "selectWidth", "maxFilterLength", "savedFilters", "tooltip", "saveCallback"], outputs: ["filtersApplied", "resetSortData"] }, { kind: "component", type: i3$1.DataExportComponent, selector: "lib-data-export", inputs: ["columns", "data", "dataFetchUrl", "dataQueryParameters"], outputs: ["exportDataEvent"] }, { kind: "component", type: i3$1.DataColumnsComponent, selector: "lib-data-columns", inputs: ["columns", "enableDragAndDrop", "maxVisibleItems", "selectedColumns"], outputs: ["columnsUpdated"] }, { kind: "component", type: i3$1.DataSortComponent, selector: "lib-data-sort", inputs: ["columns", "data", "enableDragAndDrop"], outputs: ["sortApplied", "resetFilter"] }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3$1.TooltipComponent, selector: "verben-tooltip", inputs: ["tooltipContent", "customClass", "backgroundColor", "textColor", "padding", "borderRadius", "zIndex", "border", "width", "top", "bottom", "left", "right"] }, { kind: "component", type: i5$1.OperationPopupComponent, selector: "lib-operation-popup", inputs: ["user", "task", "allowedActions"], outputs: ["actionComplete"] }, { kind: "component", type: TasksFormComponent, selector: "tasks-form", inputs: ["currentData"], outputs: ["onTaskFormSave", "onSave"] }] });
|
|
813
853
|
}
|
|
814
854
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TasksComponent, decorators: [{
|
|
815
855
|
type: Component,
|