@eric-emg/symphiq-components 1.2.384 → 1.2.385
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 +43 -11
- package/fesm2022/symphiq-components.mjs.map +1 -1
- package/index.d.ts +24 -20
- 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, keyframes } from '@angular/animations';
|
|
15
|
+
import { trigger, transition, style, animate, state, 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("@answerAnimation",
|
|
88187
|
+
i0.ɵɵproperty("@answerAnimation", ctx_r0.getAnimationState(answerData_r3.answer.id))("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("@answerAnimation",
|
|
88195
|
+
i0.ɵɵproperty("@answerAnimation", ctx_r0.getAnimationState(answerData_r3.answer.id))("ngClass", ctx_r0.answerDateClasses());
|
|
88196
88196
|
i0.ɵɵadvance();
|
|
88197
88197
|
i0.ɵɵtextInterpolate1(" Answered ", ctx_r0.formatAnswerDate(answerData_r3.answer.createdDate), " ");
|
|
88198
88198
|
} }
|
|
@@ -88242,6 +88242,8 @@ class ShopProfileQuestionCardComponent {
|
|
|
88242
88242
|
this.profileShopAnswers = input([], ...(ngDevMode ? [{ debugName: "profileShopAnswers" }] : []));
|
|
88243
88243
|
this.users = input([], ...(ngDevMode ? [{ debugName: "users" }] : []));
|
|
88244
88244
|
this.answerClick = output();
|
|
88245
|
+
this.knownAnswerIds = signal(new Set(), ...(ngDevMode ? [{ debugName: "knownAnswerIds" }] : []));
|
|
88246
|
+
this.newAnswerIds = signal(new Set(), ...(ngDevMode ? [{ debugName: "newAnswerIds" }] : []));
|
|
88245
88247
|
this.questionAnswers = computed(() => {
|
|
88246
88248
|
const questionId = this.question().id;
|
|
88247
88249
|
const answers = this.profileShopAnswers();
|
|
@@ -88265,6 +88267,30 @@ class ShopProfileQuestionCardComponent {
|
|
|
88265
88267
|
const q = this.question();
|
|
88266
88268
|
return q.focusAreaDomains || [];
|
|
88267
88269
|
}, ...(ngDevMode ? [{ debugName: "relatedFocusAreas" }] : []));
|
|
88270
|
+
effect(() => {
|
|
88271
|
+
const currentAnswers = this.questionAnswers();
|
|
88272
|
+
const currentIds = new Set(currentAnswers.map(a => a.answer.id).filter((id) => id !== undefined));
|
|
88273
|
+
const known = untracked(() => this.knownAnswerIds());
|
|
88274
|
+
if (known.size === 0) {
|
|
88275
|
+
this.knownAnswerIds.set(currentIds);
|
|
88276
|
+
this.newAnswerIds.set(new Set());
|
|
88277
|
+
}
|
|
88278
|
+
else {
|
|
88279
|
+
const newIds = new Set();
|
|
88280
|
+
currentIds.forEach(id => {
|
|
88281
|
+
if (!known.has(id)) {
|
|
88282
|
+
newIds.add(id);
|
|
88283
|
+
}
|
|
88284
|
+
});
|
|
88285
|
+
this.newAnswerIds.set(newIds);
|
|
88286
|
+
this.knownAnswerIds.set(currentIds);
|
|
88287
|
+
}
|
|
88288
|
+
});
|
|
88289
|
+
}
|
|
88290
|
+
getAnimationState(answerId) {
|
|
88291
|
+
if (!answerId)
|
|
88292
|
+
return 'existing';
|
|
88293
|
+
return this.newAnswerIds().has(answerId) ? 'new' : 'existing';
|
|
88268
88294
|
}
|
|
88269
88295
|
getFocusAreaTitle(focusArea) {
|
|
88270
88296
|
return FocusAreaDomainEnumUtil.title(focusArea);
|
|
@@ -88406,14 +88432,17 @@ class ShopProfileQuestionCardComponent {
|
|
|
88406
88432
|
i0.ɵɵtextInterpolate(ctx.isAnswered() ? "Edit Answer" : "Answer");
|
|
88407
88433
|
} }, dependencies: [CommonModule, i1$1.NgClass, UserAvatarComponent], encapsulation: 2, data: { animation: [
|
|
88408
88434
|
trigger('answerAnimation', [
|
|
88409
|
-
|
|
88435
|
+
state('existing', style({ opacity: 1, transform: 'scale(1)' })),
|
|
88436
|
+
state('new', style({ opacity: 1, transform: 'scale(1)' })),
|
|
88437
|
+
transition('void => new', [
|
|
88410
88438
|
animate('500ms ease-out', keyframes([
|
|
88411
88439
|
style({ opacity: 0, transform: 'scale(0.8)', boxShadow: '0 0 0 0 rgba(59, 130, 246, 0)', offset: 0 }),
|
|
88412
88440
|
style({ opacity: 1, transform: 'scale(1.05)', boxShadow: '0 0 20px 4px rgba(59, 130, 246, 0.5)', offset: 0.5 }),
|
|
88413
88441
|
style({ opacity: 1, transform: 'scale(1)', boxShadow: '0 0 0 0 rgba(59, 130, 246, 0)', offset: 1 })
|
|
88414
88442
|
]))
|
|
88415
88443
|
]),
|
|
88416
|
-
transition('
|
|
88444
|
+
transition('void => existing', []),
|
|
88445
|
+
transition('* => void', [
|
|
88417
88446
|
animate('300ms ease-in', style({ opacity: 0, transform: 'scale(0.8)' }))
|
|
88418
88447
|
])
|
|
88419
88448
|
])
|
|
@@ -88428,14 +88457,17 @@ class ShopProfileQuestionCardComponent {
|
|
|
88428
88457
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
88429
88458
|
animations: [
|
|
88430
88459
|
trigger('answerAnimation', [
|
|
88431
|
-
|
|
88460
|
+
state('existing', style({ opacity: 1, transform: 'scale(1)' })),
|
|
88461
|
+
state('new', style({ opacity: 1, transform: 'scale(1)' })),
|
|
88462
|
+
transition('void => new', [
|
|
88432
88463
|
animate('500ms ease-out', keyframes([
|
|
88433
88464
|
style({ opacity: 0, transform: 'scale(0.8)', boxShadow: '0 0 0 0 rgba(59, 130, 246, 0)', offset: 0 }),
|
|
88434
88465
|
style({ opacity: 1, transform: 'scale(1.05)', boxShadow: '0 0 20px 4px rgba(59, 130, 246, 0.5)', offset: 0.5 }),
|
|
88435
88466
|
style({ opacity: 1, transform: 'scale(1)', boxShadow: '0 0 0 0 rgba(59, 130, 246, 0)', offset: 1 })
|
|
88436
88467
|
]))
|
|
88437
88468
|
]),
|
|
88438
|
-
transition('
|
|
88469
|
+
transition('void => existing', []),
|
|
88470
|
+
transition('* => void', [
|
|
88439
88471
|
animate('300ms ease-in', style({ opacity: 0, transform: 'scale(0.8)' }))
|
|
88440
88472
|
])
|
|
88441
88473
|
])
|
|
@@ -88488,7 +88520,7 @@ class ShopProfileQuestionCardComponent {
|
|
|
88488
88520
|
<!-- Answered State - Show answer chips -->
|
|
88489
88521
|
<div class="flex flex-wrap gap-3">
|
|
88490
88522
|
@for (answerData of questionAnswers(); track answerData.answer.id) {
|
|
88491
|
-
<div @answerAnimation [ngClass]="answerChipClasses()" class="flex items-center gap-2 px-4 py-2.5 rounded-full">
|
|
88523
|
+
<div [@answerAnimation]="getAnimationState(answerData.answer.id)" [ngClass]="answerChipClasses()" class="flex items-center gap-2 px-4 py-2.5 rounded-full">
|
|
88492
88524
|
<span [ngClass]="answerTextClasses()" class="text-sm font-medium">
|
|
88493
88525
|
{{ answerData.answer.answer }}
|
|
88494
88526
|
</span>
|
|
@@ -88498,7 +88530,7 @@ class ShopProfileQuestionCardComponent {
|
|
|
88498
88530
|
size="small"
|
|
88499
88531
|
/>
|
|
88500
88532
|
</div>
|
|
88501
|
-
<div @answerAnimation [ngClass]="answerDateClasses()" class="self-center text-xs -ml-1">
|
|
88533
|
+
<div [@answerAnimation]="getAnimationState(answerData.answer.id)" [ngClass]="answerDateClasses()" class="self-center text-xs -ml-1">
|
|
88502
88534
|
Answered {{ formatAnswerDate(answerData.answer.createdDate) }}
|
|
88503
88535
|
</div>
|
|
88504
88536
|
}
|
|
@@ -88542,8 +88574,8 @@ class ShopProfileQuestionCardComponent {
|
|
|
88542
88574
|
</div>
|
|
88543
88575
|
`
|
|
88544
88576
|
}]
|
|
88545
|
-
}],
|
|
88546
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ShopProfileQuestionCardComponent, { className: "ShopProfileQuestionCardComponent", filePath: "lib/components/profile-analysis-dashboard/cards/shop-profile-question-card.component.ts", lineNumber:
|
|
88577
|
+
}], () => [], { 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"] }] }); })();
|
|
88578
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ShopProfileQuestionCardComponent, { className: "ShopProfileQuestionCardComponent", filePath: "lib/components/profile-analysis-dashboard/cards/shop-profile-question-card.component.ts", lineNumber: 140 }); })();
|
|
88547
88579
|
|
|
88548
88580
|
const _c0$5 = ["scrollContainer"];
|
|
88549
88581
|
const _c1$2 = ["stickySentinel"];
|