@molecule/app-query-angular 1.2.1 → 1.3.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 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-15T13:01:51.146Z
6
+ Generated: 2026-11-16T21:21:08.774Z
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,6 +623,16 @@ 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. Omit it to keep empty arrays as data.
630
+ */
631
+ empty?: {
632
+ when: (data: NonNullable<T>) => boolean
633
+ render: NonNullable<QueryContentProps<T>['children']>
634
+ }
635
+
624
636
  /** State from useQuery, or any compatible query observer. */
625
637
  query: Pick<QueryState<T>, 'data' | 'status' | 'error'>
626
638
  /** Mounted only with a real document, including false, zero and an empty list. */
@@ -690,7 +702,7 @@ error value (`let-error`), and `pending`/`missing` render without a context.
690
702
  selector: 'mol-query-content',
691
703
  standalone: true,
692
704
  template: '<ng-container #outlet></ng-container>',
693
- inputs: ['query', 'pending', 'missing', 'children', 'error'],
705
+ inputs: ['query', 'pending', 'missing', 'children', 'error', 'empty'],
694
706
  host: {
695
707
  'data-parity-unwrap': '',
696
708
  style: 'display: contents',
@@ -705,6 +717,8 @@ export class QueryContent<T = unknown> implements DoCheck, OnChanges {
705
717
  pending: TemplateRef<unknown> | null = null
706
718
  /** Content for a loaded null record. Null is distinct from an unfinished request. */
707
719
  missing: TemplateRef<unknown> | null = null
720
+ /** One empty collection template, exclusive with the loaded children. */
721
+ empty: QueryContentProps<T>['empty'] = undefined
708
722
  /** A failed initial read. Cached data stays visible if its refresh fails. */
709
723
  error: TemplateRef<QueryContentErrorContext> | null = null
710
724
 
@@ -757,6 +771,8 @@ export class QueryContent<T = unknown> implements DoCheck, OnChanges {
757
771
  : { template: this.pending ?? null, context: {} }
758
772
  }
759
773
  if (query.data === null) return { template: this.missing ?? null, context: {} }
774
+ if (this.empty?.when(query.data))
775
+ return { template: this.empty.render, context: { $implicit: query.data, a0: query.data } }
760
776
  return { template: this.children, context: { $implicit: query.data, a0: query.data } }
761
777
  }
762
778
 
@@ -1055,3 +1071,10 @@ read the record, not "Loading…".
1055
1071
  Keep every resource identity in the query key. A boundary cannot correct a query that supplies
1056
1072
  another record's cached data. For a list, map real rows inside the children template; never
1057
1073
  style a status placeholder as a row.
1074
+
1075
+ For a collection, `QueryContent` also accepts one `empty` branch:
1076
+ `{ when: page => page.rows.length === 0, render: page => selectedEmptyState }`.
1077
+ It is exclusive with loaded children, so a selected view chooses its message and
1078
+ recovery action once rather than rendering a general empty message beside it.
1079
+ `when` receives a loaded document; empty arrays remain data when this prop is omitted.
1080
+ 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';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0cG;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"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA"}
@@ -30,6 +30,8 @@ export declare class QueryContent<T = unknown> implements DoCheck, OnChanges {
30
30
  pending: TemplateRef<unknown> | null;
31
31
  /** Content for a loaded null record. Null is distinct from an unfinished request. */
32
32
  missing: TemplateRef<unknown> | null;
33
+ /** One empty collection template, exclusive with the loaded children. */
34
+ empty: QueryContentProps<T>['empty'];
33
35
  /** A failed initial read. Cached data stays visible if its refresh fails. */
34
36
  error: TemplateRef<QueryContentErrorContext> | null;
35
37
  /** Where the chosen branch renders. */
@@ -68,6 +70,6 @@ export declare class QueryContent<T = unknown> implements DoCheck, OnChanges {
68
70
  */
69
71
  private update;
70
72
  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>;
73
+ 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
74
  }
73
75
  //# 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,YA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ryContent {
30
30
  pending = null;
31
31
  /** Content for a loaded null record. Null is distinct from an unfinished request. */
32
32
  missing = null;
33
+ /** One empty collection template, exclusive with the loaded children. */
34
+ empty = undefined;
33
35
  /** A failed initial read. Cached data stays visible if its refresh fails. */
34
36
  error = null;
35
37
  /** Where the chosen branch renders. */
@@ -80,6 +82,8 @@ export class QueryContent {
80
82
  }
81
83
  if (query.data === null)
82
84
  return { template: this.missing ?? null, context: {} };
85
+ if (this.empty?.when(query.data))
86
+ return { template: this.empty.render, context: { $implicit: query.data, a0: query.data } };
83
87
  return { template: this.children, context: { $implicit: query.data, a0: query.data } };
84
88
  }
85
89
  /**
@@ -124,7 +128,7 @@ export class QueryContent {
124
128
  } if (rf & 2) {
125
129
  let _t;
126
130
  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) {
131
+ } }, 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
132
  i0.ɵɵdomElementContainer(0, null, 0);
129
133
  } }, encapsulation: 2 });
130
134
  }
@@ -134,7 +138,7 @@ export class QueryContent {
134
138
  selector: 'mol-query-content',
135
139
  standalone: true,
136
140
  template: '<ng-container #outlet></ng-container>',
137
- inputs: ['query', 'pending', 'missing', 'children', 'error'],
141
+ inputs: ['query', 'pending', 'missing', 'children', 'error', 'empty'],
138
142
  host: {
139
143
  'data-parity-unwrap': '',
140
144
  style: 'display: contents',
@@ -1 +1 @@
1
- {"version":3,"file":"query-content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AK,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,6 +56,15 @@ 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. Omit it to keep empty arrays as data.
63
+ */
64
+ empty?: {
65
+ when: (data: NonNullable<T>) => boolean;
66
+ render: NonNullable<QueryContentProps<T>['children']>;
67
+ };
59
68
  /** State from useQuery, or any compatible query observer. */
60
69
  query: Pick<QueryState<T>, 'data' | 'status' | 'error'>;
61
70
  /** Mounted only with a real document, including false, zero and an empty list. */
@@ -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,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AAU,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;;;;OAIG;IACH,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,OAAO,CAAA;QACvC,MAAM,EAAE,WAAW,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;KACtD,CAAA;IAED,6DAA6D;IAC7D,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAA;IACvD,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.2.1",
3
+ "version": "1.3.0",
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.0",
64
- "@molecule/app-query-memory": "1.0.5",
65
- "@molecule/app-query-tanstack": "1.0.5",
63
+ "@molecule/app-query": "1.3.1",
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",