@cratis/scene.components 3.4.0 → 3.5.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 +51 -2
- package/bindings/ArcBoundComponents.tsx +40 -0
- package/bindings/BoundConstructor.ts +5 -5
- package/bindings/for_requireArcProxy/NativeProxies.ts +28 -0
- package/bindings/for_requireArcProxy/when_mounting_bound_adapters.tsx +71 -0
- package/bindings/for_requireArcProxy/when_previewing_without_arc.tsx +37 -0
- package/bindings/for_requireArcProxy/when_validating_a_proxy.ts +44 -0
- package/bindings/requireArcProxy.ts +24 -0
- package/cratisComponents.ts +2 -1
- package/cratisComponentsPackage.ts +2 -1
- package/data/SceneDataTable.tsx +1 -1
- package/data/SceneObservableDataTable.tsx +1 -1
- package/data/SceneSingleResult.tsx +29 -0
- package/data/SingleResultRuntime.tsx +89 -0
- package/data/SingleResultStatus.tsx +13 -0
- package/data/for_SceneDataTable/when_forwarding_query_arguments.tsx +4 -2
- package/data/for_SceneSingleResult/when_executing_a_native_query.tsx +290 -0
- package/data/for_SceneSingleResult/when_gating_the_lazy_runtime.tsx +60 -0
- package/data/index.ts +1 -0
- package/dialogs/SceneCommandDialog.tsx +1 -1
- package/dialogs/SceneStepperCommandDialog.tsx +1 -1
- package/dist/cjs/bindings/ArcBoundComponents.js +55 -0
- package/dist/cjs/bindings/ArcBoundComponents.js.map +1 -0
- package/dist/cjs/bindings/requireArcProxy.js +25 -0
- package/dist/cjs/bindings/requireArcProxy.js.map +1 -0
- package/dist/cjs/cratisComponents.js +2 -0
- package/dist/cjs/cratisComponents.js.map +1 -1
- package/dist/cjs/cratisComponentsPackage.js +2 -1
- package/dist/cjs/cratisComponentsPackage.js.map +1 -1
- package/dist/cjs/data/SceneDataTable.js +1 -1
- package/dist/cjs/data/SceneDataTable.js.map +1 -1
- package/dist/cjs/data/SceneObservableDataTable.js +1 -1
- package/dist/cjs/data/SceneObservableDataTable.js.map +1 -1
- package/dist/cjs/data/SceneSingleResult.js +41 -0
- package/dist/cjs/data/SceneSingleResult.js.map +1 -0
- package/dist/cjs/data/SingleResultRuntime.js +122 -0
- package/dist/cjs/data/SingleResultRuntime.js.map +1 -0
- package/dist/cjs/data/SingleResultStatus.js +23 -0
- package/dist/cjs/data/SingleResultStatus.js.map +1 -0
- package/dist/cjs/dialogs/SceneCommandDialog.js +1 -1
- package/dist/cjs/dialogs/SceneCommandDialog.js.map +1 -1
- package/dist/cjs/dialogs/SceneStepperCommandDialog.js +1 -1
- package/dist/cjs/dialogs/SceneStepperCommandDialog.js.map +1 -1
- package/dist/cjs/forms/fields/SceneRadioButtonField.js +4 -1
- package/dist/cjs/forms/fields/SceneRadioButtonField.js.map +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/pages/SceneDataPage.js +1 -1
- package/dist/cjs/pages/SceneDataPage.js.map +1 -1
- package/dist/esm/bindings/ArcBoundComponents.d.ts +18 -0
- package/dist/esm/bindings/ArcBoundComponents.d.ts.map +1 -0
- package/dist/esm/bindings/ArcBoundComponents.js +49 -0
- package/dist/esm/bindings/ArcBoundComponents.js.map +1 -0
- package/dist/esm/bindings/for_requireArcProxy/NativeProxies.d.ts +25 -0
- package/dist/esm/bindings/for_requireArcProxy/NativeProxies.d.ts.map +1 -0
- package/dist/esm/bindings/for_requireArcProxy/NativeProxies.js +23 -0
- package/dist/esm/bindings/for_requireArcProxy/NativeProxies.js.map +1 -0
- package/dist/esm/bindings/for_requireArcProxy/when_mounting_bound_adapters.d.ts +2 -0
- package/dist/esm/bindings/for_requireArcProxy/when_mounting_bound_adapters.d.ts.map +1 -0
- package/dist/esm/bindings/for_requireArcProxy/when_mounting_bound_adapters.js +56 -0
- package/dist/esm/bindings/for_requireArcProxy/when_mounting_bound_adapters.js.map +1 -0
- package/dist/esm/bindings/for_requireArcProxy/when_previewing_without_arc.d.ts +2 -0
- package/dist/esm/bindings/for_requireArcProxy/when_previewing_without_arc.d.ts.map +1 -0
- package/dist/esm/bindings/for_requireArcProxy/when_previewing_without_arc.js +32 -0
- package/dist/esm/bindings/for_requireArcProxy/when_previewing_without_arc.js.map +1 -0
- package/dist/esm/bindings/for_requireArcProxy/when_validating_a_proxy.d.ts +2 -0
- package/dist/esm/bindings/for_requireArcProxy/when_validating_a_proxy.d.ts.map +1 -0
- package/dist/esm/bindings/for_requireArcProxy/when_validating_a_proxy.js +45 -0
- package/dist/esm/bindings/for_requireArcProxy/when_validating_a_proxy.js.map +1 -0
- package/dist/esm/bindings/requireArcProxy.d.ts +5 -0
- package/dist/esm/bindings/requireArcProxy.d.ts.map +1 -0
- package/dist/esm/bindings/requireArcProxy.js +23 -0
- package/dist/esm/bindings/requireArcProxy.js.map +1 -0
- package/dist/esm/cratisComponents.d.ts.map +1 -1
- package/dist/esm/cratisComponents.js +2 -0
- package/dist/esm/cratisComponents.js.map +1 -1
- package/dist/esm/cratisComponentsPackage.d.ts.map +1 -1
- package/dist/esm/cratisComponentsPackage.js +2 -1
- package/dist/esm/cratisComponentsPackage.js.map +1 -1
- package/dist/esm/data/SceneDataTable.js +1 -1
- package/dist/esm/data/SceneDataTable.js.map +1 -1
- package/dist/esm/data/SceneObservableDataTable.js +1 -1
- package/dist/esm/data/SceneObservableDataTable.js.map +1 -1
- package/dist/esm/data/SceneSingleResult.d.ts +3 -0
- package/dist/esm/data/SceneSingleResult.d.ts.map +1 -0
- package/dist/esm/data/SceneSingleResult.js +39 -0
- package/dist/esm/data/SceneSingleResult.js.map +1 -0
- package/dist/esm/data/SingleResultRuntime.d.ts +9 -0
- package/dist/esm/data/SingleResultRuntime.d.ts.map +1 -0
- package/dist/esm/data/SingleResultRuntime.js +118 -0
- package/dist/esm/data/SingleResultRuntime.js.map +1 -0
- package/dist/esm/data/SingleResultStatus.d.ts +7 -0
- package/dist/esm/data/SingleResultStatus.d.ts.map +1 -0
- package/dist/esm/data/SingleResultStatus.js +21 -0
- package/dist/esm/data/SingleResultStatus.js.map +1 -0
- package/dist/esm/data/for_SceneDataTable/when_forwarding_query_arguments.js +4 -4
- package/dist/esm/data/for_SceneDataTable/when_forwarding_query_arguments.js.map +1 -1
- package/dist/esm/data/for_SceneSingleResult/when_executing_a_native_query.d.ts +2 -0
- package/dist/esm/data/for_SceneSingleResult/when_executing_a_native_query.d.ts.map +1 -0
- package/dist/esm/data/for_SceneSingleResult/when_executing_a_native_query.js +255 -0
- package/dist/esm/data/for_SceneSingleResult/when_executing_a_native_query.js.map +1 -0
- package/dist/esm/data/for_SceneSingleResult/when_gating_the_lazy_runtime.d.ts +2 -0
- package/dist/esm/data/for_SceneSingleResult/when_gating_the_lazy_runtime.d.ts.map +1 -0
- package/dist/esm/data/for_SceneSingleResult/when_gating_the_lazy_runtime.js +54 -0
- package/dist/esm/data/for_SceneSingleResult/when_gating_the_lazy_runtime.js.map +1 -0
- package/dist/esm/data/index.d.ts +1 -0
- package/dist/esm/data/index.d.ts.map +1 -1
- package/dist/esm/data/index.js +1 -0
- package/dist/esm/data/index.js.map +1 -1
- package/dist/esm/dialogs/SceneCommandDialog.js +1 -1
- package/dist/esm/dialogs/SceneCommandDialog.js.map +1 -1
- package/dist/esm/dialogs/SceneStepperCommandDialog.js +1 -1
- package/dist/esm/dialogs/SceneStepperCommandDialog.js.map +1 -1
- package/dist/esm/for_cratisComponentsPackage/when_describing_single_result.d.ts +2 -0
- package/dist/esm/for_cratisComponentsPackage/when_describing_single_result.d.ts.map +1 -0
- package/dist/esm/for_cratisComponentsPackage/when_describing_single_result.js +16 -0
- package/dist/esm/for_cratisComponentsPackage/when_describing_single_result.js.map +1 -0
- package/dist/esm/forms/fields/SceneRadioButtonField.d.ts.map +1 -1
- package/dist/esm/forms/fields/SceneRadioButtonField.js +4 -1
- package/dist/esm/forms/fields/SceneRadioButtonField.js.map +1 -1
- package/dist/esm/forms/fields/for_SceneRadioButtonField/when_mapping_the_group_name.d.ts +2 -0
- package/dist/esm/forms/fields/for_SceneRadioButtonField/when_mapping_the_group_name.d.ts.map +1 -0
- package/dist/esm/forms/fields/for_SceneRadioButtonField/when_mapping_the_group_name.js +38 -0
- package/dist/esm/forms/fields/for_SceneRadioButtonField/when_mapping_the_group_name.js.map +1 -0
- package/dist/esm/forms/fields/for_resolveFieldBinding/when_resolving_a_field_binding.js +4 -0
- package/dist/esm/forms/fields/for_resolveFieldBinding/when_resolving_a_field_binding.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pages/SceneDataPage.js +1 -1
- package/dist/esm/pages/SceneDataPage.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/for_cratisComponentsPackage/when_describing_single_result.ts +20 -0
- package/forms/fields/SceneRadioButtonField.tsx +4 -1
- package/forms/fields/for_SceneRadioButtonField/when_mapping_the_group_name.tsx +45 -0
- package/forms/fields/for_resolveFieldBinding/when_resolving_a_field_binding.ts +6 -0
- package/package.json +19 -7
- package/pages/SceneDataPage.tsx +1 -1
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { act, cleanup, render, screen, waitFor } from '@testing-library/react';
|
|
5
|
+
import { expect, vi } from 'vitest';
|
|
6
|
+
import { StrictMode } from 'react';
|
|
7
|
+
import { ArcContext, type ArcConfiguration } from '@cratis/arc.react';
|
|
8
|
+
import { QueryFor, QueryHttpMethod, QueryValidator } from '@cratis/arc/queries';
|
|
9
|
+
import { clearBindings, registerQuery } from '../../bindings';
|
|
10
|
+
import { externalComponent } from '../../given';
|
|
11
|
+
import { SceneSingleResult } from '../SceneSingleResult';
|
|
12
|
+
|
|
13
|
+
class ProjectName extends QueryFor<object | undefined, { projectId: string }> {
|
|
14
|
+
readonly route = '/projects/{projectId}/name';
|
|
15
|
+
readonly parameterDescriptors = [];
|
|
16
|
+
readonly requiredRequestParameters = ['projectId'];
|
|
17
|
+
defaultValue = undefined;
|
|
18
|
+
|
|
19
|
+
constructor() {
|
|
20
|
+
super(Object, false);
|
|
21
|
+
this.setHttpMethod(QueryHttpMethod.Get);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
class ProjectNames extends QueryFor<object[]> {
|
|
26
|
+
readonly route = '/projects';
|
|
27
|
+
readonly parameterDescriptors = [];
|
|
28
|
+
readonly requiredRequestParameters = [];
|
|
29
|
+
defaultValue = [];
|
|
30
|
+
|
|
31
|
+
constructor() { super(Object, true); }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
class ProjectArgumentsValidator extends QueryValidator<{ projectId: string }> {
|
|
35
|
+
static received: unknown;
|
|
36
|
+
|
|
37
|
+
constructor() {
|
|
38
|
+
super();
|
|
39
|
+
this.ruleFor(args => {
|
|
40
|
+
ProjectArgumentsValidator.received = args;
|
|
41
|
+
return args.projectId;
|
|
42
|
+
}).minLength(2);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
class ValidatedProjectName extends ProjectName {
|
|
47
|
+
readonly validation = new ProjectArgumentsValidator();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function envelope(data: unknown, overrides: Record<string, unknown> = {}) {
|
|
51
|
+
return {
|
|
52
|
+
data, isSuccess: true, isAuthorized: true, isValid: true, hasExceptions: false,
|
|
53
|
+
validationResults: [], exceptionMessages: [], exceptionStackTrace: '',
|
|
54
|
+
paging: { page: 0, size: 0, totalItems: 0, totalPages: 0 }, ...overrides,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function response(data: unknown, overrides: Record<string, unknown> = {}) {
|
|
59
|
+
return { ok: true, status: 200, json: async () => envelope(data, overrides) } as Response;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function deferred() {
|
|
63
|
+
let resolve!: (value: Response) => void;
|
|
64
|
+
let reject!: (error: unknown) => void;
|
|
65
|
+
const promise = new Promise<Response>((yes, no) => { resolve = yes; reject = no; });
|
|
66
|
+
return { promise, resolve, reject };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
describe('when executing an optional single result with native Arc 22.16.1', () => {
|
|
70
|
+
const headers = () => ({ 'x-host': 'one' });
|
|
71
|
+
const context: ArcConfiguration = { microservice: 'projects', origin: 'https://example.test', apiBasePath: '/backend', httpHeadersCallback: headers };
|
|
72
|
+
const fetch = vi.fn<typeof globalThis.fetch>();
|
|
73
|
+
|
|
74
|
+
function view(queryArguments: unknown = { projectId: 'A' }, arc = context, properties: Record<string, unknown> = {}) {
|
|
75
|
+
return <ArcContext.Provider value={arc}>
|
|
76
|
+
<SceneSingleResult element={externalComponent('Cratis.Components:singleResult', {
|
|
77
|
+
query: 'ProjectName', queryArguments, enabled: true, resultField: 'name', ...properties,
|
|
78
|
+
})} slots={{}} />
|
|
79
|
+
</ArcContext.Provider>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
beforeEach(() => {
|
|
83
|
+
clearBindings();
|
|
84
|
+
registerQuery('ProjectName', ProjectName);
|
|
85
|
+
registerQuery('ProjectNames', ProjectNames);
|
|
86
|
+
registerQuery('ValidatedProjectName', ValidatedProjectName);
|
|
87
|
+
fetch.mockReset();
|
|
88
|
+
vi.stubGlobal('fetch', fetch);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
afterEach(() => {
|
|
92
|
+
cleanup();
|
|
93
|
+
clearBindings();
|
|
94
|
+
vi.unstubAllGlobals();
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('uses the native URL, arguments and context headers without changing the host object', async () => {
|
|
98
|
+
const args = Object.freeze({ projectId: 'AA', locale: 'en' });
|
|
99
|
+
fetch.mockResolvedValue(response({ name: '<b>Project A</b>' }));
|
|
100
|
+
await act(async () => { render(view(args, context, { query: 'ValidatedProjectName' })); });
|
|
101
|
+
expect(await screen.findByText('<b>Project A</b>')).not.toBeNull();
|
|
102
|
+
expect(document.querySelector('b')).toBeNull();
|
|
103
|
+
expect(fetch).toHaveBeenCalledTimes(1);
|
|
104
|
+
const [url, init] = fetch.mock.calls[0];
|
|
105
|
+
expect(String(url)).toBe('https://example.test/backend/projects/AA/name?locale=en');
|
|
106
|
+
expect(ProjectArgumentsValidator.received).toBe(args);
|
|
107
|
+
expect(new Headers(init?.headers).get('x-host')).toBe('one');
|
|
108
|
+
expect(new Headers(init?.headers).get('x-cratis-microservice')).toBe('projects');
|
|
109
|
+
expect(args).toEqual({ projectId: 'AA', locale: 'en' });
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
for (const value of [false, 0, '']) {
|
|
113
|
+
it(`renders scalar own-field ${JSON.stringify(value)} as present`, async () => {
|
|
114
|
+
fetch.mockResolvedValue(response({ name: value }));
|
|
115
|
+
await act(async () => { render(view()); });
|
|
116
|
+
await waitFor(() => expect(screen.getByRole('status').getAttribute('data-scene-single-result')).toBe('success'));
|
|
117
|
+
expect(screen.getByRole('status').textContent).toBe(String(value));
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
for (const data of [null, undefined]) {
|
|
122
|
+
it(`shows not found for successful ${String(data)}`, async () => {
|
|
123
|
+
fetch.mockResolvedValue(response(data));
|
|
124
|
+
await act(async () => { render(view()); });
|
|
125
|
+
expect(await screen.findByText('Not found')).not.toBeNull();
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
for (const failure of [{ isSuccess: false }, { isAuthorized: false }, { isValid: false }, { hasExceptions: true }]) {
|
|
130
|
+
it(`prioritizes failure over missing data: ${JSON.stringify(failure)}`, async () => {
|
|
131
|
+
fetch.mockResolvedValue(response(null, { ...failure, exceptionMessages: ['secret'], exceptionStackTrace: 'server stack' }));
|
|
132
|
+
await act(async () => { render(view()); });
|
|
133
|
+
expect(await screen.findByRole('alert')).toHaveProperty('textContent', 'Unable to load result');
|
|
134
|
+
expect(screen.queryByText('Not found')).toBeNull();
|
|
135
|
+
expect(document.body.textContent).not.toMatch(/secret|server stack/);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
for (const args of [{}, { projectId: '' }, { projectId: null }, [], null, 'A', undefined]) {
|
|
140
|
+
it(`does not send invalid or missing arguments: ${JSON.stringify(args)}`, async () => {
|
|
141
|
+
await act(async () => { render(view(args, context, { queryArguments: args })); });
|
|
142
|
+
expect(await screen.findByRole('alert')).not.toBeNull();
|
|
143
|
+
expect(fetch).not.toHaveBeenCalled();
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
it('lets the native proxy validator reject arguments without HTTP', async () => {
|
|
148
|
+
await act(async () => { render(view({ projectId: 'A' }, context, { query: 'ValidatedProjectName' })); });
|
|
149
|
+
expect(await screen.findByRole('alert')).not.toBeNull();
|
|
150
|
+
expect(fetch).not.toHaveBeenCalled();
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
for (const enabled of [false, undefined, 'true']) {
|
|
154
|
+
it(`is idle unless explicitly enabled: ${String(enabled)}`, async () => {
|
|
155
|
+
await act(async () => { render(view({ projectId: 'A' }, context, { enabled })); });
|
|
156
|
+
expect(screen.getByText('Idle')).not.toBeNull();
|
|
157
|
+
expect(fetch).not.toHaveBeenCalled();
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
it('never chooses another query when the binding is missing', async () => {
|
|
162
|
+
await act(async () => { render(view({}, context, { query: 'Missing' })); });
|
|
163
|
+
expect(screen.getByText(/Unresolved query binding 'Missing'/)).not.toBeNull();
|
|
164
|
+
expect(fetch).not.toHaveBeenCalled();
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it('aborts A and ignores reverse completion when the transport ignores abort', async () => {
|
|
168
|
+
const a = deferred();
|
|
169
|
+
const b = deferred();
|
|
170
|
+
fetch.mockReturnValueOnce(a.promise).mockReturnValueOnce(b.promise);
|
|
171
|
+
let mounted!: ReturnType<typeof render>;
|
|
172
|
+
await act(async () => { mounted = render(view()); });
|
|
173
|
+
expect(screen.getByText('Loading')).not.toBeNull();
|
|
174
|
+
const signal = fetch.mock.calls[0][1]?.signal;
|
|
175
|
+
await act(async () => { mounted.rerender(view({ projectId: 'B' })); });
|
|
176
|
+
expect(signal?.aborted).toBe(true);
|
|
177
|
+
await act(async () => { b.resolve(response({ name: 'B' })); });
|
|
178
|
+
expect(screen.getByText('B')).not.toBeNull();
|
|
179
|
+
await act(async () => { a.resolve(response({ name: 'A' })); });
|
|
180
|
+
expect(screen.queryByText('A')).toBeNull();
|
|
181
|
+
expect(screen.getByText('B')).not.toBeNull();
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it('hides a settled A immediately on B and aborts B on disposal', async () => {
|
|
185
|
+
const b = deferred();
|
|
186
|
+
fetch.mockResolvedValueOnce(response({ name: 'A' })).mockReturnValueOnce(b.promise);
|
|
187
|
+
let mounted!: ReturnType<typeof render>;
|
|
188
|
+
await act(async () => { mounted = render(view()); });
|
|
189
|
+
expect(screen.getByText('A')).not.toBeNull();
|
|
190
|
+
await act(async () => { mounted.rerender(view({ projectId: 'B' })); });
|
|
191
|
+
expect(screen.queryByText('A')).toBeNull();
|
|
192
|
+
expect(screen.getByText('Loading')).not.toBeNull();
|
|
193
|
+
mounted.unmount();
|
|
194
|
+
expect(fetch.mock.calls[1][1]?.signal?.aborted).toBe(true);
|
|
195
|
+
await act(async () => { b.reject(new DOMException('Aborted', 'AbortError')); });
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
it('reexecutes for header-only context changes and ignores the old response', async () => {
|
|
199
|
+
const a = deferred();
|
|
200
|
+
const b = deferred();
|
|
201
|
+
const args = { projectId: 'A' };
|
|
202
|
+
fetch.mockReturnValueOnce(a.promise).mockReturnValueOnce(b.promise);
|
|
203
|
+
let mounted!: ReturnType<typeof render>;
|
|
204
|
+
await act(async () => { mounted = render(view(args)); });
|
|
205
|
+
await act(async () => { mounted.rerender(view(args, { ...context, httpHeadersCallback: () => ({ 'x-host': 'two' }) })); });
|
|
206
|
+
expect(fetch.mock.calls[0][1]?.signal?.aborted).toBe(true);
|
|
207
|
+
expect(new Headers(fetch.mock.calls[1][1]?.headers).get('x-host')).toBe('two');
|
|
208
|
+
await act(async () => { b.resolve(response({ name: 'New context' })); a.resolve(response({ name: 'Old context' })); });
|
|
209
|
+
expect(screen.getByText('New context')).not.toBeNull();
|
|
210
|
+
expect(screen.queryByText('Old context')).toBeNull();
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it('rejects enumerable proxies before HTTP rather than adapting them to a single model', async () => {
|
|
214
|
+
await act(async () => { render(view({}, context, { query: 'ProjectNames' })); });
|
|
215
|
+
expect(await screen.findByRole('alert')).not.toBeNull();
|
|
216
|
+
expect(fetch).not.toHaveBeenCalled();
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it('handles StrictMode disposal without an unhandled abort promise', async () => {
|
|
220
|
+
const a = deferred();
|
|
221
|
+
const b = deferred();
|
|
222
|
+
fetch.mockReturnValueOnce(a.promise).mockReturnValueOnce(b.promise);
|
|
223
|
+
await act(async () => { render(<StrictMode>{view()}</StrictMode>); });
|
|
224
|
+
expect(fetch).toHaveBeenCalledTimes(2);
|
|
225
|
+
expect(fetch.mock.calls[0][1]?.signal?.aborted).toBe(true);
|
|
226
|
+
await act(async () => {
|
|
227
|
+
a.reject(new DOMException('Aborted', 'AbortError'));
|
|
228
|
+
b.resolve(response({ name: 'Current generation' }));
|
|
229
|
+
});
|
|
230
|
+
expect(screen.getByText('Current generation')).not.toBeNull();
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
it('ignores successful completion after unmount even if HTTP ignores abort', async () => {
|
|
234
|
+
const pending = deferred();
|
|
235
|
+
fetch.mockReturnValueOnce(pending.promise);
|
|
236
|
+
let mounted!: ReturnType<typeof render>;
|
|
237
|
+
await act(async () => { mounted = render(view()); });
|
|
238
|
+
mounted.unmount();
|
|
239
|
+
expect(fetch.mock.calls[0][1]?.signal?.aborted).toBe(true);
|
|
240
|
+
await act(async () => { pending.resolve(response({ name: 'Disposed' })); });
|
|
241
|
+
expect(screen.queryByText('Disposed')).toBeNull();
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it('turns transport rejection and malformed envelopes into safe failure', async () => {
|
|
245
|
+
fetch.mockRejectedValueOnce(new Error('private network detail'));
|
|
246
|
+
let mounted!: ReturnType<typeof render>;
|
|
247
|
+
await act(async () => { mounted = render(view()); });
|
|
248
|
+
expect(await screen.findByRole('alert')).toHaveProperty('textContent', 'Unable to load result');
|
|
249
|
+
fetch.mockResolvedValueOnce({ ok: false, status: 500, json: async () => ({}) } as Response);
|
|
250
|
+
await act(async () => { mounted.rerender(view({ projectId: 'B' })); });
|
|
251
|
+
expect(await screen.findByRole('alert')).toHaveProperty('textContent', 'Unable to load result');
|
|
252
|
+
expect(document.body.textContent).not.toContain('private network detail');
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it('aborts and clears a pending request when disabled', async () => {
|
|
256
|
+
const pending = deferred();
|
|
257
|
+
fetch.mockReturnValueOnce(pending.promise);
|
|
258
|
+
let mounted!: ReturnType<typeof render>;
|
|
259
|
+
await act(async () => { mounted = render(view()); });
|
|
260
|
+
await act(async () => { mounted.rerender(view({ projectId: 'A' }, context, { enabled: false })); });
|
|
261
|
+
expect(fetch.mock.calls[0][1]?.signal?.aborted).toBe(true);
|
|
262
|
+
await act(async () => { pending.resolve(response({ name: 'Obsolete' })); });
|
|
263
|
+
expect(screen.getByText('Idle')).not.toBeNull();
|
|
264
|
+
expect(screen.queryByText('Obsolete')).toBeNull();
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
for (const change of [{ origin: 'https://other.test' }, { apiBasePath: '/v2' }, { microservice: 'other' }, { queryVersion: 1 }]) {
|
|
268
|
+
it(`invalidates a settled result after context changes: ${JSON.stringify(change)}`, async () => {
|
|
269
|
+
const pending = deferred();
|
|
270
|
+
const args = { projectId: 'A' };
|
|
271
|
+
fetch.mockResolvedValueOnce(response({ name: 'Old' })).mockReturnValueOnce(pending.promise);
|
|
272
|
+
let mounted!: ReturnType<typeof render>;
|
|
273
|
+
await act(async () => { mounted = render(view(args)); });
|
|
274
|
+
await act(async () => { mounted.rerender(view(args, { ...context, ...change })); });
|
|
275
|
+
expect(screen.queryByText('Old')).toBeNull();
|
|
276
|
+
expect(screen.getByText('Loading')).not.toBeNull();
|
|
277
|
+
expect(fetch).toHaveBeenCalledTimes(2);
|
|
278
|
+
await act(async () => { pending.resolve(response({ name: 'New' })); });
|
|
279
|
+
expect(screen.getByText('New')).not.toBeNull();
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
for (const data of [{ name: {} }, { name: [] }, {}, Object.create({ name: 'Inherited' }), [{ name: 'A' }]]) {
|
|
284
|
+
it(`rejects non-scalar or absent own fields: ${JSON.stringify(data)}`, async () => {
|
|
285
|
+
fetch.mockResolvedValue(response(data));
|
|
286
|
+
await act(async () => { render(view()); });
|
|
287
|
+
expect(await screen.findByRole('alert')).not.toBeNull();
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { act, cleanup, render, screen } from '@testing-library/react';
|
|
5
|
+
import { expect, vi } from 'vitest';
|
|
6
|
+
import { externalComponent } from '../../given';
|
|
7
|
+
|
|
8
|
+
class RegisteredQuery {}
|
|
9
|
+
|
|
10
|
+
describe('when gating the single result lazy runtime', () => {
|
|
11
|
+
const loaded = vi.fn();
|
|
12
|
+
let SceneSingleResult: typeof import('../SceneSingleResult').SceneSingleResult;
|
|
13
|
+
let bindings: typeof import('../../bindings');
|
|
14
|
+
|
|
15
|
+
beforeEach(async () => {
|
|
16
|
+
vi.resetModules();
|
|
17
|
+
loaded.mockClear();
|
|
18
|
+
vi.doMock('../SingleResultRuntime', () => {
|
|
19
|
+
loaded();
|
|
20
|
+
return { default: () => <span>Runtime mounted</span> };
|
|
21
|
+
});
|
|
22
|
+
bindings = await import('../../bindings');
|
|
23
|
+
bindings.clearBindings();
|
|
24
|
+
bindings.registerQuery('Registered', RegisteredQuery);
|
|
25
|
+
({ SceneSingleResult } = await import('../SceneSingleResult'));
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
afterEach(() => {
|
|
29
|
+
cleanup();
|
|
30
|
+
bindings.clearBindings();
|
|
31
|
+
vi.doUnmock('../SingleResultRuntime');
|
|
32
|
+
vi.resetModules();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
for (const properties of [
|
|
36
|
+
{ query: 'Missing', enabled: true, queryArguments: {}, resultField: 'name' },
|
|
37
|
+
{ query: 'Registered', queryArguments: {}, resultField: 'name' },
|
|
38
|
+
{ query: 'Registered', enabled: true, queryArguments: [], resultField: 'name' },
|
|
39
|
+
{ query: 'Registered', enabled: true, queryArguments: {}, resultField: '' },
|
|
40
|
+
]) {
|
|
41
|
+
it(`does not import Arc-bound code for ${JSON.stringify(properties)}`, async () => {
|
|
42
|
+
await act(async () => {
|
|
43
|
+
render(<SceneSingleResult element={externalComponent('Cratis.Components:singleResult', properties)} slots={{}} />);
|
|
44
|
+
});
|
|
45
|
+
expect(loaded).not.toHaveBeenCalled();
|
|
46
|
+
expect(screen.queryByText('Runtime mounted')).toBeNull();
|
|
47
|
+
expect(document.body.textContent).toMatch(/Unresolved query binding|Idle|Unable to load result/);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
it('loads only the explicitly bound and enabled view', async () => {
|
|
52
|
+
await act(async () => {
|
|
53
|
+
render(<SceneSingleResult element={externalComponent('Cratis.Components:singleResult', {
|
|
54
|
+
query: 'Registered', enabled: true, queryArguments: {}, resultField: 'name',
|
|
55
|
+
})} slots={{}} />);
|
|
56
|
+
});
|
|
57
|
+
expect(await screen.findByText('Runtime mounted')).not.toBeNull();
|
|
58
|
+
expect(loaded).toHaveBeenCalledTimes(1);
|
|
59
|
+
});
|
|
60
|
+
});
|
package/data/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Cratis. All rights reserved.
|
|
2
2
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
3
|
|
|
4
|
+
export * from './SceneSingleResult';
|
|
4
5
|
export * from './SceneDataTable';
|
|
5
6
|
export * from './SceneObservableDataTable';
|
|
@@ -6,7 +6,7 @@ import { RegisteredComponentProps } from '@cratis/scene.react';
|
|
|
6
6
|
import { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';
|
|
7
7
|
import { booleanProperty, stringProperty } from '../properties';
|
|
8
8
|
|
|
9
|
-
const CommandDialog = lazy(async () => ({ default: (await import('
|
|
9
|
+
const CommandDialog = lazy(async () => ({ default: (await import('../bindings/ArcBoundComponents')).BoundCommandDialog }));
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* The `Cratis.Components:commandDialog` component - `CommandDialog` from `@cratis/components/CommandDialog`.
|
|
@@ -7,7 +7,7 @@ import { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding
|
|
|
7
7
|
import { booleanProperty, stringProperty, unionProperty } from '../properties';
|
|
8
8
|
|
|
9
9
|
const StepperCommandDialog = lazy(async () => ({
|
|
10
|
-
default: (await import('
|
|
10
|
+
default: (await import('../bindings/ArcBoundComponents')).BoundStepperCommandDialog,
|
|
11
11
|
}));
|
|
12
12
|
|
|
13
13
|
/** Whether the step headers run across the top or down the side. */
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var queries = require('@cratis/arc/queries');
|
|
5
|
+
var commands = require('@cratis/arc/commands');
|
|
6
|
+
var DataTables = require('@cratis/components/DataTables');
|
|
7
|
+
var DataPage = require('@cratis/components/DataPage');
|
|
8
|
+
var CommandDialog = require('@cratis/components/CommandDialog');
|
|
9
|
+
var requireArcProxy = require('./requireArcProxy.js');
|
|
10
|
+
|
|
11
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
12
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
13
|
+
// Runtime-only module: import dynamically beneath ArcRuntimeBoundary, never through the barrel.
|
|
14
|
+
// Scene carries property names and argument objects, not compile-time row schemas. These adapters
|
|
15
|
+
// support generated object/collection queries, as required by the Components public prop contracts.
|
|
16
|
+
function BoundDataTable({ query, ...props }) {
|
|
17
|
+
return /*#__PURE__*/ jsxRuntime.jsx(DataTables.DataTableForQuery, {
|
|
18
|
+
...props,
|
|
19
|
+
query: requireArcProxy.requireArcProxy(query, queries.QueryFor, 'query')
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function BoundObservableDataTable({ query, ...props }) {
|
|
23
|
+
return /*#__PURE__*/ jsxRuntime.jsx(DataTables.DataTableForObservableQuery, {
|
|
24
|
+
...props,
|
|
25
|
+
query: requireArcProxy.requireArcProxy(query, queries.ObservableQueryFor, 'observable query')
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function BoundDataPage({ query, ...props }) {
|
|
29
|
+
const base = query.prototype instanceof queries.ObservableQueryFor ? queries.ObservableQueryFor : queries.QueryFor;
|
|
30
|
+
// This chooses only the kind of the supplied constructor, never another registered binding.
|
|
31
|
+
const proxy = requireArcProxy.requireArcProxy(query, base, 'query');
|
|
32
|
+
return /*#__PURE__*/ jsxRuntime.jsx(DataPage.DataPage, {
|
|
33
|
+
...props,
|
|
34
|
+
query: proxy
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function BoundCommandDialog({ command, ...props }) {
|
|
38
|
+
return /*#__PURE__*/ jsxRuntime.jsx(CommandDialog.CommandDialog, {
|
|
39
|
+
...props,
|
|
40
|
+
command: requireArcProxy.requireArcProxy(command, commands.Command, 'command')
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function BoundStepperCommandDialog({ command, ...props }) {
|
|
44
|
+
return /*#__PURE__*/ jsxRuntime.jsx(CommandDialog.StepperCommandDialog, {
|
|
45
|
+
...props,
|
|
46
|
+
command: requireArcProxy.requireArcProxy(command, commands.Command, 'command')
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
exports.BoundCommandDialog = BoundCommandDialog;
|
|
51
|
+
exports.BoundDataPage = BoundDataPage;
|
|
52
|
+
exports.BoundDataTable = BoundDataTable;
|
|
53
|
+
exports.BoundObservableDataTable = BoundObservableDataTable;
|
|
54
|
+
exports.BoundStepperCommandDialog = BoundStepperCommandDialog;
|
|
55
|
+
//# sourceMappingURL=ArcBoundComponents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArcBoundComponents.js","sources":["../../../bindings/ArcBoundComponents.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// Runtime-only module: import dynamically beneath ArcRuntimeBoundary, never through the barrel.\nimport type { ComponentProps } from 'react';\nimport { QueryFor, ObservableQueryFor } from '@cratis/arc/queries';\nimport { Command } from '@cratis/arc/commands';\nimport { DataTableForQuery, DataTableForObservableQuery } from '@cratis/components/DataTables';\nimport { DataPage } from '@cratis/components/DataPage';\nimport { CommandDialog, StepperCommandDialog } from '@cratis/components/CommandDialog';\nimport type { BoundConstructor } from './BoundConstructor';\nimport { requireArcProxy } from './requireArcProxy';\n\ntype QueryProps<T> = Omit<T, 'query'> & { query: BoundConstructor };\ntype CommandProps<T> = Omit<T, 'command'> & { command: BoundConstructor };\n\n// Scene carries property names and argument objects, not compile-time row schemas. These adapters\n// support generated object/collection queries, as required by the Components public prop contracts.\nexport function BoundDataTable({ query, ...props }: QueryProps<ComponentProps<typeof DataTableForQuery>>) {\n return <DataTableForQuery {...props} query={requireArcProxy(query, QueryFor<object, object>, 'query')} />;\n}\n\nexport function BoundObservableDataTable({ query, ...props }: QueryProps<ComponentProps<typeof DataTableForObservableQuery>>) {\n return <DataTableForObservableQuery {...props} query={requireArcProxy(query, ObservableQueryFor<object, object>, 'observable query')} />;\n}\n\nexport function BoundDataPage({ query, ...props }: QueryProps<ComponentProps<typeof DataPage>>) {\n const base = query.prototype instanceof ObservableQueryFor ? ObservableQueryFor<object, object> : QueryFor<object, object>;\n // This chooses only the kind of the supplied constructor, never another registered binding.\n const proxy = requireArcProxy<QueryFor<object, object> | ObservableQueryFor<object, object>>(query, base, 'query');\n return <DataPage {...props} query={proxy} />;\n}\n\nexport function BoundCommandDialog({ command, ...props }: CommandProps<ComponentProps<typeof CommandDialog>>) {\n return <CommandDialog {...props} command={requireArcProxy(command, Command<object, object>, 'command')} />;\n}\n\nexport function BoundStepperCommandDialog({ command, ...props }: CommandProps<ComponentProps<typeof StepperCommandDialog>>) {\n return <StepperCommandDialog {...props} command={requireArcProxy(command, Command<object, object>, 'command')} />;\n}\n"],"names":["BoundDataTable","query","props","_jsx","DataTableForQuery","requireArcProxy","QueryFor","BoundObservableDataTable","DataTableForObservableQuery","ObservableQueryFor","BoundDataPage","base","prototype","proxy","DataPage","BoundCommandDialog","command","CommandDialog","Command","BoundStepperCommandDialog","StepperCommandDialog"],"mappings":";;;;;;;;;;AAAA;AACA;AAEA;AAaA;AACA;AACO,SAASA,cAAAA,CAAe,EAAEC,KAAK,EAAE,GAAGC,KAAAA,EAA6D,EAAA;AACpG,IAAA,qBAAOC,cAAA,CAACC,4BAAAA,EAAAA;AAAmB,QAAA,GAAGF,KAAK;QAAED,KAAAA,EAAOI,+BAAAA,CAAgBJ,OAAOK,gBAAAA,EAA0B,OAAA;;AACjG;AAEO,SAASC,wBAAAA,CAAyB,EAAEN,KAAK,EAAE,GAAGC,KAAAA,EAAuE,EAAA;AACxH,IAAA,qBAAOC,cAAA,CAACK,sCAAAA,EAAAA;AAA6B,QAAA,GAAGN,KAAK;QAAED,KAAAA,EAAOI,+BAAAA,CAAgBJ,OAAOQ,0BAAAA,EAAoC,kBAAA;;AACrH;AAEO,SAASC,aAAAA,CAAc,EAAET,KAAK,EAAE,GAAGC,KAAAA,EAAoD,EAAA;AAC1F,IAAA,MAAMS,IAAAA,GAAOV,KAAAA,CAAMW,SAAS,YAAYH,6BAAqBA,0BAAAA,GAAqCH,gBAAAA;;IAElG,MAAMO,KAAAA,GAAQR,+BAAAA,CAA+EJ,KAAAA,EAAOU,IAAAA,EAAM,OAAA,CAAA;AAC1G,IAAA,qBAAOR,cAAA,CAACW,iBAAAA,EAAAA;AAAU,QAAA,GAAGZ,KAAK;QAAED,KAAAA,EAAOY;;AACvC;AAEO,SAASE,kBAAAA,CAAmB,EAAEC,OAAO,EAAE,GAAGd,KAAAA,EAA2D,EAAA;AACxG,IAAA,qBAAOC,cAAA,CAACc,2BAAAA,EAAAA;AAAe,QAAA,GAAGf,KAAK;QAAEc,OAAAA,EAASX,+BAAAA,CAAgBW,SAASE,gBAAAA,EAAyB,SAAA;;AAChG;AAEO,SAASC,yBAAAA,CAA0B,EAAEH,OAAO,EAAE,GAAGd,KAAAA,EAAkE,EAAA;AACtH,IAAA,qBAAOC,cAAA,CAACiB,kCAAAA,EAAAA;AAAsB,QAAA,GAAGlB,KAAK;QAAEc,OAAAA,EAASX,+BAAAA,CAAgBW,SAASE,gBAAAA,EAAyB,SAAA;;AACvG;;;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* Bridge for the generated, zero-argument Arc proxies consumed by Components. The registry remains
|
|
7
|
+
* open to arbitrary constructors; only mounting an Arc adapter requires this narrower contract.
|
|
8
|
+
* Check inheritance without constructing a proxy (constructors can have side effects).
|
|
9
|
+
*
|
|
10
|
+
* This is not structural interface validation: the host still owns the generated subclass's data,
|
|
11
|
+
* argument and implementation correctness. Prototype identity deliberately rejects duck-typed proxies
|
|
12
|
+
* and proxies from a second Arc installation. The arity check enforces the generated convention,
|
|
13
|
+
* not general JavaScript constructor safety (defaults/rest parameters can hide requirements).
|
|
14
|
+
* The single assertion bridges the registry under that host-owned generated-proxy contract; it is
|
|
15
|
+
* not a proof of arbitrary subclass behavior or of erased row/argument types.
|
|
16
|
+
*/ function requireArcProxy(target, base, kind) {
|
|
17
|
+
const prototype = target.prototype;
|
|
18
|
+
if (target.length !== 0 || typeof prototype !== 'object' || prototype === null || !Object.prototype.isPrototypeOf.call(base.prototype, prototype)) {
|
|
19
|
+
throw new Error(`Invalid ${kind} binding '${target.name}': expected a zero-argument Arc ${kind} proxy`);
|
|
20
|
+
}
|
|
21
|
+
return target;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.requireArcProxy = requireArcProxy;
|
|
25
|
+
//# sourceMappingURL=requireArcProxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requireArcProxy.js","sources":["../../../bindings/requireArcProxy.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { BoundConstructor } from './BoundConstructor';\n\n/**\n * Bridge for the generated, zero-argument Arc proxies consumed by Components. The registry remains\n * open to arbitrary constructors; only mounting an Arc adapter requires this narrower contract.\n * Check inheritance without constructing a proxy (constructors can have side effects).\n *\n * This is not structural interface validation: the host still owns the generated subclass's data,\n * argument and implementation correctness. Prototype identity deliberately rejects duck-typed proxies\n * and proxies from a second Arc installation. The arity check enforces the generated convention,\n * not general JavaScript constructor safety (defaults/rest parameters can hide requirements).\n * The single assertion bridges the registry under that host-owned generated-proxy contract; it is\n * not a proof of arbitrary subclass behavior or of erased row/argument types.\n */\nexport function requireArcProxy<T extends object>(target: BoundConstructor, base: { prototype: T }, kind: string): new () => T {\n const prototype: unknown = target.prototype;\n if (target.length !== 0 || typeof prototype !== 'object' || prototype === null || !Object.prototype.isPrototypeOf.call(base.prototype, prototype)) {\n throw new Error(`Invalid ${kind} binding '${target.name}': expected a zero-argument Arc ${kind} proxy`);\n }\n return target as new () => T;\n}\n"],"names":["requireArcProxy","target","base","kind","prototype","length","Object","isPrototypeOf","call","Error","name"],"mappings":";;AAAA;AACA;AAIA;;;;;;;;;;;AAWC,IACM,SAASA,eAAAA,CAAkCC,MAAwB,EAAEC,IAAsB,EAAEC,IAAY,EAAA;IAC5G,MAAMC,SAAAA,GAAqBH,OAAOG,SAAS;IAC3C,IAAIH,MAAAA,CAAOI,MAAM,KAAK,CAAA,IAAK,OAAOD,SAAAA,KAAc,QAAA,IAAYA,cAAc,IAAA,IAAQ,CAACE,OAAOF,SAAS,CAACG,aAAa,CAACC,IAAI,CAACN,IAAAA,CAAKE,SAAS,EAAEA,SAAAA,CAAAA,EAAY;AAC/I,QAAA,MAAM,IAAIK,KAAAA,CAAM,CAAC,QAAQ,EAAEN,IAAAA,CAAK,UAAU,EAAEF,MAAAA,CAAOS,IAAI,CAAC,gCAAgC,EAAEP,IAAAA,CAAK,MAAM,CAAC,CAAA;AAC1G,IAAA;IACA,OAAOF,MAAAA;AACX;;"}
|
|
@@ -4,6 +4,7 @@ var scene_react = require('@cratis/scene.react');
|
|
|
4
4
|
var ScenePage = require('./pages/ScenePage.js');
|
|
5
5
|
var SceneDataPage = require('./pages/SceneDataPage.js');
|
|
6
6
|
var SceneFormElement = require('./pages/SceneFormElement.js');
|
|
7
|
+
var SceneSingleResult = require('./data/SceneSingleResult.js');
|
|
7
8
|
var SceneDataTable = require('./data/SceneDataTable.js');
|
|
8
9
|
var SceneObservableDataTable = require('./data/SceneObservableDataTable.js');
|
|
9
10
|
var SceneCommandForm = require('./forms/SceneCommandForm.js');
|
|
@@ -65,6 +66,7 @@ var SceneToolbarSeparator = require('./toolbar/SceneToolbarSeparator.js');
|
|
|
65
66
|
[scene_react.componentRegistryKey(cratisComponentsPackageName, 'page')]: ScenePage.ScenePage,
|
|
66
67
|
[scene_react.componentRegistryKey(cratisComponentsPackageName, 'dataPage')]: SceneDataPage.SceneDataPage,
|
|
67
68
|
[scene_react.componentRegistryKey(cratisComponentsPackageName, 'formElement')]: SceneFormElement.SceneFormElement,
|
|
69
|
+
[scene_react.componentRegistryKey(cratisComponentsPackageName, 'singleResult')]: SceneSingleResult.SceneSingleResult,
|
|
68
70
|
[scene_react.componentRegistryKey(cratisComponentsPackageName, 'dataTable')]: SceneDataTable.SceneDataTable,
|
|
69
71
|
[scene_react.componentRegistryKey(cratisComponentsPackageName, 'table')]: SceneDataTable.SceneDataTable,
|
|
70
72
|
[scene_react.componentRegistryKey(cratisComponentsPackageName, 'observableDataTable')]: SceneObservableDataTable.SceneObservableDataTable,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cratisComponents.js","sources":["../../cratisComponents.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentRegistry, componentRegistryKey } from '@cratis/scene.react';\nimport { SceneDataPage, SceneFormElement, ScenePage } from './pages';\nimport { SceneDataTable, SceneObservableDataTable } from './data';\nimport {\n SceneCalendarField,\n SceneCheckboxField,\n SceneChipsField,\n SceneColorPickerField,\n SceneCommandForm,\n SceneDropdownField,\n SceneInputTextField,\n SceneMultiSelectField,\n SceneNumberField,\n SceneRadioButtonField,\n SceneRadioGroupField,\n SceneSliderField,\n SceneTextAreaField,\n} from './forms';\nimport { SceneBusyIndicatorDialog, SceneCommandDialog, SceneConfirmationDialog, SceneDialog, SceneStepperCommandDialog } from './dialogs';\nimport { SceneDropdown, SceneErrorBoundary, SceneIcon, SceneTooltip } from './common';\nimport { SceneFilterPanel, SceneObjectContentEditor, SceneObjectNavigationalBar, SceneSchemaEditor, SceneTimeMachine } from './editors';\nimport { SceneToolbar, SceneToolbarButton, SceneToolbarGroup, SceneToolbarSeparator } from './toolbar';\n\n/**\n * The package name every component here is registered under, and the one a screen writes when it\n * qualifies a name explicitly (`Cratis.Components.table`).\n */\nexport const cratisComponentsPackageName = 'Cratis.Components';\n\n/**\n * The `Cratis.Components` package's component registry - the abstract names a screen can resolve to a\n * real `@cratis/components` component.\n *\n * Names are `lowerCamelCase` and deliberately *abstract*: a screen names `dataTable`, not\n * `DataTableForQuery`, so the same screen resolves against whichever package a profile ranks highest.\n * Two of them - `table` and `dialog` - are names `core` and `PrimeReact` also declare, and that overlap\n * is the point: a profile listing `core`, `PrimeReact`, `Cratis.Components` in that order resolves both\n * here and records the others as shadowed, which is override priority doing exactly what it exists for.\n *\n * `table` and `dataTable` are the same component under two names. `dataTable` says what it is; `table`\n * is what a screen written against the base vocabulary already says, and both should land on the\n * query-aware implementation.\n */\nexport const cratisComponents: ComponentRegistry = {\n [componentRegistryKey(cratisComponentsPackageName, 'page')]: ScenePage,\n [componentRegistryKey(cratisComponentsPackageName, 'dataPage')]: SceneDataPage,\n [componentRegistryKey(cratisComponentsPackageName, 'formElement')]: SceneFormElement,\n\n [componentRegistryKey(cratisComponentsPackageName, 'dataTable')]: SceneDataTable,\n [componentRegistryKey(cratisComponentsPackageName, 'table')]: SceneDataTable,\n [componentRegistryKey(cratisComponentsPackageName, 'observableDataTable')]: SceneObservableDataTable,\n\n [componentRegistryKey(cratisComponentsPackageName, 'commandForm')]: SceneCommandForm,\n [componentRegistryKey(cratisComponentsPackageName, 'inputTextField')]: SceneInputTextField,\n [componentRegistryKey(cratisComponentsPackageName, 'numberField')]: SceneNumberField,\n [componentRegistryKey(cratisComponentsPackageName, 'checkboxField')]: SceneCheckboxField,\n [componentRegistryKey(cratisComponentsPackageName, 'textAreaField')]: SceneTextAreaField,\n [componentRegistryKey(cratisComponentsPackageName, 'dropdownField')]: SceneDropdownField,\n [componentRegistryKey(cratisComponentsPackageName, 'sliderField')]: SceneSliderField,\n [componentRegistryKey(cratisComponentsPackageName, 'calendarField')]: SceneCalendarField,\n [componentRegistryKey(cratisComponentsPackageName, 'colorPickerField')]: SceneColorPickerField,\n [componentRegistryKey(cratisComponentsPackageName, 'multiSelectField')]: SceneMultiSelectField,\n [componentRegistryKey(cratisComponentsPackageName, 'chipsField')]: SceneChipsField,\n [componentRegistryKey(cratisComponentsPackageName, 'radioButtonField')]: SceneRadioButtonField,\n [componentRegistryKey(cratisComponentsPackageName, 'radioGroupField')]: SceneRadioGroupField,\n\n [componentRegistryKey(cratisComponentsPackageName, 'dialog')]: SceneDialog,\n [componentRegistryKey(cratisComponentsPackageName, 'confirmationDialog')]: SceneConfirmationDialog,\n [componentRegistryKey(cratisComponentsPackageName, 'busyIndicatorDialog')]: SceneBusyIndicatorDialog,\n [componentRegistryKey(cratisComponentsPackageName, 'commandDialog')]: SceneCommandDialog,\n [componentRegistryKey(cratisComponentsPackageName, 'stepperCommandDialog')]: SceneStepperCommandDialog,\n\n [componentRegistryKey(cratisComponentsPackageName, 'icon')]: SceneIcon,\n [componentRegistryKey(cratisComponentsPackageName, 'tooltip')]: SceneTooltip,\n [componentRegistryKey(cratisComponentsPackageName, 'dropdown')]: SceneDropdown,\n [componentRegistryKey(cratisComponentsPackageName, 'errorBoundary')]: SceneErrorBoundary,\n\n [componentRegistryKey(cratisComponentsPackageName, 'objectContentEditor')]: SceneObjectContentEditor,\n [componentRegistryKey(cratisComponentsPackageName, 'objectNavigationalBar')]: SceneObjectNavigationalBar,\n [componentRegistryKey(cratisComponentsPackageName, 'schemaEditor')]: SceneSchemaEditor,\n [componentRegistryKey(cratisComponentsPackageName, 'timeMachine')]: SceneTimeMachine,\n [componentRegistryKey(cratisComponentsPackageName, 'filterPanel')]: SceneFilterPanel,\n\n [componentRegistryKey(cratisComponentsPackageName, 'toolbar')]: SceneToolbar,\n [componentRegistryKey(cratisComponentsPackageName, 'toolbarButton')]: SceneToolbarButton,\n [componentRegistryKey(cratisComponentsPackageName, 'toolbarGroup')]: SceneToolbarGroup,\n [componentRegistryKey(cratisComponentsPackageName, 'toolbarSeparator')]: SceneToolbarSeparator,\n};\n"],"names":["cratisComponentsPackageName","cratisComponents","componentRegistryKey","ScenePage","SceneDataPage","SceneFormElement","SceneDataTable","SceneObservableDataTable","SceneCommandForm","SceneInputTextField","SceneNumberField","SceneCheckboxField","SceneTextAreaField","SceneDropdownField","SceneSliderField","SceneCalendarField","SceneColorPickerField","SceneMultiSelectField","SceneChipsField","SceneRadioButtonField","SceneRadioGroupField","SceneDialog","SceneConfirmationDialog","SceneBusyIndicatorDialog","SceneCommandDialog","SceneStepperCommandDialog","SceneIcon","SceneTooltip","SceneDropdown","SceneErrorBoundary","SceneObjectContentEditor","SceneObjectNavigationalBar","SceneSchemaEditor","SceneTimeMachine","SceneFilterPanel","SceneToolbar","SceneToolbarButton","SceneToolbarGroup","SceneToolbarSeparator"],"mappings":"
|
|
1
|
+
{"version":3,"file":"cratisComponents.js","sources":["../../cratisComponents.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentRegistry, componentRegistryKey } from '@cratis/scene.react';\nimport { SceneDataPage, SceneFormElement, ScenePage } from './pages';\nimport { SceneDataTable, SceneObservableDataTable, SceneSingleResult } from './data';\nimport {\n SceneCalendarField,\n SceneCheckboxField,\n SceneChipsField,\n SceneColorPickerField,\n SceneCommandForm,\n SceneDropdownField,\n SceneInputTextField,\n SceneMultiSelectField,\n SceneNumberField,\n SceneRadioButtonField,\n SceneRadioGroupField,\n SceneSliderField,\n SceneTextAreaField,\n} from './forms';\nimport { SceneBusyIndicatorDialog, SceneCommandDialog, SceneConfirmationDialog, SceneDialog, SceneStepperCommandDialog } from './dialogs';\nimport { SceneDropdown, SceneErrorBoundary, SceneIcon, SceneTooltip } from './common';\nimport { SceneFilterPanel, SceneObjectContentEditor, SceneObjectNavigationalBar, SceneSchemaEditor, SceneTimeMachine } from './editors';\nimport { SceneToolbar, SceneToolbarButton, SceneToolbarGroup, SceneToolbarSeparator } from './toolbar';\n\n/**\n * The package name every component here is registered under, and the one a screen writes when it\n * qualifies a name explicitly (`Cratis.Components.table`).\n */\nexport const cratisComponentsPackageName = 'Cratis.Components';\n\n/**\n * The `Cratis.Components` package's component registry - the abstract names a screen can resolve to a\n * real `@cratis/components` component.\n *\n * Names are `lowerCamelCase` and deliberately *abstract*: a screen names `dataTable`, not\n * `DataTableForQuery`, so the same screen resolves against whichever package a profile ranks highest.\n * Two of them - `table` and `dialog` - are names `core` and `PrimeReact` also declare, and that overlap\n * is the point: a profile listing `core`, `PrimeReact`, `Cratis.Components` in that order resolves both\n * here and records the others as shadowed, which is override priority doing exactly what it exists for.\n *\n * `table` and `dataTable` are the same component under two names. `dataTable` says what it is; `table`\n * is what a screen written against the base vocabulary already says, and both should land on the\n * query-aware implementation.\n */\nexport const cratisComponents: ComponentRegistry = {\n [componentRegistryKey(cratisComponentsPackageName, 'page')]: ScenePage,\n [componentRegistryKey(cratisComponentsPackageName, 'dataPage')]: SceneDataPage,\n [componentRegistryKey(cratisComponentsPackageName, 'formElement')]: SceneFormElement,\n\n [componentRegistryKey(cratisComponentsPackageName, 'singleResult')]: SceneSingleResult,\n [componentRegistryKey(cratisComponentsPackageName, 'dataTable')]: SceneDataTable,\n [componentRegistryKey(cratisComponentsPackageName, 'table')]: SceneDataTable,\n [componentRegistryKey(cratisComponentsPackageName, 'observableDataTable')]: SceneObservableDataTable,\n\n [componentRegistryKey(cratisComponentsPackageName, 'commandForm')]: SceneCommandForm,\n [componentRegistryKey(cratisComponentsPackageName, 'inputTextField')]: SceneInputTextField,\n [componentRegistryKey(cratisComponentsPackageName, 'numberField')]: SceneNumberField,\n [componentRegistryKey(cratisComponentsPackageName, 'checkboxField')]: SceneCheckboxField,\n [componentRegistryKey(cratisComponentsPackageName, 'textAreaField')]: SceneTextAreaField,\n [componentRegistryKey(cratisComponentsPackageName, 'dropdownField')]: SceneDropdownField,\n [componentRegistryKey(cratisComponentsPackageName, 'sliderField')]: SceneSliderField,\n [componentRegistryKey(cratisComponentsPackageName, 'calendarField')]: SceneCalendarField,\n [componentRegistryKey(cratisComponentsPackageName, 'colorPickerField')]: SceneColorPickerField,\n [componentRegistryKey(cratisComponentsPackageName, 'multiSelectField')]: SceneMultiSelectField,\n [componentRegistryKey(cratisComponentsPackageName, 'chipsField')]: SceneChipsField,\n [componentRegistryKey(cratisComponentsPackageName, 'radioButtonField')]: SceneRadioButtonField,\n [componentRegistryKey(cratisComponentsPackageName, 'radioGroupField')]: SceneRadioGroupField,\n\n [componentRegistryKey(cratisComponentsPackageName, 'dialog')]: SceneDialog,\n [componentRegistryKey(cratisComponentsPackageName, 'confirmationDialog')]: SceneConfirmationDialog,\n [componentRegistryKey(cratisComponentsPackageName, 'busyIndicatorDialog')]: SceneBusyIndicatorDialog,\n [componentRegistryKey(cratisComponentsPackageName, 'commandDialog')]: SceneCommandDialog,\n [componentRegistryKey(cratisComponentsPackageName, 'stepperCommandDialog')]: SceneStepperCommandDialog,\n\n [componentRegistryKey(cratisComponentsPackageName, 'icon')]: SceneIcon,\n [componentRegistryKey(cratisComponentsPackageName, 'tooltip')]: SceneTooltip,\n [componentRegistryKey(cratisComponentsPackageName, 'dropdown')]: SceneDropdown,\n [componentRegistryKey(cratisComponentsPackageName, 'errorBoundary')]: SceneErrorBoundary,\n\n [componentRegistryKey(cratisComponentsPackageName, 'objectContentEditor')]: SceneObjectContentEditor,\n [componentRegistryKey(cratisComponentsPackageName, 'objectNavigationalBar')]: SceneObjectNavigationalBar,\n [componentRegistryKey(cratisComponentsPackageName, 'schemaEditor')]: SceneSchemaEditor,\n [componentRegistryKey(cratisComponentsPackageName, 'timeMachine')]: SceneTimeMachine,\n [componentRegistryKey(cratisComponentsPackageName, 'filterPanel')]: SceneFilterPanel,\n\n [componentRegistryKey(cratisComponentsPackageName, 'toolbar')]: SceneToolbar,\n [componentRegistryKey(cratisComponentsPackageName, 'toolbarButton')]: SceneToolbarButton,\n [componentRegistryKey(cratisComponentsPackageName, 'toolbarGroup')]: SceneToolbarGroup,\n [componentRegistryKey(cratisComponentsPackageName, 'toolbarSeparator')]: SceneToolbarSeparator,\n};\n"],"names":["cratisComponentsPackageName","cratisComponents","componentRegistryKey","ScenePage","SceneDataPage","SceneFormElement","SceneSingleResult","SceneDataTable","SceneObservableDataTable","SceneCommandForm","SceneInputTextField","SceneNumberField","SceneCheckboxField","SceneTextAreaField","SceneDropdownField","SceneSliderField","SceneCalendarField","SceneColorPickerField","SceneMultiSelectField","SceneChipsField","SceneRadioButtonField","SceneRadioGroupField","SceneDialog","SceneConfirmationDialog","SceneBusyIndicatorDialog","SceneCommandDialog","SceneStepperCommandDialog","SceneIcon","SceneTooltip","SceneDropdown","SceneErrorBoundary","SceneObjectContentEditor","SceneObjectNavigationalBar","SceneSchemaEditor","SceneTimeMachine","SceneFilterPanel","SceneToolbar","SceneToolbarButton","SceneToolbarGroup","SceneToolbarSeparator"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAyBA;;;IAIO,MAAMA,2BAAAA,GAA8B;AAE3C;;;;;;;;;;;;;UAcaC,gBAAAA,GAAsC;IAC/C,CAACC,gCAAAA,CAAqBF,2BAAAA,EAA6B,MAAA,CAAA,GAAUG,mBAAAA;IAC7D,CAACD,gCAAAA,CAAqBF,2BAAAA,EAA6B,UAAA,CAAA,GAAcI,2BAAAA;IACjE,CAACF,gCAAAA,CAAqBF,2BAAAA,EAA6B,aAAA,CAAA,GAAiBK,iCAAAA;IAEpE,CAACH,gCAAAA,CAAqBF,2BAAAA,EAA6B,cAAA,CAAA,GAAkBM,mCAAAA;IACrE,CAACJ,gCAAAA,CAAqBF,2BAAAA,EAA6B,WAAA,CAAA,GAAeO,6BAAAA;IAClE,CAACL,gCAAAA,CAAqBF,2BAAAA,EAA6B,OAAA,CAAA,GAAWO,6BAAAA;IAC9D,CAACL,gCAAAA,CAAqBF,2BAAAA,EAA6B,qBAAA,CAAA,GAAyBQ,iDAAAA;IAE5E,CAACN,gCAAAA,CAAqBF,2BAAAA,EAA6B,aAAA,CAAA,GAAiBS,iCAAAA;IACpE,CAACP,gCAAAA,CAAqBF,2BAAAA,EAA6B,gBAAA,CAAA,GAAoBU,uCAAAA;IACvE,CAACR,gCAAAA,CAAqBF,2BAAAA,EAA6B,aAAA,CAAA,GAAiBW,iCAAAA;IACpE,CAACT,gCAAAA,CAAqBF,2BAAAA,EAA6B,eAAA,CAAA,GAAmBY,qCAAAA;IACtE,CAACV,gCAAAA,CAAqBF,2BAAAA,EAA6B,eAAA,CAAA,GAAmBa,qCAAAA;IACtE,CAACX,gCAAAA,CAAqBF,2BAAAA,EAA6B,eAAA,CAAA,GAAmBc,qCAAAA;IACtE,CAACZ,gCAAAA,CAAqBF,2BAAAA,EAA6B,aAAA,CAAA,GAAiBe,iCAAAA;IACpE,CAACb,gCAAAA,CAAqBF,2BAAAA,EAA6B,eAAA,CAAA,GAAmBgB,qCAAAA;IACtE,CAACd,gCAAAA,CAAqBF,2BAAAA,EAA6B,kBAAA,CAAA,GAAsBiB,2CAAAA;IACzE,CAACf,gCAAAA,CAAqBF,2BAAAA,EAA6B,kBAAA,CAAA,GAAsBkB,2CAAAA;IACzE,CAAChB,gCAAAA,CAAqBF,2BAAAA,EAA6B,YAAA,CAAA,GAAgBmB,+BAAAA;IACnE,CAACjB,gCAAAA,CAAqBF,2BAAAA,EAA6B,kBAAA,CAAA,GAAsBoB,2CAAAA;IACzE,CAAClB,gCAAAA,CAAqBF,2BAAAA,EAA6B,iBAAA,CAAA,GAAqBqB,yCAAAA;IAExE,CAACnB,gCAAAA,CAAqBF,2BAAAA,EAA6B,QAAA,CAAA,GAAYsB,uBAAAA;IAC/D,CAACpB,gCAAAA,CAAqBF,2BAAAA,EAA6B,oBAAA,CAAA,GAAwBuB,+CAAAA;IAC3E,CAACrB,gCAAAA,CAAqBF,2BAAAA,EAA6B,qBAAA,CAAA,GAAyBwB,iDAAAA;IAC5E,CAACtB,gCAAAA,CAAqBF,2BAAAA,EAA6B,eAAA,CAAA,GAAmByB,qCAAAA;IACtE,CAACvB,gCAAAA,CAAqBF,2BAAAA,EAA6B,sBAAA,CAAA,GAA0B0B,mDAAAA;IAE7E,CAACxB,gCAAAA,CAAqBF,2BAAAA,EAA6B,MAAA,CAAA,GAAU2B,mBAAAA;IAC7D,CAACzB,gCAAAA,CAAqBF,2BAAAA,EAA6B,SAAA,CAAA,GAAa4B,yBAAAA;IAChE,CAAC1B,gCAAAA,CAAqBF,2BAAAA,EAA6B,UAAA,CAAA,GAAc6B,2BAAAA;IACjE,CAAC3B,gCAAAA,CAAqBF,2BAAAA,EAA6B,eAAA,CAAA,GAAmB8B,qCAAAA;IAEtE,CAAC5B,gCAAAA,CAAqBF,2BAAAA,EAA6B,qBAAA,CAAA,GAAyB+B,iDAAAA;IAC5E,CAAC7B,gCAAAA,CAAqBF,2BAAAA,EAA6B,uBAAA,CAAA,GAA2BgC,qDAAAA;IAC9E,CAAC9B,gCAAAA,CAAqBF,2BAAAA,EAA6B,cAAA,CAAA,GAAkBiC,mCAAAA;IACrE,CAAC/B,gCAAAA,CAAqBF,2BAAAA,EAA6B,aAAA,CAAA,GAAiBkC,iCAAAA;IACpE,CAAChC,gCAAAA,CAAqBF,2BAAAA,EAA6B,aAAA,CAAA,GAAiBmC,iCAAAA;IAEpE,CAACjC,gCAAAA,CAAqBF,2BAAAA,EAA6B,SAAA,CAAA,GAAaoC,yBAAAA;IAChE,CAAClC,gCAAAA,CAAqBF,2BAAAA,EAA6B,eAAA,CAAA,GAAmBqC,qCAAAA;IACtE,CAACnC,gCAAAA,CAAqBF,2BAAAA,EAA6B,cAAA,CAAA,GAAkBsC,mCAAAA;IACrE,CAACpC,gCAAAA,CAAqBF,2BAAAA,EAA6B,kBAAA,CAAA,GAAsBuC;AAC7E;;;"}
|
|
@@ -41,6 +41,7 @@ var cratisComponents = require('./cratisComponents.js');
|
|
|
41
41
|
'page',
|
|
42
42
|
'dataPage',
|
|
43
43
|
'formElement',
|
|
44
|
+
'singleResult',
|
|
44
45
|
'dataTable',
|
|
45
46
|
'table',
|
|
46
47
|
'observableDataTable',
|
|
@@ -90,7 +91,7 @@ var cratisComponents = require('./cratisComponents.js');
|
|
|
90
91
|
// Shipping a theme here would be this library asserting a look it was specifically built not to have.
|
|
91
92
|
themes: [],
|
|
92
93
|
displayName: 'Cratis Components',
|
|
93
|
-
description: "Cratis' Arc-bound data, form and dialog composites, built on PrimeReact and Tailwind. dataTable and table accept optional object-valued queryArguments for collection queries.",
|
|
94
|
+
description: "Cratis' Arc-bound data, form and dialog composites, built on PrimeReact and Tailwind. dataTable and table accept optional object-valued queryArguments for collection queries. singleResult displays one read-only scalar own resultField of an optional model using an explicit query, object queryArguments and enabled: true.",
|
|
94
95
|
module: '@cratis/scene.components',
|
|
95
96
|
license: 'MIT',
|
|
96
97
|
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cratisComponentsPackage.js","sources":["../../cratisComponentsPackage.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '@cratis/scene.react';\nimport { cratisComponents, cratisComponentsPackageName } from './cratisComponents';\n\n/**\n * The `Cratis.Components` package's declaration - what a profile gets when it lists this package.\n *\n * This is the concrete case the whole package-dependency mechanism exists for. `@cratis/components` is\n * not a self-contained library: every component in it is a wrapper over a PrimeReact widget, and its own\n * styling is a `--cratis-*` token layer (`@cratis/components/tokens`) plus the component stylesheets and\n * compiled Tailwind utilities in `@cratis/components/styles`. Activate it in a profile without PrimeReact\n * and nothing renders; activate it without Tailwind and everything renders unstyled. Both are stated as\n * dependencies so a package picker can say so while the profile is being configured, instead of leaving\n * it to be discovered when the page opens.\n *\n * The version ranges are the real ones the library carries. `>=11.0.0` for PrimeReact: version 3.0.0\n * declares `primereact@^11` as a peer dependency and is built against version 11's component set, so the\n * span across the major boundary that the previous `>=10.9.0` range described is over. The `--cratis-*`\n * tokens still resolve a version 10 theme variable as their last fallback, but that is an upgrade-window\n * courtesy for an application with a compiled version 10 stylesheet still on the page - not a version of\n * PrimeReact this package can be activated against. `^4.0.0` for Tailwind, because the utility sheet is\n * compiled against Tailwind 4.\n */\nexport const cratisComponentsPackageManifest: ScenePackage = {\n name: cratisComponentsPackageName,\n version: '3.0.0',\n kind: PackageKind.ComponentLibrary,\n dependencies: [\n { name: 'PrimeReact', versionRange: '>=11.0.0' },\n { name: 'Tailwind', versionRange: '^4.0.0' },\n ],\n components: [\n 'page',\n 'dataPage',\n 'formElement',\n 'dataTable',\n 'table',\n 'observableDataTable',\n 'commandForm',\n 'inputTextField',\n 'numberField',\n 'checkboxField',\n 'textAreaField',\n 'dropdownField',\n 'sliderField',\n 'calendarField',\n 'colorPickerField',\n 'multiSelectField',\n 'chipsField',\n 'radioButtonField',\n 'radioGroupField',\n 'dialog',\n 'confirmationDialog',\n 'busyIndicatorDialog',\n 'commandDialog',\n 'stepperCommandDialog',\n 'icon',\n 'tooltip',\n 'dropdown',\n 'errorBoundary',\n 'objectContentEditor',\n 'objectNavigationalBar',\n 'schemaEditor',\n 'timeMachine',\n 'filterPanel',\n 'toolbar',\n 'toolbarButton',\n 'toolbarGroup',\n 'toolbarSeparator',\n ],\n\n // A component library ships components, and nothing else. Layouts, screen templates and dialog\n // templates all belong to a Blueprint: they are decisions about what an application looks like as a\n // whole, and this package deliberately makes none of them - it provides the Arc-bound composites a\n // template is *built from*, so that a blueprint can place a `dataPage` in a slot and configure it,\n // rather than shipping one opinionated data page nobody can rearrange.\n layouts: [],\n screenTemplates: [],\n dialogTemplates: [],\n\n // No themes either, for a different reason: `@cratis/components` has no palette of its own. It reads\n // a `--cratis-*` variable layer that resolves whatever is in front of it - the `--p-*` properties a\n // PrimeReact 11 preset emits at runtime, or a Scene theme through this package's token bridge.\n // Shipping a theme here would be this library asserting a look it was specifically built not to have.\n themes: [],\n\n displayName: 'Cratis Components',\n description: \"Cratis' Arc-bound data, form and dialog composites, built on PrimeReact and Tailwind. dataTable and table accept optional object-valued queryArguments for collection queries.\",\n module: '@cratis/scene.components',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n\n/**\n * The `Cratis.Components` package as a loadable bundle - the manifest above, plus the React components\n * behind the names it declares.\n *\n * No `layouts`, `screenTemplates`, `dialogTemplates` or `themes` are provided, matching a manifest that\n * declares none of them; `validatePackageBundle` is what proves the two halves agree.\n */\nexport const cratisComponentsPackage: ScenePackageBundle = {\n manifest: cratisComponentsPackageManifest,\n components: cratisComponents,\n};\n"],"names":["cratisComponentsPackageManifest","name","cratisComponentsPackageName","version","kind","PackageKind","ComponentLibrary","dependencies","versionRange","components","layouts","screenTemplates","dialogTemplates","themes","displayName","description","module","license","licenseUrl","cratisComponentsPackage","manifest","cratisComponents"],"mappings":";;;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;;UAmBaA,+BAAAA,GAAgD;IACzDC,IAAAA,EAAMC,4CAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,gBAAgB;IAClCC,YAAAA,EAAc;AACV,QAAA;YAAEN,IAAAA,EAAM,YAAA;YAAcO,YAAAA,EAAc;AAAW,SAAA;AAC/C,QAAA;YAAEP,IAAAA,EAAM,UAAA;YAAYO,YAAAA,EAAc;AAAS;AAC9C,KAAA;IACDC,UAAAA,EAAY;AACR,QAAA,MAAA;AACA,QAAA,UAAA;AACA,QAAA,aAAA;AACA,QAAA,WAAA;AACA,QAAA,OAAA;AACA,QAAA,qBAAA;AACA,QAAA,aAAA;AACA,QAAA,gBAAA;AACA,QAAA,aAAA;AACA,QAAA,eAAA;AACA,QAAA,eAAA;AACA,QAAA,eAAA;AACA,QAAA,aAAA;AACA,QAAA,eAAA;AACA,QAAA,kBAAA;AACA,QAAA,kBAAA;AACA,QAAA,YAAA;AACA,QAAA,kBAAA;AACA,QAAA,iBAAA;AACA,QAAA,QAAA;AACA,QAAA,oBAAA;AACA,QAAA,qBAAA;AACA,QAAA,eAAA;AACA,QAAA,sBAAA;AACA,QAAA,MAAA;AACA,QAAA,SAAA;AACA,QAAA,UAAA;AACA,QAAA,eAAA;AACA,QAAA,qBAAA;AACA,QAAA,uBAAA;AACA,QAAA,cAAA;AACA,QAAA,aAAA;AACA,QAAA,aAAA;AACA,QAAA,SAAA;AACA,QAAA,eAAA;AACA,QAAA,cAAA;AACA,QAAA;AACH,KAAA;;;;;;AAODC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiB,EAAE;AACnBC,IAAAA,eAAAA,EAAiB,EAAE;;;;;AAMnBC,IAAAA,MAAAA,EAAQ,EAAE;IAEVC,WAAAA,EAAa,mBAAA;IACbC,WAAAA,EAAa,
|
|
1
|
+
{"version":3,"file":"cratisComponentsPackage.js","sources":["../../cratisComponentsPackage.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '@cratis/scene.react';\nimport { cratisComponents, cratisComponentsPackageName } from './cratisComponents';\n\n/**\n * The `Cratis.Components` package's declaration - what a profile gets when it lists this package.\n *\n * This is the concrete case the whole package-dependency mechanism exists for. `@cratis/components` is\n * not a self-contained library: every component in it is a wrapper over a PrimeReact widget, and its own\n * styling is a `--cratis-*` token layer (`@cratis/components/tokens`) plus the component stylesheets and\n * compiled Tailwind utilities in `@cratis/components/styles`. Activate it in a profile without PrimeReact\n * and nothing renders; activate it without Tailwind and everything renders unstyled. Both are stated as\n * dependencies so a package picker can say so while the profile is being configured, instead of leaving\n * it to be discovered when the page opens.\n *\n * The version ranges are the real ones the library carries. `>=11.0.0` for PrimeReact: version 3.0.0\n * declares `primereact@^11` as a peer dependency and is built against version 11's component set, so the\n * span across the major boundary that the previous `>=10.9.0` range described is over. The `--cratis-*`\n * tokens still resolve a version 10 theme variable as their last fallback, but that is an upgrade-window\n * courtesy for an application with a compiled version 10 stylesheet still on the page - not a version of\n * PrimeReact this package can be activated against. `^4.0.0` for Tailwind, because the utility sheet is\n * compiled against Tailwind 4.\n */\nexport const cratisComponentsPackageManifest: ScenePackage = {\n name: cratisComponentsPackageName,\n version: '3.0.0',\n kind: PackageKind.ComponentLibrary,\n dependencies: [\n { name: 'PrimeReact', versionRange: '>=11.0.0' },\n { name: 'Tailwind', versionRange: '^4.0.0' },\n ],\n components: [\n 'page',\n 'dataPage',\n 'formElement',\n 'singleResult',\n 'dataTable',\n 'table',\n 'observableDataTable',\n 'commandForm',\n 'inputTextField',\n 'numberField',\n 'checkboxField',\n 'textAreaField',\n 'dropdownField',\n 'sliderField',\n 'calendarField',\n 'colorPickerField',\n 'multiSelectField',\n 'chipsField',\n 'radioButtonField',\n 'radioGroupField',\n 'dialog',\n 'confirmationDialog',\n 'busyIndicatorDialog',\n 'commandDialog',\n 'stepperCommandDialog',\n 'icon',\n 'tooltip',\n 'dropdown',\n 'errorBoundary',\n 'objectContentEditor',\n 'objectNavigationalBar',\n 'schemaEditor',\n 'timeMachine',\n 'filterPanel',\n 'toolbar',\n 'toolbarButton',\n 'toolbarGroup',\n 'toolbarSeparator',\n ],\n\n // A component library ships components, and nothing else. Layouts, screen templates and dialog\n // templates all belong to a Blueprint: they are decisions about what an application looks like as a\n // whole, and this package deliberately makes none of them - it provides the Arc-bound composites a\n // template is *built from*, so that a blueprint can place a `dataPage` in a slot and configure it,\n // rather than shipping one opinionated data page nobody can rearrange.\n layouts: [],\n screenTemplates: [],\n dialogTemplates: [],\n\n // No themes either, for a different reason: `@cratis/components` has no palette of its own. It reads\n // a `--cratis-*` variable layer that resolves whatever is in front of it - the `--p-*` properties a\n // PrimeReact 11 preset emits at runtime, or a Scene theme through this package's token bridge.\n // Shipping a theme here would be this library asserting a look it was specifically built not to have.\n themes: [],\n\n displayName: 'Cratis Components',\n description: \"Cratis' Arc-bound data, form and dialog composites, built on PrimeReact and Tailwind. dataTable and table accept optional object-valued queryArguments for collection queries. singleResult displays one read-only scalar own resultField of an optional model using an explicit query, object queryArguments and enabled: true.\",\n module: '@cratis/scene.components',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n\n/**\n * The `Cratis.Components` package as a loadable bundle - the manifest above, plus the React components\n * behind the names it declares.\n *\n * No `layouts`, `screenTemplates`, `dialogTemplates` or `themes` are provided, matching a manifest that\n * declares none of them; `validatePackageBundle` is what proves the two halves agree.\n */\nexport const cratisComponentsPackage: ScenePackageBundle = {\n manifest: cratisComponentsPackageManifest,\n components: cratisComponents,\n};\n"],"names":["cratisComponentsPackageManifest","name","cratisComponentsPackageName","version","kind","PackageKind","ComponentLibrary","dependencies","versionRange","components","layouts","screenTemplates","dialogTemplates","themes","displayName","description","module","license","licenseUrl","cratisComponentsPackage","manifest","cratisComponents"],"mappings":";;;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;;UAmBaA,+BAAAA,GAAgD;IACzDC,IAAAA,EAAMC,4CAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,gBAAgB;IAClCC,YAAAA,EAAc;AACV,QAAA;YAAEN,IAAAA,EAAM,YAAA;YAAcO,YAAAA,EAAc;AAAW,SAAA;AAC/C,QAAA;YAAEP,IAAAA,EAAM,UAAA;YAAYO,YAAAA,EAAc;AAAS;AAC9C,KAAA;IACDC,UAAAA,EAAY;AACR,QAAA,MAAA;AACA,QAAA,UAAA;AACA,QAAA,aAAA;AACA,QAAA,cAAA;AACA,QAAA,WAAA;AACA,QAAA,OAAA;AACA,QAAA,qBAAA;AACA,QAAA,aAAA;AACA,QAAA,gBAAA;AACA,QAAA,aAAA;AACA,QAAA,eAAA;AACA,QAAA,eAAA;AACA,QAAA,eAAA;AACA,QAAA,aAAA;AACA,QAAA,eAAA;AACA,QAAA,kBAAA;AACA,QAAA,kBAAA;AACA,QAAA,YAAA;AACA,QAAA,kBAAA;AACA,QAAA,iBAAA;AACA,QAAA,QAAA;AACA,QAAA,oBAAA;AACA,QAAA,qBAAA;AACA,QAAA,eAAA;AACA,QAAA,sBAAA;AACA,QAAA,MAAA;AACA,QAAA,SAAA;AACA,QAAA,UAAA;AACA,QAAA,eAAA;AACA,QAAA,qBAAA;AACA,QAAA,uBAAA;AACA,QAAA,cAAA;AACA,QAAA,aAAA;AACA,QAAA,aAAA;AACA,QAAA,SAAA;AACA,QAAA,eAAA;AACA,QAAA,cAAA;AACA,QAAA;AACH,KAAA;;;;;;AAODC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiB,EAAE;AACnBC,IAAAA,eAAAA,EAAiB,EAAE;;;;;AAMnBC,IAAAA,MAAAA,EAAQ,EAAE;IAEVC,WAAAA,EAAa,mBAAA;IACbC,WAAAA,EAAa,kUAAA;IACbC,MAAAA,EAAQ,0BAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;;;;;UAOaC,uBAAAA,GAA8C;IACvDC,QAAAA,EAAUpB,+BAAAA;IACVS,UAAAA,EAAYY;AAChB;;;"}
|
|
@@ -10,7 +10,7 @@ var ArcRuntimeBoundary = require('../bindings/ArcRuntimeBoundary.js');
|
|
|
10
10
|
var properties = require('../properties.js');
|
|
11
11
|
|
|
12
12
|
const DataTableForQuery = /*#__PURE__*/ react.lazy(async ()=>({
|
|
13
|
-
default: (await
|
|
13
|
+
default: (await Promise.resolve().then(function () { return require('../bindings/ArcBoundComponents.js'); })).BoundDataTable
|
|
14
14
|
}));
|
|
15
15
|
/**
|
|
16
16
|
* The `Cratis.Components:dataTable` component, also registered as `table` - `DataTableForQuery` from
|