@molecule/app-query-angular 1.2.1 → 1.3.1
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 +33 -4
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/query-content.component.d.ts +4 -1
- package/dist/query-content.component.d.ts.map +1 -1
- package/dist/query-content.component.js +11 -4
- package/dist/query-content.component.js.map +1 -1
- package/dist/types.d.ts +11 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
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-17T05:18:37.922Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-query-angular
|
|
@@ -483,6 +483,8 @@ interface QueryResource<T, Create = Partial<T>, Update = Partial<T>> {
|
|
|
483
483
|
/**
|
|
484
484
|
* `useQuery` options for the collection. `viewer` is who the answer is for (the signed-in id,
|
|
485
485
|
* or `'anonymous'`); a page or filter change keeps the rows on screen until the next answer.
|
|
486
|
+
* One record per URL identity, retaining the first occurrence. Equal values without an
|
|
487
|
+
* addressable id remain separate. Writes already refresh the collection.
|
|
486
488
|
*/
|
|
487
489
|
list(viewer: string, params?: Record<string, unknown>): QueryOptions<T[]>
|
|
488
490
|
/**
|
|
@@ -621,8 +623,19 @@ A loaded document owns its controls; absent documents expose only status content
|
|
|
621
623
|
|
|
622
624
|
```typescript
|
|
623
625
|
interface QueryContentProps<T> {
|
|
626
|
+
/**
|
|
627
|
+
* One optional empty branch, exclusive with children. The pure predicate reads the
|
|
628
|
+
* loaded document (an array or an application-owned envelope); render selects the
|
|
629
|
+
* current view's message and recovery action. A previous key's empty document uses
|
|
630
|
+
* pending/error instead. Omit it to keep empty arrays as data.
|
|
631
|
+
*/
|
|
632
|
+
empty?: {
|
|
633
|
+
when: (data: NonNullable<T>) => boolean
|
|
634
|
+
render: NonNullable<QueryContentProps<T>['children']>
|
|
635
|
+
}
|
|
636
|
+
|
|
624
637
|
/** State from useQuery, or any compatible query observer. */
|
|
625
|
-
query: Pick<QueryState<T>, 'data' | 'status' | 'error'>
|
|
638
|
+
query: Pick<QueryState<T>, 'data' | 'status' | 'error' | 'isPreviousData'>
|
|
626
639
|
/** Mounted only with a real document, including false, zero and an empty list. */
|
|
627
640
|
children: TemplateRef<QueryContentContext<T>> | null
|
|
628
641
|
/** Initial idle/loading content. Render a status template, never a fake item or action. */
|
|
@@ -680,6 +693,7 @@ swallow an early click. Cached data remains mounted during refresh, including
|
|
|
680
693
|
a failed refresh. Status fallbacks belong outside the list or record
|
|
681
694
|
container rendered by `children`, and so does a refresh line; the default
|
|
682
695
|
fallbacks render nothing.
|
|
696
|
+
A previous key's empty or missing document renders pending/error until the current key answers.
|
|
683
697
|
|
|
684
698
|
The templates receive the render arguments as template context: `children`
|
|
685
699
|
gets the document as `$implicit` and `a0` (`let-data`), `error` gets the
|
|
@@ -690,7 +704,7 @@ error value (`let-error`), and `pending`/`missing` render without a context.
|
|
|
690
704
|
selector: 'mol-query-content',
|
|
691
705
|
standalone: true,
|
|
692
706
|
template: '<ng-container #outlet></ng-container>',
|
|
693
|
-
inputs: ['query', 'pending', 'missing', 'children', 'error'],
|
|
707
|
+
inputs: ['query', 'pending', 'missing', 'children', 'error', 'empty'],
|
|
694
708
|
host: {
|
|
695
709
|
'data-parity-unwrap': '',
|
|
696
710
|
style: 'display: contents',
|
|
@@ -705,6 +719,8 @@ export class QueryContent<T = unknown> implements DoCheck, OnChanges {
|
|
|
705
719
|
pending: TemplateRef<unknown> | null = null
|
|
706
720
|
/** Content for a loaded null record. Null is distinct from an unfinished request. */
|
|
707
721
|
missing: TemplateRef<unknown> | null = null
|
|
722
|
+
/** One empty collection template, exclusive with the loaded children. */
|
|
723
|
+
empty: QueryContentProps<T>['empty'] = undefined
|
|
708
724
|
/** A failed initial read. Cached data stays visible if its refresh fails. */
|
|
709
725
|
error: TemplateRef<QueryContentErrorContext> | null = null
|
|
710
726
|
|
|
@@ -735,6 +751,7 @@ export class QueryContent<T = unknown> implements DoCheck, OnChanges {
|
|
|
735
751
|
void query?.data
|
|
736
752
|
void query?.status
|
|
737
753
|
void query?.error
|
|
754
|
+
void query?.isPreviousData
|
|
738
755
|
untracked(() => {
|
|
739
756
|
this.update()
|
|
740
757
|
this.changeDetector.markForCheck()
|
|
@@ -748,7 +765,10 @@ export class QueryContent<T = unknown> implements DoCheck, OnChanges {
|
|
|
748
765
|
*/
|
|
749
766
|
private branch(): Branch {
|
|
750
767
|
const query = this.query
|
|
751
|
-
if (
|
|
768
|
+
if (
|
|
769
|
+
query?.data === undefined ||
|
|
770
|
+
(query.isPreviousData && (query.data === null || this.empty?.when(query.data)))
|
|
771
|
+
) {
|
|
752
772
|
return query?.status === 'error' && this.error
|
|
753
773
|
? {
|
|
754
774
|
template: this.error,
|
|
@@ -757,6 +777,8 @@ export class QueryContent<T = unknown> implements DoCheck, OnChanges {
|
|
|
757
777
|
: { template: this.pending ?? null, context: {} }
|
|
758
778
|
}
|
|
759
779
|
if (query.data === null) return { template: this.missing ?? null, context: {} }
|
|
780
|
+
if (this.empty?.when(query.data))
|
|
781
|
+
return { template: this.empty.render, context: { $implicit: query.data, a0: query.data } }
|
|
760
782
|
return { template: this.children, context: { $implicit: query.data, a0: query.data } }
|
|
761
783
|
}
|
|
762
784
|
|
|
@@ -1055,3 +1077,10 @@ read the record, not "Loading…".
|
|
|
1055
1077
|
Keep every resource identity in the query key. A boundary cannot correct a query that supplies
|
|
1056
1078
|
another record's cached data. For a list, map real rows inside the children template; never
|
|
1057
1079
|
style a status placeholder as a row.
|
|
1080
|
+
|
|
1081
|
+
For a collection, `QueryContent` also accepts one `empty` branch:
|
|
1082
|
+
`{ when: page => page.rows.length === 0, render: page => selectedEmptyState }`.
|
|
1083
|
+
It is exclusive with loaded children, so a selected view chooses its message and
|
|
1084
|
+
recovery action once rather than rendering a general empty message beside it.
|
|
1085
|
+
`when` receives a loaded document; empty arrays remain data when this prop is omitted.
|
|
1086
|
+
The render value uses this framework's existing children function, snippet or template.
|
package/dist/index.d.ts
CHANGED
|
@@ -455,6 +455,13 @@
|
|
|
455
455
|
* another record's cached data. For a list, map real rows inside the children template; never
|
|
456
456
|
* style a status placeholder as a row.
|
|
457
457
|
*
|
|
458
|
+
* For a collection, `QueryContent` also accepts one `empty` branch:
|
|
459
|
+
* `{ when: page => page.rows.length === 0, render: page => selectedEmptyState }`.
|
|
460
|
+
* It is exclusive with loaded children, so a selected view chooses its message and
|
|
461
|
+
* recovery action once rather than rendering a general empty message beside it.
|
|
462
|
+
* `when` receives a loaded document; empty arrays remain data when this prop is omitted.
|
|
463
|
+
* The render value uses this framework's existing children function, snippet or template.
|
|
464
|
+
*
|
|
458
465
|
* @module
|
|
459
466
|
*/
|
|
460
467
|
export * from './list-query.js';
|
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,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -455,6 +455,13 @@
|
|
|
455
455
|
* another record's cached data. For a list, map real rows inside the children template; never
|
|
456
456
|
* style a status placeholder as a row.
|
|
457
457
|
*
|
|
458
|
+
* For a collection, `QueryContent` also accepts one `empty` branch:
|
|
459
|
+
* `{ when: page => page.rows.length === 0, render: page => selectedEmptyState }`.
|
|
460
|
+
* It is exclusive with loaded children, so a selected view chooses its message and
|
|
461
|
+
* recovery action once rather than rendering a general empty message beside it.
|
|
462
|
+
* `when` receives a loaded document; empty arrays remain data when this prop is omitted.
|
|
463
|
+
* The render value uses this framework's existing children function, snippet or template.
|
|
464
|
+
*
|
|
458
465
|
* @module
|
|
459
466
|
*/
|
|
460
467
|
export * from './list-query.js';
|
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,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA"}
|
|
@@ -16,6 +16,7 @@ import * as i0 from "@angular/core";
|
|
|
16
16
|
* a failed refresh. Status fallbacks belong outside the list or record
|
|
17
17
|
* container rendered by `children`, and so does a refresh line; the default
|
|
18
18
|
* fallbacks render nothing.
|
|
19
|
+
* A previous key's empty or missing document renders pending/error until the current key answers.
|
|
19
20
|
*
|
|
20
21
|
* The templates receive the render arguments as template context: `children`
|
|
21
22
|
* gets the document as `$implicit` and `a0` (`let-data`), `error` gets the
|
|
@@ -30,6 +31,8 @@ export declare class QueryContent<T = unknown> implements DoCheck, OnChanges {
|
|
|
30
31
|
pending: TemplateRef<unknown> | null;
|
|
31
32
|
/** Content for a loaded null record. Null is distinct from an unfinished request. */
|
|
32
33
|
missing: TemplateRef<unknown> | null;
|
|
34
|
+
/** One empty collection template, exclusive with the loaded children. */
|
|
35
|
+
empty: QueryContentProps<T>['empty'];
|
|
33
36
|
/** A failed initial read. Cached data stays visible if its refresh fails. */
|
|
34
37
|
error: TemplateRef<QueryContentErrorContext> | null;
|
|
35
38
|
/** Where the chosen branch renders. */
|
|
@@ -68,6 +71,6 @@ export declare class QueryContent<T = unknown> implements DoCheck, OnChanges {
|
|
|
68
71
|
*/
|
|
69
72
|
private update;
|
|
70
73
|
static ɵfac: i0.ɵɵFactoryDeclaration<QueryContent<any>, never>;
|
|
71
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<QueryContent<any>, "mol-query-content", never, { "query": { "alias": "query"; "required": false; }; "pending": { "alias": "pending"; "required": false; }; "missing": { "alias": "missing"; "required": false; }; "children": { "alias": "children"; "required": false; }; "error": { "alias": "error"; "required": false; }; }, {}, never, never, true, never>;
|
|
74
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<QueryContent<any>, "mol-query-content", never, { "query": { "alias": "query"; "required": false; }; "pending": { "alias": "pending"; "required": false; }; "missing": { "alias": "missing"; "required": false; }; "children": { "alias": "children"; "required": false; }; "error": { "alias": "error"; "required": false; }; "empty": { "alias": "empty"; "required": false; }; }, {}, never, never, true, never>;
|
|
72
75
|
}
|
|
73
76
|
//# sourceMappingURL=query-content.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-content.component.d.ts","sourceRoot":"","sources":["../src/query-content.component.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAGL,KAAK,OAAO,EAIZ,KAAK,SAAS,EAEd,KAAK,WAAW,EAIjB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;;AAQlG
|
|
1
|
+
{"version":3,"file":"query-content.component.d.ts","sourceRoot":"","sources":["../src/query-content.component.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAGL,KAAK,OAAO,EAIZ,KAAK,SAAS,EAEd,KAAK,WAAW,EAIjB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAA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ong outside the list or record
|
|
17
17
|
* container rendered by `children`, and so does a refresh line; the default
|
|
18
18
|
* fallbacks render nothing.
|
|
19
|
+
* A previous key's empty or missing document renders pending/error until the current key answers.
|
|
19
20
|
*
|
|
20
21
|
* The templates receive the render arguments as template context: `children`
|
|
21
22
|
* gets the document as `$implicit` and `a0` (`let-data`), `error` gets the
|
|
@@ -30,6 +31,8 @@ export class QueryContent {
|
|
|
30
31
|
pending = null;
|
|
31
32
|
/** Content for a loaded null record. Null is distinct from an unfinished request. */
|
|
32
33
|
missing = null;
|
|
34
|
+
/** One empty collection template, exclusive with the loaded children. */
|
|
35
|
+
empty = undefined;
|
|
33
36
|
/** A failed initial read. Cached data stays visible if its refresh fails. */
|
|
34
37
|
error = null;
|
|
35
38
|
/** Where the chosen branch renders. */
|
|
@@ -58,6 +61,7 @@ export class QueryContent {
|
|
|
58
61
|
void query?.data;
|
|
59
62
|
void query?.status;
|
|
60
63
|
void query?.error;
|
|
64
|
+
void query?.isPreviousData;
|
|
61
65
|
untracked(() => {
|
|
62
66
|
this.update();
|
|
63
67
|
this.changeDetector.markForCheck();
|
|
@@ -70,7 +74,8 @@ export class QueryContent {
|
|
|
70
74
|
*/
|
|
71
75
|
branch() {
|
|
72
76
|
const query = this.query;
|
|
73
|
-
if (query?.data === undefined
|
|
77
|
+
if (query?.data === undefined ||
|
|
78
|
+
(query.isPreviousData && (query.data === null || this.empty?.when(query.data)))) {
|
|
74
79
|
return query?.status === 'error' && this.error
|
|
75
80
|
? {
|
|
76
81
|
template: this.error,
|
|
@@ -80,6 +85,8 @@ export class QueryContent {
|
|
|
80
85
|
}
|
|
81
86
|
if (query.data === null)
|
|
82
87
|
return { template: this.missing ?? null, context: {} };
|
|
88
|
+
if (this.empty?.when(query.data))
|
|
89
|
+
return { template: this.empty.render, context: { $implicit: query.data, a0: query.data } };
|
|
83
90
|
return { template: this.children, context: { $implicit: query.data, a0: query.data } };
|
|
84
91
|
}
|
|
85
92
|
/**
|
|
@@ -124,7 +131,7 @@ export class QueryContent {
|
|
|
124
131
|
} if (rf & 2) {
|
|
125
132
|
let _t;
|
|
126
133
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.outlet = _t.first);
|
|
127
|
-
} }, hostAttrs: ["data-parity-unwrap", "", 2, "display", "contents"], inputs: { query: "query", pending: "pending", missing: "missing", children: "children", error: "error" }, features: [i0.ɵɵNgOnChangesFeature], decls: 2, vars: 0, consts: [["outlet", ""]], template: function QueryContent_Template(rf, ctx) { if (rf & 1) {
|
|
134
|
+
} }, hostAttrs: ["data-parity-unwrap", "", 2, "display", "contents"], inputs: { query: "query", pending: "pending", missing: "missing", children: "children", error: "error", empty: "empty" }, features: [i0.ɵɵNgOnChangesFeature], decls: 2, vars: 0, consts: [["outlet", ""]], template: function QueryContent_Template(rf, ctx) { if (rf & 1) {
|
|
128
135
|
i0.ɵɵdomElementContainer(0, null, 0);
|
|
129
136
|
} }, encapsulation: 2 });
|
|
130
137
|
}
|
|
@@ -134,7 +141,7 @@ export class QueryContent {
|
|
|
134
141
|
selector: 'mol-query-content',
|
|
135
142
|
standalone: true,
|
|
136
143
|
template: '<ng-container #outlet></ng-container>',
|
|
137
|
-
inputs: ['query', 'pending', 'missing', 'children', 'error'],
|
|
144
|
+
inputs: ['query', 'pending', 'missing', 'children', 'error', 'empty'],
|
|
138
145
|
host: {
|
|
139
146
|
'data-parity-unwrap': '',
|
|
140
147
|
style: 'display: contents',
|
|
@@ -144,5 +151,5 @@ export class QueryContent {
|
|
|
144
151
|
type: ViewChild,
|
|
145
152
|
args: ['outlet', { read: ViewContainerRef, static: true }]
|
|
146
153
|
}] }); })();
|
|
147
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryContent, { className: "QueryContent", filePath: "query-content.component.ts", lineNumber:
|
|
154
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryContent, { className: "QueryContent", filePath: "query-content.component.ts", lineNumber: 55 }); })();
|
|
148
155
|
//# sourceMappingURL=query-content.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-content.component.js","sourceRoot":"","sources":["../src/query-content.component.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,iBAAiB,EACjB,SAAS,EAET,MAAM,EAEN,MAAM,EAEN,MAAM,EAEN,SAAS,EACT,SAAS,EACT,gBAAgB,GACjB,MAAM,eAAe,CAAA;;;AAUtB
|
|
1
|
+
{"version":3,"file":"query-content.component.js","sourceRoot":"","sources":["../src/query-content.component.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,iBAAiB,EACjB,SAAS,EAET,MAAM,EAEN,MAAM,EAEN,MAAM,EAEN,SAAS,EACT,SAAS,EACT,gBAAgB,GACjB,MAAM,eAAe,CAAA;;;AAUtB;;;;;;;;;;;;GAYG;AAWH,MAAM,OAAO,YAAY;IACvB,6DAA6D;IAC7D,KAAK,GAAkC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA;IAC5F,kFAAkF;IAClF,QAAQ,GAA+C,IAAI,CAAA;IAC3D,2FAA2F;IAC3F,OAAO,GAAgC,IAAI,CAAA;IAC3C,qFAAqF;IACrF,OAAO,GAAgC,IAAI,CAAA;IAC3C,yEAAyE;IACzE,KAAK,GAAkC,SAAS,CAAA;IAChD,6EAA6E;IAC7E,KAAK,GAAiD,IAAI,CAAA;IAE1D,uCAAuC;IAE/B,MAAM,CAAmB;IACjC,sEAAsE;IACrD,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAA;IAC3D,yFAAyF;IACxE,QAAQ,GAAG,MAAM,CAAgC,IAAI,CAAC,KAAK;iFAAC,CAAA;IAC7E,sCAAsC;IAC9B,OAAO,GAAgC,IAAI,CAAA;IACnD,oEAAoE;IACnD,OAAO,GAA4B,EAAE,CAAA;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IAAI,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC;gBAAE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QACtD,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACzC,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,CAAA;IAC3B,CAAC;sGA3GU,YAAY;6DAAZ,YAAY;mCAeM,gBAAgB;;;;;YAtBlC,oCAAqC;;;iFAOrC,YAAY;cAVxB,SAAS;eAAC;gBACT,QAAQ,EAAE,mBAAmB;gBAC7B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,uCAAuC;gBACjD,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC;gBACrE,IAAI,EAAE;oBACJ,oBAAoB,EAAE,EAAE;oBACxB,KAAK,EAAE,mBAAmB;iBAC3B;aACF;;kBAgBE,SAAS;mBAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE;;kFAflD,YAAY"}
|
package/dist/types.d.ts
CHANGED
|
@@ -56,8 +56,18 @@ export interface QueryContentErrorContext {
|
|
|
56
56
|
}
|
|
57
57
|
/** A loaded document owns its controls; absent documents expose only status content. */
|
|
58
58
|
export interface QueryContentProps<T> {
|
|
59
|
+
/**
|
|
60
|
+
* One optional empty branch, exclusive with children. The pure predicate reads the
|
|
61
|
+
* loaded document (an array or an application-owned envelope); render selects the
|
|
62
|
+
* current view's message and recovery action. A previous key's empty document uses
|
|
63
|
+
* pending/error instead. Omit it to keep empty arrays as data.
|
|
64
|
+
*/
|
|
65
|
+
empty?: {
|
|
66
|
+
when: (data: NonNullable<T>) => boolean;
|
|
67
|
+
render: NonNullable<QueryContentProps<T>['children']>;
|
|
68
|
+
};
|
|
59
69
|
/** State from useQuery, or any compatible query observer. */
|
|
60
|
-
query: Pick<QueryState<T>, 'data' | 'status' | 'error'>;
|
|
70
|
+
query: Pick<QueryState<T>, 'data' | 'status' | 'error' | 'isPreviousData'>;
|
|
61
71
|
/** Mounted only with a real document, including false, zero and an empty list. */
|
|
62
72
|
children: TemplateRef<QueryContentContext<T>> | null;
|
|
63
73
|
/** Initial idle/loading content. Render a status template, never a fake item or action. */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD;;;;;GAKG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;IACtD;;;;;;;;;OASG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,SAAS,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,IAAI,CAAA;IAC1E;;;;;OAKG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;CACtC;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,yDAAyD;IACzD,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;IACzB,uDAAuD;IACvD,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,+CAA+C;IAC/C,SAAS,EAAE,OAAO,CAAA;IAClB,oDAAoD;IACpD,EAAE,EAAE,OAAO,CAAA;CACZ;AAED,wFAAwF;AACxF,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,6DAA6D;IAC7D,KAAK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6D;IAC7D,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,gBAAgB,CAAC,CAAA;IAC1E,kFAAkF;IAClF,QAAQ,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;IACpD,2FAA2F;IAC3F,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;IACrC,qFAAqF;IACrF,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;IACrC,6EAA6E;IAC7E,KAAK,CAAC,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAAA;CACrD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-query-angular",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Angular hooks for @molecule/app-query — read a cached document synchronously, observe it, and prefetch on intent",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-query-angular",
|
|
6
6
|
"type": "module",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"@molecule/app-framework-conformance": "0.0.0",
|
|
61
61
|
"@molecule/app-i18n": "1.2.2",
|
|
62
62
|
"@molecule/app-icons": "1.0.4",
|
|
63
|
-
"@molecule/app-query": "1.2
|
|
64
|
-
"@molecule/app-query-memory": "1.0
|
|
65
|
-
"@molecule/app-query-tanstack": "1.0
|
|
63
|
+
"@molecule/app-query": "1.3.2",
|
|
64
|
+
"@molecule/app-query-memory": "1.1.0",
|
|
65
|
+
"@molecule/app-query-tanstack": "1.1.0",
|
|
66
66
|
"@molecule/app-ui": "1.4.0",
|
|
67
67
|
"@molecule/app-ui-angular": "1.2.0",
|
|
68
68
|
"@types/node": "26.6.5",
|