@acorex/platform 18.0.4 → 18.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/lib/data/dexie-storage.service.d.ts +0 -1
- package/common/lib/layout/grid-layout/grid-layout.types.d.ts +1 -2
- package/common/lib/schema/widgets/lookup/lookup-widget-filter.component.d.ts +1 -1
- package/common/lib/schema/widgets/lookup/lookup-widget-view.component.d.ts +2 -1
- package/common/lib/utils/data-generator.d.ts +13 -1
- package/common/lib/utils/index.d.ts +1 -0
- package/common/lib/utils/pdf.service.d.ts +25 -0
- package/esm2022/common/lib/data/dexie-storage.service.mjs +2 -4
- package/esm2022/common/lib/layout/grid-layout/grid-layout.directive.mjs +5 -5
- package/esm2022/common/lib/layout/grid-layout/grid-layout.types.mjs +1 -1
- package/esm2022/common/lib/schema/widgets/lookup/lookup-widget-edit.component.mjs +20 -3
- package/esm2022/common/lib/schema/widgets/lookup/lookup-widget-filter.component.mjs +20 -3
- package/esm2022/common/lib/schema/widgets/lookup/lookup-widget-view.component.mjs +5 -5
- package/esm2022/common/lib/utils/data-generator.mjs +67 -2
- package/esm2022/common/lib/utils/index.mjs +2 -1
- package/esm2022/common/lib/utils/pdf.service.mjs +85 -0
- package/esm2022/layout/entity/lib/entity-master-create.viewmodel.mjs +23 -19
- package/esm2022/layout/entity/lib/entity-master-list.viewmodel.mjs +27 -8
- package/esm2022/layout/entity/lib/entity-master-single.viewmodel.mjs +33 -28
- package/esm2022/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.mjs +22 -7
- package/esm2022/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.component.mjs +1 -2
- package/esm2022/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.viewmodel.mjs +15 -3
- package/esm2022/layout/entity/lib/workflows/create-entity.workflow.mjs +3 -4
- package/esm2022/layout/entity/lib/workflows/delete-entity.workflow.mjs +1 -4
- package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.mjs +4 -1
- package/esm2022/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.mjs +6 -3
- package/esm2022/widgets/lib/editors/date-time-box-widget/date-time-box-widget-view.component.mjs +1 -2
- package/esm2022/widgets/lib/editors/rich-text-widget/rich-text-widget-edit.component.mjs +3 -3
- package/esm2022/widgets/lib/editors/rich-text-widget/rich-text-widget-view.component.mjs +14 -8
- package/esm2022/widgets/lib/editors/selection-list-widget/selection-list-widget-view.component.mjs +3 -2
- package/esm2022/widgets/lib/editors/signature-pad-widget/signature-pad-widget-edit.component.mjs +3 -2
- package/esm2022/widgets/lib/editors/signature-pad-widget/signature-pad-widget-view.component.mjs +3 -2
- package/esm2022/widgets/lib/editors/text-box-widget/text-box-widget-edit.component.mjs +3 -2
- package/esm2022/widgets/lib/editors/text-box-widget/text-box-widget-view.component.mjs +3 -2
- package/esm2022/workflow/lib/actions/start-workflow.action.mjs +7 -3
- package/esm2022/workflow/lib/workflow.service.mjs +3 -3
- package/esm2022/workflow/lib/workflow.types.mjs +11 -10
- package/fesm2022/{acorex-platform-common-lookup-widget-edit.component-D9UhViUG.mjs → acorex-platform-common-lookup-widget-edit.component-Do_yV2hi.mjs} +19 -2
- package/fesm2022/acorex-platform-common-lookup-widget-edit.component-Do_yV2hi.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-lookup-widget-filter.component-RWweQQaO.mjs → acorex-platform-common-lookup-widget-filter.component-AKqbYe-l.mjs} +19 -2
- package/fesm2022/acorex-platform-common-lookup-widget-filter.component-AKqbYe-l.mjs.map +1 -0
- package/fesm2022/{acorex-platform-common-lookup-widget-view.component-mXo8VADX.mjs → acorex-platform-common-lookup-widget-view.component-BHqYDEuU.mjs} +5 -5
- package/fesm2022/acorex-platform-common-lookup-widget-view.component-BHqYDEuU.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +159 -13
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +116 -66
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +8 -2
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-widgets.mjs +24 -15
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +18 -13
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/entity/lib/entity-master-list.viewmodel.d.ts +7 -5
- package/layout/entity/lib/entity-master-single.viewmodel.d.ts +7 -5
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.d.ts +2 -0
- package/package.json +1 -1
- package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +1 -0
- package/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.d.ts +1 -0
- package/widgets/lib/editors/rich-text-widget/rich-text-widget-edit.component.d.ts +1 -1
- package/widgets/lib/editors/rich-text-widget/rich-text-widget-view.component.d.ts +3 -2
- package/widgets/lib/editors/signature-pad-widget/signature-pad-widget-edit.component.d.ts +1 -1
- package/widgets/lib/editors/signature-pad-widget/signature-pad-widget-view.component.d.ts +1 -1
- package/widgets/lib/editors/text-box-widget/text-box-widget-edit.component.d.ts +1 -1
- package/widgets/lib/editors/text-box-widget/text-box-widget-view.component.d.ts +1 -1
- package/workflow/lib/workflow.service.d.ts +1 -1
- package/workflow/lib/workflow.types.d.ts +4 -3
- package/fesm2022/acorex-platform-common-lookup-widget-edit.component-D9UhViUG.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-lookup-widget-filter.component-RWweQQaO.mjs.map +0 -1
- package/fesm2022/acorex-platform-common-lookup-widget-view.component-mXo8VADX.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, inject, NgModule, Optional, Inject } from '@angular/core';
|
|
3
3
|
import { Subject, filter } from 'rxjs';
|
|
4
|
-
import { cloneDeep, set, get
|
|
4
|
+
import { cloneDeep, set, get } from 'lodash-es';
|
|
5
5
|
|
|
6
6
|
class AXPWorkflowError extends Error {
|
|
7
7
|
constructor(message, inner = null) {
|
|
@@ -70,7 +70,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
|
|
|
70
70
|
|
|
71
71
|
class AXPWorkflowContext {
|
|
72
72
|
constructor(initialData = {}) {
|
|
73
|
-
//private variables: Map<string, any> = new Map();
|
|
74
73
|
this.variables = {};
|
|
75
74
|
this.stepOutputs = new Map();
|
|
76
75
|
this.variables = cloneDeep(initialData);
|
|
@@ -78,18 +77,20 @@ class AXPWorkflowContext {
|
|
|
78
77
|
setVariable(key, value) {
|
|
79
78
|
set(this.variables, key, value);
|
|
80
79
|
}
|
|
80
|
+
setVariables(context = {}) {
|
|
81
|
+
this.variables = { ...this.variables, ...context };
|
|
82
|
+
}
|
|
81
83
|
getVariable(key) {
|
|
82
84
|
return get(this.variables, key);
|
|
83
85
|
}
|
|
84
|
-
setOutput(
|
|
85
|
-
this.stepOutputs.set(
|
|
86
|
+
setOutput(key, output) {
|
|
87
|
+
this.stepOutputs.set(key, output);
|
|
86
88
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
setOutputs(values) {
|
|
90
|
+
this.stepOutputs = new Map([...this.stepOutputs, ...values]);
|
|
89
91
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
this.variables = merge(this.variables, context.variables);
|
|
92
|
+
getOutput(key) {
|
|
93
|
+
return this.stepOutputs.get(key);
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
class AXPWorkflowAction {
|
|
@@ -130,11 +131,11 @@ class AXPWorkflowService {
|
|
|
130
131
|
this.injector = injector;
|
|
131
132
|
this.eventService = inject(AXPWorkflowEventService);
|
|
132
133
|
}
|
|
133
|
-
async execute(workflow, initialContext =
|
|
134
|
+
async execute(workflow, initialContext = null) {
|
|
134
135
|
// Instantiate or retrieve the workflow
|
|
135
136
|
const wk = typeof workflow === 'string' ? this.getWorkflowInstance(workflow) : workflow;
|
|
136
137
|
let currentStepId = wk.startStepId;
|
|
137
|
-
const context = new AXPWorkflowContext(initialContext);
|
|
138
|
+
const context = initialContext instanceof AXPWorkflowContext ? initialContext : new AXPWorkflowContext(initialContext ?? {});
|
|
138
139
|
// Initialize context with initial variables
|
|
139
140
|
while (currentStepId) {
|
|
140
141
|
const currentStep = wk.steps[currentStepId];
|
|
@@ -307,9 +308,13 @@ class AXPStartWorkflowAction extends AXPWorkflowAction {
|
|
|
307
308
|
this.workflowService = inject(AXPWorkflowService);
|
|
308
309
|
}
|
|
309
310
|
async execute(context) {
|
|
311
|
+
//console.log("start WK current context", context);
|
|
312
|
+
//console.log("start WK input context", this.context);
|
|
313
|
+
if (this.context)
|
|
314
|
+
context.setVariables(this.context);
|
|
315
|
+
//console.log("start WK merged context", context);
|
|
310
316
|
try {
|
|
311
|
-
|
|
312
|
-
context.mergeWith(newContext);
|
|
317
|
+
await this.workflowService.execute(this.workflow, context);
|
|
313
318
|
}
|
|
314
319
|
catch (e) {
|
|
315
320
|
throw e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-workflow.mjs","sources":["../../../../libs/platform/workflow/src/lib/errors.types.ts","../../../../libs/platform/workflow/src/lib/workflow-event-dispatcher.service.ts","../../../../libs/platform/workflow/src/lib/workflow-registery.service.ts","../../../../libs/platform/workflow/src/lib/workflow.types.ts","../../../../libs/platform/workflow/src/lib/workflow.service.ts","../../../../libs/platform/workflow/src/lib/actions/start-workflow.action.ts","../../../../libs/platform/workflow/src/lib/workflow.module.ts","../../../../libs/platform/workflow/src/acorex-platform-workflow.ts"],"sourcesContent":["export class AXPWorkflowError extends Error {\r\n constructor(message: string, public inner: Error | null = null) {\r\n super(message);\r\n this.name = 'AXPWorkflowError';\r\n }\r\n}","import { Injectable } from '@angular/core';\r\nimport { Observable, Subject } from 'rxjs';\r\nimport { AXPWorkflowEvent } from './workflow.types';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AXPWorkflowEventService {\r\n private eventSubject = new Subject<AXPWorkflowEvent>();\r\n\r\n dispatch(event: AXPWorkflowEvent): void {\r\n this.eventSubject.next(event);\r\n }\r\n\r\n get events$(): Observable<AXPWorkflowEvent> {\r\n return this.eventSubject.asObservable();\r\n }\r\n}\r\n","import { Injectable, Type } from '@angular/core';\r\nimport { AXPWorkflow, AXPWorkflowAction, AXPWorkflowFunction } from './workflow.types';\r\n\r\n\r\n\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AXPWorkflowRegistryService {\r\n private functionsMap = new Map<string, Type<AXPWorkflowFunction>>();\r\n private actionsMap = new Map<string, Type<AXPWorkflowAction>>();\r\n private workflowsMap = new Map<string, AXPWorkflow>();\r\n\r\n registerWorkflow(name: string, workflow: AXPWorkflow): void {\r\n this.workflowsMap.set(name, workflow);\r\n }\r\n\r\n getWorkflow(name: string): AXPWorkflow | undefined {\r\n return this.workflowsMap.get(name);\r\n }\r\n\r\n registerAction(name: string, action: Type<AXPWorkflowAction>): void {\r\n this.actionsMap.set(name, action);\r\n }\r\n\r\n getAction(name: string): Type<AXPWorkflowAction> | undefined {\r\n return this.actionsMap.get(name);\r\n }\r\n\r\n registerFunction(name: string, func: Type<AXPWorkflowFunction>): void {\r\n this.functionsMap.set(name, func);\r\n }\r\n\r\n getFunction(name: string): Type<AXPWorkflowFunction> | undefined {\r\n return this.functionsMap.get(name);\r\n }\r\n\r\n getFunctionNames(): string[] {\r\n return Array.from(this.functionsMap.keys());\r\n }\r\n}","import { Injectable, inject } from '@angular/core';\r\nimport { filter } from 'rxjs';\r\nimport { AXPWorkflowEventService } from './workflow-event-dispatcher.service';\r\nimport { cloneDeep, get, merge, set } from 'lodash-es';\r\n\r\nexport interface AXPWorkflow {\r\n steps: { [stepName: string]: AXPWorkflowStep };\r\n startStepId: string;\r\n}\r\n\r\n\r\nexport class AXPWorkflowContext {\r\n\r\n constructor(initialData: any = {}) {\r\n this.variables = cloneDeep(initialData);\r\n }\r\n\r\n //private variables: Map<string, any> = new Map();\r\n private variables: any = {};\r\n private stepOutputs: Map<string, any> = new Map();\r\n\r\n setVariable(key: string, value: any): void {\r\n set(this.variables, key, value);\r\n }\r\n\r\n getVariable<T = any>(key: string): T {\r\n return get(this.variables, key);\r\n }\r\n\r\n setOutput(stepId: string, output: any): void {\r\n this.stepOutputs.set(stepId, output);\r\n }\r\n\r\n getOutput<T = any>(stepId: string): T {\r\n return this.stepOutputs.get(stepId);\r\n }\r\n\r\n mergeWith(context: AXPWorkflowContext) {\r\n this.stepOutputs = new Map([...this.stepOutputs, ...context.stepOutputs])\r\n this.variables = merge(this.variables, context.variables);\r\n }\r\n\r\n // You can add more helper methods as needed\r\n}\r\n\r\nexport type AXPWorkflowActionInput = any;\r\n\r\nexport type AXPWorkflowConditionType = 'AND' | 'OR' | 'SINGLE';\r\n\r\nexport interface AXPWorkflowCondition {\r\n type: AXPWorkflowConditionType;\r\n conditions?: AXPWorkflowCondition[]; // Nested conditions\r\n expression?: string; // Used if type is 'SINGLE'\r\n}\r\n\r\nexport interface AXPWorkflowNextStep {\r\n conditions: AXPWorkflowCondition[];\r\n nextStepId: string;\r\n}\r\n\r\nexport interface AXPWorkflowStep {\r\n id?: string;\r\n action: AXPWorkflowAction | string;\r\n input?: AXPWorkflowActionInput;\r\n nextSteps?: AXPWorkflowNextStep[];\r\n conditions?: AXPWorkflowCondition[];\r\n}\r\n@Injectable()\r\nexport abstract class AXPWorkflowAction {\r\n private eventService = inject(AXPWorkflowEventService);\r\n\r\n protected dispatch(event: AXPWorkflowEvent): void {\r\n this.eventService.dispatch(event);\r\n }\r\n\r\n abstract execute(context: AXPWorkflowContext): Promise<void>;\r\n}\r\n\r\n@Injectable()\r\nexport abstract class AXPWorkflowFunction {\r\n abstract execute(...args: any[]): Promise<any> | any;\r\n}\r\n\r\nexport interface AXPWorkflowEvent<T = any> {\r\n type: string;\r\n payload?: T;\r\n}\r\n\r\n\r\n\r\nexport function createWorkFlowEvent<T>(type: string) {\r\n const eventCreator = (payload: T) => ({ type, payload });\r\n eventCreator.type = type;\r\n return eventCreator;\r\n}\r\n\r\nexport function ofType<T extends { type: string }>(...allowedTypes: Array<{ type: string }>) {\r\n return filter((event: T) => allowedTypes.some((type) => event.type === type.type));\r\n}\r\n","import { Injectable, Injector, inject } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { AXPWorkflowError } from './errors.types';\r\nimport { AXPWorkflowEventService } from './workflow-event-dispatcher.service';\r\nimport { AXPWorkflowRegistryService } from './workflow-registery.service';\r\nimport {\r\n AXPWorkflow,\r\n AXPWorkflowAction,\r\n AXPWorkflowCondition,\r\n AXPWorkflowContext,\r\n AXPWorkflowEvent,\r\n AXPWorkflowFunction,\r\n AXPWorkflowNextStep,\r\n AXPWorkflowStep,\r\n} from './workflow.types';\r\nimport { cloneDeep, set } from 'lodash-es';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AXPWorkflowService {\r\n private eventService = inject(AXPWorkflowEventService);\r\n\r\n\r\n get events$(): Observable<AXPWorkflowEvent> {\r\n return this.eventService.events$;\r\n }\r\n\r\n constructor(private registryService: AXPWorkflowRegistryService, private injector: Injector) { }\r\n\r\n async execute(workflow: AXPWorkflow | string, initialContext: any = {}): Promise<AXPWorkflowContext> {\r\n // Instantiate or retrieve the workflow\r\n const wk = typeof workflow === 'string' ? this.getWorkflowInstance(workflow) : workflow;\r\n\r\n let currentStepId = wk.startStepId;\r\n const context = new AXPWorkflowContext(initialContext);\r\n // Initialize context with initial variables\r\n\r\n while (currentStepId) {\r\n const currentStep = wk.steps[currentStepId];\r\n if (!currentStep) {\r\n throw new AXPWorkflowError(`Step '${currentStepId}' not found in the workflow steps.`);\r\n }\r\n\r\n // Instantiate or retrieve the action\r\n const action = typeof currentStep.action === 'string' ? this.getActionInstance(currentStep.action) : currentStep.action;\r\n if (currentStep.input) {\r\n let inputs: any = {};\r\n await this.processInputs(cloneDeep(currentStep.input), inputs, '', context);\r\n Object.assign(action, inputs);\r\n }\r\n try {\r\n await new Promise((resolve) => setTimeout(async () => {\r\n await action.execute(context);\r\n resolve(0);\r\n }, 0));\r\n } catch (error) {\r\n console.error(error);\r\n throw new AXPWorkflowError('Workflow Error', error as Error);\r\n }\r\n // Determine the next step based on the conditions\r\n const nextStepInfo = await this.determineNextStep(currentStep, context);\r\n if (nextStepInfo) {\r\n currentStepId = nextStepInfo.nextStepId;\r\n } else {\r\n break; // Exit the loop if no next step is determined\r\n }\r\n }\r\n return context;\r\n }\r\n\r\n //TODO : replace with AXDataGenerator\r\n private uuid(): string {\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (char) => {\r\n const random = (Math.random() * 16) | 0;\r\n const value = char === 'x' ? random : (random & 0x3) | 0x8;\r\n return value.toString(16);\r\n });\r\n }\r\n\r\n private getActionInstance(actionName: string): AXPWorkflowAction {\r\n const actionType = this.registryService.getAction(actionName);\r\n if (!actionType) {\r\n throw new AXPWorkflowError(`Action type '${actionName}' not found in the registry.`);\r\n }\r\n return this.injector.get(actionType,);\r\n }\r\n\r\n private getWorkflowInstance(workflowName: string): AXPWorkflow {\r\n const workflowType = this.registryService.getWorkflow(workflowName);\r\n if (!workflowType) {\r\n throw new AXPWorkflowError(`Workflow type '${workflowName}' not found in the registry.`);\r\n }\r\n return workflowType;\r\n }\r\n\r\n private async determineNextStep(\r\n currentStep: AXPWorkflowStep,\r\n context: AXPWorkflowContext\r\n ): Promise<AXPWorkflowNextStep | null> {\r\n if (!currentStep.nextSteps) {\r\n return null;\r\n }\r\n for (const nextStep of currentStep.nextSteps) {\r\n if (await this.evaluateCondition(nextStep.conditions, context)) {\r\n return nextStep;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private async evaluateCondition(conditions: AXPWorkflowCondition[], context: AXPWorkflowContext): Promise<boolean> {\r\n if (!conditions || conditions.length === 0) {\r\n return true; // If no conditions, the step proceeds\r\n }\r\n\r\n // Map each condition to a promise using evaluateSingleCondition\r\n const conditionPromises = conditions.map((condition) => this.evaluateSingleCondition(condition, context));\r\n\r\n // Wait for all promises to resolve\r\n const results = await Promise.all(conditionPromises);\r\n\r\n // Check if every condition is true\r\n return results.every((result) => result);\r\n }\r\n\r\n private async evaluateSingleCondition(\r\n condition: AXPWorkflowCondition,\r\n context: AXPWorkflowContext\r\n ): Promise<boolean> {\r\n switch (condition.type) {\r\n case 'SINGLE':\r\n return (!condition.expression ? true : await this.evaluateExpression(condition.expression, context)) as boolean;\r\n case 'AND':\r\n // Evaluate all conditions with 'AND' logic\r\n const andConditions = condition.conditions ?? [];\r\n const andResults = await Promise.all(andConditions.map((cond) => this.evaluateSingleCondition(cond, context)));\r\n return andResults.every((result) => result);\r\n\r\n case 'OR':\r\n // Evaluate all conditions with 'OR' logic\r\n const orConditions = condition.conditions ?? [];\r\n const orResults = await Promise.all(orConditions.map((cond) => this.evaluateSingleCondition(cond, context)));\r\n return orResults.some((result) => result);\r\n\r\n default:\r\n throw new AXPWorkflowError(`Unsupported condition type: ${condition.type}`);\r\n }\r\n }\r\n\r\n private async evaluateExpression(templateExpression: string, context: AXPWorkflowContext): Promise<Boolean> {\r\n try {\r\n let expression = '';\r\n if (typeof templateExpression === 'string' && templateExpression.trim().includes('{{')) {\r\n const expressionMatch = templateExpression.match(/\\{\\{\\s*(.*?)\\s*\\}\\}/);\r\n if (!expressionMatch) {\r\n throw Error(`No valid expression found in \"${templateExpression}\"`);\r\n }\r\n expression = expressionMatch[1];\r\n }\r\n else {\r\n expression = templateExpression;\r\n }\r\n // Create a scope that includes context and registered functions\r\n const scope = { context, ...this.createFunctionScope() };\r\n // Evaluating the expression within the created scope\r\n const sandbox = new Function('scope', `return (async function() { with (scope) { return ${expression}; } })();`);\r\n const result = await sandbox(scope);\r\n return result;\r\n } catch (error) {\r\n console.error('Error evaluating expression:', error);\r\n return false;\r\n }\r\n }\r\n\r\n async processInputs(obj: any, inputs: any, pathPrefix: string = '', context: any = {}): Promise<void> {\r\n if (!obj)\r\n return;\r\n\r\n for await (const i of Object.entries(obj)) {\r\n const key = i[0];\r\n const value = i[1];\r\n const currentPath = pathPrefix ? `${pathPrefix}.${key}` : key;\r\n if (typeof value === 'string' && value.trim().includes('{{')) {\r\n const expValue = await this.evaluateExpression(value, context);\r\n set(inputs, currentPath, expValue);\r\n }\r\n else if (typeof value === 'object' && value !== null && (value.constructor === Object || Array.isArray(value))) {\r\n // Recursively handle nested objects\r\n this.processInputs(value, inputs, currentPath, context);\r\n } else {\r\n // Apply static values directly\r\n set(inputs, currentPath, value);\r\n }\r\n }\r\n }\r\n\r\n private createFunctionScope(): any {\r\n const scope: any = {};\r\n this.registryService.getFunctionNames().forEach((name) => {\r\n scope[name] = this.getFunctionInstance(name).execute;\r\n });\r\n return scope;\r\n }\r\n\r\n private getFunctionInstance(functionName: string): AXPWorkflowFunction {\r\n const functionType = this.registryService.getFunction(functionName);\r\n if (!functionType) {\r\n throw new AXPWorkflowError(`Function type '${functionName}' not found in the registry.`);\r\n }\r\n return this.injector.get(functionType);\r\n }\r\n}\r\n","import { inject, Injectable } from \"@angular/core\";\r\nimport { AXPWorkflowAction, AXPWorkflowContext } from \"../workflow.types\";\r\nimport { AXPWorkflowService } from \"../workflow.service\";\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AXPStartWorkflowAction extends AXPWorkflowAction {\r\n\r\n private workflowService = inject(AXPWorkflowService)\r\n private workflow: string;\r\n private context: any;\r\n\r\n async execute(context: AXPWorkflowContext): Promise<void> {\r\n try {\r\n let newContext = await this.workflowService.execute(this.workflow, this.context);\r\n context.mergeWith(newContext);\r\n }\r\n catch (e: unknown) {\r\n throw e;\r\n }\r\n\r\n }\r\n}","import { Inject, ModuleWithProviders, NgModule, Optional, Type } from \"@angular/core\";\r\nimport { AXPWorkflowRegistryService } from \"./workflow-registery.service\";\r\nimport { AXPWorkflow, AXPWorkflowAction, AXPWorkflowFunction } from \"./workflow.types\";\r\nimport { AXPStartWorkflowAction } from \"./actions/start-workflow.action\";\r\n\r\n\r\nexport interface AXPWorkflowModuleConfigs {\r\n functions?: {\r\n [name: string]: Type<AXPWorkflowFunction>\r\n },\r\n actions?: {\r\n [name: string]: Type<AXPWorkflowAction>\r\n },\r\n workflows?: {\r\n [name: string]: AXPWorkflow\r\n }\r\n}\r\n\r\n@NgModule({\r\n imports: [],\r\n exports: [],\r\n declarations: [],\r\n})\r\nexport class AXPWorkflowModule {\r\n\r\n static forRoot(config?: AXPWorkflowModuleConfigs): ModuleWithProviders<AXPWorkflowModule> {\r\n return {\r\n ngModule: AXPWorkflowModule,\r\n providers: [\r\n {\r\n provide: 'AXPWorkflowModuleFactory',\r\n useFactory: (registry: AXPWorkflowRegistryService) => () => {\r\n registry.registerAction(\"start-workflow\", AXPStartWorkflowAction);\r\n //\r\n if (config?.functions) {\r\n for (const [key, type] of Object.entries(config.functions)) {\r\n registry.registerFunction(key, type);\r\n }\r\n }\r\n //\r\n if (config?.actions) {\r\n for (const [key, type] of Object.entries(config.actions)) {\r\n registry.registerAction(key, type);\r\n }\r\n }\r\n //\r\n if (config?.workflows) {\r\n for (const [key, type] of Object.entries(config.workflows)) {\r\n registry.registerWorkflow(key, type);\r\n }\r\n }\r\n },\r\n deps: [AXPWorkflowRegistryService],\r\n multi: true\r\n },\r\n ...Object.values(config?.actions ?? { AXPStartWorkflowAction }),\r\n ...Object.values(config?.functions ?? {}),\r\n ]\r\n };\r\n }\r\n\r\n static forChild(config?: AXPWorkflowModuleConfigs): ModuleWithProviders<AXPWorkflowModule> {\r\n return {\r\n ngModule: AXPWorkflowModule,\r\n providers: [\r\n {\r\n provide: 'AXPWorkflowModuleFactory',\r\n useFactory: (registry: AXPWorkflowRegistryService) => () => {\r\n registry.registerAction(\"start-workflow\", AXPStartWorkflowAction);\r\n //\r\n if (config?.functions) {\r\n for (const [key, type] of Object.entries(config.functions)) {\r\n registry.registerFunction(key, type);\r\n }\r\n }\r\n //\r\n if (config?.actions) {\r\n for (const [key, type] of Object.entries(config.actions)) {\r\n registry.registerAction(key, type);\r\n }\r\n }\r\n //\r\n if (config?.workflows) {\r\n for (const [key, type] of Object.entries(config.workflows)) {\r\n registry.registerWorkflow(key, type);\r\n }\r\n }\r\n },\r\n deps: [AXPWorkflowRegistryService],\r\n multi: true\r\n },\r\n ...Object.values(config?.actions ?? {}),\r\n ...Object.values(config?.functions ?? {})\r\n ]\r\n };\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(@Optional() @Inject('AXPWorkflowModuleFactory') instances: any[]) {\r\n instances?.forEach(f => {\r\n f();\r\n });\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.AXPWorkflowRegistryService"],"mappings":";;;;;AAAM,MAAO,gBAAiB,SAAQ,KAAK,CAAA;IACvC,WAAY,CAAA,OAAe,EAAS,KAAA,GAAsB,IAAI,EAAA;QAC1D,KAAK,CAAC,OAAO,CAAC,CAAC;QADiB,IAAK,CAAA,KAAA,GAAL,KAAK,CAAqB;AAE1D,QAAA,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;KAClC;AACJ;;MCEY,uBAAuB,CAAA;AAHpC,IAAA,WAAA,GAAA;AAIU,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAoB,CAAC;AASxD,KAAA;AAPC,IAAA,QAAQ,CAAC,KAAuB,EAAA;AAC9B,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAC/B;AAED,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;KACzC;8GATU,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,C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AACX,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,YAAY,EAAE,EAAE;AACnB,iBAAA,CAAA;;0BA8EgB,QAAQ;;0BAAI,MAAM;2BAAC,0BAA0B,CAAA;;;ACpG9D;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-workflow.mjs","sources":["../../../../libs/platform/workflow/src/lib/errors.types.ts","../../../../libs/platform/workflow/src/lib/workflow-event-dispatcher.service.ts","../../../../libs/platform/workflow/src/lib/workflow-registery.service.ts","../../../../libs/platform/workflow/src/lib/workflow.types.ts","../../../../libs/platform/workflow/src/lib/workflow.service.ts","../../../../libs/platform/workflow/src/lib/actions/start-workflow.action.ts","../../../../libs/platform/workflow/src/lib/workflow.module.ts","../../../../libs/platform/workflow/src/acorex-platform-workflow.ts"],"sourcesContent":["export class AXPWorkflowError extends Error {\r\n constructor(message: string, public inner: Error | null = null) {\r\n super(message);\r\n this.name = 'AXPWorkflowError';\r\n }\r\n}","import { Injectable } from '@angular/core';\r\nimport { Observable, Subject } from 'rxjs';\r\nimport { AXPWorkflowEvent } from './workflow.types';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AXPWorkflowEventService {\r\n private eventSubject = new Subject<AXPWorkflowEvent>();\r\n\r\n dispatch(event: AXPWorkflowEvent): void {\r\n this.eventSubject.next(event);\r\n }\r\n\r\n get events$(): Observable<AXPWorkflowEvent> {\r\n return this.eventSubject.asObservable();\r\n }\r\n}\r\n","import { Injectable, Type } from '@angular/core';\r\nimport { AXPWorkflow, AXPWorkflowAction, AXPWorkflowFunction } from './workflow.types';\r\n\r\n\r\n\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AXPWorkflowRegistryService {\r\n private functionsMap = new Map<string, Type<AXPWorkflowFunction>>();\r\n private actionsMap = new Map<string, Type<AXPWorkflowAction>>();\r\n private workflowsMap = new Map<string, AXPWorkflow>();\r\n\r\n registerWorkflow(name: string, workflow: AXPWorkflow): void {\r\n this.workflowsMap.set(name, workflow);\r\n }\r\n\r\n getWorkflow(name: string): AXPWorkflow | undefined {\r\n return this.workflowsMap.get(name);\r\n }\r\n\r\n registerAction(name: string, action: Type<AXPWorkflowAction>): void {\r\n this.actionsMap.set(name, action);\r\n }\r\n\r\n getAction(name: string): Type<AXPWorkflowAction> | undefined {\r\n return this.actionsMap.get(name);\r\n }\r\n\r\n registerFunction(name: string, func: Type<AXPWorkflowFunction>): void {\r\n this.functionsMap.set(name, func);\r\n }\r\n\r\n getFunction(name: string): Type<AXPWorkflowFunction> | undefined {\r\n return this.functionsMap.get(name);\r\n }\r\n\r\n getFunctionNames(): string[] {\r\n return Array.from(this.functionsMap.keys());\r\n }\r\n}","import { Injectable, inject } from '@angular/core';\r\nimport { filter } from 'rxjs';\r\nimport { AXPWorkflowEventService } from './workflow-event-dispatcher.service';\r\nimport { cloneDeep, get, set } from 'lodash-es';\r\n\r\nexport interface AXPWorkflow {\r\n steps: { [stepName: string]: AXPWorkflowStep };\r\n startStepId: string;\r\n}\r\n\r\n\r\nexport class AXPWorkflowContext {\r\n\r\n constructor(initialData: any = {}) {\r\n this.variables = cloneDeep(initialData);\r\n }\r\n\r\n private variables: any = {};\r\n private stepOutputs: Map<string, any> = new Map();\r\n\r\n setVariable(key: string, value: any): void {\r\n set(this.variables, key, value);\r\n }\r\n\r\n\r\n setVariables(context: any = {}) {\r\n this.variables = { ...this.variables, ...context };\r\n }\r\n\r\n getVariable<T = any>(key: string): T {\r\n return get(this.variables, key);\r\n }\r\n\r\n setOutput(key: string, output: any): void {\r\n this.stepOutputs.set(key, output);\r\n }\r\n\r\n setOutputs(values: Map<string, any>): void {\r\n this.stepOutputs = new Map([...this.stepOutputs, ...values])\r\n }\r\n\r\n getOutput<T = any>(key: string): T {\r\n return this.stepOutputs.get(key);\r\n }\r\n}\r\n\r\nexport type AXPWorkflowActionInput = any;\r\n\r\nexport type AXPWorkflowConditionType = 'AND' | 'OR' | 'SINGLE';\r\n\r\nexport interface AXPWorkflowCondition {\r\n type: AXPWorkflowConditionType;\r\n conditions?: AXPWorkflowCondition[]; // Nested conditions\r\n expression?: string; // Used if type is 'SINGLE'\r\n}\r\n\r\nexport interface AXPWorkflowNextStep {\r\n conditions: AXPWorkflowCondition[];\r\n nextStepId: string;\r\n}\r\n\r\nexport interface AXPWorkflowStep {\r\n id?: string;\r\n action: AXPWorkflowAction | string;\r\n input?: AXPWorkflowActionInput;\r\n nextSteps?: AXPWorkflowNextStep[];\r\n conditions?: AXPWorkflowCondition[];\r\n}\r\n@Injectable()\r\nexport abstract class AXPWorkflowAction {\r\n private eventService = inject(AXPWorkflowEventService);\r\n\r\n protected dispatch(event: AXPWorkflowEvent): void {\r\n this.eventService.dispatch(event);\r\n }\r\n\r\n abstract execute(context: AXPWorkflowContext): Promise<void>;\r\n}\r\n\r\n@Injectable()\r\nexport abstract class AXPWorkflowFunction {\r\n abstract execute(...args: any[]): Promise<any> | any;\r\n}\r\n\r\nexport interface AXPWorkflowEvent<T = any> {\r\n type: string;\r\n payload?: T;\r\n}\r\n\r\n\r\n\r\nexport function createWorkFlowEvent<T>(type: string) {\r\n const eventCreator = (payload: T) => ({ type, payload });\r\n eventCreator.type = type;\r\n return eventCreator;\r\n}\r\n\r\nexport function ofType<T extends { type: string }>(...allowedTypes: Array<{ type: string }>) {\r\n return filter((event: T) => allowedTypes.some((type) => event.type === type.type));\r\n}\r\n","import { Injectable, Injector, inject } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { AXPWorkflowError } from './errors.types';\r\nimport { AXPWorkflowEventService } from './workflow-event-dispatcher.service';\r\nimport { AXPWorkflowRegistryService } from './workflow-registery.service';\r\nimport {\r\n AXPWorkflow,\r\n AXPWorkflowAction,\r\n AXPWorkflowCondition,\r\n AXPWorkflowContext,\r\n AXPWorkflowEvent,\r\n AXPWorkflowFunction,\r\n AXPWorkflowNextStep,\r\n AXPWorkflowStep,\r\n} from './workflow.types';\r\nimport { cloneDeep, set } from 'lodash-es';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AXPWorkflowService {\r\n private eventService = inject(AXPWorkflowEventService);\r\n\r\n\r\n get events$(): Observable<AXPWorkflowEvent> {\r\n return this.eventService.events$;\r\n }\r\n\r\n constructor(private registryService: AXPWorkflowRegistryService, private injector: Injector) { }\r\n\r\n async execute(workflow: AXPWorkflow | string, initialContext: AXPWorkflowContext | any | null = null): Promise<AXPWorkflowContext> {\r\n // Instantiate or retrieve the workflow\r\n const wk = typeof workflow === 'string' ? this.getWorkflowInstance(workflow) : workflow;\r\n\r\n let currentStepId = wk.startStepId;\r\n const context = initialContext instanceof AXPWorkflowContext ? initialContext : new AXPWorkflowContext(initialContext ?? {});\r\n // Initialize context with initial variables\r\n\r\n while (currentStepId) {\r\n const currentStep = wk.steps[currentStepId];\r\n if (!currentStep) {\r\n throw new AXPWorkflowError(`Step '${currentStepId}' not found in the workflow steps.`);\r\n }\r\n\r\n // Instantiate or retrieve the action\r\n const action = typeof currentStep.action === 'string' ? this.getActionInstance(currentStep.action) : currentStep.action;\r\n if (currentStep.input) {\r\n let inputs: any = {};\r\n await this.processInputs(cloneDeep(currentStep.input), inputs, '', context);\r\n Object.assign(action, inputs);\r\n }\r\n try {\r\n await new Promise((resolve) => setTimeout(async () => {\r\n await action.execute(context);\r\n resolve(0);\r\n }, 0));\r\n } catch (error) {\r\n console.error(error);\r\n throw new AXPWorkflowError('Workflow Error', error as Error);\r\n }\r\n // Determine the next step based on the conditions\r\n const nextStepInfo = await this.determineNextStep(currentStep, context);\r\n if (nextStepInfo) {\r\n currentStepId = nextStepInfo.nextStepId;\r\n } else {\r\n break; // Exit the loop if no next step is determined\r\n }\r\n }\r\n return context;\r\n }\r\n\r\n //TODO : replace with AXDataGenerator\r\n private uuid(): string {\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (char) => {\r\n const random = (Math.random() * 16) | 0;\r\n const value = char === 'x' ? random : (random & 0x3) | 0x8;\r\n return value.toString(16);\r\n });\r\n }\r\n\r\n private getActionInstance(actionName: string): AXPWorkflowAction {\r\n const actionType = this.registryService.getAction(actionName);\r\n if (!actionType) {\r\n throw new AXPWorkflowError(`Action type '${actionName}' not found in the registry.`);\r\n }\r\n return this.injector.get(actionType,);\r\n }\r\n\r\n private getWorkflowInstance(workflowName: string): AXPWorkflow {\r\n const workflowType = this.registryService.getWorkflow(workflowName);\r\n if (!workflowType) {\r\n throw new AXPWorkflowError(`Workflow type '${workflowName}' not found in the registry.`);\r\n }\r\n return workflowType;\r\n }\r\n\r\n private async determineNextStep(\r\n currentStep: AXPWorkflowStep,\r\n context: AXPWorkflowContext\r\n ): Promise<AXPWorkflowNextStep | null> {\r\n if (!currentStep.nextSteps) {\r\n return null;\r\n }\r\n for (const nextStep of currentStep.nextSteps) {\r\n if (await this.evaluateCondition(nextStep.conditions, context)) {\r\n return nextStep;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private async evaluateCondition(conditions: AXPWorkflowCondition[], context: AXPWorkflowContext): Promise<boolean> {\r\n if (!conditions || conditions.length === 0) {\r\n return true; // If no conditions, the step proceeds\r\n }\r\n\r\n // Map each condition to a promise using evaluateSingleCondition\r\n const conditionPromises = conditions.map((condition) => this.evaluateSingleCondition(condition, context));\r\n\r\n // Wait for all promises to resolve\r\n const results = await Promise.all(conditionPromises);\r\n\r\n // Check if every condition is true\r\n return results.every((result) => result);\r\n }\r\n\r\n private async evaluateSingleCondition(\r\n condition: AXPWorkflowCondition,\r\n context: AXPWorkflowContext\r\n ): Promise<boolean> {\r\n switch (condition.type) {\r\n case 'SINGLE':\r\n return (!condition.expression ? true : await this.evaluateExpression(condition.expression, context)) as boolean;\r\n case 'AND':\r\n // Evaluate all conditions with 'AND' logic\r\n const andConditions = condition.conditions ?? [];\r\n const andResults = await Promise.all(andConditions.map((cond) => this.evaluateSingleCondition(cond, context)));\r\n return andResults.every((result) => result);\r\n\r\n case 'OR':\r\n // Evaluate all conditions with 'OR' logic\r\n const orConditions = condition.conditions ?? [];\r\n const orResults = await Promise.all(orConditions.map((cond) => this.evaluateSingleCondition(cond, context)));\r\n return orResults.some((result) => result);\r\n\r\n default:\r\n throw new AXPWorkflowError(`Unsupported condition type: ${condition.type}`);\r\n }\r\n }\r\n\r\n private async evaluateExpression(templateExpression: string, context: AXPWorkflowContext): Promise<Boolean> {\r\n try {\r\n let expression = '';\r\n if (typeof templateExpression === 'string' && templateExpression.trim().includes('{{')) {\r\n const expressionMatch = templateExpression.match(/\\{\\{\\s*(.*?)\\s*\\}\\}/);\r\n if (!expressionMatch) {\r\n throw Error(`No valid expression found in \"${templateExpression}\"`);\r\n }\r\n expression = expressionMatch[1];\r\n }\r\n else {\r\n expression = templateExpression;\r\n }\r\n // Create a scope that includes context and registered functions\r\n const scope = { context, ...this.createFunctionScope() };\r\n // Evaluating the expression within the created scope\r\n const sandbox = new Function('scope', `return (async function() { with (scope) { return ${expression}; } })();`);\r\n const result = await sandbox(scope);\r\n return result;\r\n } catch (error) {\r\n console.error('Error evaluating expression:', error);\r\n return false;\r\n }\r\n }\r\n\r\n async processInputs(obj: any, inputs: any, pathPrefix: string = '', context: any = {}): Promise<void> {\r\n if (!obj)\r\n return;\r\n\r\n for await (const i of Object.entries(obj)) {\r\n const key = i[0];\r\n const value = i[1];\r\n const currentPath = pathPrefix ? `${pathPrefix}.${key}` : key;\r\n if (typeof value === 'string' && value.trim().includes('{{')) {\r\n const expValue = await this.evaluateExpression(value, context);\r\n set(inputs, currentPath, expValue);\r\n }\r\n else if (typeof value === 'object' && value !== null && (value.constructor === Object || Array.isArray(value))) {\r\n // Recursively handle nested objects\r\n this.processInputs(value, inputs, currentPath, context);\r\n } else {\r\n // Apply static values directly\r\n set(inputs, currentPath, value);\r\n }\r\n }\r\n }\r\n\r\n private createFunctionScope(): any {\r\n const scope: any = {};\r\n this.registryService.getFunctionNames().forEach((name) => {\r\n scope[name] = this.getFunctionInstance(name).execute;\r\n });\r\n return scope;\r\n }\r\n\r\n private getFunctionInstance(functionName: string): AXPWorkflowFunction {\r\n const functionType = this.registryService.getFunction(functionName);\r\n if (!functionType) {\r\n throw new AXPWorkflowError(`Function type '${functionName}' not found in the registry.`);\r\n }\r\n return this.injector.get(functionType);\r\n }\r\n}\r\n","import { inject, Injectable } from \"@angular/core\";\r\nimport { AXPWorkflowAction, AXPWorkflowContext } from \"../workflow.types\";\r\nimport { AXPWorkflowService } from \"../workflow.service\";\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AXPStartWorkflowAction extends AXPWorkflowAction {\r\n\r\n private workflowService = inject(AXPWorkflowService)\r\n private workflow: string;\r\n private context: any;\r\n\r\n async execute(context: AXPWorkflowContext): Promise<void> {\r\n //console.log(\"start WK current context\", context);\r\n //console.log(\"start WK input context\", this.context);\r\n if (this.context)\r\n context.setVariables(this.context)\r\n //console.log(\"start WK merged context\", context);\r\n try {\r\n await this.workflowService.execute(this.workflow, context);\r\n }\r\n catch (e: unknown) {\r\n throw e;\r\n }\r\n\r\n }\r\n}","import { Inject, ModuleWithProviders, NgModule, Optional, Type } from \"@angular/core\";\r\nimport { AXPWorkflowRegistryService } from \"./workflow-registery.service\";\r\nimport { AXPWorkflow, AXPWorkflowAction, AXPWorkflowFunction } from \"./workflow.types\";\r\nimport { AXPStartWorkflowAction } from \"./actions/start-workflow.action\";\r\n\r\n\r\nexport interface AXPWorkflowModuleConfigs {\r\n functions?: {\r\n [name: string]: Type<AXPWorkflowFunction>\r\n },\r\n actions?: {\r\n [name: string]: Type<AXPWorkflowAction>\r\n },\r\n workflows?: {\r\n [name: string]: AXPWorkflow\r\n }\r\n}\r\n\r\n@NgModule({\r\n imports: [],\r\n exports: [],\r\n declarations: [],\r\n})\r\nexport class AXPWorkflowModule {\r\n\r\n static forRoot(config?: AXPWorkflowModuleConfigs): ModuleWithProviders<AXPWorkflowModule> {\r\n return {\r\n ngModule: AXPWorkflowModule,\r\n providers: [\r\n {\r\n provide: 'AXPWorkflowModuleFactory',\r\n useFactory: (registry: AXPWorkflowRegistryService) => () => {\r\n registry.registerAction(\"start-workflow\", AXPStartWorkflowAction);\r\n //\r\n if (config?.functions) {\r\n for (const [key, type] of Object.entries(config.functions)) {\r\n registry.registerFunction(key, type);\r\n }\r\n }\r\n //\r\n if (config?.actions) {\r\n for (const [key, type] of Object.entries(config.actions)) {\r\n registry.registerAction(key, type);\r\n }\r\n }\r\n //\r\n if (config?.workflows) {\r\n for (const [key, type] of Object.entries(config.workflows)) {\r\n registry.registerWorkflow(key, type);\r\n }\r\n }\r\n },\r\n deps: [AXPWorkflowRegistryService],\r\n multi: true\r\n },\r\n ...Object.values(config?.actions ?? { AXPStartWorkflowAction }),\r\n ...Object.values(config?.functions ?? {}),\r\n ]\r\n };\r\n }\r\n\r\n static forChild(config?: AXPWorkflowModuleConfigs): ModuleWithProviders<AXPWorkflowModule> {\r\n return {\r\n ngModule: AXPWorkflowModule,\r\n providers: [\r\n {\r\n provide: 'AXPWorkflowModuleFactory',\r\n useFactory: (registry: AXPWorkflowRegistryService) => () => {\r\n registry.registerAction(\"start-workflow\", AXPStartWorkflowAction);\r\n //\r\n if (config?.functions) {\r\n for (const [key, type] of Object.entries(config.functions)) {\r\n registry.registerFunction(key, type);\r\n }\r\n }\r\n //\r\n if (config?.actions) {\r\n for (const [key, type] of Object.entries(config.actions)) {\r\n registry.registerAction(key, type);\r\n }\r\n }\r\n //\r\n if (config?.workflows) {\r\n for (const [key, type] of Object.entries(config.workflows)) {\r\n registry.registerWorkflow(key, type);\r\n }\r\n }\r\n },\r\n deps: [AXPWorkflowRegistryService],\r\n multi: true\r\n },\r\n ...Object.values(config?.actions ?? {}),\r\n ...Object.values(config?.functions ?? {})\r\n ]\r\n };\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(@Optional() @Inject('AXPWorkflowModuleFactory') instances: any[]) {\r\n instances?.forEach(f => {\r\n f();\r\n });\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n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G,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,CAAC;gBACvC,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC;AAC5C,aAAA;SACJ,CAAC;KACL;AAED;;AAEG;AACH,IAAA,WAAA,CAA4D,SAAgB,EAAA;AACxE,QAAA,SAAS,EAAE,OAAO,CAAC,CAAC,IAAG;AACnB,YAAA,CAAC,EAAE,CAAC;AACR,SAAC,CAAC,CAAC;KACN;AAjFQ,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,kBA6EM,0BAA0B,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GA7EjD,iBAAiB,EAAA,CAAA,CAAA,EAAA;+GAAjB,iBAAiB,EAAA,CAAA,CAAA,EAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAL7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,YAAY,EAAE,EAAE;AACnB,iBAAA,CAAA;;0BA8EgB,QAAQ;;0BAAI,MAAM;2BAAC,0BAA0B,CAAA;;;ACpG9D;;AAEG;;;;"}
|
|
@@ -24,11 +24,12 @@ export declare class AXPEntityMasterListViewQueryViewModel {
|
|
|
24
24
|
export declare class AXPEntityMasterListViewModel {
|
|
25
25
|
private injector;
|
|
26
26
|
private config;
|
|
27
|
-
private entityDef;
|
|
28
|
-
private _viewDef;
|
|
29
|
-
private formatService;
|
|
30
|
-
private session;
|
|
31
|
-
private workflow;
|
|
27
|
+
private readonly entityDef;
|
|
28
|
+
private readonly _viewDef;
|
|
29
|
+
private readonly formatService;
|
|
30
|
+
private readonly session;
|
|
31
|
+
private readonly workflow;
|
|
32
|
+
private readonly destroyed;
|
|
32
33
|
events$: Subject<{
|
|
33
34
|
action: string;
|
|
34
35
|
}>;
|
|
@@ -74,6 +75,7 @@ export declare class AXPEntityMasterListViewModel {
|
|
|
74
75
|
views: import("@angular/core").Signal<AXPEntityMasterListViewQueryViewModel[]>;
|
|
75
76
|
view: import("@angular/core").WritableSignal<AXPEntityMasterListViewQueryViewModel>;
|
|
76
77
|
executeCommand(commandName: string, data?: any): Promise<void>;
|
|
78
|
+
destroy(): void;
|
|
77
79
|
}
|
|
78
80
|
export declare class AXPEntityListViewModelFactory {
|
|
79
81
|
private entityService;
|
|
@@ -36,11 +36,12 @@ export declare class AXPEntityMasterSingleViewModel {
|
|
|
36
36
|
private injector;
|
|
37
37
|
private config;
|
|
38
38
|
private entityData;
|
|
39
|
-
private entityDef;
|
|
40
|
-
private _viewDef;
|
|
41
|
-
private session;
|
|
42
|
-
private formatService;
|
|
43
|
-
private workflow;
|
|
39
|
+
private readonly entityDef;
|
|
40
|
+
private readonly _viewDef;
|
|
41
|
+
private readonly session;
|
|
42
|
+
private readonly formatService;
|
|
43
|
+
private readonly workflow;
|
|
44
|
+
private readonly destroyed;
|
|
44
45
|
events$: Subject<{
|
|
45
46
|
action: string;
|
|
46
47
|
}>;
|
|
@@ -55,6 +56,7 @@ export declare class AXPEntityMasterSingleViewModel {
|
|
|
55
56
|
beardcrumbs: import("@angular/core").Signal<AXPBeardCrumb[]>;
|
|
56
57
|
relatedEntities: import("@angular/core").Signal<AXPEntityDetailListViewModel[]>;
|
|
57
58
|
executeCommand(commandName: string, data?: any): Promise<void>;
|
|
59
|
+
destroy(): void;
|
|
58
60
|
}
|
|
59
61
|
export declare class AXPEntityDetailViewModelFactory {
|
|
60
62
|
private entityService;
|
|
@@ -18,6 +18,7 @@ export declare class AXPLookupWidgetEditComponent extends AXPWidgetBase<any> {
|
|
|
18
18
|
protected formatService: AXFormatService;
|
|
19
19
|
protected popupService: AXPopupService;
|
|
20
20
|
private readonly builderService;
|
|
21
|
+
private readonly destroyRef;
|
|
21
22
|
private entityDef;
|
|
22
23
|
protected conditions?: AXPQueryFilter[];
|
|
23
24
|
protected displayText: import("@angular/core").WritableSignal<string>;
|
|
@@ -36,6 +37,7 @@ export declare class AXPLookupWidgetEditComponent extends AXPWidgetBase<any> {
|
|
|
36
37
|
protected handleOnBlur(e: AXFocusEvent): void;
|
|
37
38
|
protected handleKeyDown(e: AXHtmlEvent): Promise<void>;
|
|
38
39
|
private setItems;
|
|
40
|
+
protected handleClearClick(): void;
|
|
39
41
|
clear(): void;
|
|
40
42
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPLookupWidgetEditComponent, never>;
|
|
41
43
|
static ɵcmp: i0.ɵɵComponentDeclaration<AXPLookupWidgetEditComponent, "ng-component", never, { "entity": { "alias": "entity"; "required": false; }; "conditions": { "alias": "conditions"; "required": false; }; "expose": { "alias": "expose"; "required": false; }; }, {}, never, never, true, never>;
|
package/package.json
CHANGED
|
@@ -24,6 +24,7 @@ export declare class AXPEntityMasterListViewComponent {
|
|
|
24
24
|
protected getDropdownRowItems: (rowData: unknown) => Promise<AXRowCommandItem[]>;
|
|
25
25
|
protected handleRowCommandClick(e: AXRowCommandItemClickEvent): Promise<void>;
|
|
26
26
|
protected handleSelectedRowsChange(rows: unknown[]): Promise<void>;
|
|
27
|
+
ngOnDestroy(): void;
|
|
27
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPEntityMasterListViewComponent, never>;
|
|
28
29
|
static ɵcmp: i0.ɵɵComponentDeclaration<AXPEntityMasterListViewComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
29
30
|
}
|
|
@@ -8,6 +8,7 @@ export declare class AXPEntityMasterSingleViewComponent {
|
|
|
8
8
|
protected isOpen: import("rxjs").Observable<boolean>;
|
|
9
9
|
protected selectedTabIndex: import("@angular/core").WritableSignal<number>;
|
|
10
10
|
handleActiveTabChanged(e: any): void;
|
|
11
|
+
ngOnDestroy(): void;
|
|
11
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPEntityMasterSingleViewComponent, never>;
|
|
12
13
|
static ɵcmp: i0.ɵɵComponentDeclaration<AXPEntityMasterSingleViewComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
13
14
|
}
|
|
@@ -29,5 +29,5 @@ export declare class AXPRichTextWidgetEditComponent extends AXPWidgetBase<any> {
|
|
|
29
29
|
ngAfterViewInit(): Promise<void>;
|
|
30
30
|
initEditor(): Promise<void>;
|
|
31
31
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPRichTextWidgetEditComponent, never>;
|
|
32
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AXPRichTextWidgetEditComponent, "
|
|
32
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AXPRichTextWidgetEditComponent, "axp-rich-text-widget", never, {}, {}, never, never, true, never>;
|
|
33
33
|
}
|
|
@@ -3,7 +3,8 @@ import { DomSanitizer } from '@angular/platform-browser';
|
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class AXPRichTextWidgetViewComponent extends AXPWidgetBase<any> {
|
|
5
5
|
sanitizer: DomSanitizer;
|
|
6
|
-
|
|
6
|
+
emptyPlaceHolder: string;
|
|
7
|
+
protected innerValue: import("@angular/core").Signal<import("@angular/platform-browser").SafeHtml>;
|
|
7
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPRichTextWidgetViewComponent, never>;
|
|
8
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AXPRichTextWidgetViewComponent, "
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AXPRichTextWidgetViewComponent, "axp-rich-text-widget", never, {}, {}, never, never, true, never>;
|
|
9
10
|
}
|
|
@@ -15,5 +15,5 @@ export declare class AXPSignatureWidgetEditComponent extends AXPWidgetBase<any>
|
|
|
15
15
|
protected switchEditMode(): Promise<void>;
|
|
16
16
|
protected undo(): void;
|
|
17
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPSignatureWidgetEditComponent, never>;
|
|
18
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AXPSignatureWidgetEditComponent, "
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AXPSignatureWidgetEditComponent, "axp-signature-widget", never, {}, {}, never, never, true, never>;
|
|
19
19
|
}
|
|
@@ -3,5 +3,5 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
export declare class AXPSignatureWidgetViewComponent extends AXPWidgetBase<any> {
|
|
4
4
|
protected internalValue: import("@angular/core").Signal<any>;
|
|
5
5
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPSignatureWidgetViewComponent, never>;
|
|
6
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AXPSignatureWidgetViewComponent, "
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AXPSignatureWidgetViewComponent, "axp-signature-widget", never, {}, {}, never, never, true, never>;
|
|
7
7
|
}
|
|
@@ -15,5 +15,5 @@ export declare class AXPTextBoxWidgetEditComponent extends AXPWidgetBase<any> {
|
|
|
15
15
|
protected addItem(): void;
|
|
16
16
|
protected deleteItem(i: number): void;
|
|
17
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPTextBoxWidgetEditComponent, never>;
|
|
18
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AXPTextBoxWidgetEditComponent, "
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AXPTextBoxWidgetEditComponent, "axp-text-box-widget", never, {}, {}, never, never, true, never>;
|
|
19
19
|
}
|
|
@@ -4,5 +4,5 @@ export declare class AXPTextBoxWidgetViewComponent extends AXPWidgetBase<any> {
|
|
|
4
4
|
protected internalValue: import("@angular/core").Signal<any>;
|
|
5
5
|
protected multiple: boolean;
|
|
6
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPTextBoxWidgetViewComponent, never>;
|
|
7
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AXPTextBoxWidgetViewComponent, "
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AXPTextBoxWidgetViewComponent, "axp-text-box-widget", never, {}, {}, never, never, true, never>;
|
|
8
8
|
}
|
|
@@ -9,7 +9,7 @@ export declare class AXPWorkflowService {
|
|
|
9
9
|
private eventService;
|
|
10
10
|
get events$(): Observable<AXPWorkflowEvent>;
|
|
11
11
|
constructor(registryService: AXPWorkflowRegistryService, injector: Injector);
|
|
12
|
-
execute(workflow: AXPWorkflow | string, initialContext?: any): Promise<AXPWorkflowContext>;
|
|
12
|
+
execute(workflow: AXPWorkflow | string, initialContext?: AXPWorkflowContext | any | null): Promise<AXPWorkflowContext>;
|
|
13
13
|
private uuid;
|
|
14
14
|
private getActionInstance;
|
|
15
15
|
private getWorkflowInstance;
|
|
@@ -10,10 +10,11 @@ export declare class AXPWorkflowContext {
|
|
|
10
10
|
private variables;
|
|
11
11
|
private stepOutputs;
|
|
12
12
|
setVariable(key: string, value: any): void;
|
|
13
|
+
setVariables(context?: any): void;
|
|
13
14
|
getVariable<T = any>(key: string): T;
|
|
14
|
-
setOutput(
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
setOutput(key: string, output: any): void;
|
|
16
|
+
setOutputs(values: Map<string, any>): void;
|
|
17
|
+
getOutput<T = any>(key: string): T;
|
|
17
18
|
}
|
|
18
19
|
export type AXPWorkflowActionInput = any;
|
|
19
20
|
export type AXPWorkflowConditionType = 'AND' | 'OR' | 'SINGLE';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-common-lookup-widget-edit.component-D9UhViUG.mjs","sources":["../../../../libs/platform/common/src/lib/schema/widgets/lookup/lookup-widget-edit.component.ts"],"sourcesContent":["import { AXDataSource, AXValueChangedEvent } from '@acorex/components/common';\r\nimport { AXFormModule } from '@acorex/components/form';\r\nimport { AXSelectBoxModule } from '@acorex/components/select-box';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, inject } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { AXPWidgetEditBase } from '../../widget/widget-base';\r\nimport { AXPEntityRegistryService } from '../../entity';\r\n@Component({\r\n selector: 'axp-lookup-widget-edit',\r\n template: `\r\n <ax-select-box\r\n [valueField]=\"valueField\"\r\n [textField]=\"textField\"\r\n [ngModel]=\"value\"\r\n [multiple]=\"multiple\"\r\n (onValueChanged)=\"handleChange($event)\"\r\n [dataSource]=\"dataSource || []\"\r\n >\r\n @for(vl of validations;track $index) {\r\n <ax-validation-rule [rule]=\"vl.rule\" [options]=\"vl.options\"></ax-validation-rule>\r\n }\r\n </ax-select-box>\r\n `,\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [CommonModule, FormsModule, AXSelectBoxModule, AXFormModule],\r\n inputs: ['value', 'reference', 'valueField', 'textField', 'multiple', 'referenceField'],\r\n})\r\nexport class AXPLookupWidgetEditComponent extends AXPWidgetEditBase {\r\n protected reference!: string;\r\n protected multiple!: boolean;\r\n protected valueField: string = 'value';\r\n protected textField: string = 'text';\r\n private entityRegistery = inject(AXPEntityRegistryService);\r\n protected dataSource!: AXDataSource;\r\n\r\n async ngOnInit() {\r\n const entity = await this.entityRegistery.resolve(this.reference, this.reference);\r\n this.dataSource = new AXDataSource(entity.dataSource);\r\n }\r\n\r\n protected handleChange(e: AXValueChangedEvent) {\r\n if (e.isUserInteraction) {\r\n if (this.multiple) {\r\n this.value = e.component.selectedItems;\r\n } else {\r\n this.value = e.component.selectedItems[0];\r\n }\r\n }\r\n }\r\n}\r\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BM,MAAO,4BAA6B,SAAQ,iBAAiB,CAAA;AArBnE,IAAA,WAAA,GAAA;;QAwBY,IAAU,CAAA,UAAA,GAAW,OAAO,CAAC;QAC7B,IAAS,CAAA,SAAA,G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AAU,EAAE,gBAAgB,CAAC;AACxF,iBAAA,CAAA;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-common-lookup-widget-filter.component-RWweQQaO.mjs","sources":["../../../../libs/platform/common/src/lib/schema/widgets/lookup/lookup-widget-filter.component.ts"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\r\nimport { AXDataSource, AXValueChangedEvent } from '@acorex/components/common';\r\nimport { AXDecoratorModule } from '@acorex/components/decorators';\r\nimport { AXPopoverModule } from '@acorex/components/popover';\r\nimport { AXSelectBoxModule } from '@acorex/components/select-box';\r\nimport { AXSelectionListModule } from '@acorex/components/selection-list';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component, inject } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { AXPWidgetFilterBase } from '../../widget/widget-base';\r\nimport { AXPEntityRegistryService } from '../../entity';\r\nimport { AXPFilterOperator } from '../../../app';\r\n@Component({\r\n selector: 'axp-lookup-widget-filter',\r\n template: `\r\n <div class=\"ax-flex ax-items-center\">\r\n <ax-select-box\r\n [textField]=\"'title'\"\r\n [placeholder]=\"'Select...'\"\r\n [dataSource]=\"dataSource || []\"\r\n (onValueChanged)=\"handleChange($event)\"\r\n [(ngModel)]=\"value\"\r\n [multiple]=\"multiple\"\r\n [valueField]=\"valueField\"\r\n [textField]=\"textField\"\r\n >\r\n </ax-select-box>\r\n @if(operations.length){\r\n <ax-button #changeOperator look=\"blank\" color=\"default\" class=\"ax-sm\">\r\n <ax-icon class=\"fa-solid fa-ellipsis-vertical\"></ax-icon>\r\n </ax-button>\r\n <ax-popover #operatorsPopover [target]=\"changeOperator\" [openOn]=\"'toggle'\" [closeOn]=\"'clickOut'\" [adaptivityEnabled]=\"true\">\r\n <div class=\"ax-bg-surface ax-py-5 ax-px-3 ax-border ax-border-default ax-rounded-md ax-shadow-md ax-w-full ax-min-w-[250px]\">\r\n <ax-selection-list\r\n [valueField]=\"'name'\"\r\n [textField]=\"'title'\"\r\n [(ngModel)]=\"operator\"\r\n (ngModelChange)=\"operatorsPopover.close()\"\r\n [direction]=\"'vertical'\"\r\n [items]=\"operations\"\r\n [multiple]=\"false\"\r\n ></ax-selection-list>\r\n </div>\r\n </ax-popover>\r\n }\r\n </div>\r\n `,\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [CommonModule, AXSelectBoxModule, FormsModule, AXPopoverModule, AXSelectionListModule, AXButtonModule, AXDecoratorModule],\r\n outputs: ['valueChange', 'operatorChange'],\r\n inputs: ['value', 'operator', 'refrence', 'multiple', 'textField', 'valueField'],\r\n})\r\nexport class AXPLookupWidgetFilterComponent extends AXPWidgetFilterBase {\r\n reference!: string;\r\n valueField!: string;\r\n textField!: string;\r\n multiple: boolean = false;\r\n operations: AXPFilterOperator[] = [];\r\n private entityRegistery = inject(AXPEntityRegistryService);\r\n protected dataSource!: AXDataSource;\r\n\r\n protected handleChange(e: AXValueChangedEvent) {\r\n if (e.isUserInteraction) {\r\n this.value = e.component.selectedItems[0];\r\n }\r\n }\r\n\r\n async ngOnInit() {\r\n const entity = await this.entityRegistery.resolve(this.reference, this.reference);\r\n this.dataSource = new AXDataSource(entity.dataSource);\r\n this.operations = this.schema.filterOptions.operators;\r\n }\r\n}\r\n"],"names":["i1","i5","i6"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDM,MAAO,8BAA+B,SAAQ,mBAAmB,CAAA;AAzCvE,IAAA,WAAA,GAAA;;QA6CE,IAAQ,CAAA,QAAA,GAAY,KAAK,CAAC;QAC1B,IAAU,CAAA,UAAA,GAAwB,EAAE,CAAC;AAC7B,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAc5D,KAAA;AAXW,IAAA,YAAY,CAAC,CAAsB,EAAA;AAC3C,QAAA,IAAI,CAAC,CAAC,iBAAiB,EAAE;YACvB,IAAI,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A,EAAA;;2FAItH,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAzC1C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,oBAAA,QAAQ,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCT,EAAA,CAAA;AACD,oBAAA,UAAU,EAAE,IAAI;oBAChB,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,EAAE,qBAAqB,EAAE,cAAc,EAAE,iBAAiB,CAAC;AAClI,oBAAA,OAAO,EAAE,CAAC,aAAa,EAAE,gBAAgB,CAAC;AAC1C,oBAAA,MAAM,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,CAAC;AACjF,iBAAA,CAAA;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-common-lookup-widget-view.component-mXo8VADX.mjs","sources":["../../../../libs/platform/common/src/lib/schema/widgets/lookup/lookup-widget-view.component.ts"],"sourcesContent":["import { AXTagModule } from '@acorex/components/tag';\r\nimport { AXPWidgetBase } from '../../widget/widget-base';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ChangeDetectionStrategy, Component } from '@angular/core';\r\n@Component({\r\n selector: 'axp-lookup-widget-view',\r\n template: '{{text}}',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [CommonModule, AXTagModule],\r\n inputs: ['valueField', 'textField', 'multiple'],\r\n})\r\nexport class AXPLookupWidgetViewComponent extends AXPWidgetBase {\r\n protected list: { id: string; text: string }[] = [];\r\n protected text: string | null = null;\r\n protected multiple: boolean = false;\r\n protected textField: string = 'title';\r\n protected valueField: string = 'id';\r\n\r\n override render() {\r\n const rawValue = this.rawValue;\r\n if (rawValue) {\r\n this.list = Array.isArray(rawValue) ? rawValue.map((c) => this.extractItem(c)) : [this.extractItem(rawValue)];\r\n this.text = this.list.map((c) => c.text).join(', ');\r\n } else {\r\n this.list = [];\r\n this.text = null;\r\n }\r\n }\r\n\r\n private extractItem(item: any): any {\r\n return typeof item == 'object'\r\n ? {\r\n id: item[this.valueField],\r\n text: item[this.textField],\r\n }\r\n : {\r\n id: item,\r\n text: item,\r\n };\r\n }\r\n\r\n ngOnInit() {\r\n this.render();\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAYM,MAAO,4BAA6B,SAAQ,aAAa,CAAA;AAR/D,IAAA,WAAA,GAAA;;QASY,IAAI,CAAA,IAAA,GAAmC,EAAE,CAAC;QAC1C,IAAI,CAAA,IAAA,GAAkB,IAAI,CAAC;QAC3B,IAAQ,CAAA,QAAA,GAAY,KAAK,CAAC;QAC1B,IAAS,CAAA,SAAA,GAAW,OAAO,CAAC;QAC5B,IAAU,CAAA,UAAA,GAAW,IAAI,CAAC;AA4BrC,KAAA;IA1BU,MAAM,GAAA;AACb,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,QAAQ,EAAE;AACZ,YAAA,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC9G,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACrD;aAAM;AACL,YAAA,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;AACf,YAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CA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