@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 @@
|
|
|
1
|
+
{"version":3,"file":"when_mounting_bound_adapters.d.ts","sourceRoot":"","sources":["../../../../bindings/for_requireArcProxy/when_mounting_bound_adapters.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { act, cleanup, render, screen } from '@testing-library/react';
|
|
3
|
+
import { expect, vi } from 'vitest';
|
|
4
|
+
import { externalComponent } from '../../given';
|
|
5
|
+
describe('when mounting bound adapters', () => {
|
|
6
|
+
const received = vi.fn();
|
|
7
|
+
let bindings;
|
|
8
|
+
let proxies;
|
|
9
|
+
let adapters;
|
|
10
|
+
let Boundary;
|
|
11
|
+
beforeEach(async () => {
|
|
12
|
+
vi.resetModules();
|
|
13
|
+
received.mockClear();
|
|
14
|
+
const component = (props) => { received(props); return _jsx("span", { children: "Mounted native adapter" }); };
|
|
15
|
+
vi.doMock('@cratis/components/DataTables', () => ({ DataTableForQuery: component, DataTableForObservableQuery: component }));
|
|
16
|
+
vi.doMock('@cratis/components/DataPage', () => ({ DataPage: component }));
|
|
17
|
+
vi.doMock('@cratis/components/CommandDialog', () => ({ CommandDialog: component, StepperCommandDialog: component }));
|
|
18
|
+
bindings = await import('../bindingRegistry');
|
|
19
|
+
bindings.clearBindings();
|
|
20
|
+
proxies = await import('./NativeProxies');
|
|
21
|
+
adapters = await import('../ArcBoundComponents');
|
|
22
|
+
({ ArcRuntimeBoundary: Boundary } = await import('../ArcRuntimeBoundary'));
|
|
23
|
+
vi.spyOn(console, 'error').mockImplementation(() => undefined);
|
|
24
|
+
});
|
|
25
|
+
afterEach(() => {
|
|
26
|
+
cleanup();
|
|
27
|
+
bindings.clearBindings();
|
|
28
|
+
vi.restoreAllMocks();
|
|
29
|
+
vi.doUnmock('@cratis/components/DataTables');
|
|
30
|
+
vi.doUnmock('@cratis/components/DataPage');
|
|
31
|
+
vi.doUnmock('@cratis/components/CommandDialog');
|
|
32
|
+
vi.resetModules();
|
|
33
|
+
});
|
|
34
|
+
it('should pass both supported page kinds and both command dialog constructors unchanged', () => {
|
|
35
|
+
const { BoundDataPage, BoundObservableDataTable, BoundCommandDialog, BoundStepperCommandDialog } = adapters;
|
|
36
|
+
render(_jsxs(_Fragment, { children: [_jsx(BoundDataPage, { query: proxies.Snapshot, title: '', emptyMessage: '', children: undefined }), _jsx(BoundDataPage, { query: proxies.Live, title: '', emptyMessage: '', children: undefined }), _jsx(BoundObservableDataTable, { query: proxies.Live, emptyMessage: '' }), _jsx(BoundCommandDialog, { command: proxies.Save, title: '', visible: true }), _jsx(BoundStepperCommandDialog, { command: proxies.Save, title: '', visible: true })] }));
|
|
37
|
+
expect(received.mock.calls.map(([props]) => props.query ?? props.command)).toEqual([proxies.Snapshot, proxies.Live, proxies.Live, proxies.Save, proxies.Save]);
|
|
38
|
+
});
|
|
39
|
+
it('should visibly reject a wrong-kind registered query without selecting another query', async () => {
|
|
40
|
+
bindings.registerQuery('wrong', proxies.Save);
|
|
41
|
+
bindings.registerQuery('valid', proxies.Snapshot);
|
|
42
|
+
const { SceneDataTable } = await import('../../data/SceneDataTable');
|
|
43
|
+
await act(async () => {
|
|
44
|
+
render(_jsx(SceneDataTable, { element: externalComponent('Cratis.Components:dataTable', { query: 'wrong' }), slots: {} }));
|
|
45
|
+
});
|
|
46
|
+
expect(screen.getByText("Invalid query binding 'Save': expected a zero-argument Arc query proxy")).toBeTruthy();
|
|
47
|
+
expect(received).not.toHaveBeenCalled();
|
|
48
|
+
});
|
|
49
|
+
it('should visibly reject snapshot bindings in observable tables and query bindings in dialogs', () => {
|
|
50
|
+
const { BoundObservableDataTable, BoundCommandDialog, BoundStepperCommandDialog, BoundDataPage } = adapters;
|
|
51
|
+
render(_jsxs(_Fragment, { children: [_jsx(Boundary, { children: _jsx(BoundObservableDataTable, { query: proxies.Snapshot, emptyMessage: '' }) }), _jsx(Boundary, { children: _jsx(BoundCommandDialog, { command: proxies.Snapshot, title: '', visible: true }) }), _jsx(Boundary, { children: _jsx(BoundStepperCommandDialog, { command: proxies.Live, title: '', visible: true }) }), _jsx(Boundary, { children: _jsx(BoundDataPage, { query: proxies.Save, title: '', emptyMessage: '', children: undefined }) })] }));
|
|
52
|
+
expect(screen.getAllByText('Error')).toHaveLength(4);
|
|
53
|
+
expect(received).not.toHaveBeenCalled();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=when_mounting_bound_adapters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when_mounting_bound_adapters.js","sourceRoot":"","sources":["../../../../bindings/for_requireArcProxy/when_mounting_bound_adapters.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO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GAAG,GAAW,EAC/F,KAAC,QAAQ,cAAC,KAAC,kBAAkB,IAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAC,EAAE,EAAC,OAAO,SAAG,GAAW,EACvF,KAAC,QAAQ,cAAC,KAAC,yBAAyB,IAAC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAC,EAAE,EAAC,OAAO,SAAG,GAAW,EAC1F,KAAC,QAAQ,cAAC,KAAC,aAAa,IAAC,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAC,EAAE,EAAC,YAAY,EAAC,EAAE,EAAC,QAAQ,EAAE,SAAS,GAAI,GAAW,IAAG,CAAC,CAAC;QAClH,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACrD,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAC5C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when_previewing_without_arc.d.ts","sourceRoot":"","sources":["../../../../bindings/for_requireArcProxy/when_previewing_without_arc.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { act, cleanup, render, screen } from '@testing-library/react';
|
|
3
|
+
import { expect, vi } from 'vitest';
|
|
4
|
+
import { externalComponent } from '../../given';
|
|
5
|
+
describe('when previewing bound adapters without Arc', () => {
|
|
6
|
+
const loaded = vi.fn();
|
|
7
|
+
afterEach(() => {
|
|
8
|
+
cleanup();
|
|
9
|
+
vi.doUnmock('../ArcBoundComponents');
|
|
10
|
+
vi.resetModules();
|
|
11
|
+
});
|
|
12
|
+
it('should show missing bindings without importing the Arc runtime module', async () => {
|
|
13
|
+
vi.resetModules();
|
|
14
|
+
vi.doMock('../ArcBoundComponents', () => {
|
|
15
|
+
loaded();
|
|
16
|
+
throw new Error('Arc is unavailable in preview');
|
|
17
|
+
});
|
|
18
|
+
const { clearBindings } = await import('../bindingRegistry');
|
|
19
|
+
clearBindings();
|
|
20
|
+
const { SceneDataTable } = await import('../../data/SceneDataTable');
|
|
21
|
+
const { SceneObservableDataTable } = await import('../../data/SceneObservableDataTable');
|
|
22
|
+
const { SceneDataPage } = await import('../../pages/SceneDataPage');
|
|
23
|
+
const { SceneCommandDialog } = await import('../../dialogs/SceneCommandDialog');
|
|
24
|
+
const { SceneStepperCommandDialog } = await import('../../dialogs/SceneStepperCommandDialog');
|
|
25
|
+
await act(async () => {
|
|
26
|
+
render(_jsx(_Fragment, { children: [SceneDataTable, SceneObservableDataTable, SceneDataPage, SceneCommandDialog, SceneStepperCommandDialog].map((Adapter, index) => _jsx(Adapter, { element: externalComponent('Cratis.Components:preview', { query: 'missing', command: 'missing' }), slots: {} }, index)) }));
|
|
27
|
+
});
|
|
28
|
+
expect(screen.getAllByText(/Unresolved .* binding 'missing'/)).toHaveLength(5);
|
|
29
|
+
expect(loaded).not.toHaveBeenCalled();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=when_previewing_without_arc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when_previewing_without_arc.js","sourceRoot":"","sources":["../../../../bindings/for_requireArcProxy/when_previewing_without_arc.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,QAAQ,CAAC,4CAA4C,EAAE,GAAG,EAAE;IACxD,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;I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nH,KAAK,CAAkH,CAAC,GAAI,CAAC,CAAC;QACpJ,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,iCAAiC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/E,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAC1C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when_validating_a_proxy.d.ts","sourceRoot":"","sources":["../../../../bindings/for_requireArcProxy/when_validating_a_proxy.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { expect } from 'vitest';
|
|
2
|
+
import { QueryFor, ObservableQueryFor } from '@cratis/arc/queries';
|
|
3
|
+
import { Command } from '@cratis/arc/commands';
|
|
4
|
+
import { requireArcProxy } from '../requireArcProxy';
|
|
5
|
+
import { registerQuery, resolveQuery, clearBindings } from '../bindingRegistry';
|
|
6
|
+
import { Snapshot, Live, Save } from './NativeProxies';
|
|
7
|
+
describe('when validating a proxy at the lazy Arc boundary', () => {
|
|
8
|
+
afterEach(clearBindings);
|
|
9
|
+
it('should preserve native constructors without constructing them and satisfy public component props', () => {
|
|
10
|
+
const query = requireArcProxy(Snapshot, QueryFor, 'query');
|
|
11
|
+
const observable = requireArcProxy(Live, ObservableQueryFor, 'observable query');
|
|
12
|
+
const command = requireArcProxy(Save, Command, 'command');
|
|
13
|
+
expect(query).toBe(Snapshot);
|
|
14
|
+
expect(observable).toBe(Live);
|
|
15
|
+
expect(command).toBe(Save);
|
|
16
|
+
});
|
|
17
|
+
it('should reject wrong kinds rather than perform an observable query as a snapshot', () => {
|
|
18
|
+
expect(() => requireArcProxy(Live, QueryFor, 'query')).toThrow('Invalid query binding');
|
|
19
|
+
expect(() => requireArcProxy(Snapshot, ObservableQueryFor, 'observable query')).toThrow('Invalid observable query binding');
|
|
20
|
+
expect(() => requireArcProxy(Snapshot, Command, 'command')).toThrow('Invalid command binding');
|
|
21
|
+
expect(() => requireArcProxy(Save, QueryFor, 'query')).toThrow('Invalid query binding');
|
|
22
|
+
});
|
|
23
|
+
it('should preserve arbitrary constructor registration but reject it at an Arc adapter', () => {
|
|
24
|
+
class Arbitrary {
|
|
25
|
+
input;
|
|
26
|
+
constructor(input) {
|
|
27
|
+
this.input = input;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
registerQuery('arbitrary', Arbitrary);
|
|
31
|
+
expect(resolveQuery('arbitrary')).toBe(Arbitrary);
|
|
32
|
+
expect(() => requireArcProxy(Arbitrary, QueryFor, 'query')).toThrow('Invalid query binding');
|
|
33
|
+
});
|
|
34
|
+
it('should reject a native subclass requiring constructor arguments without invoking it', () => {
|
|
35
|
+
class NeedsArguments extends Snapshot {
|
|
36
|
+
input;
|
|
37
|
+
constructor(input) {
|
|
38
|
+
super();
|
|
39
|
+
this.input = input;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
expect(() => requireArcProxy(NeedsArguments, QueryFor, 'query')).toThrow('zero-argument Arc');
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=when_validating_a_proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when_validating_a_proxy.js","sourceRoot":"","sources":["../../../../bindings/for_requireArcProxy/when_validating_a_proxy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAI/C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,QAAQ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IAC5G,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oFAAoF,EAAE,GAAG,EAAE;QAC1F,MAAM,SAAS;YAAwB,KAAK;YAA1B,YAAqB,KAAa;6BAAb,KAAK;YAAW,CAAC;SAAE;QAC1D,aAAa,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QACtC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClD,MAAM,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,SAAS,EAAE,QAAwB,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACjH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qFAAqF,EAAE,GAAG,EAAE;QAC3F,MAAM,cAAe,SAAQ,QAAQ;YAAwB,KAAK;YAA1B,YAAqB,KAAa;gBAAI,KAAK,EAAE,CAAC;6BAAzB,KAAK;YAAqB,CAAC;SAAE;QAC1F,MAAM,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,cAAc,EAAE,QAAwB,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requireArcProxy.d.ts","sourceRoot":"","sources":["../../../bindings/requireArcProxy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAc3D,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE;IAAE,SAAS,EAAE,CAAC,CAAA;CAAE,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,CAM7H"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
* Bridge for the generated, zero-argument Arc proxies consumed by Components. The registry remains
|
|
5
|
+
* open to arbitrary constructors; only mounting an Arc adapter requires this narrower contract.
|
|
6
|
+
* Check inheritance without constructing a proxy (constructors can have side effects).
|
|
7
|
+
*
|
|
8
|
+
* This is not structural interface validation: the host still owns the generated subclass's data,
|
|
9
|
+
* argument and implementation correctness. Prototype identity deliberately rejects duck-typed proxies
|
|
10
|
+
* and proxies from a second Arc installation. The arity check enforces the generated convention,
|
|
11
|
+
* not general JavaScript constructor safety (defaults/rest parameters can hide requirements).
|
|
12
|
+
* The single assertion bridges the registry under that host-owned generated-proxy contract; it is
|
|
13
|
+
* not a proof of arbitrary subclass behavior or of erased row/argument types.
|
|
14
|
+
*/ function requireArcProxy(target, base, kind) {
|
|
15
|
+
const prototype = target.prototype;
|
|
16
|
+
if (target.length !== 0 || typeof prototype !== 'object' || prototype === null || !Object.prototype.isPrototypeOf.call(base.prototype, prototype)) {
|
|
17
|
+
throw new Error(`Invalid ${kind} binding '${target.name}': expected a zero-argument Arc ${kind} proxy`);
|
|
18
|
+
}
|
|
19
|
+
return target;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { requireArcProxy };
|
|
23
|
+
//# 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;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cratisComponents.d.ts","sourceRoot":"","sources":["../../cratisComponents.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAwB,MAAM,qBAAqB,CAAC;AA2B9E,eAAO,MAAM,2BAA2B,sBAAsB,CAAC;AAgB/D,eAAO,MAAM,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"cratisComponents.d.ts","sourceRoot":"","sources":["../../cratisComponents.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAwB,MAAM,qBAAqB,CAAC;AA2B9E,eAAO,MAAM,2BAA2B,sBAAsB,CAAC;AAgB/D,eAAO,MAAM,gBAAgB,EAAE,iBA6C9B,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { componentRegistryKey } from '@cratis/scene.react';
|
|
|
2
2
|
import { ScenePage } from './pages/ScenePage.js';
|
|
3
3
|
import { SceneDataPage } from './pages/SceneDataPage.js';
|
|
4
4
|
import { SceneFormElement } from './pages/SceneFormElement.js';
|
|
5
|
+
import { SceneSingleResult } from './data/SceneSingleResult.js';
|
|
5
6
|
import { SceneDataTable } from './data/SceneDataTable.js';
|
|
6
7
|
import { SceneObservableDataTable } from './data/SceneObservableDataTable.js';
|
|
7
8
|
import { SceneCommandForm } from './forms/SceneCommandForm.js';
|
|
@@ -63,6 +64,7 @@ import { SceneToolbarSeparator } from './toolbar/SceneToolbarSeparator.js';
|
|
|
63
64
|
[componentRegistryKey(cratisComponentsPackageName, 'page')]: ScenePage,
|
|
64
65
|
[componentRegistryKey(cratisComponentsPackageName, 'dataPage')]: SceneDataPage,
|
|
65
66
|
[componentRegistryKey(cratisComponentsPackageName, 'formElement')]: SceneFormElement,
|
|
67
|
+
[componentRegistryKey(cratisComponentsPackageName, 'singleResult')]: SceneSingleResult,
|
|
66
68
|
[componentRegistryKey(cratisComponentsPackageName, 'dataTable')]: SceneDataTable,
|
|
67
69
|
[componentRegistryKey(cratisComponentsPackageName, 'table')]: SceneDataTable,
|
|
68
70
|
[componentRegistryKey(cratisComponentsPackageName, 'observableDataTable')]: 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,GA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C/B,oBAAAA,CAAqBF,2BAAAA,EAA6B,aAAA,CAAA,GAAiBkC,gBAAAA;IACpE,CAAChC,oBAAAA,CAAqBF,2BAAAA,EAA6B,aAAA,CAAA,GAAiBmC,gBAAAA;IAEpE,CAACjC,oBAAAA,CAAqBF,2BAAAA,EAA6B,SAAA,CAAA,GAAaoC,YAAAA;IAChE,CAAClC,oBAAAA,CAAqBF,2BAAAA,EAA6B,eAAA,CAAA,GAAmBqC,kBAAAA;IACtE,CAACnC,oBAAAA,CAAqBF,2BAAAA,EAA6B,cAAA,CAAA,GAAkBsC,iBAAAA;IACrE,CAACpC,oBAAAA,CAAqBF,2BAAAA,EAA6B,kBAAA,CAAA,GAAsBuC;AAC7E;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cratisComponentsPackage.d.ts","sourceRoot":"","sources":["../../cratisComponentsPackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAsBzD,eAAO,MAAM,+BAA+B,EAAE,
|
|
1
|
+
{"version":3,"file":"cratisComponentsPackage.d.ts","sourceRoot":"","sources":["../../cratisComponentsPackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAsBzD,eAAO,MAAM,+BAA+B,EAAE,YAqE7C,CAAC;AASF,eAAO,MAAM,uBAAuB,EAAE,kBAGrC,CAAC"}
|
|
@@ -39,6 +39,7 @@ import { cratisComponents, cratisComponentsPackageName } from './cratisComponent
|
|
|
39
39
|
'page',
|
|
40
40
|
'dataPage',
|
|
41
41
|
'formElement',
|
|
42
|
+
'singleResult',
|
|
42
43
|
'dataTable',
|
|
43
44
|
'table',
|
|
44
45
|
'observableDataTable',
|
|
@@ -88,7 +89,7 @@ import { cratisComponents, cratisComponentsPackageName } from './cratisComponent
|
|
|
88
89
|
// Shipping a theme here would be this library asserting a look it was specifically built not to have.
|
|
89
90
|
themes: [],
|
|
90
91
|
displayName: 'Cratis Components',
|
|
91
|
-
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.",
|
|
92
|
+
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.",
|
|
92
93
|
module: '@cratis/scene.components',
|
|
93
94
|
license: 'MIT',
|
|
94
95
|
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,2BAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,YAAYC,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,2BAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,YAAYC,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;;"}
|
|
@@ -8,7 +8,7 @@ import { ArcRuntimeBoundary } from '../bindings/ArcRuntimeBoundary.js';
|
|
|
8
8
|
import { objectProperty, stringProperty, stringArrayProperty } from '../properties.js';
|
|
9
9
|
|
|
10
10
|
const DataTableForQuery = /*#__PURE__*/ lazy(async ()=>({
|
|
11
|
-
default: (await import('
|
|
11
|
+
default: (await import('../bindings/ArcBoundComponents.js')).BoundDataTable
|
|
12
12
|
}));
|
|
13
13
|
/**
|
|
14
14
|
* The `Cratis.Components:dataTable` component, also registered as `table` - `DataTableForQuery` from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneDataTable.js","sources":["../../../data/SceneDataTable.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\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport { objectProperty, stringArrayProperty, stringProperty } from '../properties';\nimport { Placeholder } from '../bindings/Placeholder';\n\nconst DataTableForQuery = lazy(async () => ({ default: (await import('
|
|
1
|
+
{"version":3,"file":"SceneDataTable.js","sources":["../../../data/SceneDataTable.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\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport { objectProperty, stringArrayProperty, stringProperty } from '../properties';\nimport { Placeholder } from '../bindings/Placeholder';\n\nconst DataTableForQuery = lazy(async () => ({ default: (await import('../bindings/ArcBoundComponents')).BoundDataTable }));\n\n/**\n * The `Cratis.Components:dataTable` component, also registered as `table` - `DataTableForQuery` from\n * `@cratis/components/DataTables`.\n *\n * Registering it under the bare name `table` as well is override priority working as designed: a profile\n * listing `core`, `PrimeReact` and `Cratis.Components` in that order resolves `table` here and records\n * the other two as shadowed. That is the right outcome, because this is a strictly better `table` for a\n * Cratis application - it performs the query, pages against the server, and wires filtering and sorting\n * back into it, where PrimeReact's `DataTable` is handed rows and knows nothing about where they came from.\n *\n * The `query` property names an Arc query proxy; the columns come from the `content` slot.\n * Optional `queryArguments` is an explicit object forwarded unchanged to that proxy. Invalid values\n * render a placeholder rather than accidentally executing a query without its arguments. This remains\n * a collection table; forwarding arguments does not make optional single-result queries compatible.\n *\n * There is deliberately no `clientFiltering` property. `@cratis/components` 3.0.0 still accepts the prop\n * so existing call sites compile, but it no longer does anything - filtering is always applied to the\n * loaded page. Exposing a screen property that reads as a choice and silently is not would be worse than\n * not offering it, so a screen that set it now gets a property-not-recognized signal rather than a\n * setting that quietly stopped mattering.\n */\nexport function SceneDataTable({ element, slots }: RegisteredComponentProps) {\n const { name, target } = resolveElementBinding(element, BindingKind.Query);\n if (!target) return <MissingBinding element={element} kind={BindingKind.Query} name={name} />;\n\n const queryArguments = objectProperty(element.properties, 'queryArguments');\n if (element.properties.queryArguments !== undefined && queryArguments === undefined) {\n return <Placeholder element={element} problem='Invalid queryArguments: expected an object' />;\n }\n\n return (\n <ArcRuntimeBoundary>\n <DataTableForQuery\n query={target}\n {...(queryArguments === undefined ? {} : { queryArguments })}\n emptyMessage={stringProperty(element.properties, 'emptyMessage') ?? ''}\n dataKey={stringProperty(element.properties, 'dataKey')}\n globalFilterFields={stringArrayProperty(element.properties, 'globalFilterFields')}\n className={stringProperty(element.properties, 'className')}\n >\n {slots.content}\n </DataTableForQuery>\n </ArcRuntimeBoundary>\n );\n}\n"],"names":["DataTableForQuery","lazy","default","BoundDataTable","SceneDataTable","element","slots","name","target","resolveElementBinding","BindingKind","Query","_jsx","MissingBinding","kind","queryArguments","objectProperty","properties","undefined","Placeholder","problem","ArcRuntimeBoundary","query","emptyMessage","stringProperty","dataKey","globalFilterFields","stringArrayProperty","className","content"],"mappings":";;;;;;;;;AASA,MAAMA,iBAAAA,iBAAoBC,IAAAA,CAAK,WAAa;AAAEC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OAAO,mCAAA,CAAgC,EAAGC;KAAe,CAAA,CAAA;AAEvH;;;;;;;;;;;;;;;;;;;;AAoBC,IACM,SAASC,cAAAA,CAAe,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACvE,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGC,qBAAAA,CAAsBJ,OAAAA,EAASK,WAAAA,CAAYC,KAAK,CAAA;IACzE,IAAI,CAACH,MAAAA,EAAQ,qBAAOI,GAAA,CAACC,cAAAA,EAAAA;QAAeR,OAAAA,EAASA,OAAAA;AAASS,QAAAA,IAAAA,EAAMJ,YAAYC,KAAK;QAAEJ,IAAAA,EAAMA;;AAErF,IAAA,MAAMQ,cAAAA,GAAiBC,cAAAA,CAAeX,OAAAA,CAAQY,UAAU,EAAE,gBAAA,CAAA;AAC1D,IAAA,IAAIZ,QAAQY,UAAU,CAACF,cAAc,KAAKG,SAAAA,IAAaH,mBAAmBG,SAAAA,EAAW;AACjF,QAAA,qBAAON,GAAA,CAACO,WAAAA,EAAAA;YAAYd,OAAAA,EAASA,OAAAA;YAASe,OAAAA,EAAQ;;AAClD,IAAA;AAEA,IAAA,qBACIR,GAAA,CAACS,kBAAAA,EAAAA;AACG,QAAA,QAAA,gBAAAT,GAAA,CAACZ,iBAAAA,EAAAA;YACGsB,KAAAA,EAAOd,MAAAA;YACN,GAAIO,cAAAA,KAAmBG,SAAAA,GAAY,EAAC,GAAI;AAAEH,gBAAAA;aAAgB;AAC3DQ,YAAAA,YAAAA,EAAcC,cAAAA,CAAenB,OAAAA,CAAQY,UAAU,EAAE,cAAA,CAAA,IAAmB,EAAA;YACpEQ,OAAAA,EAASD,cAAAA,CAAenB,OAAAA,CAAQY,UAAU,EAAE,SAAA,CAAA;YAC5CS,kBAAAA,EAAoBC,mBAAAA,CAAoBtB,OAAAA,CAAQY,UAAU,EAAE,oBAAA,CAAA;YAC5DW,SAAAA,EAAWJ,cAAAA,CAAenB,OAAAA,CAAQY,UAAU,EAAE,WAAA,CAAA;AAE7CX,YAAAA,QAAAA,EAAAA,KAAAA,CAAMuB;;;AAIvB;;"}
|
|
@@ -7,7 +7,7 @@ import { ArcRuntimeBoundary } from '../bindings/ArcRuntimeBoundary.js';
|
|
|
7
7
|
import { stringProperty, stringArrayProperty } from '../properties.js';
|
|
8
8
|
|
|
9
9
|
const DataTableForObservableQuery = /*#__PURE__*/ lazy(async ()=>({
|
|
10
|
-
default: (await import('
|
|
10
|
+
default: (await import('../bindings/ArcBoundComponents.js')).BoundObservableDataTable
|
|
11
11
|
}));
|
|
12
12
|
/**
|
|
13
13
|
* The `Cratis.Components:observableDataTable` component - `DataTableForObservableQuery` from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneObservableDataTable.js","sources":["../../../data/SceneObservableDataTable.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\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport { stringArrayProperty, stringProperty } from '../properties';\n\nconst DataTableForObservableQuery = lazy(async () => ({\n default: (await import('
|
|
1
|
+
{"version":3,"file":"SceneObservableDataTable.js","sources":["../../../data/SceneObservableDataTable.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\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport { stringArrayProperty, stringProperty } from '../properties';\n\nconst DataTableForObservableQuery = lazy(async () => ({\n default: (await import('../bindings/ArcBoundComponents')).BoundObservableDataTable,\n}));\n\n/**\n * The `Cratis.Components:observableDataTable` component - `DataTableForObservableQuery` from\n * `@cratis/components/DataTables`.\n *\n * A separate name rather than a flag on `dataTable`, because the distinction is in the *proxy* a host\n * registers, not in how the table is configured: an observable query opens a WebSocket subscription and\n * re-renders when the server's read model changes, and a plain query does not. A screen that names an\n * observable query here is stating that its data is live, which is a design decision worth being able to\n * read off the screen.\n *\n * As with `dataTable`, no `clientFiltering` property is exposed: `@cratis/components` 3.0.0 keeps the\n * prop for source compatibility but ignores it, and a screen property that cannot change anything is\n * worse than an absent one.\n */\nexport function SceneObservableDataTable({ element, slots }: RegisteredComponentProps) {\n const { name, target } = resolveElementBinding(element, BindingKind.Query);\n if (!target) return <MissingBinding element={element} kind={BindingKind.Query} name={name} />;\n\n return (\n <ArcRuntimeBoundary>\n <DataTableForObservableQuery\n query={target}\n emptyMessage={stringProperty(element.properties, 'emptyMessage') ?? ''}\n dataKey={stringProperty(element.properties, 'dataKey')}\n globalFilterFields={stringArrayProperty(element.properties, 'globalFilterFields')}\n className={stringProperty(element.properties, 'className')}\n >\n {slots.content}\n </DataTableForObservableQuery>\n </ArcRuntimeBoundary>\n );\n}\n"],"names":["DataTableForObservableQuery","lazy","default","BoundObservableDataTable","SceneObservableDataTable","element","slots","name","target","resolveElementBinding","BindingKind","Query","_jsx","MissingBinding","kind","ArcRuntimeBoundary","query","emptyMessage","stringProperty","properties","dataKey","globalFilterFields","stringArrayProperty","className","content"],"mappings":";;;;;;;;AAQA,MAAMA,2BAAAA,iBAA8BC,IAAAA,CAAK,WAAa;AAClDC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OAAO,mCAAA,CAAgC,EAAGC;KAC9D,CAAA,CAAA;AAEA;;;;;;;;;;;;;AAaC,IACM,SAASC,wBAAAA,CAAyB,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACjF,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGC,qBAAAA,CAAsBJ,OAAAA,EAASK,WAAAA,CAAYC,KAAK,CAAA;IACzE,IAAI,CAACH,MAAAA,EAAQ,qBAAOI,GAAA,CAACC,cAAAA,EAAAA;QAAeR,OAAAA,EAASA,OAAAA;AAASS,QAAAA,IAAAA,EAAMJ,YAAYC,KAAK;QAAEJ,IAAAA,EAAMA;;AAErF,IAAA,qBACIK,GAAA,CAACG,kBAAAA,EAAAA;AACG,QAAA,QAAA,gBAAAH,GAAA,CAACZ,2BAAAA,EAAAA;YACGgB,KAAAA,EAAOR,MAAAA;AACPS,YAAAA,YAAAA,EAAcC,cAAAA,CAAeb,OAAAA,CAAQc,UAAU,EAAE,cAAA,CAAA,IAAmB,EAAA;YACpEC,OAAAA,EAASF,cAAAA,CAAeb,OAAAA,CAAQc,UAAU,EAAE,SAAA,CAAA;YAC5CE,kBAAAA,EAAoBC,mBAAAA,CAAoBjB,OAAAA,CAAQc,UAAU,EAAE,oBAAA,CAAA;YAC5DI,SAAAA,EAAWL,cAAAA,CAAeb,OAAAA,CAAQc,UAAU,EAAE,WAAA,CAAA;AAE7Cb,YAAAA,QAAAA,EAAAA,KAAAA,CAAMkB;;;AAIvB;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneSingleResult.d.ts","sourceRoot":"","sources":["../../../data/SceneSingleResult.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAQ/D,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,wBAAwB,+BAgBtE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { lazy } from 'react';
|
|
3
|
+
import { BindingKind } from '../bindings/BindingKind.js';
|
|
4
|
+
import { resolveElementBinding } from '../bindings/resolveElementBinding.js';
|
|
5
|
+
import { MissingBinding } from '../bindings/MissingBinding.js';
|
|
6
|
+
import { ArcRuntimeBoundary } from '../bindings/ArcRuntimeBoundary.js';
|
|
7
|
+
import { booleanProperty, objectProperty, stringProperty } from '../properties.js';
|
|
8
|
+
import { SingleResultStatus } from './SingleResultStatus.js';
|
|
9
|
+
|
|
10
|
+
const SingleResultRuntime = /*#__PURE__*/ lazy(()=>import('./SingleResultRuntime.js'));
|
|
11
|
+
/** Read-only scalar field of an optional single model; the host owns and commits the input. */ function SceneSingleResult({ element }) {
|
|
12
|
+
const { name, target } = resolveElementBinding(element, BindingKind.Query);
|
|
13
|
+
if (!target) return /*#__PURE__*/ jsx(MissingBinding, {
|
|
14
|
+
element: element,
|
|
15
|
+
kind: BindingKind.Query,
|
|
16
|
+
name: name
|
|
17
|
+
});
|
|
18
|
+
// Nothing, including loading Arc, happens until the host explicitly commits its input.
|
|
19
|
+
if (!element.isEnabled || booleanProperty(element.properties, 'enabled') !== true) {
|
|
20
|
+
return /*#__PURE__*/ jsx(SingleResultStatus, {
|
|
21
|
+
state: "idle"
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const queryArguments = objectProperty(element.properties, 'queryArguments');
|
|
25
|
+
const resultField = stringProperty(element.properties, 'resultField');
|
|
26
|
+
if (!queryArguments || !resultField) return /*#__PURE__*/ jsx(SingleResultStatus, {
|
|
27
|
+
state: "failure"
|
|
28
|
+
});
|
|
29
|
+
return /*#__PURE__*/ jsx(ArcRuntimeBoundary, {
|
|
30
|
+
children: /*#__PURE__*/ jsx(SingleResultRuntime, {
|
|
31
|
+
query: target,
|
|
32
|
+
queryArguments: queryArguments,
|
|
33
|
+
resultField: resultField
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { SceneSingleResult };
|
|
39
|
+
//# sourceMappingURL=SceneSingleResult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneSingleResult.js","sources":["../../../data/SceneSingleResult.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\nimport { lazy } from 'react';\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { ArcRuntimeBoundary, BindingKind, MissingBinding, resolveElementBinding } from '../bindings';\nimport { booleanProperty, objectProperty, stringProperty } from '../properties';\nimport { SingleResultStatus } from './SingleResultStatus';\n\nconst SingleResultRuntime = lazy(() => import('./SingleResultRuntime'));\n\n/** Read-only scalar field of an optional single model; the host owns and commits the input. */\nexport function SceneSingleResult({ element }: RegisteredComponentProps) {\n const { name, target } = resolveElementBinding(element, BindingKind.Query);\n if (!target) return <MissingBinding element={element} kind={BindingKind.Query} name={name} />;\n\n // Nothing, including loading Arc, happens until the host explicitly commits its input.\n if (!element.isEnabled || booleanProperty(element.properties, 'enabled') !== true) {\n return <SingleResultStatus state='idle' />;\n }\n\n const queryArguments = objectProperty(element.properties, 'queryArguments');\n const resultField = stringProperty(element.properties, 'resultField');\n if (!queryArguments || !resultField) return <SingleResultStatus state='failure' />;\n\n return <ArcRuntimeBoundary>\n <SingleResultRuntime query={target} queryArguments={queryArguments} resultField={resultField} />\n </ArcRuntimeBoundary>;\n}\n"],"names":["SingleResultRuntime","lazy","SceneSingleResult","element","name","target","resolveElementBinding","BindingKind","Query","_jsx","MissingBinding","kind","isEnabled","booleanProperty","properties","SingleResultStatus","state","queryArguments","objectProperty","resultField","stringProperty","ArcRuntimeBoundary","query"],"mappings":";;;;;;;;;AASA,MAAMA,mBAAAA,iBAAsBC,IAAAA,CAAK,IAAM,OAAO,0BAAA,CAAA,CAAA;AAE9C,gGACO,SAASC,iBAAAA,CAAkB,EAAEC,OAAO,EAA4B,EAAA;IACnE,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGC,qBAAAA,CAAsBH,OAAAA,EAASI,WAAAA,CAAYC,KAAK,CAAA;IACzE,IAAI,CAACH,MAAAA,EAAQ,qBAAOI,GAAA,CAACC,cAAAA,EAAAA;QAAeP,OAAAA,EAASA,OAAAA;AAASQ,QAAAA,IAAAA,EAAMJ,YAAYC,KAAK;QAAEJ,IAAAA,EAAMA;;;IAGrF,IAAI,CAACD,QAAQS,SAAS,IAAIC,gBAAgBV,OAAAA,CAAQW,UAAU,EAAE,SAAA,CAAA,KAAe,IAAA,EAAM;AAC/E,QAAA,qBAAOL,GAAA,CAACM,kBAAAA,EAAAA;YAAmBC,KAAAA,EAAM;;AACrC,IAAA;AAEA,IAAA,MAAMC,cAAAA,GAAiBC,cAAAA,CAAef,OAAAA,CAAQW,UAAU,EAAE,gBAAA,CAAA;AAC1D,IAAA,MAAMK,WAAAA,GAAcC,cAAAA,CAAejB,OAAAA,CAAQW,UAAU,EAAE,aAAA,CAAA;AACvD,IAAA,IAAI,CAACG,cAAAA,IAAkB,CAACE,WAAAA,EAAa,qBAAOV,GAAA,CAACM,kBAAAA,EAAAA;QAAmBC,KAAAA,EAAM;;AAEtE,IAAA,qBAAOP,GAAA,CAACY,kBAAAA,EAAAA;AACJ,QAAA,QAAA,gBAAAZ,GAAA,CAACT,mBAAAA,EAAAA;YAAoBsB,KAAAA,EAAOjB,MAAAA;YAAQY,cAAAA,EAAgBA,cAAAA;YAAgBE,WAAAA,EAAaA;;;AAEzF;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BoundConstructor } from '../bindings/BoundConstructor';
|
|
2
|
+
interface Props {
|
|
3
|
+
query: BoundConstructor;
|
|
4
|
+
queryArguments: Record<string, unknown>;
|
|
5
|
+
resultField: string;
|
|
6
|
+
}
|
|
7
|
+
export default function SingleResultRuntime({ query, queryArguments, resultField }: Props): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=SingleResultRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SingleResultRuntime.d.ts","sourceRoot":"","sources":["../../../data/SingleResultRuntime.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,UAAU,KAAK;IACX,KAAK,EAAE,gBAAgB,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,WAAW,EAAE,MAAM,CAAC;CACvB;AAQD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,EAAE,KAAK,+BAmExF"}
|