@molecule/app-contact-display-angular 1.1.0 → 1.2.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/README.md +139 -147
- package/dist/contact-display.component.d.ts +77 -14
- package/dist/contact-display.component.d.ts.map +1 -1
- package/dist/contact-display.component.js +209 -77
- package/dist/contact-display.component.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +8 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-16T21:24:35.676Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-contact-display-angular
|
|
@@ -101,8 +101,14 @@ interface ContactDisplayProps {
|
|
|
101
101
|
layout?: 'card' | 'row' | 'compact'
|
|
102
102
|
/** Optional right-side actions, projected as `[slot=actions]` content. */
|
|
103
103
|
actions?: unknown
|
|
104
|
-
/**
|
|
105
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Activates the contact: the whole row becomes clickable through a
|
|
106
|
+
* transparent native button covering it, named by the contact name (the
|
|
107
|
+
* name span), so Enter and Space activate it natively. The row's inner
|
|
108
|
+
* controls — the mail/tel links and the `actions` slot — sit above that
|
|
109
|
+
* button and keep their own clicks.
|
|
110
|
+
*/
|
|
111
|
+
onClick?: () => void
|
|
106
112
|
/** Extra classes. */
|
|
107
113
|
className?: string
|
|
108
114
|
}
|
|
@@ -117,11 +123,15 @@ ContactDisplay component.
|
|
|
117
123
|
Formatted contact display — avatar + name + role + email/phone with leading
|
|
118
124
|
glyphs + optional address and company. Three layouts for different
|
|
119
125
|
densities. The host IS the root `<div>` (`div[mol-contact-display]`),
|
|
120
|
-
matching React's root exactly.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
matching React's root exactly. With `onClick` a transparent native button
|
|
127
|
+
covering the whole row is its first child (a click anywhere on it, Enter or
|
|
128
|
+
Space activates the contact) and is named by the contact-name span; the
|
|
129
|
+
mail/tel links and the `actions` slot sit above it and keep their own
|
|
130
|
+
clicks. The optional right-side actions are projected (`[slot=actions]`);
|
|
131
|
+
the node-valued `contact.role`, `contact.address` and `contact.company`
|
|
132
|
+
arrive as `TemplateRef`s and render through {@link ContactNodeOutlet}, or as
|
|
133
|
+
text. Same props, same DOM as `@molecule/app-contact-display-react`'s
|
|
134
|
+
`ContactDisplay`.
|
|
125
135
|
|
|
126
136
|
```typescript
|
|
127
137
|
@Component({
|
|
@@ -131,185 +141,162 @@ matching React's root exactly. The optional right-side actions are projected
|
|
|
131
141
|
inputs: ['contact', 'layout', 'onClick', 'className'],
|
|
132
142
|
host: {
|
|
133
143
|
'[class]': 'classes()',
|
|
134
|
-
'(click)': 'handleClick($event)',
|
|
135
144
|
},
|
|
136
|
-
|
|
137
|
-
|
|
145
|
+
template: `@if (hasOnClick()) {
|
|
146
|
+
<button
|
|
147
|
+
type="button"
|
|
148
|
+
[attr.aria-labelledby]="nameId"
|
|
149
|
+
data-mol-id="contact-display-open"
|
|
150
|
+
(click)="handleClick()"
|
|
151
|
+
[class]="openButtonClass()"
|
|
152
|
+
[style.background]="'transparent'"
|
|
153
|
+
[style.border]="'none'"
|
|
154
|
+
[style.padding]="'0'"
|
|
155
|
+
></button>
|
|
156
|
+
}
|
|
157
|
+
<div [class]="avatarWrapClass()">
|
|
158
|
+
<div
|
|
159
|
+
mol-avatar
|
|
160
|
+
[src]="avatarSrc()"
|
|
161
|
+
[alt]="contactName()"
|
|
162
|
+
[name]="contactName()"
|
|
163
|
+
[size]="avatarSize()"
|
|
164
|
+
></div>
|
|
165
|
+
</div>
|
|
138
166
|
<div [class]="detailWrapClass()">
|
|
139
|
-
<div [class]="nameRowClass()"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
167
|
+
<div [class]="nameRowClass()">
|
|
168
|
+
<span [attr.id]="hasOnClick() ? nameId : null" [class]="nameClass()">{{
|
|
169
|
+
contactName()
|
|
170
|
+
}}</span>
|
|
171
|
+
@if (hasRole()) {
|
|
172
|
+
<span [class]="roleClass()"
|
|
173
|
+
>{{ roleText }}<ng-container [molContactNode]="roleTemplate()"></ng-container
|
|
174
|
+
></span>
|
|
175
|
+
}
|
|
176
|
+
</div>
|
|
177
|
+
@if (hasCompany()) {
|
|
178
|
+
<div [class]="companyClass()">
|
|
179
|
+
{{ companyText }}<ng-container [molContactNode]="companyTemplate()"></ng-container>
|
|
180
|
+
</div>
|
|
181
|
+
}
|
|
182
|
+
@if (showEmail()) {
|
|
183
|
+
<div [class]="hasOnClick() ? raisedDetailRowClass() : detailRowClass()">
|
|
184
|
+
<span aria-hidden="true">✉</span
|
|
185
|
+
><a [attr.href]="'mailto:' + contactEmail()" [class]="linkClass()">{{
|
|
186
|
+
contactEmail()
|
|
187
|
+
}}</a>
|
|
188
|
+
</div>
|
|
189
|
+
}
|
|
190
|
+
@if (showPhone()) {
|
|
191
|
+
<div [class]="hasOnClick() ? raisedDetailRowClass() : detailRowClass()">
|
|
192
|
+
<span aria-hidden="true">☎</span
|
|
193
|
+
><a [attr.href]="'tel:' + contactPhone()" [class]="linkClass()">{{ contactPhone() }}</a>
|
|
194
|
+
</div>
|
|
195
|
+
}
|
|
196
|
+
@if (showAddress()) {
|
|
197
|
+
<div [class]="detailRowClass()">
|
|
198
|
+
<span aria-hidden="true">⌂</span
|
|
199
|
+
><span
|
|
200
|
+
>{{ addressText }}<ng-container [molContactNode]="addressTemplate()"></ng-container
|
|
201
|
+
></span>
|
|
202
|
+
</div>
|
|
203
|
+
}
|
|
204
|
+
</div>
|
|
205
|
+
<div #actionsWrap [class]="actionsWrapClass()">
|
|
206
|
+
<ng-content select="[slot=actions]"></ng-content>
|
|
207
|
+
</div>`,
|
|
145
208
|
})
|
|
146
|
-
export class ContactDisplay {
|
|
147
|
-
/** The contact to display. */
|
|
209
|
+
export class ContactDisplay implements AfterViewChecked {
|
|
148
210
|
contact?: ContactFields
|
|
149
|
-
/** Layout preset. Defaults to `'card'` at read time. */
|
|
150
211
|
layout?: 'card' | 'row' | 'compact'
|
|
151
|
-
|
|
152
|
-
onClick?: (event: MouseEvent) => void
|
|
153
|
-
/** Extra classes on the outer wrapper. */
|
|
212
|
+
onClick?: () => void
|
|
154
213
|
className?: string
|
|
155
214
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
215
|
+
@ViewChild('actionsWrap') private actionsWrapRef?: ElementRef<HTMLDivElement>
|
|
216
|
+
|
|
217
|
+
private readonly host = inject(ElementRef)
|
|
218
|
+
private readonly renderer = inject(Renderer2)
|
|
219
|
+
private readonly slotSync = new SlotWrapper(this.host, this.renderer)
|
|
220
|
+
private readonly bareActions: Node[] = []
|
|
221
|
+
|
|
222
|
+
readonly nameId = `contact-display-name-${nextNameId++}`
|
|
223
|
+
|
|
160
224
|
cm(): UIClassMap {
|
|
161
225
|
return getClassMap()
|
|
162
226
|
}
|
|
163
227
|
|
|
164
|
-
/**
|
|
165
|
-
* The active layout (React's `layout = 'card'` default).
|
|
166
|
-
* @returns The layout.
|
|
167
|
-
*/
|
|
168
228
|
activeLayout(): 'card' | 'row' | 'compact' {
|
|
169
229
|
return this.layout ?? 'card'
|
|
170
230
|
}
|
|
171
231
|
|
|
172
|
-
/**
|
|
173
|
-
* Whether the compact layout hides the contact details.
|
|
174
|
-
* @returns True for `layout: 'compact'`.
|
|
175
|
-
*/
|
|
176
232
|
isCompact(): boolean {
|
|
177
233
|
return this.activeLayout() === 'compact'
|
|
178
234
|
}
|
|
179
235
|
|
|
180
|
-
/**
|
|
181
|
-
* The contact's display name.
|
|
182
|
-
* @returns The name, or the empty string.
|
|
183
|
-
*/
|
|
184
236
|
contactName(): string {
|
|
185
237
|
return fieldText(this.contact?.name)
|
|
186
238
|
}
|
|
187
239
|
|
|
188
|
-
/**
|
|
189
|
-
* The contact's email address.
|
|
190
|
-
* @returns The email, or the empty string.
|
|
191
|
-
*/
|
|
192
240
|
contactEmail(): string {
|
|
193
241
|
return fieldText(this.contact?.email)
|
|
194
242
|
}
|
|
195
243
|
|
|
196
|
-
/**
|
|
197
|
-
* The contact's phone number.
|
|
198
|
-
* @returns The phone, or the empty string.
|
|
199
|
-
*/
|
|
200
244
|
contactPhone(): string {
|
|
201
245
|
return fieldText(this.contact?.phone)
|
|
202
246
|
}
|
|
203
247
|
|
|
204
|
-
/**
|
|
205
|
-
* The avatar image URL, when the contact has one.
|
|
206
|
-
* @returns The URL, or undefined.
|
|
207
|
-
*/
|
|
208
248
|
avatarSrc(): string | undefined {
|
|
209
249
|
return this.contact?.avatarSrc
|
|
210
250
|
}
|
|
211
251
|
|
|
212
|
-
/**
|
|
213
|
-
* The avatar size preset for the layout.
|
|
214
|
-
* @returns `'sm'` in the compact layout, else `'md'`.
|
|
215
|
-
*/
|
|
216
252
|
avatarSize(): 'sm' | 'md' {
|
|
217
253
|
return this.isCompact() ? 'sm' : 'md'
|
|
218
254
|
}
|
|
219
255
|
|
|
220
|
-
/**
|
|
221
|
-
* Whether the role renders (React's `role && …` truthiness).
|
|
222
|
-
* @returns True for a node or non-empty text.
|
|
223
|
-
*/
|
|
224
256
|
hasRole(): boolean {
|
|
225
257
|
return Boolean(this.contact?.role)
|
|
226
258
|
}
|
|
227
259
|
|
|
228
|
-
/**
|
|
229
|
-
* Whether the company renders.
|
|
230
|
-
* @returns True for a node or non-empty text.
|
|
231
|
-
*/
|
|
232
260
|
hasCompany(): boolean {
|
|
233
261
|
return Boolean(this.contact?.company)
|
|
234
262
|
}
|
|
235
263
|
|
|
236
|
-
/**
|
|
237
|
-
* Whether the email line renders (React's `!isCompact && email`).
|
|
238
|
-
* @returns True when the email shows.
|
|
239
|
-
*/
|
|
240
264
|
showEmail(): boolean {
|
|
241
265
|
return !this.isCompact() && Boolean(this.contactEmail())
|
|
242
266
|
}
|
|
243
267
|
|
|
244
|
-
/**
|
|
245
|
-
* Whether the phone line renders.
|
|
246
|
-
* @returns True when the phone shows.
|
|
247
|
-
*/
|
|
248
268
|
showPhone(): boolean {
|
|
249
269
|
return !this.isCompact() && Boolean(this.contactPhone())
|
|
250
270
|
}
|
|
251
271
|
|
|
252
|
-
/**
|
|
253
|
-
* Whether the address line renders.
|
|
254
|
-
* @returns True when the address shows.
|
|
255
|
-
*/
|
|
256
272
|
showAddress(): boolean {
|
|
257
273
|
return !this.isCompact() && Boolean(this.contact?.address)
|
|
258
274
|
}
|
|
259
275
|
|
|
260
|
-
/**
|
|
261
|
-
* The role as a template, when the caller passed a node.
|
|
262
|
-
* @returns The template, or null for text or an absent role.
|
|
263
|
-
*/
|
|
264
276
|
roleTemplate(): TemplateRef<unknown> | null {
|
|
265
277
|
return asTemplate(this.contact?.role)
|
|
266
278
|
}
|
|
267
279
|
|
|
268
|
-
/**
|
|
269
|
-
* The role's text (React renders a string role as text).
|
|
270
|
-
* @returns The text, or the empty string for a node or an absent role.
|
|
271
|
-
*/
|
|
272
280
|
get roleText(): string {
|
|
273
281
|
return fieldText(this.contact?.role)
|
|
274
282
|
}
|
|
275
283
|
|
|
276
|
-
/**
|
|
277
|
-
* The company as a template, when the caller passed a node.
|
|
278
|
-
* @returns The template, or null for text or an absent company.
|
|
279
|
-
*/
|
|
280
284
|
companyTemplate(): TemplateRef<unknown> | null {
|
|
281
285
|
return asTemplate(this.contact?.company)
|
|
282
286
|
}
|
|
283
287
|
|
|
284
|
-
/**
|
|
285
|
-
* The company's text.
|
|
286
|
-
* @returns The text, or the empty string for a node or an absent company.
|
|
287
|
-
*/
|
|
288
288
|
get companyText(): string {
|
|
289
289
|
return fieldText(this.contact?.company)
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
/**
|
|
293
|
-
* The address as a template, when the caller passed a node.
|
|
294
|
-
* @returns The template, or null for text or an absent address.
|
|
295
|
-
*/
|
|
296
292
|
addressTemplate(): TemplateRef<unknown> | null {
|
|
297
293
|
return asTemplate(this.contact?.address)
|
|
298
294
|
}
|
|
299
295
|
|
|
300
|
-
/**
|
|
301
|
-
* The address's text.
|
|
302
|
-
* @returns The text, or the empty string for a node or an absent address.
|
|
303
|
-
*/
|
|
304
296
|
get addressText(): string {
|
|
305
297
|
return fieldText(this.contact?.address)
|
|
306
298
|
}
|
|
307
299
|
|
|
308
|
-
/**
|
|
309
|
-
* Computes the root class list (`cm.flex(…)` + `cm.cursorPointer` only when
|
|
310
|
-
* clickable + `className`).
|
|
311
|
-
* @returns The class string.
|
|
312
|
-
*/
|
|
313
300
|
classes(): string {
|
|
314
301
|
return this.cm().cn(
|
|
315
302
|
this.cm().flex({
|
|
@@ -317,39 +304,27 @@ export class ContactDisplay {
|
|
|
317
304
|
gap: this.isCompact() ? 'sm' : 'md',
|
|
318
305
|
direction: this.activeLayout() === 'card' ? 'col' : 'row',
|
|
319
306
|
}),
|
|
320
|
-
this.
|
|
307
|
+
this.hasOnClick() ? this.cm().position('relative') : undefined,
|
|
321
308
|
this.className,
|
|
322
309
|
)
|
|
323
310
|
}
|
|
324
311
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
312
|
+
hasOnClick(): boolean {
|
|
313
|
+
return Boolean(this.onClick)
|
|
314
|
+
}
|
|
315
|
+
|
|
329
316
|
avatarWrapClass(): string {
|
|
330
317
|
return this.cm().cn(this.cm().shrink0)
|
|
331
318
|
}
|
|
332
319
|
|
|
333
|
-
/**
|
|
334
|
-
* The avatar column's class (`cm.flex1` + `cm.stack(1)`).
|
|
335
|
-
* @returns The class string.
|
|
336
|
-
*/
|
|
337
320
|
detailWrapClass(): string {
|
|
338
321
|
return this.cm().cn(this.cm().flex1, this.cm().stack(1))
|
|
339
322
|
}
|
|
340
323
|
|
|
341
|
-
/**
|
|
342
|
-
* The name line's class (`cm.flex({ align: 'baseline', gap: 'sm' })`).
|
|
343
|
-
* @returns The class string.
|
|
344
|
-
*/
|
|
345
324
|
nameRowClass(): string {
|
|
346
325
|
return this.cm().flex({ align: 'baseline', gap: 'sm' })
|
|
347
326
|
}
|
|
348
327
|
|
|
349
|
-
/**
|
|
350
|
-
* The name span's class (size by layout + semibold).
|
|
351
|
-
* @returns The class string.
|
|
352
|
-
*/
|
|
353
328
|
nameClass(): string {
|
|
354
329
|
return this.cm().cn(
|
|
355
330
|
this.cm().textSize(this.isCompact() ? 'sm' : 'base'),
|
|
@@ -357,49 +332,65 @@ export class ContactDisplay {
|
|
|
357
332
|
)
|
|
358
333
|
}
|
|
359
334
|
|
|
360
|
-
/**
|
|
361
|
-
* The role span's class (`cm.textSize('xs')`).
|
|
362
|
-
* @returns The class string.
|
|
363
|
-
*/
|
|
364
335
|
roleClass(): string {
|
|
365
336
|
return this.cm().textSize('xs')
|
|
366
337
|
}
|
|
367
338
|
|
|
368
|
-
/**
|
|
369
|
-
* The company line's class (`cm.textSize('sm')`).
|
|
370
|
-
* @returns The class string.
|
|
371
|
-
*/
|
|
372
339
|
companyClass(): string {
|
|
373
340
|
return this.cm().textSize('sm')
|
|
374
341
|
}
|
|
375
342
|
|
|
376
|
-
/**
|
|
377
|
-
* One detail line's class (`cm.flex({ align: 'center', gap: 'xs' })` +
|
|
378
|
-
* `cm.textSize('sm')`).
|
|
379
|
-
* @returns The class string.
|
|
380
|
-
*/
|
|
381
343
|
detailRowClass(): string {
|
|
382
344
|
return this.cm().cn(this.cm().flex({ align: 'center', gap: 'xs' }), this.cm().textSize('sm'))
|
|
383
345
|
}
|
|
384
346
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
347
|
+
raisedDetailRowClass(): string {
|
|
348
|
+
return this.cm().cn(this.detailRowClass(), this.cm().position('relative'))
|
|
349
|
+
}
|
|
350
|
+
|
|
389
351
|
linkClass(): string {
|
|
390
352
|
return this.cm().cn(this.cm().link)
|
|
391
353
|
}
|
|
392
354
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
this.
|
|
355
|
+
openButtonClass(): string {
|
|
356
|
+
return this.cm().cn(this.cm().position('absolute'), this.cm().inset0, this.cm().cursorPointer)
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
actionsWrapClass(): string {
|
|
360
|
+
return this.hasOnClick() ? this.cm().position('relative') : ''
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
ngAfterViewChecked(): void {
|
|
364
|
+
this.syncActionsSlot()
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
private syncActionsSlot(): void {
|
|
368
|
+
const wrapper = this.actionsWrapRef?.nativeElement
|
|
369
|
+
if (!wrapper) return
|
|
370
|
+
if (this.hasOnClick() && hasNodes(wrapper)) {
|
|
371
|
+
if (wrapper.isConnected) return
|
|
372
|
+
this.slotSync.sync(wrapper, true)
|
|
373
|
+
for (const node of this.bareActions.splice(0)) wrapper.appendChild(node)
|
|
374
|
+
return
|
|
375
|
+
}
|
|
376
|
+
if (!wrapper.isConnected) return
|
|
377
|
+
const parent = wrapper.parentElement ?? this.host.nativeElement
|
|
378
|
+
while (wrapper.firstChild) {
|
|
379
|
+
const node = wrapper.firstChild
|
|
380
|
+
this.bareActions.push(node)
|
|
381
|
+
parent.insertBefore(node, wrapper)
|
|
382
|
+
}
|
|
383
|
+
this.slotSync.sync(wrapper, false)
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
handleClick(): void {
|
|
387
|
+
this.onClick?.()
|
|
399
388
|
}
|
|
400
389
|
}
|
|
401
390
|
```
|
|
402
391
|
|
|
392
|
+
_(Member comments are left out to fit; the full declaration is in `node_modules/@molecule/app-contact-display-angular/dist/contact-display.component.d.ts`.)_
|
|
393
|
+
|
|
403
394
|
## Injection Notes
|
|
404
395
|
|
|
405
396
|
### Requirements
|
|
@@ -428,6 +419,7 @@ address markers are text glyphs (✉ ☎ ⌂), not themed SVG icons. `role`,
|
|
|
428
419
|
`address`, and `company` are node-valued in React: in Angular pass a
|
|
429
420
|
`TemplateRef` (rendered through the package's `[molContactNode]` outlet) or
|
|
430
421
|
plain text. The right-side actions are projected as `[slot=actions]`
|
|
431
|
-
content. When `onClick` is provided the whole row becomes clickable
|
|
432
|
-
|
|
433
|
-
|
|
422
|
+
content. When `onClick` is provided the whole row becomes clickable through
|
|
423
|
+
a transparent native button covering it, named by the contact name (the
|
|
424
|
+
name span); the mail/tel links and the `actions` slot sit above that button
|
|
425
|
+
and keep their own clicks.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { type TemplateRef } from '@angular/core';
|
|
6
|
+
import { type AfterViewChecked, type TemplateRef } from '@angular/core';
|
|
7
7
|
import type { UIClassMap } from '@molecule/app-ui';
|
|
8
8
|
import type { ContactFields } from './types.js';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
@@ -13,21 +13,46 @@ import * as i0 from "@angular/core";
|
|
|
13
13
|
* Formatted contact display — avatar + name + role + email/phone with leading
|
|
14
14
|
* glyphs + optional address and company. Three layouts for different
|
|
15
15
|
* densities. The host IS the root `<div>` (`div[mol-contact-display]`),
|
|
16
|
-
* matching React's root exactly.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* matching React's root exactly. With `onClick` a transparent native button
|
|
17
|
+
* covering the whole row is its first child (a click anywhere on it, Enter or
|
|
18
|
+
* Space activates the contact) and is named by the contact-name span; the
|
|
19
|
+
* mail/tel links and the `actions` slot sit above it and keep their own
|
|
20
|
+
* clicks. The optional right-side actions are projected (`[slot=actions]`);
|
|
21
|
+
* the node-valued `contact.role`, `contact.address` and `contact.company`
|
|
22
|
+
* arrive as `TemplateRef`s and render through {@link ContactNodeOutlet}, or as
|
|
23
|
+
* text. Same props, same DOM as `@molecule/app-contact-display-react`'s
|
|
24
|
+
* `ContactDisplay`.
|
|
21
25
|
*/
|
|
22
|
-
export declare class ContactDisplay {
|
|
26
|
+
export declare class ContactDisplay implements AfterViewChecked {
|
|
23
27
|
/** The contact to display. */
|
|
24
28
|
contact?: ContactFields;
|
|
25
29
|
/** Layout preset. Defaults to `'card'` at read time. */
|
|
26
30
|
layout?: 'card' | 'row' | 'compact';
|
|
27
|
-
/**
|
|
28
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Activates the contact: the whole row becomes clickable through a
|
|
33
|
+
* transparent native button covering it, named by the contact name (the
|
|
34
|
+
* name span), so Enter and Space activate it natively. The row's inner
|
|
35
|
+
* controls — the mail/tel links and the `actions` slot — sit above that
|
|
36
|
+
* button and keep their own clicks.
|
|
37
|
+
*/
|
|
38
|
+
onClick?: () => void;
|
|
29
39
|
/** Extra classes on the outer wrapper. */
|
|
30
40
|
className?: string;
|
|
41
|
+
/** The actions slot's always-mounted wrapper (projection needs the capture point). */
|
|
42
|
+
private actionsWrapRef?;
|
|
43
|
+
/** The host element (the root `<div>`). */
|
|
44
|
+
private readonly host;
|
|
45
|
+
private readonly renderer;
|
|
46
|
+
/** Detaches the actions wrapper where React would not render it. */
|
|
47
|
+
private readonly slotSync;
|
|
48
|
+
/** The projected action nodes while they sit bare on the host (React's unwrapped render). */
|
|
49
|
+
private readonly bareActions;
|
|
50
|
+
/**
|
|
51
|
+
* The contact-name span's id, which the open button's `aria-labelledby`
|
|
52
|
+
* names (React derives it from `useId()`; a per-instance counter gives each
|
|
53
|
+
* instance its own).
|
|
54
|
+
*/
|
|
55
|
+
readonly nameId: string;
|
|
31
56
|
/**
|
|
32
57
|
* The current class map.
|
|
33
58
|
* @returns The UIClassMap.
|
|
@@ -124,11 +149,16 @@ export declare class ContactDisplay {
|
|
|
124
149
|
*/
|
|
125
150
|
get addressText(): string;
|
|
126
151
|
/**
|
|
127
|
-
* Computes the root class list (`cm.flex(…)` + `
|
|
128
|
-
*
|
|
152
|
+
* Computes the root class list (`cm.flex(…)` + `className`; with `onClick`,
|
|
153
|
+
* `cm.position('relative')`, so the open button inside covers the row).
|
|
129
154
|
* @returns The class string.
|
|
130
155
|
*/
|
|
131
156
|
classes(): string;
|
|
157
|
+
/**
|
|
158
|
+
* Whether the open button renders (React's `onClick ? …`).
|
|
159
|
+
* @returns True when an `onClick` handler is set.
|
|
160
|
+
*/
|
|
161
|
+
hasOnClick(): boolean;
|
|
132
162
|
/**
|
|
133
163
|
* The avatar wrapper's class (`cm.shrink0`).
|
|
134
164
|
* @returns The class string.
|
|
@@ -165,16 +195,49 @@ export declare class ContactDisplay {
|
|
|
165
195
|
* @returns The class string.
|
|
166
196
|
*/
|
|
167
197
|
detailRowClass(): string;
|
|
198
|
+
/**
|
|
199
|
+
* A control detail line's class (the detail line's class plus
|
|
200
|
+
* `cm.position('relative')`, so the mail/tel link paints above the open
|
|
201
|
+
* button and keeps its own clicks).
|
|
202
|
+
* @returns The class string.
|
|
203
|
+
*/
|
|
204
|
+
raisedDetailRowClass(): string;
|
|
168
205
|
/**
|
|
169
206
|
* The mailto/tel link's class (`cm.link`).
|
|
170
207
|
* @returns The class string.
|
|
171
208
|
*/
|
|
172
209
|
linkClass(): string;
|
|
173
210
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
211
|
+
* The open button's class (`cm.position('absolute')` + `cm.inset0` +
|
|
212
|
+
* `cm.cursorPointer`).
|
|
213
|
+
* @returns The class string.
|
|
214
|
+
*/
|
|
215
|
+
openButtonClass(): string;
|
|
216
|
+
/**
|
|
217
|
+
* The actions slot wrapper's class (`cm.position('relative')` with
|
|
218
|
+
* `onClick`, so the projected controls paint above the open button and
|
|
219
|
+
* keep their own clicks; empty while the wrapper sits detached).
|
|
220
|
+
* @returns The class string.
|
|
221
|
+
*/
|
|
222
|
+
actionsWrapClass(): string;
|
|
223
|
+
/**
|
|
224
|
+
* Wraps or unwraps the projected actions after every change detection
|
|
225
|
+
* cycle, the way React renders them: with `onClick` and projected actions
|
|
226
|
+
* content the actions sit in the `position: relative` wrapper; otherwise
|
|
227
|
+
* they render bare on the host (or not at all, when there is nothing
|
|
228
|
+
* projected).
|
|
229
|
+
*/
|
|
230
|
+
ngAfterViewChecked(): void;
|
|
231
|
+
/**
|
|
232
|
+
* Applies the actions wrapper decision once, idempotently.
|
|
233
|
+
*/
|
|
234
|
+
private syncActionsSlot;
|
|
235
|
+
/**
|
|
236
|
+
* Runs the click handler from the open button (a native button turns Enter
|
|
237
|
+
* and Space into this click itself; no event is forwarded, the way React
|
|
238
|
+
* calls `onClick()` with none).
|
|
176
239
|
*/
|
|
177
|
-
handleClick(
|
|
240
|
+
handleClick(): void;
|
|
178
241
|
static ɵfac: i0.ɵɵFactoryDeclaration<ContactDisplay, never>;
|
|
179
242
|
static ɵcmp: i0.ɵɵComponentDeclaration<ContactDisplay, "div[mol-contact-display]", never, { "contact": { "alias": "contact"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "onClick": { "alias": "onClick"; "required": false; }; "className": { "alias": "className"; "required": false; }; }, {}, never, ["[slot=actions]"], true, never>;
|
|
180
243
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-display.component.d.ts","sourceRoot":"","sources":["../src/contact-display.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"contact-display.component.d.ts","sourceRoot":"","sources":["../src/contact-display.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,gBAAgB,EAQrB,KAAK,WAAW,EAGjB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIlD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM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C,OAAO,CAAC,GAAG,IAAI;IAI3C;;;OAGG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;OAGG;IACH,eAAe,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI;IAI9C;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;;OAGG;IACH,eAAe,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI;IAI9C;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;;;OAIG;IACH,OAAO,IAAI,MAAM;IAYjB;;;OAGG;IACH,UAAU,IAAI,OAAO;IAIrB;;;OAGG;IACH,eAAe,IAAI,MAAM;IAIzB;;;OAGG;IACH,eAAe,IAAI,MAAM;IAIzB;;;OAGG;IACH,YAAY,IAAI,MAAM;IAItB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAOnB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAInB;;;OAGG;IACH,YAAY,IAAI,MAAM;IAItB;;;;OAIG;IACH,cAAc,IAAI,MAAM;IAIxB;;;;;OAKG;IACH,oBAAoB,IAAI,MAAM;IAI9B;;;OAGG;IACH,SAAS,IAAI,MAAM;IAInB;;;;OAIG;IACH,eAAe,IAAI,MAAM;IAIzB;;;;;OAKG;IACH,gBAAgB,IAAI,MAAM;IAI1B;;;;;;OAMG;IACH,kBAAkB,IAAI,IAAI;IAI1B;;OAEG;IACH,OAAO,CAAC,eAAe;IAuBvB;;;;OAIG;IACH,WAAW,IAAI,IAAI;yCA9VR,cAAc;2CAAd,cAAc;CAiW1B"}
|
|
@@ -3,86 +3,107 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { Component, Directive, inject, Input, ViewContainerRef, } from '@angular/core';
|
|
6
|
+
import { Component, Directive, ElementRef, inject, Input, Renderer2, ViewChild, ViewContainerRef, } from '@angular/core';
|
|
7
7
|
import { getClassMap } from '@molecule/app-ui';
|
|
8
|
-
import { asTemplate, Avatar } from '@molecule/app-ui-angular';
|
|
8
|
+
import { asTemplate, Avatar, hasNodes, SlotWrapper } from '@molecule/app-ui-angular';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
|
-
const _c0 = [
|
|
11
|
-
const _c1 = ["
|
|
12
|
-
|
|
10
|
+
const _c0 = ["actionsWrap"];
|
|
11
|
+
const _c1 = [[["", "slot", "actions"]]];
|
|
12
|
+
const _c2 = ["[slot=actions]"];
|
|
13
|
+
function ContactDisplay_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
14
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
15
|
+
i0.ɵɵelementStart(0, "button", 4);
|
|
16
|
+
i0.ɵɵlistener("click", function ContactDisplay_Conditional_0_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.handleClick()); });
|
|
17
|
+
i0.ɵɵelementEnd();
|
|
18
|
+
} if (rf & 2) {
|
|
19
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
20
|
+
i0.ɵɵclassMap(ctx_r1.openButtonClass());
|
|
21
|
+
i0.ɵɵstyleProp("background", "transparent")("border", "none")("padding", "0");
|
|
22
|
+
i0.ɵɵattribute("aria-labelledby", ctx_r1.nameId);
|
|
23
|
+
} }
|
|
24
|
+
function ContactDisplay_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
13
25
|
i0.ɵɵelementStart(0, "span");
|
|
14
26
|
i0.ɵɵtext(1);
|
|
15
|
-
i0.ɵɵelementContainer(2,
|
|
27
|
+
i0.ɵɵelementContainer(2, 5);
|
|
16
28
|
i0.ɵɵelementEnd();
|
|
17
29
|
} if (rf & 2) {
|
|
18
|
-
const
|
|
19
|
-
i0.ɵɵclassMap(
|
|
30
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
31
|
+
i0.ɵɵclassMap(ctx_r1.roleClass());
|
|
20
32
|
i0.ɵɵadvance();
|
|
21
|
-
i0.ɵɵtextInterpolate(
|
|
33
|
+
i0.ɵɵtextInterpolate(ctx_r1.roleText);
|
|
22
34
|
i0.ɵɵadvance();
|
|
23
|
-
i0.ɵɵproperty("molContactNode",
|
|
35
|
+
i0.ɵɵproperty("molContactNode", ctx_r1.roleTemplate());
|
|
24
36
|
} }
|
|
25
|
-
function
|
|
37
|
+
function ContactDisplay_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
26
38
|
i0.ɵɵelementStart(0, "div");
|
|
27
39
|
i0.ɵɵtext(1);
|
|
28
|
-
i0.ɵɵelementContainer(2,
|
|
40
|
+
i0.ɵɵelementContainer(2, 5);
|
|
29
41
|
i0.ɵɵelementEnd();
|
|
30
42
|
} if (rf & 2) {
|
|
31
|
-
const
|
|
32
|
-
i0.ɵɵclassMap(
|
|
43
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
44
|
+
i0.ɵɵclassMap(ctx_r1.companyClass());
|
|
33
45
|
i0.ɵɵadvance();
|
|
34
|
-
i0.ɵɵtextInterpolate(
|
|
46
|
+
i0.ɵɵtextInterpolate(ctx_r1.companyText);
|
|
35
47
|
i0.ɵɵadvance();
|
|
36
|
-
i0.ɵɵproperty("molContactNode",
|
|
48
|
+
i0.ɵɵproperty("molContactNode", ctx_r1.companyTemplate());
|
|
37
49
|
} }
|
|
38
|
-
function
|
|
39
|
-
i0.ɵɵelementStart(0, "div")(1, "span",
|
|
50
|
+
function ContactDisplay_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
51
|
+
i0.ɵɵelementStart(0, "div")(1, "span", 6);
|
|
40
52
|
i0.ɵɵtext(2, "\u2709");
|
|
41
53
|
i0.ɵɵelementEnd();
|
|
42
54
|
i0.ɵɵelementStart(3, "a");
|
|
43
55
|
i0.ɵɵtext(4);
|
|
44
56
|
i0.ɵɵelementEnd()();
|
|
45
57
|
} if (rf & 2) {
|
|
46
|
-
const
|
|
47
|
-
i0.ɵɵclassMap(
|
|
58
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
59
|
+
i0.ɵɵclassMap(ctx_r1.hasOnClick() ? ctx_r1.raisedDetailRowClass() : ctx_r1.detailRowClass());
|
|
48
60
|
i0.ɵɵadvance(3);
|
|
49
|
-
i0.ɵɵclassMap(
|
|
50
|
-
i0.ɵɵattribute("href", "mailto:" +
|
|
61
|
+
i0.ɵɵclassMap(ctx_r1.linkClass());
|
|
62
|
+
i0.ɵɵattribute("href", "mailto:" + ctx_r1.contactEmail(), i0.ɵɵsanitizeUrl);
|
|
51
63
|
i0.ɵɵadvance();
|
|
52
|
-
i0.ɵɵtextInterpolate(
|
|
64
|
+
i0.ɵɵtextInterpolate(ctx_r1.contactEmail());
|
|
53
65
|
} }
|
|
54
|
-
function
|
|
55
|
-
i0.ɵɵelementStart(0, "div")(1, "span",
|
|
66
|
+
function ContactDisplay_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
67
|
+
i0.ɵɵelementStart(0, "div")(1, "span", 6);
|
|
56
68
|
i0.ɵɵtext(2, "\u260E");
|
|
57
69
|
i0.ɵɵelementEnd();
|
|
58
70
|
i0.ɵɵelementStart(3, "a");
|
|
59
71
|
i0.ɵɵtext(4);
|
|
60
72
|
i0.ɵɵelementEnd()();
|
|
61
73
|
} if (rf & 2) {
|
|
62
|
-
const
|
|
63
|
-
i0.ɵɵclassMap(
|
|
74
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
75
|
+
i0.ɵɵclassMap(ctx_r1.hasOnClick() ? ctx_r1.raisedDetailRowClass() : ctx_r1.detailRowClass());
|
|
64
76
|
i0.ɵɵadvance(3);
|
|
65
|
-
i0.ɵɵclassMap(
|
|
66
|
-
i0.ɵɵattribute("href", "tel:" +
|
|
77
|
+
i0.ɵɵclassMap(ctx_r1.linkClass());
|
|
78
|
+
i0.ɵɵattribute("href", "tel:" + ctx_r1.contactPhone(), i0.ɵɵsanitizeUrl);
|
|
67
79
|
i0.ɵɵadvance();
|
|
68
|
-
i0.ɵɵtextInterpolate(
|
|
80
|
+
i0.ɵɵtextInterpolate(ctx_r1.contactPhone());
|
|
69
81
|
} }
|
|
70
|
-
function
|
|
71
|
-
i0.ɵɵelementStart(0, "div")(1, "span",
|
|
82
|
+
function ContactDisplay_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
83
|
+
i0.ɵɵelementStart(0, "div")(1, "span", 6);
|
|
72
84
|
i0.ɵɵtext(2, "\u2302");
|
|
73
85
|
i0.ɵɵelementEnd();
|
|
74
86
|
i0.ɵɵelementStart(3, "span");
|
|
75
87
|
i0.ɵɵtext(4);
|
|
76
|
-
i0.ɵɵelementContainer(5,
|
|
88
|
+
i0.ɵɵelementContainer(5, 5);
|
|
77
89
|
i0.ɵɵelementEnd()();
|
|
78
90
|
} if (rf & 2) {
|
|
79
|
-
const
|
|
80
|
-
i0.ɵɵclassMap(
|
|
91
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
92
|
+
i0.ɵɵclassMap(ctx_r1.detailRowClass());
|
|
81
93
|
i0.ɵɵadvance(4);
|
|
82
|
-
i0.ɵɵtextInterpolate(
|
|
94
|
+
i0.ɵɵtextInterpolate(ctx_r1.addressText);
|
|
83
95
|
i0.ɵɵadvance();
|
|
84
|
-
i0.ɵɵproperty("molContactNode",
|
|
96
|
+
i0.ɵɵproperty("molContactNode", ctx_r1.addressTemplate());
|
|
85
97
|
} }
|
|
98
|
+
/**
|
|
99
|
+
* Next value of the module-wide contact-name id counter.
|
|
100
|
+
*
|
|
101
|
+
* React derives the contact-name span's id from `useId()`, which numbers ids
|
|
102
|
+
* from one process-wide counter; the open button's `aria-labelledby` names the
|
|
103
|
+
* span by it, so the port generates ids from the same kind of counter — unique
|
|
104
|
+
* per instance.
|
|
105
|
+
*/
|
|
106
|
+
let nextNameId = 0;
|
|
86
107
|
/**
|
|
87
108
|
* The text of a node-valued field (React renders a string, or a number, as
|
|
88
109
|
* text; a node renders through {@link ContactNodeOutlet} instead).
|
|
@@ -151,21 +172,46 @@ class ContactNodeOutlet {
|
|
|
151
172
|
* Formatted contact display — avatar + name + role + email/phone with leading
|
|
152
173
|
* glyphs + optional address and company. Three layouts for different
|
|
153
174
|
* densities. The host IS the root `<div>` (`div[mol-contact-display]`),
|
|
154
|
-
* matching React's root exactly.
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
175
|
+
* matching React's root exactly. With `onClick` a transparent native button
|
|
176
|
+
* covering the whole row is its first child (a click anywhere on it, Enter or
|
|
177
|
+
* Space activates the contact) and is named by the contact-name span; the
|
|
178
|
+
* mail/tel links and the `actions` slot sit above it and keep their own
|
|
179
|
+
* clicks. The optional right-side actions are projected (`[slot=actions]`);
|
|
180
|
+
* the node-valued `contact.role`, `contact.address` and `contact.company`
|
|
181
|
+
* arrive as `TemplateRef`s and render through {@link ContactNodeOutlet}, or as
|
|
182
|
+
* text. Same props, same DOM as `@molecule/app-contact-display-react`'s
|
|
183
|
+
* `ContactDisplay`.
|
|
159
184
|
*/
|
|
160
185
|
export class ContactDisplay {
|
|
161
186
|
/** The contact to display. */
|
|
162
187
|
contact;
|
|
163
188
|
/** Layout preset. Defaults to `'card'` at read time. */
|
|
164
189
|
layout;
|
|
165
|
-
/**
|
|
190
|
+
/**
|
|
191
|
+
* Activates the contact: the whole row becomes clickable through a
|
|
192
|
+
* transparent native button covering it, named by the contact name (the
|
|
193
|
+
* name span), so Enter and Space activate it natively. The row's inner
|
|
194
|
+
* controls — the mail/tel links and the `actions` slot — sit above that
|
|
195
|
+
* button and keep their own clicks.
|
|
196
|
+
*/
|
|
166
197
|
onClick;
|
|
167
198
|
/** Extra classes on the outer wrapper. */
|
|
168
199
|
className;
|
|
200
|
+
/** The actions slot's always-mounted wrapper (projection needs the capture point). */
|
|
201
|
+
actionsWrapRef;
|
|
202
|
+
/** The host element (the root `<div>`). */
|
|
203
|
+
host = inject(ElementRef);
|
|
204
|
+
renderer = inject(Renderer2);
|
|
205
|
+
/** Detaches the actions wrapper where React would not render it. */
|
|
206
|
+
slotSync = new SlotWrapper(this.host, this.renderer);
|
|
207
|
+
/** The projected action nodes while they sit bare on the host (React's unwrapped render). */
|
|
208
|
+
bareActions = [];
|
|
209
|
+
/**
|
|
210
|
+
* The contact-name span's id, which the open button's `aria-labelledby`
|
|
211
|
+
* names (React derives it from `useId()`; a per-instance counter gives each
|
|
212
|
+
* instance its own).
|
|
213
|
+
*/
|
|
214
|
+
nameId = `contact-display-name-${nextNameId++}`;
|
|
169
215
|
/**
|
|
170
216
|
* The current class map.
|
|
171
217
|
* @returns The UIClassMap.
|
|
@@ -300,8 +346,8 @@ export class ContactDisplay {
|
|
|
300
346
|
return fieldText(this.contact?.address);
|
|
301
347
|
}
|
|
302
348
|
/**
|
|
303
|
-
* Computes the root class list (`cm.flex(…)` + `
|
|
304
|
-
*
|
|
349
|
+
* Computes the root class list (`cm.flex(…)` + `className`; with `onClick`,
|
|
350
|
+
* `cm.position('relative')`, so the open button inside covers the row).
|
|
305
351
|
* @returns The class string.
|
|
306
352
|
*/
|
|
307
353
|
classes() {
|
|
@@ -309,7 +355,14 @@ export class ContactDisplay {
|
|
|
309
355
|
align: this.activeLayout() === 'card' ? 'start' : 'center',
|
|
310
356
|
gap: this.isCompact() ? 'sm' : 'md',
|
|
311
357
|
direction: this.activeLayout() === 'card' ? 'col' : 'row',
|
|
312
|
-
}), this.
|
|
358
|
+
}), this.hasOnClick() ? this.cm().position('relative') : undefined, this.className);
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Whether the open button renders (React's `onClick ? …`).
|
|
362
|
+
* @returns True when an `onClick` handler is set.
|
|
363
|
+
*/
|
|
364
|
+
hasOnClick() {
|
|
365
|
+
return Boolean(this.onClick);
|
|
313
366
|
}
|
|
314
367
|
/**
|
|
315
368
|
* The avatar wrapper's class (`cm.shrink0`).
|
|
@@ -361,6 +414,15 @@ export class ContactDisplay {
|
|
|
361
414
|
detailRowClass() {
|
|
362
415
|
return this.cm().cn(this.cm().flex({ align: 'center', gap: 'xs' }), this.cm().textSize('sm'));
|
|
363
416
|
}
|
|
417
|
+
/**
|
|
418
|
+
* A control detail line's class (the detail line's class plus
|
|
419
|
+
* `cm.position('relative')`, so the mail/tel link paints above the open
|
|
420
|
+
* button and keeps its own clicks).
|
|
421
|
+
* @returns The class string.
|
|
422
|
+
*/
|
|
423
|
+
raisedDetailRowClass() {
|
|
424
|
+
return this.cm().cn(this.detailRowClass(), this.cm().position('relative'));
|
|
425
|
+
}
|
|
364
426
|
/**
|
|
365
427
|
* The mailto/tel link's class (`cm.link`).
|
|
366
428
|
* @returns The class string.
|
|
@@ -369,34 +431,99 @@ export class ContactDisplay {
|
|
|
369
431
|
return this.cm().cn(this.cm().link);
|
|
370
432
|
}
|
|
371
433
|
/**
|
|
372
|
-
*
|
|
373
|
-
*
|
|
434
|
+
* The open button's class (`cm.position('absolute')` + `cm.inset0` +
|
|
435
|
+
* `cm.cursorPointer`).
|
|
436
|
+
* @returns The class string.
|
|
437
|
+
*/
|
|
438
|
+
openButtonClass() {
|
|
439
|
+
return this.cm().cn(this.cm().position('absolute'), this.cm().inset0, this.cm().cursorPointer);
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* The actions slot wrapper's class (`cm.position('relative')` with
|
|
443
|
+
* `onClick`, so the projected controls paint above the open button and
|
|
444
|
+
* keep their own clicks; empty while the wrapper sits detached).
|
|
445
|
+
* @returns The class string.
|
|
446
|
+
*/
|
|
447
|
+
actionsWrapClass() {
|
|
448
|
+
return this.hasOnClick() ? this.cm().position('relative') : '';
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Wraps or unwraps the projected actions after every change detection
|
|
452
|
+
* cycle, the way React renders them: with `onClick` and projected actions
|
|
453
|
+
* content the actions sit in the `position: relative` wrapper; otherwise
|
|
454
|
+
* they render bare on the host (or not at all, when there is nothing
|
|
455
|
+
* projected).
|
|
374
456
|
*/
|
|
375
|
-
|
|
376
|
-
this.
|
|
457
|
+
ngAfterViewChecked() {
|
|
458
|
+
this.syncActionsSlot();
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Applies the actions wrapper decision once, idempotently.
|
|
462
|
+
*/
|
|
463
|
+
syncActionsSlot() {
|
|
464
|
+
const wrapper = this.actionsWrapRef?.nativeElement;
|
|
465
|
+
if (!wrapper)
|
|
466
|
+
return;
|
|
467
|
+
if (this.hasOnClick() && hasNodes(wrapper)) {
|
|
468
|
+
if (wrapper.isConnected)
|
|
469
|
+
return;
|
|
470
|
+
this.slotSync.sync(wrapper, true);
|
|
471
|
+
// Return the projected actions that sat bare on the host to the wrapper.
|
|
472
|
+
for (const node of this.bareActions.splice(0))
|
|
473
|
+
wrapper.appendChild(node);
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
if (!wrapper.isConnected)
|
|
477
|
+
return;
|
|
478
|
+
// No wrapper for React's render (no `onClick`, or nothing projected): move
|
|
479
|
+
// the projected nodes out to the host, then detach the empty wrapper where
|
|
480
|
+
// it sat.
|
|
481
|
+
const parent = wrapper.parentElement ?? this.host.nativeElement;
|
|
482
|
+
while (wrapper.firstChild) {
|
|
483
|
+
const node = wrapper.firstChild;
|
|
484
|
+
this.bareActions.push(node);
|
|
485
|
+
parent.insertBefore(node, wrapper);
|
|
486
|
+
}
|
|
487
|
+
this.slotSync.sync(wrapper, false);
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Runs the click handler from the open button (a native button turns Enter
|
|
491
|
+
* and Space into this click itself; no event is forwarded, the way React
|
|
492
|
+
* calls `onClick()` with none).
|
|
493
|
+
*/
|
|
494
|
+
handleClick() {
|
|
495
|
+
this.onClick?.();
|
|
377
496
|
}
|
|
378
497
|
static ɵfac = function ContactDisplay_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ContactDisplay)(); };
|
|
379
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ContactDisplay, selectors: [["div", "mol-contact-display", ""]],
|
|
380
|
-
i0.ɵɵ
|
|
498
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ContactDisplay, selectors: [["div", "mol-contact-display", ""]], viewQuery: function ContactDisplay_Query(rf, ctx) { if (rf & 1) {
|
|
499
|
+
i0.ɵɵviewQuery(_c0, 5);
|
|
381
500
|
} if (rf & 2) {
|
|
501
|
+
let _t;
|
|
502
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.actionsWrapRef = _t.first);
|
|
503
|
+
} }, hostVars: 2, hostBindings: function ContactDisplay_HostBindings(rf, ctx) { if (rf & 2) {
|
|
382
504
|
i0.ɵɵclassMap(ctx.classes());
|
|
383
|
-
} }, inputs: { contact: "contact", layout: "layout", onClick: "onClick", className: "className" }, ngContentSelectors:
|
|
384
|
-
i0.ɵɵprojectionDef(
|
|
385
|
-
i0.ɵɵ
|
|
386
|
-
i0.ɵɵ
|
|
505
|
+
} }, inputs: { contact: "contact", layout: "layout", onClick: "onClick", className: "className" }, ngContentSelectors: _c2, decls: 15, vars: 22, consts: [["actionsWrap", ""], ["type", "button", "data-mol-id", "contact-display-open", 3, "class", "background", "border", "padding"], ["mol-avatar", "", 3, "src", "alt", "name", "size"], [3, "class"], ["type", "button", "data-mol-id", "contact-display-open", 3, "click"], [3, "molContactNode"], ["aria-hidden", "true"]], template: function ContactDisplay_Template(rf, ctx) { if (rf & 1) {
|
|
506
|
+
i0.ɵɵprojectionDef(_c1);
|
|
507
|
+
i0.ɵɵconditionalCreate(0, ContactDisplay_Conditional_0_Template, 1, 9, "button", 1);
|
|
508
|
+
i0.ɵɵelementStart(1, "div");
|
|
509
|
+
i0.ɵɵelement(2, "div", 2);
|
|
510
|
+
i0.ɵɵelementEnd();
|
|
511
|
+
i0.ɵɵelementStart(3, "div")(4, "div")(5, "span");
|
|
512
|
+
i0.ɵɵtext(6);
|
|
387
513
|
i0.ɵɵelementEnd();
|
|
388
|
-
i0.ɵɵ
|
|
389
|
-
i0.ɵɵtext(5);
|
|
514
|
+
i0.ɵɵconditionalCreate(7, ContactDisplay_Conditional_7_Template, 3, 4, "span", 3);
|
|
390
515
|
i0.ɵɵelementEnd();
|
|
391
|
-
i0.ɵɵconditionalCreate(
|
|
516
|
+
i0.ɵɵconditionalCreate(8, ContactDisplay_Conditional_8_Template, 3, 4, "div", 3);
|
|
517
|
+
i0.ɵɵconditionalCreate(9, ContactDisplay_Conditional_9_Template, 5, 6, "div", 3);
|
|
518
|
+
i0.ɵɵconditionalCreate(10, ContactDisplay_Conditional_10_Template, 5, 6, "div", 3);
|
|
519
|
+
i0.ɵɵconditionalCreate(11, ContactDisplay_Conditional_11_Template, 6, 4, "div", 3);
|
|
392
520
|
i0.ɵɵelementEnd();
|
|
393
|
-
i0.ɵɵ
|
|
394
|
-
i0.ɵɵ
|
|
395
|
-
i0.ɵɵconditionalCreate(9, ContactDisplay_Conditional_9_Template, 5, 6, "div", 1);
|
|
396
|
-
i0.ɵɵconditionalCreate(10, ContactDisplay_Conditional_10_Template, 6, 4, "div", 1);
|
|
521
|
+
i0.ɵɵelementStart(12, "div", null, 0);
|
|
522
|
+
i0.ɵɵprojection(14);
|
|
397
523
|
i0.ɵɵelementEnd();
|
|
398
|
-
i0.ɵɵprojection(11);
|
|
399
524
|
} if (rf & 2) {
|
|
525
|
+
i0.ɵɵconditional(ctx.hasOnClick() ? 0 : -1);
|
|
526
|
+
i0.ɵɵadvance();
|
|
400
527
|
i0.ɵɵclassMap(ctx.avatarWrapClass());
|
|
401
528
|
i0.ɵɵadvance();
|
|
402
529
|
i0.ɵɵproperty("src", ctx.avatarSrc())("alt", ctx.contactName())("name", ctx.contactName())("size", ctx.avatarSize());
|
|
@@ -406,18 +533,21 @@ export class ContactDisplay {
|
|
|
406
533
|
i0.ɵɵclassMap(ctx.nameRowClass());
|
|
407
534
|
i0.ɵɵadvance();
|
|
408
535
|
i0.ɵɵclassMap(ctx.nameClass());
|
|
536
|
+
i0.ɵɵattribute("id", ctx.hasOnClick() ? ctx.nameId : null);
|
|
409
537
|
i0.ɵɵadvance();
|
|
410
538
|
i0.ɵɵtextInterpolate(ctx.contactName());
|
|
411
539
|
i0.ɵɵadvance();
|
|
412
|
-
i0.ɵɵconditional(ctx.hasRole() ?
|
|
540
|
+
i0.ɵɵconditional(ctx.hasRole() ? 7 : -1);
|
|
413
541
|
i0.ɵɵadvance();
|
|
414
|
-
i0.ɵɵconditional(ctx.hasCompany() ?
|
|
542
|
+
i0.ɵɵconditional(ctx.hasCompany() ? 8 : -1);
|
|
415
543
|
i0.ɵɵadvance();
|
|
416
|
-
i0.ɵɵconditional(ctx.showEmail() ?
|
|
544
|
+
i0.ɵɵconditional(ctx.showEmail() ? 9 : -1);
|
|
417
545
|
i0.ɵɵadvance();
|
|
418
|
-
i0.ɵɵconditional(ctx.showPhone() ?
|
|
546
|
+
i0.ɵɵconditional(ctx.showPhone() ? 10 : -1);
|
|
419
547
|
i0.ɵɵadvance();
|
|
420
|
-
i0.ɵɵconditional(ctx.showAddress() ?
|
|
548
|
+
i0.ɵɵconditional(ctx.showAddress() ? 11 : -1);
|
|
549
|
+
i0.ɵɵadvance();
|
|
550
|
+
i0.ɵɵclassMap(ctx.actionsWrapClass());
|
|
421
551
|
} }, dependencies: [Avatar, ContactNodeOutlet], encapsulation: 2 });
|
|
422
552
|
}
|
|
423
553
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ContactDisplay, [{
|
|
@@ -429,18 +559,20 @@ export class ContactDisplay {
|
|
|
429
559
|
inputs: ['contact', 'layout', 'onClick', 'className'],
|
|
430
560
|
host: {
|
|
431
561
|
'[class]': 'classes()',
|
|
432
|
-
'(click)': 'handleClick($event)',
|
|
433
562
|
},
|
|
434
563
|
// prettier-ignore
|
|
435
|
-
template:
|
|
564
|
+
template: `@if (hasOnClick()) {<button type="button" [attr.aria-labelledby]="nameId" data-mol-id="contact-display-open" (click)="handleClick()" [class]="openButtonClass()" [style.background]="'transparent'" [style.border]="'none'" [style.padding]="'0'"></button>}<div [class]="avatarWrapClass()"><div mol-avatar [src]="avatarSrc()" [alt]="contactName()" [name]="contactName()" [size]="avatarSize()"></div></div>
|
|
436
565
|
<div [class]="detailWrapClass()">
|
|
437
|
-
<div [class]="nameRowClass()"><span [class]="nameClass()">{{ contactName() }}</span>@if (hasRole()) {<span [class]="roleClass()">{{ roleText }}<ng-container [molContactNode]="roleTemplate()"></ng-container></span>}</div>
|
|
566
|
+
<div [class]="nameRowClass()"><span [attr.id]="hasOnClick() ? nameId : null" [class]="nameClass()">{{ contactName() }}</span>@if (hasRole()) {<span [class]="roleClass()">{{ roleText }}<ng-container [molContactNode]="roleTemplate()"></ng-container></span>}</div>
|
|
438
567
|
@if (hasCompany()) {<div [class]="companyClass()">{{ companyText }}<ng-container [molContactNode]="companyTemplate()"></ng-container></div>}
|
|
439
|
-
@if (showEmail()) {<div [class]="detailRowClass()"><span aria-hidden="true">✉</span><a [attr.href]="'mailto:' + contactEmail()" [class]="linkClass()">{{ contactEmail() }}</a></div>}
|
|
440
|
-
@if (showPhone()) {<div [class]="detailRowClass()"><span aria-hidden="true">☎</span><a [attr.href]="'tel:' + contactPhone()" [class]="linkClass()">{{ contactPhone() }}</a></div>}
|
|
568
|
+
@if (showEmail()) {<div [class]="hasOnClick() ? raisedDetailRowClass() : detailRowClass()"><span aria-hidden="true">✉</span><a [attr.href]="'mailto:' + contactEmail()" [class]="linkClass()">{{ contactEmail() }}</a></div>}
|
|
569
|
+
@if (showPhone()) {<div [class]="hasOnClick() ? raisedDetailRowClass() : detailRowClass()"><span aria-hidden="true">☎</span><a [attr.href]="'tel:' + contactPhone()" [class]="linkClass()">{{ contactPhone() }}</a></div>}
|
|
441
570
|
@if (showAddress()) {<div [class]="detailRowClass()"><span aria-hidden="true">⌂</span><span>{{ addressText }}<ng-container [molContactNode]="addressTemplate()"></ng-container></span></div>}
|
|
442
|
-
</div><ng-content select="[slot=actions]"></ng-content>`,
|
|
571
|
+
</div><div #actionsWrap [class]="actionsWrapClass()"><ng-content select="[slot=actions]"></ng-content></div>`,
|
|
443
572
|
}]
|
|
444
|
-
}], null,
|
|
445
|
-
|
|
573
|
+
}], null, { actionsWrapRef: [{
|
|
574
|
+
type: ViewChild,
|
|
575
|
+
args: ['actionsWrap']
|
|
576
|
+
}] }); })();
|
|
577
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ContactDisplay, { className: "ContactDisplay", filePath: "contact-display.component.ts", lineNumber: 126 }); })();
|
|
446
578
|
//# sourceMappingURL=contact-display.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-display.component.js","sourceRoot":"","sources":["../src/contact-display.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"contact-display.component.js","sourceRoot":"","sources":["../src/contact-display.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,SAAS,EACT,SAAS,EACT,UAAU,EAEV,MAAM,EACN,KAAK,EACL,SAAS,EAET,SAAS,EACT,gBAAgB,GACjB,MAAM,eAAe,CAAA;AAGtB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;;;;;;;IA8FnD,iCAA8N;IAArI,kLAAS,oBAAa,KAAC;IAA8G,iBAAS;;;IAAtH,uCAA2B;IAA4D,AAAxB,AAAnC,2CAAkC,kBAAwB,gBAAsB;;;;IAE1G,4BAA4B;IAAA,YAAc;IAAA,2BAA+D;IAAA,iBAAO;;;IAA1G,iCAAqB;IAAC,cAAc;IAAd,qCAAc;IAAc,cAAiC;IAAjC,sDAAiC;;;IACnN,2BAA8B;IAAA,YAAiB;IAAA,2BAAkE;IAAA,iBAAM;;;IAAlH,oCAAwB;IAAC,cAAiB;IAAjB,wCAAiB;IAAc,cAAoC;IAApC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A5I,2CAA4I;YAC5I,cAA6N;YAA7N,0CAA6N;YAC7N,cAA0N;YAA1N,2CAA0N;YAC1N,cAA6L;YAA7L,6CAA6L;YACvK,cAA4B;YAA5B,qCAA4B;4BAb5C,MAAM,EA9CZ,iBAAiB;;iFA6DV,cAAc;cAlB1B,SAAS;eAAC;gBACT,QAAQ,EAAE,0BAA0B;gBACpC,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC;gBACpC,MAAM,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC;gBACrD,IAAI,EAAE;oBACJ,SAAS,EAAE,WAAW;iBACvB;gBACD,kBAAkB;gBAClB,QAAQ,EAAE;;;;;;;iHAOqG;aAChH;;kBAkBE,SAAS;mBAAC,aAAa;;kFAjBb,cAAc"}
|
package/dist/index.d.ts
CHANGED
|
@@ -41,9 +41,10 @@
|
|
|
41
41
|
* `address`, and `company` are node-valued in React: in Angular pass a
|
|
42
42
|
* `TemplateRef` (rendered through the package's `[molContactNode]` outlet) or
|
|
43
43
|
* plain text. The right-side actions are projected as `[slot=actions]`
|
|
44
|
-
* content. When `onClick` is provided the whole row becomes clickable
|
|
45
|
-
*
|
|
46
|
-
*
|
|
44
|
+
* content. When `onClick` is provided the whole row becomes clickable through
|
|
45
|
+
* a transparent native button covering it, named by the contact name (the
|
|
46
|
+
* name span); the mail/tel links and the `actions` slot sit above that button
|
|
47
|
+
* and keep their own clicks.
|
|
47
48
|
*
|
|
48
49
|
* @module
|
|
49
50
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,cAAc,gCAAgC,CAAA;AAC9C,cAAc,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -41,9 +41,10 @@
|
|
|
41
41
|
* `address`, and `company` are node-valued in React: in Angular pass a
|
|
42
42
|
* `TemplateRef` (rendered through the package's `[molContactNode]` outlet) or
|
|
43
43
|
* plain text. The right-side actions are projected as `[slot=actions]`
|
|
44
|
-
* content. When `onClick` is provided the whole row becomes clickable
|
|
45
|
-
*
|
|
46
|
-
*
|
|
44
|
+
* content. When `onClick` is provided the whole row becomes clickable through
|
|
45
|
+
* a transparent native button covering it, named by the contact name (the
|
|
46
|
+
* name span); the mail/tel links and the `actions` slot sit above that button
|
|
47
|
+
* and keep their own clicks.
|
|
47
48
|
*
|
|
48
49
|
* @module
|
|
49
50
|
*/
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,cAAc,gCAAgC,CAAA;AAC9C,cAAc,YAAY,CAAA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -36,8 +36,14 @@ export interface ContactDisplayProps {
|
|
|
36
36
|
layout?: 'card' | 'row' | 'compact';
|
|
37
37
|
/** Optional right-side actions, projected as `[slot=actions]` content. */
|
|
38
38
|
actions?: unknown;
|
|
39
|
-
/**
|
|
40
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Activates the contact: the whole row becomes clickable through a
|
|
41
|
+
* transparent native button covering it, named by the contact name (the
|
|
42
|
+
* name span), so Enter and Space activate it natively. The row's inner
|
|
43
|
+
* controls — the mail/tel links and the `actions` slot — sit above that
|
|
44
|
+
* button and keep their own clicks.
|
|
45
|
+
*/
|
|
46
|
+
onClick?: () => void;
|
|
41
47
|
/** Extra classes. */
|
|
42
48
|
className?: string;
|
|
43
49
|
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,wEAAwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,8BAA8B;IAC9B,OAAO,EAAE,aAAa,CAAA;IACtB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;IACnC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,wEAAwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,8BAA8B;IAC9B,OAAO,EAAE,aAAa,CAAA;IACtB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;IACnC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-contact-display-angular",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Formatted contact display: name + avatar + email/phone with icons + optional address",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-contact-display-angular",
|
|
6
6
|
"type": "module",
|