@eric-emg/symphiq-components 1.2.386 → 1.2.388
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/symphiq-components.mjs +30 -71
- package/fesm2022/symphiq-components.mjs.map +1 -1
- package/index.d.ts +23 -30
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ import * as i1$1 from '@angular/common';
|
|
|
12
12
|
import { NgClass, CommonModule, isPlatformBrowser, DOCUMENT } from '@angular/common';
|
|
13
13
|
import * as i2$1 from '@angular/forms';
|
|
14
14
|
import { FormsModule, FormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
15
|
-
import { trigger, transition, style, animate,
|
|
15
|
+
import { trigger, transition, style, animate, keyframes } from '@angular/animations';
|
|
16
16
|
import { toObservable, toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
17
17
|
import { MarkdownComponent } from 'ngx-markdown';
|
|
18
18
|
import dayjs from 'dayjs';
|
|
@@ -88184,7 +88184,7 @@ function ShopProfileQuestionCardComponent_Conditional_8_For_2_Template(rf, ctx)
|
|
|
88184
88184
|
} if (rf & 2) {
|
|
88185
88185
|
const answerData_r3 = ctx.$implicit;
|
|
88186
88186
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
88187
|
-
i0.ɵɵproperty("@
|
|
88187
|
+
i0.ɵɵproperty("@answerChip", undefined)("ngClass", ctx_r0.answerChipClasses());
|
|
88188
88188
|
i0.ɵɵadvance();
|
|
88189
88189
|
i0.ɵɵproperty("ngClass", ctx_r0.answerTextClasses());
|
|
88190
88190
|
i0.ɵɵadvance();
|
|
@@ -88192,7 +88192,7 @@ function ShopProfileQuestionCardComponent_Conditional_8_For_2_Template(rf, ctx)
|
|
|
88192
88192
|
i0.ɵɵadvance();
|
|
88193
88193
|
i0.ɵɵproperty("viewMode", ctx_r0.viewMode())("user", answerData_r3.user);
|
|
88194
88194
|
i0.ɵɵadvance();
|
|
88195
|
-
i0.ɵɵproperty("@
|
|
88195
|
+
i0.ɵɵproperty("@answerChip", undefined)("ngClass", ctx_r0.answerDateClasses());
|
|
88196
88196
|
i0.ɵɵadvance();
|
|
88197
88197
|
i0.ɵɵtextInterpolate1(" Answered ", ctx_r0.formatAnswerDate(answerData_r3.answer.createdDate), " ");
|
|
88198
88198
|
} }
|
|
@@ -88202,6 +88202,7 @@ function ShopProfileQuestionCardComponent_Conditional_8_Template(rf, ctx) { if (
|
|
|
88202
88202
|
i0.ɵɵelementEnd();
|
|
88203
88203
|
} if (rf & 2) {
|
|
88204
88204
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
88205
|
+
i0.ɵɵproperty("@.disabled", !ctx_r0.animationsEnabled());
|
|
88205
88206
|
i0.ɵɵadvance();
|
|
88206
88207
|
i0.ɵɵrepeater(ctx_r0.questionAnswers());
|
|
88207
88208
|
} }
|
|
@@ -88242,36 +88243,21 @@ class ShopProfileQuestionCardComponent {
|
|
|
88242
88243
|
this.profileShopAnswers = input([], ...(ngDevMode ? [{ debugName: "profileShopAnswers" }] : []));
|
|
88243
88244
|
this.users = input([], ...(ngDevMode ? [{ debugName: "users" }] : []));
|
|
88244
88245
|
this.answerClick = output();
|
|
88245
|
-
this.
|
|
88246
|
-
this.
|
|
88247
|
-
this.questionAnswersWithState = computed(() => {
|
|
88246
|
+
this.animationsEnabled = signal(false, ...(ngDevMode ? [{ debugName: "animationsEnabled" }] : []));
|
|
88247
|
+
this.questionAnswers = computed(() => {
|
|
88248
88248
|
const questionId = this.question().id;
|
|
88249
88249
|
const answers = this.profileShopAnswers();
|
|
88250
88250
|
const allUsers = this.users();
|
|
88251
|
-
const known = this.knownAnswerIds();
|
|
88252
|
-
const initialized = this.isInitialized();
|
|
88253
|
-
console.log(`[QuestionCard ${questionId}] Computing answers:`, {
|
|
88254
|
-
answerCount: answers?.length,
|
|
88255
|
-
knownIds: Array.from(known),
|
|
88256
|
-
initialized
|
|
88257
|
-
});
|
|
88258
88251
|
if (!questionId || !answers)
|
|
88259
88252
|
return [];
|
|
88260
88253
|
const result = answers
|
|
88261
88254
|
.filter(a => a.profileQuestionId === questionId)
|
|
88262
|
-
.map(answer => {
|
|
88263
|
-
|
|
88264
|
-
|
|
88265
|
-
|
|
88266
|
-
|
|
88267
|
-
user: allUsers.find(u => u.id === answer.creatorUserId),
|
|
88268
|
-
animState: isNew ? 'new' : 'existing'
|
|
88269
|
-
};
|
|
88270
|
-
});
|
|
88255
|
+
.map(answer => ({
|
|
88256
|
+
answer,
|
|
88257
|
+
user: allUsers.find(u => u.id === answer.creatorUserId)
|
|
88258
|
+
}));
|
|
88259
|
+
console.log(`[QuestionCard ${questionId}] Answers:`, result.map(r => r.answer.id));
|
|
88271
88260
|
return result;
|
|
88272
|
-
}, ...(ngDevMode ? [{ debugName: "questionAnswersWithState" }] : []));
|
|
88273
|
-
this.questionAnswers = computed(() => {
|
|
88274
|
-
return this.questionAnswersWithState();
|
|
88275
88261
|
}, ...(ngDevMode ? [{ debugName: "questionAnswers" }] : []));
|
|
88276
88262
|
this.isAnswered = computed(() => {
|
|
88277
88263
|
return this.questionAnswers().length > 0;
|
|
@@ -88283,34 +88269,13 @@ class ShopProfileQuestionCardComponent {
|
|
|
88283
88269
|
const q = this.question();
|
|
88284
88270
|
return q.focusAreaDomains || [];
|
|
88285
88271
|
}, ...(ngDevMode ? [{ debugName: "relatedFocusAreas" }] : []));
|
|
88286
|
-
|
|
88287
|
-
|
|
88288
|
-
|
|
88289
|
-
|
|
88290
|
-
|
|
88291
|
-
|
|
88292
|
-
|
|
88293
|
-
currentIds: Array.from(currentIds),
|
|
88294
|
-
knownIds: Array.from(known),
|
|
88295
|
-
initialized
|
|
88296
|
-
});
|
|
88297
|
-
if (!initialized) {
|
|
88298
|
-
console.log(`[QuestionCard ${questionId}] First run - marking all ${currentIds.size} as known`);
|
|
88299
|
-
this.knownAnswerIds.set(new Set(currentIds));
|
|
88300
|
-
setTimeout(() => {
|
|
88301
|
-
console.log(`[QuestionCard ${questionId}] Setting initialized=true`);
|
|
88302
|
-
this.isInitialized.set(true);
|
|
88303
|
-
}, 50);
|
|
88304
|
-
}
|
|
88305
|
-
else {
|
|
88306
|
-
const newKnown = new Set(known);
|
|
88307
|
-
currentIds.forEach(id => newKnown.add(id));
|
|
88308
|
-
if (newKnown.size !== known.size) {
|
|
88309
|
-
console.log(`[QuestionCard ${questionId}] Adding new IDs to known:`, Array.from(currentIds).filter(id => !known.has(id)));
|
|
88310
|
-
}
|
|
88311
|
-
this.knownAnswerIds.set(newKnown);
|
|
88312
|
-
}
|
|
88313
|
-
});
|
|
88272
|
+
}
|
|
88273
|
+
ngOnInit() {
|
|
88274
|
+
console.log(`[QuestionCard ${this.question().id}] ngOnInit - enabling animations after delay`);
|
|
88275
|
+
setTimeout(() => {
|
|
88276
|
+
console.log(`[QuestionCard ${this.question().id}] Animations now enabled`);
|
|
88277
|
+
this.animationsEnabled.set(true);
|
|
88278
|
+
}, 100);
|
|
88314
88279
|
}
|
|
88315
88280
|
getFocusAreaTitle(focusArea) {
|
|
88316
88281
|
return FocusAreaDomainEnumUtil.title(focusArea);
|
|
@@ -88422,7 +88387,7 @@ class ShopProfileQuestionCardComponent {
|
|
|
88422
88387
|
i0.ɵɵelementEnd();
|
|
88423
88388
|
i0.ɵɵconditionalCreate(6, ShopProfileQuestionCardComponent_Conditional_6_Template, 2, 2, "p", 5);
|
|
88424
88389
|
i0.ɵɵconditionalCreate(7, ShopProfileQuestionCardComponent_Conditional_7_Template, 7, 2, "div", 6);
|
|
88425
|
-
i0.ɵɵconditionalCreate(8, ShopProfileQuestionCardComponent_Conditional_8_Template, 3,
|
|
88390
|
+
i0.ɵɵconditionalCreate(8, ShopProfileQuestionCardComponent_Conditional_8_Template, 3, 1, "div", 7)(9, ShopProfileQuestionCardComponent_Conditional_9_Template, 11, 6, "div", 8);
|
|
88426
88391
|
i0.ɵɵelementStart(10, "div", 9)(11, "button", 10);
|
|
88427
88392
|
i0.ɵɵlistener("click", function ShopProfileQuestionCardComponent_Template_button_click_11_listener() { return ctx.onAnswerClick(); });
|
|
88428
88393
|
i0.ɵɵelementStart(12, "span");
|
|
@@ -88451,18 +88416,15 @@ class ShopProfileQuestionCardComponent {
|
|
|
88451
88416
|
i0.ɵɵadvance(2);
|
|
88452
88417
|
i0.ɵɵtextInterpolate(ctx.isAnswered() ? "Edit Answer" : "Answer");
|
|
88453
88418
|
} }, dependencies: [CommonModule, i1$1.NgClass, UserAvatarComponent], encapsulation: 2, data: { animation: [
|
|
88454
|
-
trigger('
|
|
88455
|
-
|
|
88456
|
-
state('new', style({ opacity: 1, transform: 'scale(1)' })),
|
|
88457
|
-
transition('void => new', [
|
|
88419
|
+
trigger('answerChip', [
|
|
88420
|
+
transition(':enter', [
|
|
88458
88421
|
animate('500ms ease-out', keyframes([
|
|
88459
88422
|
style({ opacity: 0, transform: 'scale(0.8)', boxShadow: '0 0 0 0 rgba(59, 130, 246, 0)', offset: 0 }),
|
|
88460
88423
|
style({ opacity: 1, transform: 'scale(1.05)', boxShadow: '0 0 20px 4px rgba(59, 130, 246, 0.5)', offset: 0.5 }),
|
|
88461
88424
|
style({ opacity: 1, transform: 'scale(1)', boxShadow: '0 0 0 0 rgba(59, 130, 246, 0)', offset: 1 })
|
|
88462
88425
|
]))
|
|
88463
88426
|
]),
|
|
88464
|
-
transition('
|
|
88465
|
-
transition('* => void', [
|
|
88427
|
+
transition(':leave', [
|
|
88466
88428
|
animate('300ms ease-in', style({ opacity: 0, transform: 'scale(0.8)' }))
|
|
88467
88429
|
])
|
|
88468
88430
|
])
|
|
@@ -88476,18 +88438,15 @@ class ShopProfileQuestionCardComponent {
|
|
|
88476
88438
|
imports: [CommonModule, UserAvatarComponent],
|
|
88477
88439
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
88478
88440
|
animations: [
|
|
88479
|
-
trigger('
|
|
88480
|
-
|
|
88481
|
-
state('new', style({ opacity: 1, transform: 'scale(1)' })),
|
|
88482
|
-
transition('void => new', [
|
|
88441
|
+
trigger('answerChip', [
|
|
88442
|
+
transition(':enter', [
|
|
88483
88443
|
animate('500ms ease-out', keyframes([
|
|
88484
88444
|
style({ opacity: 0, transform: 'scale(0.8)', boxShadow: '0 0 0 0 rgba(59, 130, 246, 0)', offset: 0 }),
|
|
88485
88445
|
style({ opacity: 1, transform: 'scale(1.05)', boxShadow: '0 0 20px 4px rgba(59, 130, 246, 0.5)', offset: 0.5 }),
|
|
88486
88446
|
style({ opacity: 1, transform: 'scale(1)', boxShadow: '0 0 0 0 rgba(59, 130, 246, 0)', offset: 1 })
|
|
88487
88447
|
]))
|
|
88488
88448
|
]),
|
|
88489
|
-
transition('
|
|
88490
|
-
transition('* => void', [
|
|
88449
|
+
transition(':leave', [
|
|
88491
88450
|
animate('300ms ease-in', style({ opacity: 0, transform: 'scale(0.8)' }))
|
|
88492
88451
|
])
|
|
88493
88452
|
])
|
|
@@ -88538,9 +88497,9 @@ class ShopProfileQuestionCardComponent {
|
|
|
88538
88497
|
<!-- Answer Section -->
|
|
88539
88498
|
@if (questionAnswers().length > 0) {
|
|
88540
88499
|
<!-- Answered State - Show answer chips -->
|
|
88541
|
-
<div class="flex flex-wrap gap-3">
|
|
88500
|
+
<div class="flex flex-wrap gap-3" [@.disabled]="!animationsEnabled()">
|
|
88542
88501
|
@for (answerData of questionAnswers(); track answerData.answer.id) {
|
|
88543
|
-
<div
|
|
88502
|
+
<div @answerChip [ngClass]="answerChipClasses()" class="flex items-center gap-2 px-4 py-2.5 rounded-full">
|
|
88544
88503
|
<span [ngClass]="answerTextClasses()" class="text-sm font-medium">
|
|
88545
88504
|
{{ answerData.answer.answer }}
|
|
88546
88505
|
</span>
|
|
@@ -88550,7 +88509,7 @@ class ShopProfileQuestionCardComponent {
|
|
|
88550
88509
|
size="small"
|
|
88551
88510
|
/>
|
|
88552
88511
|
</div>
|
|
88553
|
-
<div
|
|
88512
|
+
<div @answerChip [ngClass]="answerDateClasses()" class="self-center text-xs -ml-1">
|
|
88554
88513
|
Answered {{ formatAnswerDate(answerData.answer.createdDate) }}
|
|
88555
88514
|
</div>
|
|
88556
88515
|
}
|
|
@@ -88594,8 +88553,8 @@ class ShopProfileQuestionCardComponent {
|
|
|
88594
88553
|
</div>
|
|
88595
88554
|
`
|
|
88596
88555
|
}]
|
|
88597
|
-
}],
|
|
88598
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ShopProfileQuestionCardComponent, { className: "ShopProfileQuestionCardComponent", filePath: "lib/components/profile-analysis-dashboard/cards/shop-profile-question-card.component.ts", lineNumber:
|
|
88556
|
+
}], null, { question: [{ type: i0.Input, args: [{ isSignal: true, alias: "question", required: true }] }], viewMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewMode", required: false }] }], viewType: [{ type: i0.Input, args: [{ isSignal: true, alias: "viewType", required: false }] }], profileShopAnswers: [{ type: i0.Input, args: [{ isSignal: true, alias: "profileShopAnswers", required: false }] }], users: [{ type: i0.Input, args: [{ isSignal: true, alias: "users", required: false }] }], answerClick: [{ type: i0.Output, args: ["answerClick"] }] }); })();
|
|
88557
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ShopProfileQuestionCardComponent, { className: "ShopProfileQuestionCardComponent", filePath: "lib/components/profile-analysis-dashboard/cards/shop-profile-question-card.component.ts", lineNumber: 136 }); })();
|
|
88599
88558
|
|
|
88600
88559
|
const _c0$5 = ["scrollContainer"];
|
|
88601
88560
|
const _c1$2 = ["stickySentinel"];
|