@xxmachina/components 0.0.0-PLACEHOLDER

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.
Files changed (195) hide show
  1. package/extras/flow/index.d.ts +183 -0
  2. package/features/command/index.d.ts +67 -0
  3. package/features/query/index.d.ts +162 -0
  4. package/fesm2022/xxmachina-components-extras-flow.mjs +397 -0
  5. package/fesm2022/xxmachina-components-extras-flow.mjs.map +1 -0
  6. package/fesm2022/xxmachina-components-features-command.mjs +93 -0
  7. package/fesm2022/xxmachina-components-features-command.mjs.map +1 -0
  8. package/fesm2022/xxmachina-components-features-query.mjs +256 -0
  9. package/fesm2022/xxmachina-components-features-query.mjs.map +1 -0
  10. package/fesm2022/xxmachina-components-groups-command-form.mjs +73 -0
  11. package/fesm2022/xxmachina-components-groups-command-form.mjs.map +1 -0
  12. package/fesm2022/xxmachina-components-groups-query-form.mjs +215 -0
  13. package/fesm2022/xxmachina-components-groups-query-form.mjs.map +1 -0
  14. package/fesm2022/xxmachina-components-molecules-calendar-paginator.mjs +51 -0
  15. package/fesm2022/xxmachina-components-molecules-calendar-paginator.mjs.map +1 -0
  16. package/fesm2022/xxmachina-components-molecules-daily-cell.mjs +158 -0
  17. package/fesm2022/xxmachina-components-molecules-daily-cell.mjs.map +1 -0
  18. package/fesm2022/xxmachina-components-molecules-weekly-header.mjs +33 -0
  19. package/fesm2022/xxmachina-components-molecules-weekly-header.mjs.map +1 -0
  20. package/fesm2022/xxmachina-components-organisms-calendar-section.mjs +123 -0
  21. package/fesm2022/xxmachina-components-organisms-calendar-section.mjs.map +1 -0
  22. package/fesm2022/xxmachina-components-organisms-event-input-section.mjs +150 -0
  23. package/fesm2022/xxmachina-components-organisms-event-input-section.mjs.map +1 -0
  24. package/fesm2022/xxmachina-components-organisms-terminal-input-section.mjs +123 -0
  25. package/fesm2022/xxmachina-components-organisms-terminal-input-section.mjs.map +1 -0
  26. package/fesm2022/xxmachina-components-organisms-video-trimmer-section.mjs +93 -0
  27. package/fesm2022/xxmachina-components-organisms-video-trimmer-section.mjs.map +1 -0
  28. package/fesm2022/xxmachina-components-organisms-xterm.mjs +94 -0
  29. package/fesm2022/xxmachina-components-organisms-xterm.mjs.map +1 -0
  30. package/fesm2022/xxmachina-components-pages-command.mjs +482 -0
  31. package/fesm2022/xxmachina-components-pages-command.mjs.map +1 -0
  32. package/fesm2022/xxmachina-components-pages-query-v2.mjs +198 -0
  33. package/fesm2022/xxmachina-components-pages-query-v2.mjs.map +1 -0
  34. package/fesm2022/xxmachina-components-pages-query.mjs +782 -0
  35. package/fesm2022/xxmachina-components-pages-query.mjs.map +1 -0
  36. package/fesm2022/xxmachina-components-pages-thread.mjs +176 -0
  37. package/fesm2022/xxmachina-components-pages-thread.mjs.map +1 -0
  38. package/fesm2022/xxmachina-components-routes-commands-command.routes-CSwIdXZg.mjs +19 -0
  39. package/fesm2022/xxmachina-components-routes-commands-command.routes-CSwIdXZg.mjs.map +1 -0
  40. package/fesm2022/xxmachina-components-routes-commands-pages.routes-j2xVop4W.mjs +10 -0
  41. package/fesm2022/xxmachina-components-routes-commands-pages.routes-j2xVop4W.mjs.map +1 -0
  42. package/fesm2022/xxmachina-components-routes-commands.mjs +104 -0
  43. package/fesm2022/xxmachina-components-routes-commands.mjs.map +1 -0
  44. package/fesm2022/xxmachina-components-routes-pages.mjs +62 -0
  45. package/fesm2022/xxmachina-components-routes-pages.mjs.map +1 -0
  46. package/fesm2022/xxmachina-components-routes-preloading.mjs +22 -0
  47. package/fesm2022/xxmachina-components-routes-preloading.mjs.map +1 -0
  48. package/fesm2022/xxmachina-components-routes-queries-pages.routes-CfrglCIL.mjs +9 -0
  49. package/fesm2022/xxmachina-components-routes-queries-pages.routes-CfrglCIL.mjs.map +1 -0
  50. package/fesm2022/xxmachina-components-routes-queries.mjs +147 -0
  51. package/fesm2022/xxmachina-components-routes-queries.mjs.map +1 -0
  52. package/fesm2022/xxmachina-components-routes-query-pages.routes-CxTbOJDQ.mjs +17 -0
  53. package/fesm2022/xxmachina-components-routes-query-pages.routes-CxTbOJDQ.mjs.map +1 -0
  54. package/fesm2022/xxmachina-components-routes-query.mjs +42 -0
  55. package/fesm2022/xxmachina-components-routes-query.mjs.map +1 -0
  56. package/fesm2022/xxmachina-components-routes-resources-pages.routes-CzjQOxwT.mjs +9 -0
  57. package/fesm2022/xxmachina-components-routes-resources-pages.routes-CzjQOxwT.mjs.map +1 -0
  58. package/fesm2022/xxmachina-components-routes-resources-resource.routes-C5KpB3KM.mjs +131 -0
  59. package/fesm2022/xxmachina-components-routes-resources-resource.routes-C5KpB3KM.mjs.map +1 -0
  60. package/fesm2022/xxmachina-components-routes-resources.mjs +130 -0
  61. package/fesm2022/xxmachina-components-routes-resources.mjs.map +1 -0
  62. package/fesm2022/xxmachina-components-routes-side-chat.mjs +19 -0
  63. package/fesm2022/xxmachina-components-routes-side-chat.mjs.map +1 -0
  64. package/fesm2022/xxmachina-components-routes-side.mjs +18 -0
  65. package/fesm2022/xxmachina-components-routes-side.mjs.map +1 -0
  66. package/fesm2022/xxmachina-components-routes-transformer.mjs +99 -0
  67. package/fesm2022/xxmachina-components-routes-transformer.mjs.map +1 -0
  68. package/fesm2022/xxmachina-components-routes-transformers-pages.routes-02pVsNas.mjs +9 -0
  69. package/fesm2022/xxmachina-components-routes-transformers-pages.routes-02pVsNas.mjs.map +1 -0
  70. package/fesm2022/xxmachina-components-routes-transformers.mjs +75 -0
  71. package/fesm2022/xxmachina-components-routes-transformers.mjs.map +1 -0
  72. package/fesm2022/xxmachina-components-routes.mjs +35 -0
  73. package/fesm2022/xxmachina-components-routes.mjs.map +1 -0
  74. package/fesm2022/xxmachina-components-services-app.mjs +30 -0
  75. package/fesm2022/xxmachina-components-services-app.mjs.map +1 -0
  76. package/fesm2022/xxmachina-components-services-assistant.mjs +43 -0
  77. package/fesm2022/xxmachina-components-services-assistant.mjs.map +1 -0
  78. package/fesm2022/xxmachina-components-services-calendar.mjs +27 -0
  79. package/fesm2022/xxmachina-components-services-calendar.mjs.map +1 -0
  80. package/fesm2022/xxmachina-components-services-command.mjs +138 -0
  81. package/fesm2022/xxmachina-components-services-command.mjs.map +1 -0
  82. package/fesm2022/xxmachina-components-services-context.mjs +23 -0
  83. package/fesm2022/xxmachina-components-services-context.mjs.map +1 -0
  84. package/fesm2022/xxmachina-components-services-contract.mjs +29 -0
  85. package/fesm2022/xxmachina-components-services-contract.mjs.map +1 -0
  86. package/fesm2022/xxmachina-components-services-debug.mjs +48 -0
  87. package/fesm2022/xxmachina-components-services-debug.mjs.map +1 -0
  88. package/fesm2022/xxmachina-components-services-forms-query.mjs +70 -0
  89. package/fesm2022/xxmachina-components-services-forms-query.mjs.map +1 -0
  90. package/fesm2022/xxmachina-components-services-forms-schedule.mjs +78 -0
  91. package/fesm2022/xxmachina-components-services-forms-schedule.mjs.map +1 -0
  92. package/fesm2022/xxmachina-components-services-forms-variables.mjs +34 -0
  93. package/fesm2022/xxmachina-components-services-forms-variables.mjs.map +1 -0
  94. package/fesm2022/xxmachina-components-services-graphql.mjs +34 -0
  95. package/fesm2022/xxmachina-components-services-graphql.mjs.map +1 -0
  96. package/fesm2022/xxmachina-components-services-invoice.mjs +130 -0
  97. package/fesm2022/xxmachina-components-services-invoice.mjs.map +1 -0
  98. package/fesm2022/xxmachina-components-services-json-schema.mjs +61 -0
  99. package/fesm2022/xxmachina-components-services-json-schema.mjs.map +1 -0
  100. package/fesm2022/xxmachina-components-services-link.mjs +31 -0
  101. package/fesm2022/xxmachina-components-services-link.mjs.map +1 -0
  102. package/fesm2022/xxmachina-components-services-message.mjs +50 -0
  103. package/fesm2022/xxmachina-components-services-message.mjs.map +1 -0
  104. package/fesm2022/xxmachina-components-services-openai.mjs +113 -0
  105. package/fesm2022/xxmachina-components-services-openai.mjs.map +1 -0
  106. package/fesm2022/xxmachina-components-services-openapi.mjs +40 -0
  107. package/fesm2022/xxmachina-components-services-openapi.mjs.map +1 -0
  108. package/fesm2022/xxmachina-components-services-order.mjs +37 -0
  109. package/fesm2022/xxmachina-components-services-order.mjs.map +1 -0
  110. package/fesm2022/xxmachina-components-services-partner.mjs +42 -0
  111. package/fesm2022/xxmachina-components-services-partner.mjs.map +1 -0
  112. package/fesm2022/xxmachina-components-services-query.mjs +66 -0
  113. package/fesm2022/xxmachina-components-services-query.mjs.map +1 -0
  114. package/fesm2022/xxmachina-components-services-recording.mjs +71 -0
  115. package/fesm2022/xxmachina-components-services-recording.mjs.map +1 -0
  116. package/fesm2022/xxmachina-components-services-schedule.mjs +53 -0
  117. package/fesm2022/xxmachina-components-services-schedule.mjs.map +1 -0
  118. package/fesm2022/xxmachina-components-services-thread.mjs +125 -0
  119. package/fesm2022/xxmachina-components-services-thread.mjs.map +1 -0
  120. package/fesm2022/xxmachina-components-services-transformer.mjs +31 -0
  121. package/fesm2022/xxmachina-components-services-transformer.mjs.map +1 -0
  122. package/fesm2022/xxmachina-components-services-youtube.mjs +28 -0
  123. package/fesm2022/xxmachina-components-services-youtube.mjs.map +1 -0
  124. package/fesm2022/xxmachina-components-templates-agent.mjs +549 -0
  125. package/fesm2022/xxmachina-components-templates-agent.mjs.map +1 -0
  126. package/fesm2022/xxmachina-components-templates-background.mjs +309 -0
  127. package/fesm2022/xxmachina-components-templates-background.mjs.map +1 -0
  128. package/fesm2022/xxmachina-components-templates-invoice-iframe.mjs +48 -0
  129. package/fesm2022/xxmachina-components-templates-invoice-iframe.mjs.map +1 -0
  130. package/fesm2022/xxmachina-components-templates-scheduler.mjs +178 -0
  131. package/fesm2022/xxmachina-components-templates-scheduler.mjs.map +1 -0
  132. package/fesm2022/xxmachina-components-templates-video.mjs +101 -0
  133. package/fesm2022/xxmachina-components-templates-video.mjs.map +1 -0
  134. package/fesm2022/xxmachina-components-validators-query.mjs +38 -0
  135. package/fesm2022/xxmachina-components-validators-query.mjs.map +1 -0
  136. package/fesm2022/xxmachina-components.mjs +278 -0
  137. package/fesm2022/xxmachina-components.mjs.map +1 -0
  138. package/groups/command-form/index.d.ts +13 -0
  139. package/groups/query-form/index.d.ts +56 -0
  140. package/index.d.ts +71 -0
  141. package/molecules/calendar-paginator/index.d.ts +14 -0
  142. package/molecules/daily-cell/index.d.ts +35 -0
  143. package/molecules/weekly-header/index.d.ts +11 -0
  144. package/organisms/calendar-section/index.d.ts +25 -0
  145. package/organisms/event-input-section/index.d.ts +45 -0
  146. package/organisms/terminal-input-section/index.d.ts +37 -0
  147. package/organisms/video-trimmer-section/index.d.ts +30 -0
  148. package/organisms/xterm/index.d.ts +23 -0
  149. package/package.json +258 -0
  150. package/pages/command/index.d.ts +217 -0
  151. package/pages/query/index.d.ts +292 -0
  152. package/pages/query-v2/index.d.ts +68 -0
  153. package/pages/thread/index.d.ts +109 -0
  154. package/routes/commands/index.d.ts +5 -0
  155. package/routes/index.d.ts +5 -0
  156. package/routes/pages/index.d.ts +5 -0
  157. package/routes/preloading/index.d.ts +11 -0
  158. package/routes/queries/index.d.ts +5 -0
  159. package/routes/query/index.d.ts +5 -0
  160. package/routes/resources/index.d.ts +5 -0
  161. package/routes/side/chat/index.d.ts +5 -0
  162. package/routes/side/index.d.ts +5 -0
  163. package/routes/transformer/index.d.ts +5 -0
  164. package/routes/transformers/index.d.ts +5 -0
  165. package/services/app/index.d.ts +17 -0
  166. package/services/assistant/index.d.ts +20 -0
  167. package/services/calendar/index.d.ts +13 -0
  168. package/services/command/index.d.ts +54 -0
  169. package/services/context/index.d.ts +10 -0
  170. package/services/contract/index.d.ts +11 -0
  171. package/services/debug/index.d.ts +14 -0
  172. package/services/forms/query/index.d.ts +46 -0
  173. package/services/forms/schedule/index.d.ts +42 -0
  174. package/services/forms/variables/index.d.ts +12 -0
  175. package/services/graphql/index.d.ts +20 -0
  176. package/services/invoice/index.d.ts +19 -0
  177. package/services/json-schema/index.d.ts +15 -0
  178. package/services/link/index.d.ts +13 -0
  179. package/services/message/index.d.ts +23 -0
  180. package/services/openai/index.d.ts +35 -0
  181. package/services/openapi/index.d.ts +17 -0
  182. package/services/order/index.d.ts +13 -0
  183. package/services/partner/index.d.ts +11 -0
  184. package/services/query/index.d.ts +42 -0
  185. package/services/recording/index.d.ts +20 -0
  186. package/services/schedule/index.d.ts +26 -0
  187. package/services/thread/index.d.ts +30 -0
  188. package/services/transformer/index.d.ts +19 -0
  189. package/services/youtube/index.d.ts +10 -0
  190. package/templates/agent/index.d.ts +54 -0
  191. package/templates/background/index.d.ts +44 -0
  192. package/templates/invoice-iframe/index.d.ts +13 -0
  193. package/templates/scheduler/index.d.ts +31 -0
  194. package/templates/video/index.d.ts +36 -0
  195. package/validators/query/index.d.ts +7 -0
@@ -0,0 +1,782 @@
1
+ import { __decorate, __metadata } from 'tslib';
2
+ import * as i0 from '@angular/core';
3
+ import { signal, Injectable, effect, inject, computed, untracked, ElementRef, input, Directive, viewChild, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { toObservable } from '@angular/core/rxjs-interop';
5
+ import { IndexTemplateStore, IndexTemplate } from '@ng-atomic/components/templates/_index';
6
+ import { InjectableComponent, createAction, applyToInput, provideEffect, computeFake, _computed, TokenizedType, NgAtomicComponent, updateInput, Effect } from '@ng-atomic/core';
7
+ import { EditingStateManager } from '@ng-atomic/common';
8
+ import { AppService } from '@xxmachina/components/services/app';
9
+ import { buildColumns, TableOrganism, injectIndexFormBuilder } from '@ng-atomic/components/organisms/table';
10
+ import { FormGroup, FormBuilder } from '@angular/forms';
11
+ import { injectUnflattenRouteParam, injectHasNext, injectRouteData, injectNavigationExtras, getValue$, getRawValue$, injectRouteSkip } from '@ng-atomic/common/utils';
12
+ import { ActivatedRoute } from '@angular/router';
13
+ import { RouterOutletFrameStore, RouterOutletFrame } from '@ng-atomic/components/frames/router-outlet';
14
+ import { CommandService } from '@xxmachina/components/services/command';
15
+ import { FlatTreeControl } from '@angular/cdk/tree';
16
+ import { Query, QueryHelper } from '@xxmachina/common/domain/models';
17
+ import { injectOne } from '@ng-atomic/common/stores/entities';
18
+ import { makeDI, injectNavStartActionsV2 } from '@ng-atomic/common/services/ui';
19
+ import { makeInitializerConfig } from '@ng-atomic/common/services/initializer';
20
+ import { NgAtomicFormSectionBuilder } from '@ng-atomic/components/templates/form';
21
+ import { QueryFeature, QueryGraphqlVariablesFormFeature } from '@xxmachina/components/features/query';
22
+ import { QueryService } from '@xxmachina/components/services/query';
23
+ import { QueryFormGroup } from '@xxmachina/components/groups/query-form';
24
+ import { flatten } from 'flat';
25
+ import { derivedAsync } from 'ngxtension/derived-async';
26
+ import { omitBy, merge, isEqual } from 'lodash-es';
27
+ import { ValueCellAtomStore } from '@ng-atomic/components/atoms/value-cell';
28
+ import { MachinaDevService } from '@xxmachina/components/services/debug';
29
+
30
+ var QueryPageStore_1;
31
+ var ActionId;
32
+ (function (ActionId) {
33
+ ActionId["NAVIGATE_TO_IFRAME"] = "NAVIGATE TO IFRAME";
34
+ ActionId["TOGGLE_PAGE"] = "\u5168\u4F53\u8868\u793A";
35
+ ActionId["TOGGLE_VARIABLES_FORM"] = "\u5909\u6570\u30D5\u30A9\u30FC\u30E0\u306E\u8868\u793A\u5207\u66FF";
36
+ ActionId["ADD"] = "\u8FFD\u52A0";
37
+ ActionId["DETAIL"] = "\u8A73\u7D30";
38
+ })(ActionId || (ActionId = {}));
39
+ function buildItemsMap(itemsResult = {}, itemsLengthResult = {}) {
40
+ return Object.entries(itemsResult).reduce((acc, [key, items]) => ({
41
+ ...acc,
42
+ [key]: {
43
+ items,
44
+ itemsLength: itemsLengthResult[key] ?? items.length,
45
+ }
46
+ }), {});
47
+ }
48
+ function buildItemsMapFromResult(result = {}) {
49
+ console.debug('[DEBUG] result:', result);
50
+ const data = omitBy(result, (_, key) => key.startsWith('_'));
51
+ if (Array.isArray(data)) {
52
+ return buildItemsMap({ default: data });
53
+ }
54
+ else if (data && typeof data === 'object' && 'items' in data) {
55
+ const itemsMap = buildItemsMap({ default: data.items }, { default: data?.itemsLength });
56
+ return itemsMap;
57
+ }
58
+ else {
59
+ const itemsResult = {};
60
+ const itemsLengthResult = {};
61
+ Object.entries(data).forEach(([key, value]) => {
62
+ if (key.endsWith('Length')) {
63
+ itemsLengthResult[key.replace('Length', '')] = value;
64
+ }
65
+ else {
66
+ itemsResult[key] = value;
67
+ }
68
+ });
69
+ return buildItemsMap(itemsResult, itemsLengthResult);
70
+ }
71
+ }
72
+ class QueryActionReducer {
73
+ constructor() {
74
+ this.action = signal(null);
75
+ this.action$ = toObservable(this.action);
76
+ }
77
+ dispatch(action) {
78
+ this.action.set(action);
79
+ }
80
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: QueryActionReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
81
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: QueryActionReducer, providedIn: 'root' }); }
82
+ }
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: QueryActionReducer, decorators: [{
84
+ type: Injectable,
85
+ args: [{ providedIn: 'root' }]
86
+ }] });
87
+ let QueryPageStore = class QueryPageStore extends InjectableComponent {
88
+ static { QueryPageStore_1 = this; }
89
+ static { this.ActionId = ActionId; }
90
+ static { this.DI = makeDI(QueryPageStore_1, () => {
91
+ return () => ({
92
+ type: 'table',
93
+ style: {
94
+ width: 'var(--page-width-lv2)',
95
+ },
96
+ title: null,
97
+ titleEditable: true,
98
+ childrenKey: 'children',
99
+ additionalNavEndActions: [],
100
+ navEndActions: [],
101
+ additionalColumns: (items) => [],
102
+ itemActions: (item => [{ id: QueryPageStore_1.ActionId.DETAIL, icon: 'open_in_new', name: '詳細', payload: item }]),
103
+ pageSizeOptions: [50, 100, 300, 500, 1000],
104
+ });
105
+ }, ['@xxmachina/components', 'pages', 'query']); }
106
+ /** @deprecated use `QueryPageStore.DI.provideInitializer` instead */
107
+ static { this.Initializer = makeInitializerConfig(QueryPageStore_1); }
108
+ static provideDefault() {
109
+ return [
110
+ QueryPageStore_1.DI.provideConfig(),
111
+ QueryPageStore_1.provideDefaultInitializes(),
112
+ QueryPageStore_1.provideDefaultEffects(),
113
+ QueryPageStore_1.provideDebugStyleInitializer(),
114
+ QueryFeature.provideDefault(),
115
+ ];
116
+ }
117
+ static provideCustom() {
118
+ return [
119
+ QueryPageStore_1.DI.provideConfig(),
120
+ QueryPageStore_1.provideDefaultInitializes(),
121
+ QueryPageStore_1.provideDefaultEffects(),
122
+ QueryPageStore_1.provideDebugStyleInitializer(),
123
+ QueryPageStore_1.provideNonEditableConfig(),
124
+ QueryPageStore_1.provideQueryFromRouteDataQueryIdInitializer(),
125
+ QueryPageStore_1.provideAutoTogglePageInitializer(),
126
+ QueryFeature.provideDefault(),
127
+ ];
128
+ }
129
+ static provideDefaultV2() {
130
+ return [
131
+ QueryPageStore_1.provideCustom(),
132
+ QueryPageStore_1.DI.Config.provide(() => config => ({ ...config })),
133
+ QueryPageStore_1.provideTitleFromQueryResultInitializer(),
134
+ QueryPageStore_1.provideQueryFromRouteDataInitializer(),
135
+ QueryPageStore_1.providePaginationInitializer(),
136
+ ];
137
+ }
138
+ /** @deprecated use `provideCustom` instead */
139
+ static provideForCustomPage() {
140
+ return this.provideCustom();
141
+ }
142
+ static provideNonEditableConfig() {
143
+ return QueryPageStore_1.DI.provideConfig(() => {
144
+ return config => ({
145
+ ...config,
146
+ titleEditable: false,
147
+ style: {
148
+ ...config.style,
149
+ width: `var(--page-width-lv3)`
150
+ },
151
+ });
152
+ });
153
+ }
154
+ static provideDefaultInitializes() {
155
+ return [
156
+ QueryPageStore_1.provideAutoTogglePageInitializer(),
157
+ QueryPageStore_1.provideVariablesFormValueFromMatrixParamsInitializer(),
158
+ ];
159
+ }
160
+ static provideNavEndActionsInitializers() {
161
+ return [
162
+ QueryPageStore_1.DI.provideInitializer((store) => {
163
+ effect(() => {
164
+ const icon = store.style()?.width === 'var(--page-width-lv3)' ? 'close_fullscreen' : 'open_in_full';
165
+ const navEndActions = [
166
+ createAction(QueryFeature.ActionId.クエリの実行, null, { icon: 'play_arrow' }).create(),
167
+ store.variablesFormDisplayed() ? createAction(ActionId.TOGGLE_PAGE, null, { icon }).create() : null,
168
+ createAction(QueryFeature.ActionId.クエリの更新, null, { icon: 'save' }).create(),
169
+ ].filter(Boolean);
170
+ applyToInput(store, 'navEndActions', navEndActions);
171
+ });
172
+ }),
173
+ QueryPageStore_1.provideVariablesFromRouteParamDataInitializer(),
174
+ ];
175
+ }
176
+ static provideVariablesFromRouteParamDataInitializer() {
177
+ return [
178
+ QueryPageStore_1.DI.provideInitializer(store => {
179
+ const data = injectUnflattenRouteParam('data');
180
+ effect(() => {
181
+ const variables = store.variablesFormValue();
182
+ const merged = merge(variables, data());
183
+ store.feature.form.patchValue({
184
+ graphql: {
185
+ variablesJson: JSON.stringify(merged, null, 2),
186
+ }
187
+ });
188
+ });
189
+ }),
190
+ ];
191
+ }
192
+ static provideVariablesFromRouteParamInitializer() {
193
+ return [
194
+ QueryPageStore_1.DI.provideInitializer(store => {
195
+ const data = injectUnflattenRouteParam();
196
+ effect(() => {
197
+ const variables = store.variablesFormValue();
198
+ const merged = merge(variables, data());
199
+ store.feature.form.patchValue({
200
+ graphql: {
201
+ variablesJson: JSON.stringify(merged, null, 2),
202
+ }
203
+ });
204
+ });
205
+ }),
206
+ ];
207
+ }
208
+ static provideAutoTogglePageInitializer() {
209
+ return [
210
+ provideEffect(RouterOutletFrameStore.ActionId.DEACTIVATED, () => {
211
+ const store = inject(QueryPageStore_1);
212
+ const style = computeFake(store.style());
213
+ return () => {
214
+ applyToInput(store, 'style', { ...style, paddingLeft: `0` });
215
+ };
216
+ }),
217
+ QueryPageStore_1.DI.provideInitializer((store) => {
218
+ const hasNext = injectHasNext();
219
+ const style = computeFake(store.style());
220
+ effect(() => {
221
+ if (hasNext()) {
222
+ setTimeout(() => {
223
+ if (style.width === 'var(--page-width-lv3)') {
224
+ applyToInput(store, 'style', {
225
+ ...style,
226
+ paddingLeft: 'var(--page-width-lv1)',
227
+ });
228
+ }
229
+ }, 300);
230
+ }
231
+ });
232
+ }),
233
+ ];
234
+ }
235
+ static provideVariablesFormValueFromMatrixParamsInitializer() {
236
+ return [
237
+ QueryPageStore_1.DI.provideInitializer((store) => {
238
+ const data = injectUnflattenRouteParam('data');
239
+ effect(() => {
240
+ store.variablesForm()?.patchValue({ ...data() });
241
+ });
242
+ }),
243
+ ];
244
+ }
245
+ static provideQueryFromRouteDataQueryIdInitializer(key = 'queryId') {
246
+ return [
247
+ QueryPageStore_1.DI.provideInitializer((store) => {
248
+ const query = injectOne(Query, { id: injectRouteData(key) });
249
+ const _query = computed(() => {
250
+ return query();
251
+ }, { equal: (pre, cur) => JSON.stringify(pre) === JSON.stringify(cur) });
252
+ effect(() => {
253
+ console.debug('[QueryPageStore] query:', _query());
254
+ applyToInput(store, 'query', _query());
255
+ });
256
+ }),
257
+ ];
258
+ }
259
+ static provideQueryFromRouteDataInitializer(key = 'query') {
260
+ return [
261
+ QueryPageStore_1.DI.provideInitializer((store) => {
262
+ const query = injectRouteData(key);
263
+ effect(() => applyToInput(store, 'query', query()));
264
+ }),
265
+ ];
266
+ }
267
+ static provideItemActionsFromRouteDataInitializer(key = 'itemActionsCommandIds') {
268
+ return QueryPageStore_1.DI.provideInitializer((store) => {
269
+ const idOrObjectArray = injectRouteData(key);
270
+ const service = inject(CommandService);
271
+ const itemActions = (item) => {
272
+ const params = (idOrObjectArray() ?? []).map((idOrObject) => ({
273
+ id: typeof idOrObject === 'string' ? idOrObject : idOrObject.id,
274
+ options: typeof idOrObject === 'string' ? {} : idOrObject.options,
275
+ }));
276
+ const builder = service.getActionBuilder().setItem(item);
277
+ const actions = params.map(param => builder.setOptions(param.options).buildAction(param.id));
278
+ console.debug('actions:', actions);
279
+ return actions;
280
+ };
281
+ applyToInput(store, 'itemActions', itemActions);
282
+ });
283
+ }
284
+ static provideNavEndActionsFromRouteDataInitializer(key = 'navEndActionsCommandIds') {
285
+ return QueryPageStore_1.DI.provideInitializer((store) => {
286
+ const ids = injectRouteData(key);
287
+ const queryId = injectRouteData('navEndActionsCommandQueryId');
288
+ const service = inject(CommandService);
289
+ const route = inject(ActivatedRoute);
290
+ const hasNext = injectHasNext();
291
+ effect(() => {
292
+ const actions = service.getActionBuilder().setFilterIds(ids()).setOptions({ queryId: queryId() }).buildActions(undefined, { relativeTo: route, replaceUrl: hasNext() });
293
+ applyToInput(store, 'navEndActions', [
294
+ store.variablesFormDisplayed() ? { id: ActionId.TOGGLE_VARIABLES_FORM, icon: store.navMode() === 'collapsed' ? 'expand_less' : 'expand_more' } : null,
295
+ // TODO(@NozomuMiyamoto): 変更
296
+ actions?.length ? {
297
+ id: 'open_command_menu',
298
+ icon: 'more_vert',
299
+ children: [...actions],
300
+ } : null,
301
+ ].filter(Boolean));
302
+ });
303
+ });
304
+ }
305
+ static provideDefaultEffects() {
306
+ return [
307
+ QueryPageStore_1.provideCommandEffects(),
308
+ QueryPageStore_1.provideNavModeToggleEffect(),
309
+ QueryPageStore_1.provideChangeWidthEffect(),
310
+ QueryFeature.provideDefaultEffects(),
311
+ QueryPageStore_1.provideNavigateEffects(),
312
+ QueryPageStore_1.provideEditingStateEffects(),
313
+ ];
314
+ }
315
+ static provideEditingStateEffects() {
316
+ return [
317
+ provideEffect(ValueCellAtomStore.ActionId.START_EDIT, () => {
318
+ const editingStateManager = inject(EditingStateManager);
319
+ return (payload) => {
320
+ editingStateManager.startEditing(payload.rowId, payload.columnId);
321
+ };
322
+ }),
323
+ provideEffect(ValueCellAtomStore.ActionId.END_EDIT, () => {
324
+ const editingStateManager = inject(EditingStateManager);
325
+ return (payload) => {
326
+ setTimeout(() => editingStateManager.stopEditing(payload.rowId, payload.columnId), 0);
327
+ };
328
+ }),
329
+ ];
330
+ }
331
+ static provideCommandEffects() {
332
+ return [
333
+ QueryPageStore_1.provideCommandExecuteEffect(),
334
+ QueryPageStore_1.provideCommandNavigateEffect(),
335
+ ];
336
+ }
337
+ static provideCommandExecuteEffect() {
338
+ return [
339
+ provideEffect(CommandService.ActionId.EXECUTE_COMMAND, () => {
340
+ const commandService = inject(CommandService);
341
+ return async (payload) => {
342
+ const app = inject(AppService);
343
+ const obj = omitBy(payload.body, (value) => typeof value === undefined);
344
+ const command = inject(CommandService).getCommand(payload.command.id);
345
+ console.debug('[QueryPage] payload:', payload);
346
+ if (payload.options?.confirm && !(await payload.options?.confirm())) {
347
+ app.snackBar.open('キャンセルされました。');
348
+ return;
349
+ }
350
+ app.loading.await(() => {
351
+ return commandService.execute(command, obj).then(() => {
352
+ app.snackBar.open('成功しました。');
353
+ }).catch((error) => {
354
+ console.error(error);
355
+ app.snackBar.open(`エラー: ${error.message}`);
356
+ });
357
+ });
358
+ };
359
+ }),
360
+ ];
361
+ }
362
+ static provideCommandNavigateEffect() {
363
+ return [
364
+ provideEffect(CommandService.ActionId.NAVIGATE_TO_COMMAND_PAGE, () => {
365
+ const app = inject(AppService);
366
+ const route = inject(ActivatedRoute);
367
+ const hasNext = injectHasNext();
368
+ return (payload) => {
369
+ const flat = flatten({ data: { id: payload.body?.id }, queryId: payload?.options?.queryId });
370
+ const _flat = omitBy(flat, (value) => value === undefined);
371
+ app.router.navigate(['commands', { skip: true }, payload.command.id, _flat], {
372
+ relativeTo: route,
373
+ replaceUrl: hasNext(),
374
+ });
375
+ };
376
+ }),
377
+ ];
378
+ }
379
+ static provideNavModeToggleEffect() {
380
+ return provideEffect(ActionId.TOGGLE_VARIABLES_FORM, () => {
381
+ const store = inject(QueryPageStore_1);
382
+ return () => {
383
+ store.navMode.set(store.navMode() === 'collapsed' ? 'expanded' : 'collapsed');
384
+ };
385
+ }, { scopes: ['root', 'host'] });
386
+ }
387
+ static provideNavEndActionsInitializer() {
388
+ return QueryPageStore_1.DI.provideInitializer((store) => {
389
+ const navEndActions = computed(() => [
390
+ store.variablesFormDisplayed() ? {
391
+ id: ActionId.TOGGLE_VARIABLES_FORM,
392
+ icon: store.navMode() === 'collapsed' ? 'expand_less' : 'expand_more'
393
+ } : null,
394
+ ].filter(Boolean));
395
+ effect(() => applyToInput(store, 'navEndActions', [
396
+ ...navEndActions(),
397
+ ...store.additionalNavEndActions()
398
+ ]));
399
+ });
400
+ }
401
+ static provideChangeWidthEffect() {
402
+ return [
403
+ provideEffect(IndexTemplateStore.ActionId.TABLE_COLUMN_WIDTH_CHANGE, () => {
404
+ const store = inject(QueryPageStore_1);
405
+ return (payload) => {
406
+ const form = store.itemsMap()?.[payload.key]?.form || store.form();
407
+ form.patchValue({ columns: { map: { [payload.columnName]: { width: payload.width } } } });
408
+ };
409
+ }),
410
+ ];
411
+ }
412
+ static provideNavigateEffects() {
413
+ return [
414
+ provideEffect(QueryPageStore_1.ActionId.ADD, () => {
415
+ const app = inject(AppService);
416
+ const extras = injectNavigationExtras();
417
+ return (item) => app.router.navigate(['new'], extras());
418
+ }),
419
+ provideEffect(QueryPageStore_1.ActionId.DETAIL, () => {
420
+ const app = inject(AppService);
421
+ const extras = injectNavigationExtras();
422
+ return (item) => app.router.navigate([item.id], extras());
423
+ }),
424
+ ];
425
+ }
426
+ static providePaginationInitializer() {
427
+ return [
428
+ QueryPageStore_1.DI.provideInitializer((store) => {
429
+ effect(() => {
430
+ const columns = store.columnNames();
431
+ const sticky = store.sticky();
432
+ const current = untracked(() => store.form())?.value;
433
+ const form = store.indexFormBuilder.build({
434
+ columns: buildColumns([...columns, '__actions'], sticky),
435
+ page: {
436
+ size: current?.page?.size ?? 100,
437
+ index: current?.page?.index ?? 0,
438
+ }
439
+ });
440
+ applyToInput(store, 'form', form);
441
+ });
442
+ }),
443
+ QueryPageStore_1.DI.provideInitializer((store) => {
444
+ const page = derivedAsync(() => getValue$(store.form().get(['page'])), {
445
+ initialValue: { index: 0, size: 100 }
446
+ });
447
+ const pagination = computed(() => {
448
+ const _page = page() || { index: 0, size: 100 };
449
+ return {
450
+ offset: _page.index * _page.size,
451
+ limit: _page.size,
452
+ };
453
+ });
454
+ effect(() => {
455
+ const _pagination = pagination();
456
+ store.variablesForm()?.patchValue(_pagination);
457
+ });
458
+ }),
459
+ ];
460
+ }
461
+ static provideTableCellValueChangeEffect(handlerFactory, optionsOrColumns) {
462
+ return provideEffect(ValueCellAtomStore.ActionId.UPDATE_VALUE, (injector) => {
463
+ // 後方互換性のためのオプション正規化
464
+ const normalizedOptions = Array.isArray(optionsOrColumns)
465
+ ? { columns: optionsOrColumns }
466
+ : (optionsOrColumns || {});
467
+ // デフォルトの比較関数
468
+ const defaultEquals = (current, next) => current === next;
469
+ const equalsFn = normalizedOptions.equals || defaultEquals;
470
+ const handler = handlerFactory(injector);
471
+ return (action) => {
472
+ const { context, next, current, setValue } = action;
473
+ const name = context.name;
474
+ // フィールドフィルタリング
475
+ if (normalizedOptions.columns && normalizedOptions.columns.length > 0 && !normalizedOptions.columns.includes(name)) {
476
+ return;
477
+ }
478
+ // 値の比較
479
+ if (equalsFn(current, next, name)) {
480
+ // 値が同じ場合は処理をスキップ
481
+ return;
482
+ }
483
+ // TableCellValueChangeオブジェクトの作成
484
+ const change = {
485
+ item: context.item,
486
+ name: name,
487
+ current: current,
488
+ next: next,
489
+ rowIndex: context.position?.row ?? 0,
490
+ columnId: context.name
491
+ };
492
+ // ハンドラーの実行
493
+ handler(change, setValue);
494
+ };
495
+ });
496
+ }
497
+ static provideTableAutofillEffect(handlerFactory) {
498
+ return provideEffect(TableOrganism.ActionId.AUTOFILL_COMPLETE, (injector) => {
499
+ const handler = handlerFactory(injector);
500
+ const store = inject(QueryPageStore_1);
501
+ return async (payload) => {
502
+ // TableOrganismから渡されたコンテキスト情報を使用
503
+ if (!payload.contexts) {
504
+ console.warn('No autofill contexts provided');
505
+ return;
506
+ }
507
+ const { sourceContext, targetContexts } = payload.contexts;
508
+ const sourceItem = sourceContext.item;
509
+ const columnName = sourceContext.name;
510
+ const sourceValue = sourceItem[columnName];
511
+ // 影響を受けるアイテムを収集(表示されているセルのみ)
512
+ const affectedItems = [];
513
+ targetContexts.forEach(({ position, context }, index) => {
514
+ const targetItem = context.item;
515
+ // 値の生成
516
+ let newValue = sourceValue;
517
+ // 数値の連番
518
+ if (typeof sourceValue === 'number') {
519
+ newValue = sourceValue + index + 1;
520
+ }
521
+ // 文字列パターン
522
+ else if (typeof sourceValue === 'string') {
523
+ const dateMatch = sourceValue.match(/^(\d{4}-\d{2}-\d{2})$/);
524
+ if (dateMatch) {
525
+ const sourceDate = new Date(dateMatch[1]);
526
+ const newDate = new Date(sourceDate);
527
+ newDate.setDate(sourceDate.getDate() + index + 1);
528
+ newValue = newDate.toISOString().split('T')[0];
529
+ }
530
+ }
531
+ affectedItems.push({
532
+ item: targetItem,
533
+ newValue,
534
+ rowIndex: position.row
535
+ });
536
+ });
537
+ // オートフィルの変更情報を作成
538
+ const autofillChange = {
539
+ sourceItem,
540
+ sourceValue,
541
+ columnName,
542
+ columnIndex: payload.sourcePosition.col,
543
+ affectedItems,
544
+ range: payload.targetRange
545
+ };
546
+ // ハンドラーを実行
547
+ await handler(autofillChange);
548
+ };
549
+ });
550
+ }
551
+ static provideDebugStyleInitializer() {
552
+ return [
553
+ QueryPageStore_1.DI.provideInitializer((store) => {
554
+ const debug = inject(MachinaDevService);
555
+ const el = inject(ElementRef);
556
+ effect(() => el.nativeElement.style.setProperty('--is-debug', debug.isDevMode() ? '1' : '0'));
557
+ }),
558
+ ];
559
+ }
560
+ static provideTitleFromQueryResultInitializer() {
561
+ return [
562
+ QueryPageStore_1.DI.provideInitializer((store) => {
563
+ effect(() => applyToInput(store, 'title', store.feature.result()?.__meta__?.title));
564
+ }),
565
+ ];
566
+ }
567
+ #navStartActions;
568
+ constructor() {
569
+ super();
570
+ this.app = inject(AppService);
571
+ this.config = QueryPageStore_1.DI.injectConfig();
572
+ this.feature = inject(QueryFeature);
573
+ this.variablesFormFeature = inject(QueryGraphqlVariablesFormFeature);
574
+ this.indexFormBuilder = injectIndexFormBuilder();
575
+ this.navMode = signal('collapsed');
576
+ this.editingStateManager = inject(EditingStateManager);
577
+ this.style = input(_computed(() => this.config().style));
578
+ this.query = input(null);
579
+ this.#navStartActions = injectNavStartActionsV2();
580
+ this.navStartActions = input(_computed(() => this.#navStartActions()));
581
+ this.additionalNavEndActions = input(_computed(() => this.config().additionalNavEndActions));
582
+ this.navEndActions = input(_computed(() => this.config().navEndActions));
583
+ this.type = input(_computed(() => this.config().type));
584
+ this.title = input(_computed(() => this.config().title ?? this.query()?.title));
585
+ this.titleEditable = input(_computed(() => this.config().titleEditable));
586
+ this.itemsMap = input(_computed(() => buildItemsMapFromResult(this.feature.result())));
587
+ this.items = computed(() => this.itemsMap()[Object.keys(this.itemsMap())[0]]?.items ?? []);
588
+ this.itemsLength = input(_computed(() => this.itemsMap()[Object.keys(this.itemsMap())[0]]?.itemsLength ?? 0));
589
+ this.childrenKey = input(_computed(() => this.config().childrenKey));
590
+ this.additionalColumns = input(_computed(() => this.config().additionalColumns));
591
+ this.additionalColumnNames = input(_computed(() => this.additionalColumns()(this.items())));
592
+ this.extractedColumnNames = input(_computed(() => QueryHelper.extractColumnNames(this.items(), this.childrenKey())));
593
+ this.columnNames = input(_computed(() => [...this.extractedColumnNames(), ...this.additionalColumnNames()]));
594
+ this.sticky = input(_computed(() => ({ stickyStart: 2, stickyEnd: 1 })));
595
+ this.form = input(_computed(() => this.indexFormBuilder.build({
596
+ columns: buildColumns([...this.columnNames(), '__actions'], this.sticky()),
597
+ })));
598
+ this.itemActions = input(_computed(() => this.config().itemActions));
599
+ this.tableTreeControl = new FlatTreeControl(n => n.level, n => n.isExpandable, { trackBy: (n) => n?.id ?? n });
600
+ this.variablesForm = input(_computed(() => this.variablesFormFeature.variablesForm() ?? new FormGroup({})));
601
+ this.variablesFormFieldMap = input(_computed(() => ({})));
602
+ this.variablesFormValue = derivedAsync(() => getRawValue$(this.variablesForm()), { equal: isEqual });
603
+ this.variablesFormValue$ = toObservable(this.variablesFormValue);
604
+ this.variablesFormDisplayed = input(_computed(() => Object.keys(this.variablesFormFeature.variablesValue())?.length > 0));
605
+ this.tableColumnFormFieldMap = input(_computed(() => ({})));
606
+ this.getRowClass = input(_computed(() => () => ''));
607
+ this.skip = injectRouteSkip();
608
+ this.pageSizeOptions = input(_computed(() => this.config().pageSizeOptions));
609
+ QueryPageStore_1.DI.initialize(this);
610
+ effect(() => this.feature.form.patchValue(this.query()));
611
+ }
612
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: QueryPageStore, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
613
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.5", type: QueryPageStore, isStandalone: true, inputs: { style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, navStartActions: { classPropertyName: "navStartActions", publicName: "navStartActions", isSignal: true, isRequired: false, transformFunction: null }, additionalNavEndActions: { classPropertyName: "additionalNavEndActions", publicName: "additionalNavEndActions", isSignal: true, isRequired: false, transformFunction: null }, navEndActions: { classPropertyName: "navEndActions", publicName: "navEndActions", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, titleEditable: { classPropertyName: "titleEditable", publicName: "titleEditable", isSignal: true, isRequired: false, transformFunction: null }, itemsMap: { classPropertyName: "itemsMap", publicName: "itemsMap", isSignal: true, isRequired: false, transformFunction: null }, itemsLength: { classPropertyName: "itemsLength", publicName: "itemsLength", isSignal: true, isRequired: false, transformFunction: null }, childrenKey: { classPropertyName: "childrenKey", publicName: "childrenKey", isSignal: true, isRequired: false, transformFunction: null }, additionalColumns: { classPropertyName: "additionalColumns", publicName: "additionalColumns", isSignal: true, isRequired: false, transformFunction: null }, additionalColumnNames: { classPropertyName: "additionalColumnNames", publicName: "additionalColumnNames", isSignal: true, isRequired: false, transformFunction: null }, extractedColumnNames: { classPropertyName: "extractedColumnNames", publicName: "extractedColumnNames", isSignal: true, isRequired: false, transformFunction: null }, columnNames: { classPropertyName: "columnNames", publicName: "columnNames", isSignal: true, isRequired: false, transformFunction: null }, sticky: { classPropertyName: "sticky", publicName: "sticky", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, itemActions: { classPropertyName: "itemActions", publicName: "itemActions", isSignal: true, isRequired: false, transformFunction: null }, variablesForm: { classPropertyName: "variablesForm", publicName: "variablesForm", isSignal: true, isRequired: false, transformFunction: null }, variablesFormFieldMap: { classPropertyName: "variablesFormFieldMap", publicName: "variablesFormFieldMap", isSignal: true, isRequired: false, transformFunction: null }, variablesFormDisplayed: { classPropertyName: "variablesFormDisplayed", publicName: "variablesFormDisplayed", isSignal: true, isRequired: false, transformFunction: null }, tableColumnFormFieldMap: { classPropertyName: "tableColumnFormFieldMap", publicName: "tableColumnFormFieldMap", isSignal: true, isRequired: false, transformFunction: null }, getRowClass: { classPropertyName: "getRowClass", publicName: "getRowClass", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
614
+ };
615
+ QueryPageStore = QueryPageStore_1 = __decorate([
616
+ TokenizedType(),
617
+ __metadata("design:paramtypes", [])
618
+ ], QueryPageStore);
619
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: QueryPageStore, decorators: [{
620
+ type: Directive,
621
+ args: [{ standalone: true }]
622
+ }], ctorParameters: () => [] });
623
+ class QueryPage extends NgAtomicComponent {
624
+ constructor() {
625
+ super();
626
+ this.fb = inject(FormBuilder);
627
+ this.route = inject(ActivatedRoute);
628
+ this.app = inject(AppService);
629
+ this.store = inject(QueryPageStore);
630
+ this.reducer = inject(QueryActionReducer);
631
+ this.query = inject(QueryService);
632
+ this.feature = inject(QueryFeature);
633
+ this.template = viewChild(IndexTemplate);
634
+ this.title = input('default title');
635
+ this.reducer.action$.subscribe((action) => this.dispatch(action));
636
+ const context = computed(() => ({
637
+ query: this.feature.formValue(),
638
+ // schema: this.feature.graphqlSchema(),
639
+ }));
640
+ effect(() => this.app.context.context.set(JSON.stringify(context())));
641
+ }
642
+ async back() {
643
+ history.back();
644
+ }
645
+ async navigateToIframe(item) {
646
+ this.app.router.navigate(['invoices', item.id], {
647
+ relativeTo: this.route,
648
+ });
649
+ }
650
+ async expandPage() {
651
+ updateInput(this.store, 'style', (style) => ({
652
+ ...style,
653
+ width: style?.width === 'var(--page-width-lv3)' ? 'var(--page-width-lv2)' : 'var(--page-width-lv3)',
654
+ }));
655
+ }
656
+ itemClick(item) {
657
+ this.dispatch({ id: ActionId.DETAIL, payload: item });
658
+ }
659
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: QueryPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
660
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: QueryPage, isStandalone: true, selector: "pages-query", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "template", first: true, predicate: IndexTemplate, descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: QueryPageStore, inputs: ["type", "type", "query", "query", "titleEditable", "titleEditable", "variablesForm", "variablesForm", "variablesFormFieldMap", "variablesFormFieldMap", "navStartActions", "navStartActions", "navEndActions", "navEndActions", "itemActions", "itemActions", "pageSizeOptions", "pageSizeOptions"] }], ngImport: i0, template: `
661
+ <frames-router-outlet [skip]="store.skip()" (action)="dispatch($event)">
662
+ <templates-index
663
+ [tableColumnFormFieldMap]="store.tableColumnFormFieldMap()"
664
+ [style]="store.style()"
665
+ [title]="store.title()"
666
+ [titleControl]="store.feature.form.get(['title'])"
667
+ [titleEditable]="store.titleEditable()"
668
+ [type]="store.type()"
669
+ [tableChildrenKey]="store.childrenKey()"
670
+ [tableTreeControl]="store.tableTreeControl"
671
+ [itemsMap]="store.itemsMap()"
672
+ [itemsLength]="store.itemsLength()"
673
+ [itemActions]="store.itemActions()"
674
+ [getRowClass]="store.getRowClass()"
675
+ [form]="store.form()"
676
+ [navStartActions]="store.navStartActions()"
677
+ [navEndActions]="store.navEndActions()"
678
+ [navMode]="store.navMode()"
679
+ [pageSizeOptions]="store.pageSizeOptions()"
680
+ (action)="dispatch($event)"
681
+ >
682
+ @if (store.variablesFormDisplayed()) {
683
+ <div navDashboard>
684
+ <ng-atomic-form-section-builder
685
+ [form]="store.variablesForm()"
686
+ [fieldMap]="store.variablesFormFieldMap()"
687
+ />
688
+ </div>
689
+ }
690
+ <groups-query-form dashboard (action)="dispatch($event)" />
691
+ </templates-index>
692
+ </frames-router-outlet>
693
+ `, isInline: true, styles: ["@charset \"UTF-8\";:host{width:100%;height:100%;display:block;--page-width-lv1-SCOPED-IN-query-SEA9: var(--page-width-lv1);--page-width-lv3-SCOPED-IN-query-SEA9: var(--page-width-lv3);--primary-color-SCOPED-IN-query-SEA9: var(--primary-color);--on-primary-color-SCOPED-IN-query-SEA9: var(--on-primary-color);--surface-color-SCOPED-IN-query-SEA9: var(--surface-color);--on-surface-color-SCOPED-IN-query-SEA9: var(--on-surface-color);--on-background-color-SCOPED-IN-query-SEA9: var(--on-background-color);--background-color-SCOPED-IN-query-SEA9: var(--background-color);--navigator-background-color-SCOPED-IN-query-SEA9: var(--navigator-background-color);--navigator-on-background-color-SCOPED-IN-query-SEA9: var(--navigator-on-background-color);--table-background-color-SCOPED-IN-query-SEA9: var(--table-background-color);--table-on-background-color-SCOPED-IN-query-SEA9: var(--table-on-background-color);--is-debug: 1;--is-debug-SCOPED-IN-query-SEA9: var(--is-debug)}:host *{--primary-color: var(--primary-color-SCOPED-IN-query-SEA9);--on-primary-color: var(--on-primary-color-SCOPED-IN-query-SEA9);--surface-color: var(--surface-color-SCOPED-IN-query-SEA9);--on-surface-color: var(--on-surface-color-SCOPED-IN-query-SEA9);--background-color: var(--background-color-SCOPED-IN-query-SEA9);--on-background-color: var(--on-background-color-SCOPED-IN-query-SEA9);--navigator-background-color: var(--navigator-background-color-SCOPED-IN-query-SEA9);--navigator-on-background-color: var(--navigator-on-background-color-SCOPED-IN-query-SEA9);--table-background-color: var(--table-background-color-SCOPED-IN-query-SEA9);--table-on-background-color: var(--table-on-background-color-SCOPED-IN-query-SEA9);--is-debug: var(--is-debug-SCOPED-IN-query-SEA9)}:host templates-index{padding-left:0;box-sizing:border-box;--first-content-height: calc(var(--is-debug-SCOPED-IN-query-SEA9) * 300px);transition:padding-left .3s}:host templates-index div[navDashboard]{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;padding:16px;box-sizing:border-box}:host templates-index div[navDashboard] ng-atomic-form-section-builder{--horizontal-padding: 0}\n"], dependencies: [{ kind: "component", type: IndexTemplate, selector: "templates-index" }, { kind: "component", type: RouterOutletFrame, selector: "frames-router-outlet", outputs: ["events"] }, { kind: "component", type: NgAtomicFormSectionBuilder, selector: "ng-atomic-form-section-builder", inputs: ["form", "formFlatExcludes", "fieldMap", "fieldKeys"] }, { kind: "component", type: QueryFormGroup, selector: "groups-query-form", inputs: ["form", "keyActions"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
694
+ }
695
+ __decorate([
696
+ Effect(IndexTemplateStore.ActionId.BACK),
697
+ __metadata("design:type", Function),
698
+ __metadata("design:paramtypes", []),
699
+ __metadata("design:returntype", Promise)
700
+ ], QueryPage.prototype, "back", null);
701
+ __decorate([
702
+ Effect(ActionId.NAVIGATE_TO_IFRAME),
703
+ __metadata("design:type", Function),
704
+ __metadata("design:paramtypes", [Object]),
705
+ __metadata("design:returntype", Promise)
706
+ ], QueryPage.prototype, "navigateToIframe", null);
707
+ __decorate([
708
+ Effect(ActionId.TOGGLE_PAGE),
709
+ __metadata("design:type", Function),
710
+ __metadata("design:paramtypes", []),
711
+ __metadata("design:returntype", Promise)
712
+ ], QueryPage.prototype, "expandPage", null);
713
+ __decorate([
714
+ Effect(IndexTemplate.ActionId.ITEM_CLICK),
715
+ __metadata("design:type", Function),
716
+ __metadata("design:paramtypes", [Object]),
717
+ __metadata("design:returntype", void 0)
718
+ ], QueryPage.prototype, "itemClick", null);
719
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: QueryPage, decorators: [{
720
+ type: Component,
721
+ args: [{ selector: 'pages-query', imports: [
722
+ IndexTemplate,
723
+ RouterOutletFrame,
724
+ NgAtomicFormSectionBuilder,
725
+ QueryFormGroup,
726
+ ], template: `
727
+ <frames-router-outlet [skip]="store.skip()" (action)="dispatch($event)">
728
+ <templates-index
729
+ [tableColumnFormFieldMap]="store.tableColumnFormFieldMap()"
730
+ [style]="store.style()"
731
+ [title]="store.title()"
732
+ [titleControl]="store.feature.form.get(['title'])"
733
+ [titleEditable]="store.titleEditable()"
734
+ [type]="store.type()"
735
+ [tableChildrenKey]="store.childrenKey()"
736
+ [tableTreeControl]="store.tableTreeControl"
737
+ [itemsMap]="store.itemsMap()"
738
+ [itemsLength]="store.itemsLength()"
739
+ [itemActions]="store.itemActions()"
740
+ [getRowClass]="store.getRowClass()"
741
+ [form]="store.form()"
742
+ [navStartActions]="store.navStartActions()"
743
+ [navEndActions]="store.navEndActions()"
744
+ [navMode]="store.navMode()"
745
+ [pageSizeOptions]="store.pageSizeOptions()"
746
+ (action)="dispatch($event)"
747
+ >
748
+ @if (store.variablesFormDisplayed()) {
749
+ <div navDashboard>
750
+ <ng-atomic-form-section-builder
751
+ [form]="store.variablesForm()"
752
+ [fieldMap]="store.variablesFormFieldMap()"
753
+ />
754
+ </div>
755
+ }
756
+ <groups-query-form dashboard (action)="dispatch($event)" />
757
+ </templates-index>
758
+ </frames-router-outlet>
759
+ `, changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [
760
+ {
761
+ directive: QueryPageStore,
762
+ inputs: [
763
+ 'type',
764
+ 'query',
765
+ 'titleEditable',
766
+ 'variablesForm',
767
+ 'variablesFormFieldMap',
768
+ 'navStartActions',
769
+ 'navEndActions',
770
+ 'itemActions',
771
+ 'pageSizeOptions'
772
+ ]
773
+ },
774
+ ], styles: ["@charset \"UTF-8\";:host{width:100%;height:100%;display:block;--page-width-lv1-SCOPED-IN-query-SEA9: var(--page-width-lv1);--page-width-lv3-SCOPED-IN-query-SEA9: var(--page-width-lv3);--primary-color-SCOPED-IN-query-SEA9: var(--primary-color);--on-primary-color-SCOPED-IN-query-SEA9: var(--on-primary-color);--surface-color-SCOPED-IN-query-SEA9: var(--surface-color);--on-surface-color-SCOPED-IN-query-SEA9: var(--on-surface-color);--on-background-color-SCOPED-IN-query-SEA9: var(--on-background-color);--background-color-SCOPED-IN-query-SEA9: var(--background-color);--navigator-background-color-SCOPED-IN-query-SEA9: var(--navigator-background-color);--navigator-on-background-color-SCOPED-IN-query-SEA9: var(--navigator-on-background-color);--table-background-color-SCOPED-IN-query-SEA9: var(--table-background-color);--table-on-background-color-SCOPED-IN-query-SEA9: var(--table-on-background-color);--is-debug: 1;--is-debug-SCOPED-IN-query-SEA9: var(--is-debug)}:host *{--primary-color: var(--primary-color-SCOPED-IN-query-SEA9);--on-primary-color: var(--on-primary-color-SCOPED-IN-query-SEA9);--surface-color: var(--surface-color-SCOPED-IN-query-SEA9);--on-surface-color: var(--on-surface-color-SCOPED-IN-query-SEA9);--background-color: var(--background-color-SCOPED-IN-query-SEA9);--on-background-color: var(--on-background-color-SCOPED-IN-query-SEA9);--navigator-background-color: var(--navigator-background-color-SCOPED-IN-query-SEA9);--navigator-on-background-color: var(--navigator-on-background-color-SCOPED-IN-query-SEA9);--table-background-color: var(--table-background-color-SCOPED-IN-query-SEA9);--table-on-background-color: var(--table-on-background-color-SCOPED-IN-query-SEA9);--is-debug: var(--is-debug-SCOPED-IN-query-SEA9)}:host templates-index{padding-left:0;box-sizing:border-box;--first-content-height: calc(var(--is-debug-SCOPED-IN-query-SEA9) * 300px);transition:padding-left .3s}:host templates-index div[navDashboard]{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;padding:16px;box-sizing:border-box}:host templates-index div[navDashboard] ng-atomic-form-section-builder{--horizontal-padding: 0}\n"] }]
775
+ }], ctorParameters: () => [], propDecorators: { back: [], navigateToIframe: [], expandPage: [], itemClick: [] } });
776
+
777
+ /**
778
+ * Generated bundle index. Do not edit.
779
+ */
780
+
781
+ export { ActionId, QueryActionReducer, QueryPage, QueryPageStore, buildItemsMap, buildItemsMapFromResult };
782
+ //# sourceMappingURL=xxmachina-components-pages-query.mjs.map