@memberjunction/ng-conversations 2.117.0 → 2.118.0
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/dist/lib/components/collection/collection-artifact-card.component.d.ts +7 -1
- package/dist/lib/components/collection/collection-artifact-card.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-artifact-card.component.js +14 -18
- package/dist/lib/components/collection/collection-artifact-card.component.js.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.d.ts +86 -1
- package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.js +1042 -255
- package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +9 -2
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +236 -162
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/mention/mention-dropdown.component.js +2 -2
- package/dist/lib/components/mention/mention-editor.component.d.ts +21 -0
- package/dist/lib/components/mention/mention-editor.component.d.ts.map +1 -1
- package/dist/lib/components/mention/mention-editor.component.js +299 -2
- package/dist/lib/components/mention/mention-editor.component.js.map +1 -1
- package/dist/lib/components/message/actionable-commands.component.d.ts +33 -0
- package/dist/lib/components/message/actionable-commands.component.d.ts.map +1 -0
- package/dist/lib/components/message/actionable-commands.component.js +107 -0
- package/dist/lib/components/message/actionable-commands.component.js.map +1 -0
- package/dist/lib/components/message/agent-response-form.component.d.ts +72 -0
- package/dist/lib/components/message/agent-response-form.component.d.ts.map +1 -0
- package/dist/lib/components/message/agent-response-form.component.js +310 -0
- package/dist/lib/components/message/agent-response-form.component.js.map +1 -0
- package/dist/lib/components/message/form-question.component.d.ts +105 -0
- package/dist/lib/components/message/form-question.component.d.ts.map +1 -0
- package/dist/lib/components/message/form-question.component.js +621 -0
- package/dist/lib/components/message/form-question.component.js.map +1 -0
- package/dist/lib/components/message/message-input-box.component.d.ts +12 -0
- package/dist/lib/components/message/message-input-box.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input-box.component.js +14 -1
- package/dist/lib/components/message/message-input-box.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +3 -3
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +85 -51
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +39 -6
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +490 -196
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/message/message-list.component.d.ts +2 -1
- package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-list.component.js +5 -1
- package/dist/lib/components/message/message-list.component.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +23 -6
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +128 -52
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/conversations.module.d.ts +60 -56
- package/dist/lib/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.js +17 -1
- package/dist/lib/conversations.module.js.map +1 -1
- package/dist/lib/models/collection-view.model.d.ts +30 -0
- package/dist/lib/models/collection-view.model.d.ts.map +1 -0
- package/dist/lib/models/collection-view.model.js +2 -0
- package/dist/lib/models/collection-view.model.js.map +1 -0
- package/dist/lib/models/conversation-state.model.d.ts +1 -0
- package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts +4 -1
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +22 -2
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/data-cache.service.d.ts +12 -0
- package/dist/lib/services/data-cache.service.d.ts.map +1 -1
- package/dist/lib/services/data-cache.service.js +41 -0
- package/dist/lib/services/data-cache.service.js.map +1 -1
- package/dist/lib/services/mention-parser.service.d.ts +6 -1
- package/dist/lib/services/mention-parser.service.d.ts.map +1 -1
- package/dist/lib/services/mention-parser.service.js +114 -34
- package/dist/lib/services/mention-parser.service.js.map +1 -1
- package/dist/lib/services/ui-command-handler.service.d.ts +45 -0
- package/dist/lib/services/ui-command-handler.service.d.ts.map +1 -0
- package/dist/lib/services/ui-command-handler.service.js +95 -0
- package/dist/lib/services/ui-command-handler.service.js.map +1 -0
- package/package.json +15 -14
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
2
|
+
import { FormGroup, FormControl, Validators } from '@angular/forms';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/common";
|
|
5
|
+
import * as i2 from "@angular/forms";
|
|
6
|
+
import * as i3 from "@progress/kendo-angular-buttons";
|
|
7
|
+
import * as i4 from "./form-question.component";
|
|
8
|
+
function AgentResponseFormComponent_div_0_div_1_button_1_i_1_Template(rf, ctx) { if (rf & 1) {
|
|
9
|
+
i0.ɵɵelement(0, "i", 8);
|
|
10
|
+
} if (rf & 2) {
|
|
11
|
+
const option_r2 = i0.ɵɵnextContext().$implicit;
|
|
12
|
+
i0.ɵɵclassMapInterpolate1("fa ", option_r2.icon, "");
|
|
13
|
+
} }
|
|
14
|
+
function AgentResponseFormComponent_div_0_div_1_button_1_Template(rf, ctx) { if (rf & 1) {
|
|
15
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
16
|
+
i0.ɵɵelementStart(0, "button", 6);
|
|
17
|
+
i0.ɵɵlistener("click", function AgentResponseFormComponent_div_0_div_1_button_1_Template_button_click_0_listener() { const option_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r2.onSimpleChoiceClick(option_r2.value)); });
|
|
18
|
+
i0.ɵɵtemplate(1, AgentResponseFormComponent_div_0_div_1_button_1_i_1_Template, 1, 3, "i", 7);
|
|
19
|
+
i0.ɵɵtext(2);
|
|
20
|
+
i0.ɵɵelementEnd();
|
|
21
|
+
} if (rf & 2) {
|
|
22
|
+
const option_r2 = ctx.$implicit;
|
|
23
|
+
const ctx_r2 = i0.ɵɵnextContext(3);
|
|
24
|
+
i0.ɵɵproperty("disabled", ctx_r2.disabled || ctx_r2.isSubmitting);
|
|
25
|
+
i0.ɵɵadvance();
|
|
26
|
+
i0.ɵɵproperty("ngIf", ctx_r2.hasIcon(option_r2));
|
|
27
|
+
i0.ɵɵadvance();
|
|
28
|
+
i0.ɵɵtextInterpolate1(" ", option_r2.label, " ");
|
|
29
|
+
} }
|
|
30
|
+
function AgentResponseFormComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
31
|
+
i0.ɵɵelementStart(0, "div", 4);
|
|
32
|
+
i0.ɵɵtemplate(1, AgentResponseFormComponent_div_0_div_1_button_1_Template, 3, 3, "button", 5);
|
|
33
|
+
i0.ɵɵelementEnd();
|
|
34
|
+
} if (rf & 2) {
|
|
35
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
36
|
+
i0.ɵɵadvance();
|
|
37
|
+
i0.ɵɵproperty("ngForOf", ctx_r2.getOptions(ctx_r2.responseForm.questions[0]))("ngForTrackBy", ctx_r2.trackByValue);
|
|
38
|
+
} }
|
|
39
|
+
function AgentResponseFormComponent_div_0_form_2_h3_1_Template(rf, ctx) { if (rf & 1) {
|
|
40
|
+
i0.ɵɵelementStart(0, "h3", 17);
|
|
41
|
+
i0.ɵɵtext(1);
|
|
42
|
+
i0.ɵɵelementEnd();
|
|
43
|
+
} if (rf & 2) {
|
|
44
|
+
const ctx_r2 = i0.ɵɵnextContext(3);
|
|
45
|
+
i0.ɵɵadvance();
|
|
46
|
+
i0.ɵɵtextInterpolate(ctx_r2.responseForm.title);
|
|
47
|
+
} }
|
|
48
|
+
function AgentResponseFormComponent_div_0_form_2_p_2_Template(rf, ctx) { if (rf & 1) {
|
|
49
|
+
i0.ɵɵelementStart(0, "p", 18);
|
|
50
|
+
i0.ɵɵtext(1);
|
|
51
|
+
i0.ɵɵelementEnd();
|
|
52
|
+
} if (rf & 2) {
|
|
53
|
+
const ctx_r2 = i0.ɵɵnextContext(3);
|
|
54
|
+
i0.ɵɵadvance();
|
|
55
|
+
i0.ɵɵtextInterpolate(ctx_r2.responseForm.description);
|
|
56
|
+
} }
|
|
57
|
+
function AgentResponseFormComponent_div_0_form_2_mj_form_question_4_Template(rf, ctx) { if (rf & 1) {
|
|
58
|
+
i0.ɵɵelement(0, "mj-form-question", 19);
|
|
59
|
+
} if (rf & 2) {
|
|
60
|
+
const question_r5 = ctx.$implicit;
|
|
61
|
+
const ctx_r2 = i0.ɵɵnextContext(3);
|
|
62
|
+
i0.ɵɵproperty("question", question_r5)("control", ctx_r2.getControl(question_r5.id))("formControlName", question_r5.id);
|
|
63
|
+
} }
|
|
64
|
+
function AgentResponseFormComponent_div_0_form_2_span_7_Template(rf, ctx) { if (rf & 1) {
|
|
65
|
+
i0.ɵɵelementStart(0, "span");
|
|
66
|
+
i0.ɵɵelement(1, "i", 20);
|
|
67
|
+
i0.ɵɵtext(2);
|
|
68
|
+
i0.ɵɵelementEnd();
|
|
69
|
+
} if (rf & 2) {
|
|
70
|
+
const ctx_r2 = i0.ɵɵnextContext(3);
|
|
71
|
+
i0.ɵɵadvance(2);
|
|
72
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r2.submitLabel, " ");
|
|
73
|
+
} }
|
|
74
|
+
function AgentResponseFormComponent_div_0_form_2_span_8_Template(rf, ctx) { if (rf & 1) {
|
|
75
|
+
i0.ɵɵelementStart(0, "span");
|
|
76
|
+
i0.ɵɵelement(1, "span", 21);
|
|
77
|
+
i0.ɵɵtext(2, " Submitting... ");
|
|
78
|
+
i0.ɵɵelementEnd();
|
|
79
|
+
} }
|
|
80
|
+
function AgentResponseFormComponent_div_0_form_2_Template(rf, ctx) { if (rf & 1) {
|
|
81
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
82
|
+
i0.ɵɵelementStart(0, "form", 9);
|
|
83
|
+
i0.ɵɵlistener("ngSubmit", function AgentResponseFormComponent_div_0_form_2_Template_form_ngSubmit_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onSubmit()); });
|
|
84
|
+
i0.ɵɵtemplate(1, AgentResponseFormComponent_div_0_form_2_h3_1_Template, 2, 1, "h3", 10)(2, AgentResponseFormComponent_div_0_form_2_p_2_Template, 2, 1, "p", 11);
|
|
85
|
+
i0.ɵɵelementStart(3, "div", 12);
|
|
86
|
+
i0.ɵɵtemplate(4, AgentResponseFormComponent_div_0_form_2_mj_form_question_4_Template, 1, 3, "mj-form-question", 13);
|
|
87
|
+
i0.ɵɵelementEnd();
|
|
88
|
+
i0.ɵɵelementStart(5, "div", 14)(6, "button", 15);
|
|
89
|
+
i0.ɵɵtemplate(7, AgentResponseFormComponent_div_0_form_2_span_7_Template, 3, 1, "span", 16)(8, AgentResponseFormComponent_div_0_form_2_span_8_Template, 3, 0, "span", 16);
|
|
90
|
+
i0.ɵɵelementEnd()()();
|
|
91
|
+
} if (rf & 2) {
|
|
92
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
93
|
+
i0.ɵɵproperty("formGroup", ctx_r2.formGroup);
|
|
94
|
+
i0.ɵɵadvance();
|
|
95
|
+
i0.ɵɵproperty("ngIf", ctx_r2.responseForm.title);
|
|
96
|
+
i0.ɵɵadvance();
|
|
97
|
+
i0.ɵɵproperty("ngIf", ctx_r2.responseForm.description);
|
|
98
|
+
i0.ɵɵadvance(2);
|
|
99
|
+
i0.ɵɵproperty("ngForOf", ctx_r2.responseForm.questions)("ngForTrackBy", ctx_r2.trackByQuestionId);
|
|
100
|
+
i0.ɵɵadvance(2);
|
|
101
|
+
i0.ɵɵproperty("themeColor", "primary")("disabled", ctx_r2.disabled || ctx_r2.isSubmitting || ctx_r2.formGroup.invalid);
|
|
102
|
+
i0.ɵɵadvance();
|
|
103
|
+
i0.ɵɵproperty("ngIf", !ctx_r2.isSubmitting);
|
|
104
|
+
i0.ɵɵadvance();
|
|
105
|
+
i0.ɵɵproperty("ngIf", ctx_r2.isSubmitting);
|
|
106
|
+
} }
|
|
107
|
+
function AgentResponseFormComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
108
|
+
i0.ɵɵelementStart(0, "div", 1);
|
|
109
|
+
i0.ɵɵtemplate(1, AgentResponseFormComponent_div_0_div_1_Template, 2, 2, "div", 2)(2, AgentResponseFormComponent_div_0_form_2_Template, 9, 9, "form", 3);
|
|
110
|
+
i0.ɵɵelementEnd();
|
|
111
|
+
} if (rf & 2) {
|
|
112
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
113
|
+
i0.ɵɵadvance();
|
|
114
|
+
i0.ɵɵproperty("ngIf", ctx_r2.isSimpleChoice);
|
|
115
|
+
i0.ɵɵadvance();
|
|
116
|
+
i0.ɵɵproperty("ngIf", !ctx_r2.isSimpleChoice);
|
|
117
|
+
} }
|
|
118
|
+
/**
|
|
119
|
+
* Component for displaying agent response forms with dynamic questions
|
|
120
|
+
* Handles both simple button choices and complex multi-question forms
|
|
121
|
+
*/
|
|
122
|
+
export class AgentResponseFormComponent {
|
|
123
|
+
cdr;
|
|
124
|
+
responseForm;
|
|
125
|
+
disabled = false;
|
|
126
|
+
isLastMessage = false;
|
|
127
|
+
isConversationOwner = false;
|
|
128
|
+
formSubmitted = new EventEmitter();
|
|
129
|
+
formGroup;
|
|
130
|
+
isSubmitting = false;
|
|
131
|
+
constructor(cdr) {
|
|
132
|
+
this.cdr = cdr;
|
|
133
|
+
}
|
|
134
|
+
ngOnInit() {
|
|
135
|
+
console.log('AgentResponseForm ngOnInit:', {
|
|
136
|
+
hasResponseForm: !!this.responseForm,
|
|
137
|
+
responseForm: this.responseForm,
|
|
138
|
+
disabled: this.disabled,
|
|
139
|
+
isLastMessage: this.isLastMessage,
|
|
140
|
+
isConversationOwner: this.isConversationOwner,
|
|
141
|
+
isVisible: this.isVisible,
|
|
142
|
+
isSimpleChoice: this.isSimpleChoice
|
|
143
|
+
});
|
|
144
|
+
this.buildFormGroup();
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Check if this is a simple choice (single question with buttongroup/radio, no title)
|
|
148
|
+
* Simple choices render as buttons only, complex forms render as full forms
|
|
149
|
+
*/
|
|
150
|
+
get isSimpleChoice() {
|
|
151
|
+
if (!this.responseForm)
|
|
152
|
+
return false;
|
|
153
|
+
return (this.responseForm.questions.length === 1 &&
|
|
154
|
+
!this.responseForm.title &&
|
|
155
|
+
this.isChoiceQuestion(this.responseForm.questions[0]));
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Check if component should be visible
|
|
159
|
+
*/
|
|
160
|
+
get isVisible() {
|
|
161
|
+
return (this.isLastMessage &&
|
|
162
|
+
this.isConversationOwner &&
|
|
163
|
+
this.responseForm &&
|
|
164
|
+
this.responseForm.questions.length > 0);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Get submit button label
|
|
168
|
+
*/
|
|
169
|
+
get submitLabel() {
|
|
170
|
+
return this.responseForm.submitLabel || 'Submit';
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Check if a question is a choice-based question
|
|
174
|
+
*/
|
|
175
|
+
isChoiceQuestion(question) {
|
|
176
|
+
const type = typeof question.type === 'string' ? question.type : question.type.type;
|
|
177
|
+
return ['buttongroup', 'radio'].includes(type);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Build the reactive form group from the response form definition
|
|
181
|
+
*/
|
|
182
|
+
buildFormGroup() {
|
|
183
|
+
const controls = {};
|
|
184
|
+
for (const question of this.responseForm.questions) {
|
|
185
|
+
const validators = [];
|
|
186
|
+
if (question.required) {
|
|
187
|
+
validators.push(Validators.required);
|
|
188
|
+
}
|
|
189
|
+
// Add email validator for email questions
|
|
190
|
+
const questionType = typeof question.type === 'string' ? question.type : question.type.type;
|
|
191
|
+
if (questionType === 'email') {
|
|
192
|
+
validators.push(Validators.email);
|
|
193
|
+
}
|
|
194
|
+
// Add min/max validators for number/currency questions
|
|
195
|
+
if (['number', 'currency'].includes(questionType) && typeof question.type === 'object') {
|
|
196
|
+
if ('min' in question.type && question.type.min != null) {
|
|
197
|
+
validators.push(Validators.min(question.type.min));
|
|
198
|
+
}
|
|
199
|
+
if ('max' in question.type && question.type.max != null) {
|
|
200
|
+
validators.push(Validators.max(question.type.max));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
// Initialize value based on question type
|
|
204
|
+
let initialValue = question.defaultValue;
|
|
205
|
+
if (!initialValue) {
|
|
206
|
+
// For checkbox with multiple selection, initialize as empty array
|
|
207
|
+
if (questionType === 'checkbox' && typeof question.type === 'object' && 'multiple' in question.type && question.type.multiple) {
|
|
208
|
+
initialValue = [];
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
initialValue = null;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
controls[question.id] = new FormControl(initialValue, validators);
|
|
215
|
+
}
|
|
216
|
+
this.formGroup = new FormGroup(controls);
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Get FormControl for a specific question
|
|
220
|
+
*/
|
|
221
|
+
getControl(questionId) {
|
|
222
|
+
return this.formGroup.get(questionId);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Handle simple choice button click (for single question forms)
|
|
226
|
+
*/
|
|
227
|
+
onSimpleChoiceClick(value) {
|
|
228
|
+
if (!this.disabled && !this.isSubmitting) {
|
|
229
|
+
const question = this.responseForm.questions[0];
|
|
230
|
+
this.isSubmitting = true;
|
|
231
|
+
this.formSubmitted.emit({ [question.id]: value });
|
|
232
|
+
// Reset submitting state after a short delay
|
|
233
|
+
setTimeout(() => {
|
|
234
|
+
this.isSubmitting = false;
|
|
235
|
+
this.cdr.detectChanges();
|
|
236
|
+
}, 1000);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Handle full form submission
|
|
241
|
+
*/
|
|
242
|
+
onSubmit() {
|
|
243
|
+
if (this.formGroup.invalid) {
|
|
244
|
+
// Mark all fields as touched to show validation errors
|
|
245
|
+
Object.keys(this.formGroup.controls).forEach(key => {
|
|
246
|
+
this.formGroup.controls[key].markAsTouched();
|
|
247
|
+
});
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (!this.disabled && !this.isSubmitting) {
|
|
251
|
+
this.isSubmitting = true;
|
|
252
|
+
this.formSubmitted.emit(this.formGroup.value);
|
|
253
|
+
// Reset form and submitting state
|
|
254
|
+
Promise.resolve().then(() => {
|
|
255
|
+
this.formGroup.reset();
|
|
256
|
+
this.isSubmitting = false;
|
|
257
|
+
this.cdr.detectChanges();
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Get options for a choice question (used in simple choice mode)
|
|
263
|
+
*/
|
|
264
|
+
getOptions(question) {
|
|
265
|
+
if (typeof question.type === 'object' && 'options' in question.type) {
|
|
266
|
+
return question.type.options;
|
|
267
|
+
}
|
|
268
|
+
return [];
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Check if question has an icon
|
|
272
|
+
*/
|
|
273
|
+
hasIcon(option) {
|
|
274
|
+
return option && option.icon;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Track by function for questions list
|
|
278
|
+
*/
|
|
279
|
+
trackByQuestionId(index, question) {
|
|
280
|
+
return question.id;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Track by function for options list
|
|
284
|
+
*/
|
|
285
|
+
trackByValue(index, option) {
|
|
286
|
+
return option.value;
|
|
287
|
+
}
|
|
288
|
+
static ɵfac = function AgentResponseFormComponent_Factory(t) { return new (t || AgentResponseFormComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
|
289
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AgentResponseFormComponent, selectors: [["mj-agent-response-form"]], inputs: { responseForm: "responseForm", disabled: "disabled", isLastMessage: "isLastMessage", isConversationOwner: "isConversationOwner" }, outputs: { formSubmitted: "formSubmitted" }, decls: 1, vars: 1, consts: [["class", "agent-response-form", 4, "ngIf"], [1, "agent-response-form"], ["class", "simple-choice-buttons", 4, "ngIf"], ["class", "response-form", 3, "formGroup", "ngSubmit", 4, "ngIf"], [1, "simple-choice-buttons"], ["kendoButton", "", "class", "choice-button", 3, "disabled", "click", 4, "ngFor", "ngForOf", "ngForTrackBy"], ["kendoButton", "", 1, "choice-button", 3, "click", "disabled"], ["aria-hidden", "true", 3, "class", 4, "ngIf"], ["aria-hidden", "true"], [1, "response-form", 3, "ngSubmit", "formGroup"], ["class", "form-title", 4, "ngIf"], ["class", "form-description", 4, "ngIf"], [1, "form-questions"], [3, "question", "control", "formControlName", 4, "ngFor", "ngForOf", "ngForTrackBy"], [1, "form-actions"], ["kendoButton", "", "type", "submit", 1, "submit-button", 3, "themeColor", "disabled"], [4, "ngIf"], [1, "form-title"], [1, "form-description"], [3, "question", "control", "formControlName"], ["aria-hidden", "true", 1, "fa", "fa-check"], [1, "k-icon", "k-i-loading"]], template: function AgentResponseFormComponent_Template(rf, ctx) { if (rf & 1) {
|
|
290
|
+
i0.ɵɵtemplate(0, AgentResponseFormComponent_div_0_Template, 3, 2, "div", 0);
|
|
291
|
+
} if (rf & 2) {
|
|
292
|
+
i0.ɵɵproperty("ngIf", ctx.isVisible);
|
|
293
|
+
} }, dependencies: [i1.NgForOf, i1.NgIf, i2.ɵNgNoValidate, i2.NgControlStatus, i2.NgControlStatusGroup, i2.FormGroupDirective, i2.FormControlName, i3.ButtonComponent, i4.FormQuestionComponent], styles: [".agent-response-form[_ngcontent-%COMP%] {\n margin-top: 16px;\n display: inline-block;\n max-width: min(800px, 100%);\n min-width: 400px;\n width: auto;\n}\n\n\n\n.simple-choice-buttons[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n margin-top: 12px;\n}\n\n.choice-button[_ngcontent-%COMP%] {\n padding: 8px 16px;\n font-size: 14px;\n}\n\n.choice-button[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n margin-right: 6px;\n}\n\n\n\n.response-form[_ngcontent-%COMP%] {\n background: rgba(16, 185, 129, 0.03);\n border: 2px solid rgba(16, 185, 129, 0.3);\n border-radius: 12px;\n padding: 0;\n margin-top: 12px;\n box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);\n overflow: hidden;\n}\n\n.form-title[_ngcontent-%COMP%] {\n margin: 0;\n padding: 12px 16px;\n font-size: 14px;\n font-weight: 600;\n color: white;\n background: linear-gradient(135deg, #10b981 0%, #059669 100%);\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.form-title[_ngcontent-%COMP%]::before {\n content: \"\\f044\";\n font-family: \"Font Awesome 6 Free\";\n font-weight: 900;\n font-size: 13px;\n opacity: 0.95;\n}\n\n.form-description[_ngcontent-%COMP%] {\n margin: 0;\n padding: 12px 16px;\n font-size: 13px;\n color: #059669;\n background: rgba(16, 185, 129, 0.08);\n border-bottom: 1px solid rgba(16, 185, 129, 0.15);\n font-style: italic;\n}\n\n.form-questions[_ngcontent-%COMP%] {\n padding: 16px;\n background: white;\n}\n\n.form-actions[_ngcontent-%COMP%] {\n display: flex;\n justify-content: flex-end;\n padding: 12px 16px;\n background: rgba(16, 185, 129, 0.05);\n border-top: 1px solid rgba(16, 185, 129, 0.15);\n}\n\n.submit-button[_ngcontent-%COMP%] {\n min-width: 120px;\n}\n\n.submit-button[_ngcontent-%COMP%] i.fa[_ngcontent-%COMP%] {\n margin-right: 6px;\n}\n\n.submit-button[_ngcontent-%COMP%] .k-icon[_ngcontent-%COMP%] {\n margin-right: 6px;\n animation: _ngcontent-%COMP%_spin 1s linear infinite;\n}\n\n@keyframes _ngcontent-%COMP%_spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n\n\n@media (max-width: 600px) {\n .agent-response-form[_ngcontent-%COMP%] {\n min-width: 300px;\n }\n\n .form-questions[_ngcontent-%COMP%] {\n padding: 12px;\n }\n\n .simple-choice-buttons[_ngcontent-%COMP%] {\n flex-direction: column;\n }\n\n .choice-button[_ngcontent-%COMP%] {\n width: 100%;\n }\n}\n\n@media (max-width: 400px) {\n .agent-response-form[_ngcontent-%COMP%] {\n min-width: 100%;\n }\n\n .form-title[_ngcontent-%COMP%] {\n font-size: 13px;\n padding: 10px 12px;\n }\n\n .form-description[_ngcontent-%COMP%] {\n font-size: 12px;\n padding: 10px 12px;\n }\n}"] });
|
|
294
|
+
}
|
|
295
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AgentResponseFormComponent, [{
|
|
296
|
+
type: Component,
|
|
297
|
+
args: [{ selector: 'mj-agent-response-form', template: "<div *ngIf=\"isVisible\" class=\"agent-response-form\">\n <!-- Simple Choice Mode (single question, no title, buttongroup/radio) -->\n <div *ngIf=\"isSimpleChoice\" class=\"simple-choice-buttons\">\n <button\n *ngFor=\"let option of getOptions(responseForm.questions[0]); trackBy: trackByValue\"\n kendoButton\n [disabled]=\"disabled || isSubmitting\"\n (click)=\"onSimpleChoiceClick(option.value)\"\n class=\"choice-button\"\n >\n <i *ngIf=\"hasIcon(option)\" class=\"fa {{ option.icon }}\" aria-hidden=\"true\"></i>\n {{ option.label }}\n </button>\n </div>\n\n <!-- Full Form Mode (complex forms) -->\n <form *ngIf=\"!isSimpleChoice\" [formGroup]=\"formGroup\" (ngSubmit)=\"onSubmit()\" class=\"response-form\">\n <!-- Form Title -->\n <h3 *ngIf=\"responseForm.title\" class=\"form-title\">{{ responseForm.title }}</h3>\n\n <!-- Form Description -->\n <p *ngIf=\"responseForm.description\" class=\"form-description\">{{ responseForm.description }}</p>\n\n <!-- Questions -->\n <div class=\"form-questions\">\n <mj-form-question\n *ngFor=\"let question of responseForm.questions; trackBy: trackByQuestionId\"\n [question]=\"question\"\n [control]=\"getControl(question.id)\"\n [formControlName]=\"question.id\"\n ></mj-form-question>\n </div>\n\n <!-- Submit Button -->\n <div class=\"form-actions\">\n <button\n kendoButton\n type=\"submit\"\n [themeColor]=\"'primary'\"\n [disabled]=\"disabled || isSubmitting || formGroup.invalid\"\n class=\"submit-button\"\n >\n <span *ngIf=\"!isSubmitting\">\n <i class=\"fa fa-check\" aria-hidden=\"true\"></i>\n {{ submitLabel }}\n </span>\n <span *ngIf=\"isSubmitting\">\n <span class=\"k-icon k-i-loading\"></span>\n Submitting...\n </span>\n </button>\n </div>\n </form>\n</div>\n", styles: [".agent-response-form {\n margin-top: 16px;\n display: inline-block;\n max-width: min(800px, 100%);\n min-width: 400px;\n width: auto;\n}\n\n/* Simple Choice Mode */\n.simple-choice-buttons {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n margin-top: 12px;\n}\n\n.choice-button {\n padding: 8px 16px;\n font-size: 14px;\n}\n\n.choice-button i {\n margin-right: 6px;\n}\n\n/* Full Form Mode - Styled to match response cards but clearly active */\n.response-form {\n background: rgba(16, 185, 129, 0.03);\n border: 2px solid rgba(16, 185, 129, 0.3);\n border-radius: 12px;\n padding: 0;\n margin-top: 12px;\n box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);\n overflow: hidden;\n}\n\n.form-title {\n margin: 0;\n padding: 12px 16px;\n font-size: 14px;\n font-weight: 600;\n color: white;\n background: linear-gradient(135deg, #10b981 0%, #059669 100%);\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.form-title::before {\n content: \"\\f044\";\n font-family: \"Font Awesome 6 Free\";\n font-weight: 900;\n font-size: 13px;\n opacity: 0.95;\n}\n\n.form-description {\n margin: 0;\n padding: 12px 16px;\n font-size: 13px;\n color: #059669;\n background: rgba(16, 185, 129, 0.08);\n border-bottom: 1px solid rgba(16, 185, 129, 0.15);\n font-style: italic;\n}\n\n.form-questions {\n padding: 16px;\n background: white;\n}\n\n.form-actions {\n display: flex;\n justify-content: flex-end;\n padding: 12px 16px;\n background: rgba(16, 185, 129, 0.05);\n border-top: 1px solid rgba(16, 185, 129, 0.15);\n}\n\n.submit-button {\n min-width: 120px;\n}\n\n.submit-button i.fa {\n margin-right: 6px;\n}\n\n.submit-button .k-icon {\n margin-right: 6px;\n animation: spin 1s linear infinite;\n}\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n/* Responsive Design */\n@media (max-width: 600px) {\n .agent-response-form {\n min-width: 300px;\n }\n\n .form-questions {\n padding: 12px;\n }\n\n .simple-choice-buttons {\n flex-direction: column;\n }\n\n .choice-button {\n width: 100%;\n }\n}\n\n@media (max-width: 400px) {\n .agent-response-form {\n min-width: 100%;\n }\n\n .form-title {\n font-size: 13px;\n padding: 10px 12px;\n }\n\n .form-description {\n font-size: 12px;\n padding: 10px 12px;\n }\n}\n"] }]
|
|
298
|
+
}], () => [{ type: i0.ChangeDetectorRef }], { responseForm: [{
|
|
299
|
+
type: Input
|
|
300
|
+
}], disabled: [{
|
|
301
|
+
type: Input
|
|
302
|
+
}], isLastMessage: [{
|
|
303
|
+
type: Input
|
|
304
|
+
}], isConversationOwner: [{
|
|
305
|
+
type: Input
|
|
306
|
+
}], formSubmitted: [{
|
|
307
|
+
type: Output
|
|
308
|
+
}] }); })();
|
|
309
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AgentResponseFormComponent, { className: "AgentResponseFormComponent", filePath: "src/lib/components/message/agent-response-form.component.ts", lineNumber: 14 }); })();
|
|
310
|
+
//# sourceMappingURL=agent-response-form.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-response-form.component.js","sourceRoot":"","sources":["../../../../src/lib/components/message/agent-response-form.component.ts","../../../../src/lib/components/message/agent-response-form.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAA6B,MAAM,eAAe,CAAC;AAClG,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;;;;;;;ICS9D,uBAA+E;;;IAApD,oDAA4B;;;;IAPzD,iCAMC;IAFC,kOAAS,2CAAiC,KAAC;IAG3C,4FAA2E;IAC3E,YACF;IAAA,iBAAS;;;;IANP,iEAAqC;IAIjC,cAAqB;IAArB,gDAAqB;IACzB,cACF;IADE,gDACF;;;IAVF,8BAA0D;IACxD,6FAMC;IAIH,iBAAM;;;IATiB,cAA0C;IAAA,AAA1C,6EAA0C,qCAAqB;;;IAcpF,8BAAkD;IAAA,YAAwB;IAAA,iBAAK;;;IAA7B,cAAwB;IAAxB,+CAAwB;;;IAG1E,6BAA6D;IAAA,YAA8B;IAAA,iBAAI;;;IAAlC,cAA8B;IAA9B,qDAA8B;;;IAIzF,uCAKoB;;;;IADlB,AADA,AADA,sCAAqB,8CACc,mCACJ;;;IAa/B,4BAA4B;IAC1B,wBAA8C;IAC9C,YACF;IAAA,iBAAO;;;IADL,eACF;IADE,mDACF;;;IACA,4BAA2B;IACzB,2BAAwC;IACxC,+BACF;IAAA,iBAAO;;;;IAjCb,+BAAoG;IAA9C,kMAAY,iBAAU,KAAC;IAK3E,AAHA,uFAAkD,wEAGW;IAG7D,+BAA4B;IAC1B,mHAKC;IACH,iBAAM;IAIJ,AADF,+BAA0B,iBAOvB;IAKC,AAJA,2FAA4B,8EAID;IAMjC,AADE,AADE,iBAAS,EACL,EACD;;;IApCuB,4CAAuB;IAE9C,cAAwB;IAAxB,gDAAwB;IAGzB,cAA8B;IAA9B,sDAA8B;IAKT,eAA2B;IAAA,AAA3B,uDAA2B,0CAA0B;IAY1E,eAAwB;IACxB,AADA,sCAAwB,gFACkC;IAGnD,cAAmB;IAA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CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;YAC3B,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED;;OAEG;IACI,UAAU,CAAC,QAAsB;QACtC,IAAI,OAAO,QAAQ,CAAC,IAAI,KAAK,QAAQ,IAAI,SAAS,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpE,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;QAC/B,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,MAAW;QACxB,OAAO,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,KAAa,EAAE,QAAsB;QAC5D,OAAO,QAAQ,CAAC,EAAE,CAAC;IACrB,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,KAAa,EAAE,MAAW;QAC5C,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;oFA9LU,0BAA0B;6DAA1B,0BAA0B;YCbvC,2EAAmD;;YAA7C,oCAAe;;;iFDaR,0BAA0B;cALtC,SAAS;2BACE,wBAAwB;kDAKzB,YAAY;kBAApB,KAAK;YACG,QAAQ;kBAAhB,KAAK;YACG,aAAa;kBAArB,KAAK;YACG,mBAAmB;kBAA3B,KAAK;YAEI,aAAa;kBAAtB,MAAM;;kFANI,0BAA0B"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor, FormControl } from '@angular/forms';
|
|
3
|
+
import { FormQuestion, FormOption } from '@memberjunction/ai-core-plus';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Component for rendering individual form questions with various input types
|
|
7
|
+
* Implements ControlValueAccessor for seamless integration with Angular forms
|
|
8
|
+
*/
|
|
9
|
+
export declare class FormQuestionComponent implements ControlValueAccessor, OnInit {
|
|
10
|
+
question: FormQuestion;
|
|
11
|
+
control: FormControl;
|
|
12
|
+
value: any;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
private onChange;
|
|
15
|
+
private onTouched;
|
|
16
|
+
ngOnInit(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Get the question type (handles both simple string and complex types)
|
|
19
|
+
*/
|
|
20
|
+
get questionType(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Check if this is a choice-based question (buttongroup, radio, dropdown, checkbox)
|
|
23
|
+
*/
|
|
24
|
+
get isChoiceQuestion(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Get options for choice questions
|
|
27
|
+
*/
|
|
28
|
+
get options(): FormOption[];
|
|
29
|
+
/**
|
|
30
|
+
* Check if multiple selections are allowed (for checkbox type)
|
|
31
|
+
*/
|
|
32
|
+
get allowMultiple(): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Get CSS class for field width based on widthHint or intelligent defaults
|
|
35
|
+
*/
|
|
36
|
+
get widthClass(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Get placeholder text for text inputs
|
|
39
|
+
*/
|
|
40
|
+
get placeholder(): string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Get min value for number/currency inputs
|
|
43
|
+
*/
|
|
44
|
+
get min(): number | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Get max value for number/currency inputs
|
|
47
|
+
*/
|
|
48
|
+
get max(): number | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Get step value for number/currency inputs
|
|
51
|
+
*/
|
|
52
|
+
get step(): number | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Get prefix for currency inputs
|
|
55
|
+
*/
|
|
56
|
+
get prefix(): string | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Get suffix for currency inputs
|
|
59
|
+
*/
|
|
60
|
+
get suffix(): string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Handle value changes
|
|
63
|
+
*/
|
|
64
|
+
onValueChange(newValue: any): void;
|
|
65
|
+
/**
|
|
66
|
+
* Handle checkbox toggle for multiple selection
|
|
67
|
+
*/
|
|
68
|
+
toggleCheckbox(option: FormOption): void;
|
|
69
|
+
/**
|
|
70
|
+
* Check if a checkbox option is selected
|
|
71
|
+
*/
|
|
72
|
+
isChecked(option: FormOption): boolean;
|
|
73
|
+
writeValue(value: any): void;
|
|
74
|
+
registerOnChange(fn: any): void;
|
|
75
|
+
registerOnTouched(fn: any): void;
|
|
76
|
+
setDisabledState(isDisabled: boolean): void;
|
|
77
|
+
/**
|
|
78
|
+
* Debug handler for dropdown changes
|
|
79
|
+
*/
|
|
80
|
+
onDropdownChange(value: any): void;
|
|
81
|
+
/**
|
|
82
|
+
* Get slider configuration
|
|
83
|
+
*/
|
|
84
|
+
getSliderConfig(): {
|
|
85
|
+
min: number;
|
|
86
|
+
max: number;
|
|
87
|
+
step?: number;
|
|
88
|
+
suffix?: string;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Handle date range start date change
|
|
92
|
+
*/
|
|
93
|
+
onDateRangeStartChange(value: Date): void;
|
|
94
|
+
/**
|
|
95
|
+
* Handle date range end date change
|
|
96
|
+
*/
|
|
97
|
+
onDateRangeEndChange(value: Date): void;
|
|
98
|
+
/**
|
|
99
|
+
* Track by function for options list
|
|
100
|
+
*/
|
|
101
|
+
trackByValue(index: number, option: FormOption): any;
|
|
102
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormQuestionComponent, never>;
|
|
103
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormQuestionComponent, "mj-form-question", never, { "question": { "alias": "question"; "required": false; }; "control": { "alias": "control"; "required": false; }; }, {}, never, never, false, never>;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=form-question.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-question.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/message/form-question.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,MAAM,EAAE,MAAM,eAA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