@molecule/app-list-item-row-angular 1.1.1 → 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 +78 -5
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/list-item-row.component.d.ts +4 -1
- package/dist/list-item-row.component.d.ts.map +1 -1
- package/dist/list-item-row.component.js +61 -20
- package/dist/list-item-row.component.js.map +1 -1
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
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-18T19:30:05.953Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-list-item-row-angular
|
|
@@ -12,8 +12,9 @@ Angular generic list-item row.
|
|
|
12
12
|
|
|
13
13
|
Exports `<ListItemRow>` — leading slot (icon/avatar/thumbnail) + up to three
|
|
14
14
|
text lines (title / subtitle / metadata) + right-side actions. Inputs: `title`,
|
|
15
|
-
`subtitle?`, `metadata?`, `leading?`, `actions?`, `
|
|
16
|
-
`disabled?`, `density?` (`'comfortable'` default | `'compact'`),
|
|
15
|
+
`subtitle?`, `metadata?`, `leading?`, `actions?`, `toggle?`, `onClick?`,
|
|
16
|
+
`selected?`, `disabled?`, `density?` (`'comfortable'` default | `'compact'`),
|
|
17
|
+
`className?`.
|
|
17
18
|
Use for nav lists, mobile menus, search results, picker dialogs, inbox threads.
|
|
18
19
|
For table rows use `<RowWithActions>` from `@molecule/app-data-table-ui-angular`
|
|
19
20
|
instead — this component is not a `<tr>`. It is the Angular counterpart of
|
|
@@ -84,6 +85,33 @@ interface ListItemRowProps {
|
|
|
84
85
|
leading?: string | number
|
|
85
86
|
/** Optional right-side actions (buttons, action menu; `[slot=actions]` content, or text). */
|
|
86
87
|
actions?: string | number
|
|
88
|
+
/** Loaded boolean action rendered as its own native button, independently of read-only metadata. */
|
|
89
|
+
toggle?: {
|
|
90
|
+
/** The loaded server value. */
|
|
91
|
+
value: boolean
|
|
92
|
+
/** Saves the desired boolean and resolves with the server-confirmed boolean. */
|
|
93
|
+
commit: (desired: boolean) => Promise<boolean>
|
|
94
|
+
/** Label when the displayed value is true. */
|
|
95
|
+
activeLabel?: string | number
|
|
96
|
+
/** Label when the displayed value is false. */
|
|
97
|
+
inactiveLabel?: string | number
|
|
98
|
+
/** Receives a failed save after the toggle restored the last confirmed value. */
|
|
99
|
+
onError?: (error: unknown) => void
|
|
100
|
+
/** Button variant. */
|
|
101
|
+
variant?: ButtonVariant
|
|
102
|
+
/** Button color. */
|
|
103
|
+
color?: ColorVariant
|
|
104
|
+
/** Button size. */
|
|
105
|
+
size?: Size
|
|
106
|
+
/** Whether the button stretches to fill its container. */
|
|
107
|
+
fullWidth?: boolean
|
|
108
|
+
/** Disables the toggle (permissions, never a pending save). */
|
|
109
|
+
disabled?: boolean
|
|
110
|
+
/** Extra classes. */
|
|
111
|
+
className?: string
|
|
112
|
+
/** `data-testid`. */
|
|
113
|
+
testId?: string
|
|
114
|
+
}
|
|
87
115
|
/**
|
|
88
116
|
* Called when the row is activated (called bare, the way React forwards the
|
|
89
117
|
* open button's click). The whole row is clickable through a transparent
|
|
@@ -134,12 +162,14 @@ in {@link ListItemRow.ngAfterViewInit}.
|
|
|
134
162
|
@Component({
|
|
135
163
|
selector: 'div[mol-list-item-row]',
|
|
136
164
|
standalone: true,
|
|
165
|
+
imports: [OptimisticToggleButton],
|
|
137
166
|
inputs: [
|
|
138
167
|
'title',
|
|
139
168
|
'subtitle',
|
|
140
169
|
'metadata',
|
|
141
170
|
'leading',
|
|
142
171
|
'actions',
|
|
172
|
+
'toggle',
|
|
143
173
|
'onClick',
|
|
144
174
|
'selected',
|
|
145
175
|
'disabled',
|
|
@@ -190,6 +220,24 @@ in {@link ListItemRow.ngAfterViewInit}.
|
|
|
190
220
|
</div>
|
|
191
221
|
</div>
|
|
192
222
|
<div #actionsWrap [class]="actionsClass()">
|
|
223
|
+
@if (toggle) {
|
|
224
|
+
<button
|
|
225
|
+
mol-optimistic-toggle-button
|
|
226
|
+
[value]="toggle.value"
|
|
227
|
+
[commit]="toggle.commit"
|
|
228
|
+
[onError]="toggle.onError"
|
|
229
|
+
[variant]="toggle.variant"
|
|
230
|
+
[color]="toggle.color"
|
|
231
|
+
[size]="toggle.size"
|
|
232
|
+
[fullWidth]="toggle.fullWidth ?? false"
|
|
233
|
+
[disabled]="toggle.disabled ?? false"
|
|
234
|
+
[className]="toggle.className"
|
|
235
|
+
[testId]="toggle.testId"
|
|
236
|
+
>
|
|
237
|
+
<span slot="activeLabel">{{ toggle.activeLabel }}</span>
|
|
238
|
+
<span slot="inactiveLabel">{{ toggle.inactiveLabel }}</span>
|
|
239
|
+
</button>
|
|
240
|
+
}
|
|
193
241
|
@if (actionsText()) {
|
|
194
242
|
{{ actionsText() }}
|
|
195
243
|
}
|
|
@@ -201,30 +249,44 @@ export class ListItemRow implements AfterViewInit, AfterViewChecked {
|
|
|
201
249
|
subtitle?: unknown
|
|
202
250
|
metadata?: unknown
|
|
203
251
|
leading?: unknown
|
|
252
|
+
/** Optional right-side actions (`[slot=actions]` content, or text). */
|
|
204
253
|
actions?: unknown
|
|
254
|
+
toggle?: ListItemRowProps['toggle']
|
|
255
|
+
/** Called when the row is activated (React's `onClick`, called bare). */
|
|
205
256
|
onClick?: () => void
|
|
206
257
|
selected?: boolean
|
|
207
258
|
disabled?: boolean
|
|
259
|
+
/** Dense vs comfortable spacing. */
|
|
208
260
|
density?: 'comfortable' | 'compact'
|
|
261
|
+
/** Extra classes. */
|
|
209
262
|
className?: string
|
|
210
263
|
|
|
211
264
|
private static nextNameId = 0
|
|
212
265
|
|
|
213
266
|
readonly nameId = `list-item-row-title-${ListItemRow.nextNameId++}`
|
|
214
267
|
|
|
268
|
+
/** The leading wrapper (detached when no leading value and the slot is empty). */
|
|
215
269
|
@ViewChild('leadingWrap') leadingWrap?: ElementRef<HTMLElement>
|
|
270
|
+
/** The subtitle line (detached when no subtitle value and the slot is empty). */
|
|
216
271
|
@ViewChild('subtitleWrap') subtitleWrap?: ElementRef<HTMLElement>
|
|
272
|
+
/** The metadata line (detached when no metadata value and the slot is empty). */
|
|
217
273
|
@ViewChild('metadataWrap') metadataWrap?: ElementRef<HTMLElement>
|
|
274
|
+
/** The actions wrapper (detached when no actions value and the slot is empty). */
|
|
218
275
|
@ViewChild('actionsWrap') actionsWrap?: ElementRef<HTMLElement>
|
|
219
276
|
|
|
220
277
|
private slotsRead = false
|
|
278
|
+
/** Whether the leading slot holds content (read once with the slots). */
|
|
221
279
|
private hasLeadingSlot = false
|
|
280
|
+
/** Whether the subtitle slot holds content (read once with the slots). */
|
|
222
281
|
private hasSubtitleSlot = false
|
|
282
|
+
/** Whether the metadata slot holds content (read once with the slots). */
|
|
223
283
|
private hasMetadataSlot = false
|
|
284
|
+
/** Whether the actions slot holds content (read once with the slots). */
|
|
224
285
|
private hasActionsSlot = false
|
|
225
286
|
|
|
226
287
|
private readonly guard = new SlotGuard(inject(ElementRef), inject(Renderer2))
|
|
227
288
|
|
|
289
|
+
/** The current class map. */
|
|
228
290
|
cm(): UIClassMap {
|
|
229
291
|
return getClassMap()
|
|
230
292
|
}
|
|
@@ -247,18 +309,22 @@ export class ListItemRow implements AfterViewInit, AfterViewChecked {
|
|
|
247
309
|
)
|
|
248
310
|
}
|
|
249
311
|
|
|
312
|
+
/** Computes the middle stack's class (`cm.flex1` + `cm.stack(0)`). */
|
|
250
313
|
stackClass(): string {
|
|
251
314
|
return this.cm().cn(this.cm().flex1, this.cm().stack(0))
|
|
252
315
|
}
|
|
253
316
|
|
|
317
|
+
/** The leading wrapper's class (`cm.shrink0`). */
|
|
254
318
|
leadingClass(): string {
|
|
255
319
|
return this.cm().cn(this.cm().shrink0)
|
|
256
320
|
}
|
|
257
321
|
|
|
322
|
+
/** The subtitle line's class (`cm.textSize('sm')`). */
|
|
258
323
|
subtitleClass(): string {
|
|
259
324
|
return this.cm().cn(this.cm().textSize('sm'))
|
|
260
325
|
}
|
|
261
326
|
|
|
327
|
+
/** The metadata line's class (`cm.textSize('xs')`). */
|
|
262
328
|
metadataClass(): string {
|
|
263
329
|
return this.cm().cn(this.cm().textSize('xs'))
|
|
264
330
|
}
|
|
@@ -285,24 +351,28 @@ export class ListItemRow implements AfterViewInit, AfterViewChecked {
|
|
|
285
351
|
: ''
|
|
286
352
|
}
|
|
287
353
|
|
|
354
|
+
/** The subtitle input's text (React's `{subtitle}` for a text child). */
|
|
288
355
|
subtitleText(): string {
|
|
289
356
|
return typeof this.subtitle === 'string' || typeof this.subtitle === 'number'
|
|
290
357
|
? String(this.subtitle)
|
|
291
358
|
: ''
|
|
292
359
|
}
|
|
293
360
|
|
|
361
|
+
/** The metadata input's text (React's `{metadata}` for a text child). */
|
|
294
362
|
metadataText(): string {
|
|
295
363
|
return typeof this.metadata === 'string' || typeof this.metadata === 'number'
|
|
296
364
|
? String(this.metadata)
|
|
297
365
|
: ''
|
|
298
366
|
}
|
|
299
367
|
|
|
368
|
+
/** The leading input's text (React's `{leading}` for a text child). */
|
|
300
369
|
leadingText(): string {
|
|
301
370
|
return typeof this.leading === 'string' || typeof this.leading === 'number'
|
|
302
371
|
? String(this.leading)
|
|
303
372
|
: ''
|
|
304
373
|
}
|
|
305
374
|
|
|
375
|
+
/** The actions input's text (React's `{actions}` for a text child). */
|
|
306
376
|
actionsText(): string {
|
|
307
377
|
return typeof this.actions === 'string' || typeof this.actions === 'number'
|
|
308
378
|
? String(this.actions)
|
|
@@ -338,12 +408,15 @@ export class ListItemRow implements AfterViewInit, AfterViewChecked {
|
|
|
338
408
|
this.guard.toggle(leading, this.leadingText() !== '' || this.hasLeadingSlot)
|
|
339
409
|
this.guard.toggle(subtitle, this.subtitleText() !== '' || this.hasSubtitleSlot)
|
|
340
410
|
this.guard.toggle(metadata, this.metadataText() !== '' || this.hasMetadataSlot)
|
|
341
|
-
this.guard.toggle(
|
|
411
|
+
this.guard.toggle(
|
|
412
|
+
actions,
|
|
413
|
+
this.actionsText() !== '' || this.hasActionsSlot || Boolean(this.toggle),
|
|
414
|
+
)
|
|
342
415
|
}
|
|
343
416
|
}
|
|
344
417
|
```
|
|
345
418
|
|
|
346
|
-
_(Member comments are left out to fit; the full declaration is in `node_modules/@molecule/app-list-item-row-angular/dist/list-item-row.component.d.ts`.)_
|
|
419
|
+
_(Member comments are shortened to their first sentence, and the 21 longest are left out to fit; the full declaration is in `node_modules/@molecule/app-list-item-row-angular/dist/list-item-row.component.d.ts`.)_
|
|
347
420
|
|
|
348
421
|
## Injection Notes
|
|
349
422
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Exports `<ListItemRow>` — leading slot (icon/avatar/thumbnail) + up to three
|
|
5
5
|
* text lines (title / subtitle / metadata) + right-side actions. Inputs: `title`,
|
|
6
|
-
* `subtitle?`, `metadata?`, `leading?`, `actions?`, `
|
|
7
|
-
* `disabled?`, `density?` (`'comfortable'` default | `'compact'`),
|
|
6
|
+
* `subtitle?`, `metadata?`, `leading?`, `actions?`, `toggle?`, `onClick?`,
|
|
7
|
+
* `selected?`, `disabled?`, `density?` (`'comfortable'` default | `'compact'`),
|
|
8
|
+
* `className?`.
|
|
8
9
|
* Use for nav lists, mobile menus, search results, picker dialogs, inbox threads.
|
|
9
10
|
* For table rows use `<RowWithActions>` from `@molecule/app-data-table-ui-angular`
|
|
10
11
|
* instead — this component is not a `<tr>`. It is the Angular counterpart of
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,cAAc,8BAA8B,CAAA;AAC5C,cAAc,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Exports `<ListItemRow>` — leading slot (icon/avatar/thumbnail) + up to three
|
|
5
5
|
* text lines (title / subtitle / metadata) + right-side actions. Inputs: `title`,
|
|
6
|
-
* `subtitle?`, `metadata?`, `leading?`, `actions?`, `
|
|
7
|
-
* `disabled?`, `density?` (`'comfortable'` default | `'compact'`),
|
|
6
|
+
* `subtitle?`, `metadata?`, `leading?`, `actions?`, `toggle?`, `onClick?`,
|
|
7
|
+
* `selected?`, `disabled?`, `density?` (`'comfortable'` default | `'compact'`),
|
|
8
|
+
* `className?`.
|
|
8
9
|
* Use for nav lists, mobile menus, search results, picker dialogs, inbox threads.
|
|
9
10
|
* For table rows use `<RowWithActions>` from `@molecule/app-data-table-ui-angular`
|
|
10
11
|
* instead — this component is not a `<tr>`. It is the Angular counterpart of
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,cAAc,8BAA8B,CAAA;AAC5C,cAAc,YAAY,CAAA"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type AfterViewChecked, type AfterViewInit, ElementRef } from '@angular/core';
|
|
7
7
|
import type { UIClassMap } from '@molecule/app-ui';
|
|
8
|
+
import type { ListItemRowProps } from './types.js';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
/**
|
|
10
11
|
* ListItemRow component.
|
|
@@ -42,6 +43,8 @@ export declare class ListItemRow implements AfterViewInit, AfterViewChecked {
|
|
|
42
43
|
leading?: unknown;
|
|
43
44
|
/** Optional right-side actions (`[slot=actions]` content, or text). */
|
|
44
45
|
actions?: unknown;
|
|
46
|
+
/** Loaded boolean action rendered as its own native button, independently of read-only metadata. */
|
|
47
|
+
toggle?: ListItemRowProps['toggle'];
|
|
45
48
|
/**
|
|
46
49
|
* Called when the row is activated (React's `onClick`, called bare). The
|
|
47
50
|
* whole row is clickable through a transparent native button over it, named
|
|
@@ -192,6 +195,6 @@ export declare class ListItemRow implements AfterViewInit, AfterViewChecked {
|
|
|
192
195
|
*/
|
|
193
196
|
private reconcile;
|
|
194
197
|
static ɵfac: i0.ɵɵFactoryDeclaration<ListItemRow, never>;
|
|
195
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ListItemRow, "div[mol-list-item-row]", never, { "title": { "alias": "title"; "required": false; }; "subtitle": { "alias": "subtitle"; "required": false; }; "metadata": { "alias": "metadata"; "required": false; }; "leading": { "alias": "leading"; "required": false; }; "actions": { "alias": "actions"; "required": false; }; "onClick": { "alias": "onClick"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "density": { "alias": "density"; "required": false; }; "className": { "alias": "className"; "required": false; }; }, {}, never, ["[slot=leading]", "[slot=title]", "[slot=subtitle]", "[slot=metadata]", "[slot=actions]"], true, never>;
|
|
198
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ListItemRow, "div[mol-list-item-row]", never, { "title": { "alias": "title"; "required": false; }; "subtitle": { "alias": "subtitle"; "required": false; }; "metadata": { "alias": "metadata"; "required": false; }; "leading": { "alias": "leading"; "required": false; }; "actions": { "alias": "actions"; "required": false; }; "toggle": { "alias": "toggle"; "required": false; }; "onClick": { "alias": "onClick"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "density": { "alias": "density"; "required": false; }; "className": { "alias": "className"; "required": false; }; }, {}, never, ["[slot=leading]", "[slot=title]", "[slot=subtitle]", "[slot=metadata]", "[slot=actions]"], true, never>;
|
|
196
199
|
}
|
|
197
200
|
//# sourceMappingURL=list-item-row.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item-row.component.d.ts","sourceRoot":"","sources":["../src/list-item-row.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAElB,UAAU,EAIX,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;
|
|
1
|
+
{"version":3,"file":"list-item-row.component.d.ts","sourceRoot":"","sources":["../src/list-item-row.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAElB,UAAU,EAIX,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAKlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;;AAElD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAqFa,WAAY,YAAW,aAAa,EAAE,gBAAgB;IACjE,4FAA4F;IAC5F,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,yFAAyF;IACzF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,2FAA2F;IAC3F,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,uEAAuE;IACvE,OAAO,CAAC,EAAE,O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AGG;IACH,aAAa,IAAI,MAAM;IAIvB;;;OAGG;IACH,aAAa,IAAI,MAAM;IAIvB;;;;OAIG;IACH,YAAY,IAAI,MAAM;IAItB;;;OAGG;IACH,UAAU,IAAI,MAAM;IAIpB;;;;;OAKG;IACH,aAAa,IAAI,OAAO;IAIxB;;;;OAIG;IACH,IAAI,IAAI,CAAC,GAAG,CAAC;IAIb;;;;OAIG;IACH,SAAS,IAAI,MAAM;IAMnB;;;OAGG;IACH,YAAY,IAAI,MAAM;IAMtB;;;OAGG;IACH,YAAY,IAAI,MAAM;IAMtB;;;OAGG;IACH,WAAW,IAAI,MAAM;IAMrB;;;OAGG;IACH,WAAW,IAAI,MAAM;IAMrB;;;;;OAKG;IACH,WAAW,IAAI,IAAI;IAKnB,gGAAgG;IAChG,eAAe,IAAI,IAAI;IAIvB;;;;OAIG;IACH,kBAAkB,IAAI,IAAI;IAI1B;;;;;OAKG;IACH,OAAO,CAAC,SAAS;yCArPN,WAAW;2CAAX,WAAW;CA0QvB"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Component, ElementRef, inject, Renderer2, ViewChild, } from '@angular/core';
|
|
7
7
|
import { getClassMap } from '@molecule/app-ui';
|
|
8
|
+
import { OptimisticToggleButton } from '@molecule/app-ui-angular';
|
|
8
9
|
import { hasNodes, SlotGuard } from './slot-dom.js';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
const _c0 = ["leadingWrap"];
|
|
@@ -15,9 +16,9 @@ const _c4 = [[["", "slot", "leading"]], [["", "slot", "title"]], [["", "slot", "
|
|
|
15
16
|
const _c5 = ["[slot=leading]", "[slot=title]", "[slot=subtitle]", "[slot=metadata]", "[slot=actions]"];
|
|
16
17
|
function ListItemRow_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
17
18
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
18
|
-
i0.ɵɵ
|
|
19
|
-
i0.ɵɵ
|
|
20
|
-
i0.ɵɵ
|
|
19
|
+
i0.ɵɵelementStart(0, "button", 6);
|
|
20
|
+
i0.ɵɵlistener("click", function ListItemRow_Conditional_0_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.handleClick()); });
|
|
21
|
+
i0.ɵɵelementEnd();
|
|
21
22
|
} if (rf & 2) {
|
|
22
23
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
23
24
|
i0.ɵɵclassMap(ctx_r1.openButtonClasses());
|
|
@@ -48,6 +49,21 @@ function ListItemRow_Conditional_15_Template(rf, ctx) { if (rf & 1) {
|
|
|
48
49
|
i0.ɵɵtextInterpolate1(" ", ctx_r1.metadataText(), " ");
|
|
49
50
|
} }
|
|
50
51
|
function ListItemRow_Conditional_19_Template(rf, ctx) { if (rf & 1) {
|
|
52
|
+
i0.ɵɵelementStart(0, "button", 5)(1, "span", 7);
|
|
53
|
+
i0.ɵɵtext(2);
|
|
54
|
+
i0.ɵɵelementEnd();
|
|
55
|
+
i0.ɵɵelementStart(3, "span", 8);
|
|
56
|
+
i0.ɵɵtext(4);
|
|
57
|
+
i0.ɵɵelementEnd()();
|
|
58
|
+
} if (rf & 2) {
|
|
59
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
60
|
+
i0.ɵɵproperty("value", ctx_r1.toggle.value)("commit", ctx_r1.toggle.commit)("onError", ctx_r1.toggle.onError)("variant", ctx_r1.toggle.variant)("color", ctx_r1.toggle.color)("size", ctx_r1.toggle.size)("fullWidth", ctx_r1.toggle.fullWidth ?? false)("disabled", ctx_r1.toggle.disabled ?? false)("className", ctx_r1.toggle.className)("testId", ctx_r1.toggle.testId);
|
|
61
|
+
i0.ɵɵadvance(2);
|
|
62
|
+
i0.ɵɵtextInterpolate(ctx_r1.toggle.activeLabel);
|
|
63
|
+
i0.ɵɵadvance(2);
|
|
64
|
+
i0.ɵɵtextInterpolate(ctx_r1.toggle.inactiveLabel);
|
|
65
|
+
} }
|
|
66
|
+
function ListItemRow_Conditional_20_Template(rf, ctx) { if (rf & 1) {
|
|
51
67
|
i0.ɵɵtext(0);
|
|
52
68
|
} if (rf & 2) {
|
|
53
69
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
@@ -89,6 +105,8 @@ export class ListItemRow {
|
|
|
89
105
|
leading;
|
|
90
106
|
/** Optional right-side actions (`[slot=actions]` content, or text). */
|
|
91
107
|
actions;
|
|
108
|
+
/** Loaded boolean action rendered as its own native button, independently of read-only metadata. */
|
|
109
|
+
toggle;
|
|
92
110
|
/**
|
|
93
111
|
* Called when the row is activated (React's `onClick`, called bare). The
|
|
94
112
|
* whole row is clickable through a transparent native button over it, named
|
|
@@ -302,7 +320,7 @@ export class ListItemRow {
|
|
|
302
320
|
this.guard.toggle(leading, this.leadingText() !== '' || this.hasLeadingSlot);
|
|
303
321
|
this.guard.toggle(subtitle, this.subtitleText() !== '' || this.hasSubtitleSlot);
|
|
304
322
|
this.guard.toggle(metadata, this.metadataText() !== '' || this.hasMetadataSlot);
|
|
305
|
-
this.guard.toggle(actions, this.actionsText() !== '' || this.hasActionsSlot);
|
|
323
|
+
this.guard.toggle(actions, this.actionsText() !== '' || this.hasActionsSlot || Boolean(this.toggle));
|
|
306
324
|
}
|
|
307
325
|
static ɵfac = function ListItemRow_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ListItemRow)(); };
|
|
308
326
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ListItemRow, selectors: [["div", "mol-list-item-row", ""]], viewQuery: function ListItemRow_Query(rf, ctx) { if (rf & 1) {
|
|
@@ -317,29 +335,30 @@ export class ListItemRow {
|
|
|
317
335
|
i0.ɵɵattribute("aria-current", ctx.selected ? "true" : null)("aria-disabled", ctx.disabled ?? null);
|
|
318
336
|
i0.ɵɵclassMap(ctx.classes());
|
|
319
337
|
i0.ɵɵstyleProp("opacity", ctx.disabled ? 0.5 : null);
|
|
320
|
-
} }, inputs: { title: "title", subtitle: "subtitle", metadata: "metadata", leading: "leading", actions: "actions", onClick: "onClick", selected: "selected", disabled: "disabled", density: "density", className: "className" }, ngContentSelectors: _c5, decls:
|
|
338
|
+
} }, inputs: { title: "title", subtitle: "subtitle", metadata: "metadata", leading: "leading", actions: "actions", toggle: "toggle", onClick: "onClick", selected: "selected", disabled: "disabled", density: "density", className: "className" }, ngContentSelectors: _c5, decls: 22, vars: 20, consts: [["leadingWrap", ""], ["subtitleWrap", ""], ["metadataWrap", ""], ["actionsWrap", ""], ["type", "button", "data-mol-id", "list-item-row-open", 2, "background", "transparent", "border", "medium", "padding", "0px", 3, "class"], ["mol-optimistic-toggle-button", "", 3, "value", "commit", "onError", "variant", "color", "size", "fullWidth", "disabled", "className", "testId"], ["type", "button", "data-mol-id", "list-item-row-open", 2, "background", "transparent", "border", "medium", "padding", "0px", 3, "click"], ["slot", "activeLabel"], ["slot", "inactiveLabel"]], template: function ListItemRow_Template(rf, ctx) { if (rf & 1) {
|
|
321
339
|
i0.ɵɵprojectionDef(_c4);
|
|
322
340
|
i0.ɵɵconditionalCreate(0, ListItemRow_Conditional_0_Template, 1, 4, "button", 4);
|
|
323
|
-
i0.ɵɵ
|
|
341
|
+
i0.ɵɵelementStart(1, "div", null, 0);
|
|
324
342
|
i0.ɵɵconditionalCreate(3, ListItemRow_Conditional_3_Template, 1, 1);
|
|
325
343
|
i0.ɵɵprojection(4);
|
|
326
|
-
i0.ɵɵ
|
|
327
|
-
i0.ɵɵ
|
|
344
|
+
i0.ɵɵelementEnd();
|
|
345
|
+
i0.ɵɵelementStart(5, "div")(6, "div");
|
|
328
346
|
i0.ɵɵconditionalCreate(7, ListItemRow_Conditional_7_Template, 1, 1);
|
|
329
347
|
i0.ɵɵprojection(8, 1);
|
|
330
|
-
i0.ɵɵ
|
|
331
|
-
i0.ɵɵ
|
|
348
|
+
i0.ɵɵelementEnd();
|
|
349
|
+
i0.ɵɵelementStart(9, "div", null, 1);
|
|
332
350
|
i0.ɵɵconditionalCreate(11, ListItemRow_Conditional_11_Template, 1, 1);
|
|
333
351
|
i0.ɵɵprojection(12, 2);
|
|
334
|
-
i0.ɵɵ
|
|
335
|
-
i0.ɵɵ
|
|
352
|
+
i0.ɵɵelementEnd();
|
|
353
|
+
i0.ɵɵelementStart(13, "div", null, 2);
|
|
336
354
|
i0.ɵɵconditionalCreate(15, ListItemRow_Conditional_15_Template, 1, 1);
|
|
337
355
|
i0.ɵɵprojection(16, 3);
|
|
338
|
-
i0.ɵɵ
|
|
339
|
-
i0.ɵɵ
|
|
340
|
-
i0.ɵɵconditionalCreate(19, ListItemRow_Conditional_19_Template,
|
|
341
|
-
i0.ɵɵ
|
|
342
|
-
i0.ɵɵ
|
|
356
|
+
i0.ɵɵelementEnd()();
|
|
357
|
+
i0.ɵɵelementStart(17, "div", null, 3);
|
|
358
|
+
i0.ɵɵconditionalCreate(19, ListItemRow_Conditional_19_Template, 5, 12, "button", 5);
|
|
359
|
+
i0.ɵɵconditionalCreate(20, ListItemRow_Conditional_20_Template, 1, 1);
|
|
360
|
+
i0.ɵɵprojection(21, 4);
|
|
361
|
+
i0.ɵɵelementEnd();
|
|
343
362
|
} if (rf & 2) {
|
|
344
363
|
i0.ɵɵconditional(ctx.onClick ? 0 : -1);
|
|
345
364
|
i0.ɵɵadvance();
|
|
@@ -364,20 +383,24 @@ export class ListItemRow {
|
|
|
364
383
|
i0.ɵɵadvance(2);
|
|
365
384
|
i0.ɵɵclassMap(ctx.actionsClass());
|
|
366
385
|
i0.ɵɵadvance(2);
|
|
367
|
-
i0.ɵɵconditional(ctx.
|
|
368
|
-
|
|
386
|
+
i0.ɵɵconditional(ctx.toggle ? 19 : -1);
|
|
387
|
+
i0.ɵɵadvance();
|
|
388
|
+
i0.ɵɵconditional(ctx.actionsText() ? 20 : -1);
|
|
389
|
+
} }, dependencies: [OptimisticToggleButton], encapsulation: 2 });
|
|
369
390
|
}
|
|
370
391
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ListItemRow, [{
|
|
371
392
|
type: Component,
|
|
372
393
|
args: [{
|
|
373
394
|
selector: 'div[mol-list-item-row]',
|
|
374
395
|
standalone: true,
|
|
396
|
+
imports: [OptimisticToggleButton],
|
|
375
397
|
inputs: [
|
|
376
398
|
'title',
|
|
377
399
|
'subtitle',
|
|
378
400
|
'metadata',
|
|
379
401
|
'leading',
|
|
380
402
|
'actions',
|
|
403
|
+
'toggle',
|
|
381
404
|
'onClick',
|
|
382
405
|
'selected',
|
|
383
406
|
'disabled',
|
|
@@ -428,6 +451,24 @@ export class ListItemRow {
|
|
|
428
451
|
</div>
|
|
429
452
|
</div>
|
|
430
453
|
<div #actionsWrap [class]="actionsClass()">
|
|
454
|
+
@if (toggle) {
|
|
455
|
+
<button
|
|
456
|
+
mol-optimistic-toggle-button
|
|
457
|
+
[value]="toggle.value"
|
|
458
|
+
[commit]="toggle.commit"
|
|
459
|
+
[onError]="toggle.onError"
|
|
460
|
+
[variant]="toggle.variant"
|
|
461
|
+
[color]="toggle.color"
|
|
462
|
+
[size]="toggle.size"
|
|
463
|
+
[fullWidth]="toggle.fullWidth ?? false"
|
|
464
|
+
[disabled]="toggle.disabled ?? false"
|
|
465
|
+
[className]="toggle.className"
|
|
466
|
+
[testId]="toggle.testId"
|
|
467
|
+
>
|
|
468
|
+
<span slot="activeLabel">{{ toggle.activeLabel }}</span>
|
|
469
|
+
<span slot="inactiveLabel">{{ toggle.inactiveLabel }}</span>
|
|
470
|
+
</button>
|
|
471
|
+
}
|
|
431
472
|
@if (actionsText()) {
|
|
432
473
|
{{ actionsText() }}
|
|
433
474
|
}
|
|
@@ -447,5 +488,5 @@ export class ListItemRow {
|
|
|
447
488
|
type: ViewChild,
|
|
448
489
|
args: ['actionsWrap']
|
|
449
490
|
}] }); })();
|
|
450
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ListItemRow, { className: "ListItemRow", filePath: "list-item-row.component.ts", lineNumber:
|
|
491
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ListItemRow, { className: "ListItemRow", filePath: "list-item-row.component.ts", lineNumber: 134 }); })();
|
|
451
492
|
//# sourceMappingURL=list-item-row.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item-row.component.js","sourceRoot":"","sources":["../src/list-item-row.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,SAAS,EACT,UAAU,EACV,MAAM,EACN,SAAS,EACT,SAAS,GACV,MAAM,eAAe,CAAA;AAGtB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"list-item-row.component.js","sourceRoot":"","sources":["../src/list-item-row.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,SAAS,EACT,UAAU,EACV,MAAM,EACN,SAAS,EACT,SAAS,GACV,MAAM,eAAe,CAAA;AAGtB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;;;;;;;;;;IAoD7C,iCAQC;IAHC,+KAAS,oBAAa,KAAC;IAGxB,iBAAS;;;IAFR,yCAA6B;;;;IAM7B,YACF;;;IADE,qDACF;;;IAMI,YACF;;;IADE,mDACF;;;IAKE,YACF;;;IADE,sDACF;;;IAKE,YACF;;;IADE,sDACF;;;IAmBE,AAbF,iCAYC,cAC0B;IAAA,YAAwB;IAAA,iBAAO;IACxD,+BAA2B;IAAA,YAA0B;IACvD,AADuD,iBAAO,EACrD;;;IAJP,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,2CAAsB,gCACE,kCACE,kCACA,8BACJ,4BACF,+CACmB,6CACF,sCACP,gCACN;IAEC,eAAwB;IAAxB,+CAAwB;IAC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@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
+
import type { ButtonVariant, ColorVariant, Size } from '@molecule/app-ui';
|
|
6
7
|
/** Props accepted by the {@link ListItemRow} component (its inputs). */
|
|
7
8
|
export interface ListItemRowProps {
|
|
8
9
|
/** Title — first line. A string/number renders as text; nodes are `[slot=title]` projected content. */
|
|
@@ -15,6 +16,33 @@ export interface ListItemRowProps {
|
|
|
15
16
|
leading?: string | number;
|
|
16
17
|
/** Optional right-side actions (buttons, action menu; `[slot=actions]` content, or text). */
|
|
17
18
|
actions?: string | number;
|
|
19
|
+
/** Loaded boolean action rendered as its own native button, independently of read-only metadata. */
|
|
20
|
+
toggle?: {
|
|
21
|
+
/** The loaded server value. */
|
|
22
|
+
value: boolean;
|
|
23
|
+
/** Saves the desired boolean and resolves with the server-confirmed boolean. */
|
|
24
|
+
commit: (desired: boolean) => Promise<boolean>;
|
|
25
|
+
/** Label when the displayed value is true. */
|
|
26
|
+
activeLabel?: string | number;
|
|
27
|
+
/** Label when the displayed value is false. */
|
|
28
|
+
inactiveLabel?: string | number;
|
|
29
|
+
/** Receives a failed save after the toggle restored the last confirmed value. */
|
|
30
|
+
onError?: (error: unknown) => void;
|
|
31
|
+
/** Button variant. */
|
|
32
|
+
variant?: ButtonVariant;
|
|
33
|
+
/** Button color. */
|
|
34
|
+
color?: ColorVariant;
|
|
35
|
+
/** Button size. */
|
|
36
|
+
size?: Size;
|
|
37
|
+
/** Whether the button stretches to fill its container. */
|
|
38
|
+
fullWidth?: boolean;
|
|
39
|
+
/** Disables the toggle (permissions, never a pending save). */
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
/** Extra classes. */
|
|
42
|
+
className?: string;
|
|
43
|
+
/** `data-testid`. */
|
|
44
|
+
testId?: string;
|
|
45
|
+
};
|
|
18
46
|
/**
|
|
19
47
|
* Called when the row is activated (called bare, the way React forwards the
|
|
20
48
|
* open button's click). The whole row is clickable through a transparent
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,uGAAuG;IACvG,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,yHAAyH;IACzH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,uIAAuI;IACvI,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,iGAAiG;IACjG,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,6FAA6F;IAC7F,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,6HAA6H;IAC7H,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iEAAiE;IACjE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAA;IACnC,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAEzE,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,uGAAuG;IACvG,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,yHAAyH;IACzH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,uIAAuI;IACvI,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,iGAAiG;IACjG,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,C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version": "1.2.0",
|
|
4
4
|
"description": "Thumbnail + title + subtitle + metadata + actions row (nav lists, mobile menus)",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-list-item-row-angular",
|
|
6
6
|
"type": "module",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"@angular/compiler-cli": "22.2.3",
|
|
56
56
|
"@angular/core": "22.2.3",
|
|
57
57
|
"@angular/platform-browser": "22.2.3",
|
|
58
|
-
"@molecule/app-angular": "3.7.
|
|
58
|
+
"@molecule/app-angular": "3.7.2",
|
|
59
59
|
"@molecule/app-framework-conformance": "0.0.0",
|
|
60
60
|
"@molecule/app-i18n": "1.2.2",
|
|
61
61
|
"@molecule/app-icons": "1.0.4",
|
|
62
62
|
"@molecule/app-ui": "1.4.0",
|
|
63
|
-
"@molecule/app-ui-angular": "1.2.
|
|
63
|
+
"@molecule/app-ui-angular": "1.2.1",
|
|
64
64
|
"@types/node": "26.6.5",
|
|
65
65
|
"jsdom": "30.1.3",
|
|
66
66
|
"rxjs": "7.8.2",
|