@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneCommandDialog.js","sources":["../../../dialogs/SceneCommandDialog.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, stringProperty } from '../properties';\n\nconst CommandDialog = lazy(async () => ({ default: (await import('
|
|
1
|
+
{"version":3,"file":"SceneCommandDialog.js","sources":["../../../dialogs/SceneCommandDialog.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, stringProperty } from '../properties';\n\nconst CommandDialog = lazy(async () => ({ default: (await import('../bindings/ArcBoundComponents')).BoundCommandDialog }));\n\n/**\n * The `Cratis.Components:commandDialog` component - `CommandDialog` from `@cratis/components/CommandDialog`.\n *\n * A dialog whose confirm button *is* the command's execution: it binds the form to the command, submits\n * on confirm, feeds the backend's validation results back onto the fields, and only closes when the\n * command succeeded. That last part is the reason to use it rather than composing `dialog` with\n * `commandForm` - a hand-composed pair has no way to keep the dialog open on a rejected command without\n * reimplementing the protocol.\n *\n * The `command` property names an Arc command proxy; the fields go in the `content` slot.\n *\n * `dismissable` and `closeAriaLabel` are here rather than on `dialog` alone because `CommandDialog`\n * forwards both to the dialog it wraps, and in `@cratis/components` 3.0.0 that forwarding actually\n * happens - 2.x accepted the two props and dropped them on the floor. `dismissable` matters more on a\n * command dialog than anywhere else: it decides whether a half-filled form can be abandoned with\n * `Escape` or a backdrop click, which is a decision about the command, not about the chrome.\n *\n * The `resizable` property this adapter used to carry is gone. It is still declared upstream so call\n * sites compile, but PrimeReact 11's headless dialog has no resize handle and nothing reads the prop.\n */\nexport function SceneCommandDialog({ element, slots }: RegisteredComponentProps) {\n const { name, target } = resolveElementBinding(element, BindingKind.Command);\n if (!target) return <MissingBinding element={element} kind={BindingKind.Command} name={name} />;\n\n return (\n <ArcRuntimeBoundary>\n <CommandDialog\n title={stringProperty(element.properties, 'title') ?? ''}\n command={target}\n visible={booleanProperty(element.properties, 'visible') ?? true}\n width={stringProperty(element.properties, 'width')}\n dismissable={booleanProperty(element.properties, 'dismissable')}\n okLabel={stringProperty(element.properties, 'okLabel')}\n cancelLabel={stringProperty(element.properties, 'cancelLabel')}\n closeAriaLabel={stringProperty(element.properties, 'closeAriaLabel')}\n className={stringProperty(element.properties, 'className')}\n >\n {slots.content}\n </CommandDialog>\n </ArcRuntimeBoundary>\n );\n}\n"],"names":["CommandDialog","lazy","default","BoundCommandDialog","SceneCommandDialog","element","slots","name","target","resolveElementBinding","BindingKind","Command","_jsx","MissingBinding","kind","ArcRuntimeBoundary","title","stringProperty","properties","command","visible","booleanProperty","width","dismissable","okLabel","cancelLabel","closeAriaLabel","className","content"],"mappings":";;;;;;;;AAQA,MAAMA,aAAAA,iBAAgBC,IAAAA,CAAK,WAAa;AAAEC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OAAO,mCAAA,CAAgC,EAAGC;KAAmB,CAAA,CAAA;AAEvH;;;;;;;;;;;;;;;;;;;AAmBC,IACM,SAASC,kBAAAA,CAAmB,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IAC3E,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGC,qBAAAA,CAAsBJ,OAAAA,EAASK,WAAAA,CAAYC,OAAO,CAAA;IAC3E,IAAI,CAACH,MAAAA,EAAQ,qBAAOI,GAAA,CAACC,cAAAA,EAAAA;QAAeR,OAAAA,EAASA,OAAAA;AAASS,QAAAA,IAAAA,EAAMJ,YAAYC,OAAO;QAAEJ,IAAAA,EAAMA;;AAEvF,IAAA,qBACIK,GAAA,CAACG,kBAAAA,EAAAA;AACG,QAAA,QAAA,gBAAAH,GAAA,CAACZ,aAAAA,EAAAA;AACGgB,YAAAA,KAAAA,EAAOC,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,OAAA,CAAA,IAAY,EAAA;YACtDC,OAAAA,EAASX,MAAAA;AACTY,YAAAA,OAAAA,EAASC,eAAAA,CAAgBhB,OAAAA,CAAQa,UAAU,EAAE,SAAA,CAAA,IAAc,IAAA;YAC3DI,KAAAA,EAAOL,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,OAAA,CAAA;YAC1CK,WAAAA,EAAaF,eAAAA,CAAgBhB,OAAAA,CAAQa,UAAU,EAAE,aAAA,CAAA;YACjDM,OAAAA,EAASP,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,SAAA,CAAA;YAC5CO,WAAAA,EAAaR,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,aAAA,CAAA;YAChDQ,cAAAA,EAAgBT,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,gBAAA,CAAA;YACnDS,SAAAA,EAAWV,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,WAAA,CAAA;AAE7CZ,YAAAA,QAAAA,EAAAA,KAAAA,CAAMsB;;;AAIvB;;"}
|
|
@@ -7,7 +7,7 @@ import { ArcRuntimeBoundary } from '../bindings/ArcRuntimeBoundary.js';
|
|
|
7
7
|
import { stringProperty, booleanProperty, unionProperty } from '../properties.js';
|
|
8
8
|
|
|
9
9
|
const StepperCommandDialog = /*#__PURE__*/ lazy(async ()=>({
|
|
10
|
-
default: (await import('
|
|
10
|
+
default: (await import('../bindings/ArcBoundComponents.js')).BoundStepperCommandDialog
|
|
11
11
|
}));
|
|
12
12
|
/** Whether the step headers run across the top or down the side. */ const orientations = [
|
|
13
13
|
'horizontal',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneStepperCommandDialog.js","sources":["../../../dialogs/SceneStepperCommandDialog.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, stringProperty, unionProperty } from '../properties';\n\nconst StepperCommandDialog = lazy(async () => ({\n default: (await import('
|
|
1
|
+
{"version":3,"file":"SceneStepperCommandDialog.js","sources":["../../../dialogs/SceneStepperCommandDialog.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, stringProperty, unionProperty } from '../properties';\n\nconst StepperCommandDialog = lazy(async () => ({\n default: (await import('../bindings/ArcBoundComponents')).BoundStepperCommandDialog,\n}));\n\n/** Whether the step headers run across the top or down the side. */\nconst orientations = ['horizontal', 'vertical'] as const;\n\n/**\n * The `Cratis.Components:stepperCommandDialog` component - `StepperCommandDialog` from\n * `@cratis/components/CommandDialog`.\n *\n * `commandDialog` split across steps, for a command with more fields than fit one screen. It stays a\n * single command: the steps partition the *fields*, not the intent, and nothing is submitted until the\n * last step - so a half-finished wizard leaves no trace, which is exactly what a command should do.\n *\n * `linear` decides whether a step can be skipped ahead of the one before it. The step panels go in the\n * `content` slot.\n */\nexport function SceneStepperCommandDialog({ element, slots }: RegisteredComponentProps) {\n const { name, target } = resolveElementBinding(element, BindingKind.Command);\n if (!target) return <MissingBinding element={element} kind={BindingKind.Command} name={name} />;\n\n return (\n <ArcRuntimeBoundary>\n <StepperCommandDialog\n title={stringProperty(element.properties, 'title') ?? ''}\n command={target}\n visible={booleanProperty(element.properties, 'visible') ?? true}\n width={stringProperty(element.properties, 'width')}\n linear={booleanProperty(element.properties, 'linear')}\n orientation={unionProperty(element.properties, 'orientation', orientations)}\n okLabel={stringProperty(element.properties, 'okLabel')}\n nextLabel={stringProperty(element.properties, 'nextLabel')}\n previousLabel={stringProperty(element.properties, 'previousLabel')}\n showCancel={booleanProperty(element.properties, 'showCancel')}\n cancelLabel={stringProperty(element.properties, 'cancelLabel')}\n >\n {slots.content}\n </StepperCommandDialog>\n </ArcRuntimeBoundary>\n );\n}\n"],"names":["StepperCommandDialog","lazy","default","BoundStepperCommandDialog","orientations","SceneStepperCommandDialog","element","slots","name","target","resolveElementBinding","BindingKind","Command","_jsx","MissingBinding","kind","ArcRuntimeBoundary","title","stringProperty","properties","command","visible","booleanProperty","width","linear","orientation","unionProperty","okLabel","nextLabel","previousLabel","showCancel","cancelLabel","content"],"mappings":";;;;;;;;AAQA,MAAMA,oBAAAA,iBAAuBC,IAAAA,CAAK,WAAa;AAC3CC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OA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AAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,eAAA,CAAA;YAClDW,UAAAA,EAAYR,eAAAA,CAAgBhB,OAAAA,CAAQa,UAAU,EAAE,YAAA,CAAA;YAChDY,WAAAA,EAAab,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,aAAA,CAAA;AAE/CZ,YAAAA,QAAAA,EAAAA,KAAAA,CAAMyB;;;AAIvB;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when_describing_single_result.d.ts","sourceRoot":"","sources":["../../../for_cratisComponentsPackage/when_describing_single_result.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { expect } from 'vitest';
|
|
2
|
+
import { componentRegistryKey } from '@cratis/scene.react';
|
|
3
|
+
import { cratisComponents, cratisComponentsPackageName } from '../cratisComponents';
|
|
4
|
+
import { cratisComponentsPackageManifest } from '../cratisComponentsPackage';
|
|
5
|
+
import { SceneSingleResult } from '../data/SceneSingleResult';
|
|
6
|
+
describe('when describing the single result view', () => {
|
|
7
|
+
it('registers the same component advertised by the manifest', () => {
|
|
8
|
+
expect(cratisComponentsPackageManifest.components).toContain('singleResult');
|
|
9
|
+
expect(cratisComponents[componentRegistryKey(cratisComponentsPackageName, 'singleResult')]).toBe(SceneSingleResult);
|
|
10
|
+
});
|
|
11
|
+
it('describes an explicitly enabled read-only own-field capability', () => {
|
|
12
|
+
expect(cratisComponentsPackageManifest.description).toContain('read-only scalar own resultField');
|
|
13
|
+
expect(cratisComponentsPackageManifest.description).toContain('enabled: true');
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=when_describing_single_result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when_describing_single_result.js","sourceRoot":"","sources":["../../../for_cratisComponentsPackage/when_describing_single_result.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,QAAQ,CAAC,wCAAwC,EAAE,GAAG,EAAE;IACpD,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QAC/D,MAAM,CAAC,+BAA+B,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAC7E,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,2BAA2B,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACxH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACtE,MAAM,CAAC,+BAA+B,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,kCAAkC,CAAC,CAAC;QAClG,MAAM,CAAC,+BAA+B,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IACnF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneRadioButtonField.d.ts","sourceRoot":"","sources":["../../../../forms/fields/SceneRadioButtonField.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAiB/D,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE,wBAAwB,+
|
|
1
|
+
{"version":3,"file":"SceneRadioButtonField.d.ts","sourceRoot":"","sources":["../../../../forms/fields/SceneRadioButtonField.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAiB/D,wBAAgB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE,wBAAwB,+BAkB1E"}
|
|
@@ -17,11 +17,14 @@ const RadioButtonField = /*#__PURE__*/ lazy(async ()=>({
|
|
|
17
17
|
* `buttonValue` is read as a string first and a number second, since a choice is usually a string but a
|
|
18
18
|
* numeric code is common enough that forcing it through as `'1'` would bind the wrong value.
|
|
19
19
|
*/ function SceneRadioButtonField({ element }) {
|
|
20
|
+
// Use the same reader as CommandFormField's binding gate; that gate owns missing-property feedback.
|
|
21
|
+
const name = stringProperty(element.properties, 'property');
|
|
20
22
|
const buttonValue = stringProperty(element.properties, 'buttonValue') ?? numberProperty(element.properties, 'buttonValue') ?? '';
|
|
21
23
|
return /*#__PURE__*/ jsx(CommandFormField, {
|
|
22
24
|
element: element,
|
|
23
|
-
children: (binding)
|
|
25
|
+
children: (binding)=>name !== undefined && /*#__PURE__*/ jsx(RadioButtonField, {
|
|
24
26
|
...binding,
|
|
27
|
+
name: name,
|
|
25
28
|
buttonValue: buttonValue,
|
|
26
29
|
label: stringProperty(element.properties, 'label'),
|
|
27
30
|
className: stringProperty(element.properties, 'className')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneRadioButtonField.js","sources":["../../../../forms/fields/SceneRadioButtonField.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 { numberProperty, stringProperty } from '../../properties';\nimport { CommandFormField } from './CommandFormField';\n\nconst RadioButtonField = lazy(async () => ({ default: (await import('@cratis/components/CommandForm')).RadioButtonField }));\n\n/**\n * The `Cratis.Components:radioButtonField` component - `RadioButtonField` from\n * `@cratis/components/CommandForm`.\n *\n * One button of a mutually exclusive set, for a screen that needs the choices placed individually rather\n * than as a block. `buttonValue` is the value this particular button writes to the bound property, and\n * the whole set is tied together by every button naming the same `property`.\n *\n * `buttonValue` is read as a string first and a number second, since a choice is usually a string but a\n * numeric code is common enough that forcing it through as `'1'` would bind the wrong value.\n */\nexport function SceneRadioButtonField({ element }: RegisteredComponentProps) {\n const buttonValue = stringProperty(element.properties, 'buttonValue') ?? numberProperty(element.properties, 'buttonValue') ?? '';\n\n return (\n <CommandFormField element={element}>\n {binding => (\n <RadioButtonField\n {...binding}\n buttonValue={buttonValue}\n label={stringProperty(element.properties, 'label')}\n className={stringProperty(element.properties, 'className')}\n />\n )}\n </CommandFormField>\n );\n}\n"],"names":["RadioButtonField","lazy","default","SceneRadioButtonField","element","
|
|
1
|
+
{"version":3,"file":"SceneRadioButtonField.js","sources":["../../../../forms/fields/SceneRadioButtonField.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 { numberProperty, stringProperty } from '../../properties';\nimport { CommandFormField } from './CommandFormField';\n\nconst RadioButtonField = lazy(async () => ({ default: (await import('@cratis/components/CommandForm')).RadioButtonField }));\n\n/**\n * The `Cratis.Components:radioButtonField` component - `RadioButtonField` from\n * `@cratis/components/CommandForm`.\n *\n * One button of a mutually exclusive set, for a screen that needs the choices placed individually rather\n * than as a block. `buttonValue` is the value this particular button writes to the bound property, and\n * the whole set is tied together by every button naming the same `property`.\n *\n * `buttonValue` is read as a string first and a number second, since a choice is usually a string but a\n * numeric code is common enough that forcing it through as `'1'` would bind the wrong value.\n */\nexport function SceneRadioButtonField({ element }: RegisteredComponentProps) {\n // Use the same reader as CommandFormField's binding gate; that gate owns missing-property feedback.\n const name = stringProperty(element.properties, 'property');\n const buttonValue = stringProperty(element.properties, 'buttonValue') ?? numberProperty(element.properties, 'buttonValue') ?? '';\n\n return (\n <CommandFormField element={element}>\n {binding => name !== undefined && (\n <RadioButtonField\n {...binding}\n name={name}\n buttonValue={buttonValue}\n label={stringProperty(element.properties, 'label')}\n className={stringProperty(element.properties, 'className')}\n />\n )}\n </CommandFormField>\n );\n}\n"],"names":["RadioButtonField","lazy","default","SceneRadioButtonField","element","name","stringProperty","properties","buttonValue","numberProperty","_jsx","CommandFormField","binding","undefined","label","className"],"mappings":";;;;;AAQA,MAAMA,gBAAAA,iBAAmBC,IAAAA,CAAK,WAAa;AAAEC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OAAO,gCAAA,CAAgC,EAAGF;KAAiB,CAAA,CAAA;AAExH;;;;;;;;;;AAUC,IACM,SAASG,qBAAAA,CAAsB,EAAEC,OAAO,EAA4B,EAAA;;AAEvE,IAAA,MAAMC,IAAAA,GAAOC,cAAAA,CAAeF,OAAAA,CAAQG,UAAU,EAAE,UAAA,CAAA;IAChD,MAAMC,WAAAA,GAAcF,cAAAA,CAAeF,OAAAA,CAAQG,UAAU,EAAE,kBAAkBE,cAAAA,CAAeL,OAAAA,CAAQG,UAAU,EAAE,aAAA,CAAA,IAAkB,EAAA;AAE9H,IAAA,qBACIG,GAAA,CAACC,gBAAAA,EAAAA;QAAiBP,OAAAA,EAASA,OAAAA;kBACtBQ,CAAAA,OAAAA,GAAWP,IAAAA,KAASQ,SAAAA,kBACjBH,GAAA,CAACV,gBAAAA,EAAAA;AACI,gBAAA,GAAGY,OAAO;gBACXP,IAAAA,EAAMA,IAAAA;gBACNG,WAAAA,EAAaA,WAAAA;gBACbM,KAAAA,EAAOR,cAAAA,CAAeF,OAAAA,CAAQG,UAAU,EAAE,OAAA,CAAA;gBAC1CQ,SAAAA,EAAWT,cAAAA,CAAeF,OAAAA,CAAQG,UAAU,EAAE,WAAA;;;AAKlE;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when_mapping_the_group_name.d.ts","sourceRoot":"","sources":["../../../../../forms/fields/for_SceneRadioButtonField/when_mapping_the_group_name.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 mapping the radio group name', () => {
|
|
6
|
+
const received = vi.fn();
|
|
7
|
+
let SceneRadioButtonField;
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
vi.resetModules();
|
|
10
|
+
received.mockClear();
|
|
11
|
+
vi.doMock('@cratis/components/CommandForm', () => ({
|
|
12
|
+
RadioButtonField: (props) => { received(props); return _jsx("input", { type: 'radio', name: props.name }); },
|
|
13
|
+
}));
|
|
14
|
+
({ SceneRadioButtonField } = await import('../SceneRadioButtonField'));
|
|
15
|
+
});
|
|
16
|
+
afterEach(() => {
|
|
17
|
+
cleanup();
|
|
18
|
+
vi.doUnmock('@cratis/components/CommandForm');
|
|
19
|
+
vi.resetModules();
|
|
20
|
+
});
|
|
21
|
+
it('should group options by the explicit property, regardless of titles or labels', async () => {
|
|
22
|
+
await act(async () => {
|
|
23
|
+
render(_jsx(_Fragment, { children: ['First title', 'Second title'].map((title, index) => _jsx(SceneRadioButtonField, { element: externalComponent('Cratis.Components:radioButtonField', { property: 'choice', title, label: 'Display label', buttonValue: index }), slots: {} }, title)) }));
|
|
24
|
+
});
|
|
25
|
+
expect(screen.getAllByRole('radio').map(radio => radio.getAttribute('name'))).toEqual(['choice', 'choice']);
|
|
26
|
+
expect(received.mock.calls.map(([props]) => props.value({ choice: 2 }))).toEqual([2, 2]);
|
|
27
|
+
});
|
|
28
|
+
for (const property of [undefined, 42, null, {}, []]) {
|
|
29
|
+
it(`should visibly reject malformed property ${JSON.stringify(property)} instead of using the title`, async () => {
|
|
30
|
+
await act(async () => {
|
|
31
|
+
render(_jsx(SceneRadioButtonField, { element: externalComponent('Cratis.Components:radioButtonField', { property, title: 'Not a binding' }), slots: {} }));
|
|
32
|
+
});
|
|
33
|
+
expect(screen.getByText("Missing 'property' on Cratis.Components:radioButtonField")).toBeTruthy();
|
|
34
|
+
expect(received).not.toHaveBeenCalled();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=when_mapping_the_group_name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when_mapping_the_group_name.js","sourceRoot":"","sources":["../../../../../forms/fields/for_SceneRadioButtonField/when_mapping_the_group_name.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,gBAAgB,CAAC;AAGnD,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;IAC/C,MAAM,QAAQ,GAAG,EAAE,CAAC,EAAE,EAA2G,CAAC;IAClI,IAAI,qBAAsF,CAAC;IAE3F,UAAU,CAAC,KAAK,IAAI,EAAE;QAClB,EAAE,CAAC,YAAY,EAAE,CAAC;QAClB,QAAQ,CAAC,SAAS,EAAE,CAAC;QACrB,EAAE,CAAC,MAAM,CAAC,gCAAgC,EAAE,GAAG,EAAE,CAAC,CAAC;YAC/C,gBAAgB,EAAE,CAAC,KAAqC,EAAE,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,gBAAO,IAAI,EAAC,OAAO,EAAC,IAAI,EAAE,KAAK,CAAC,IAAI,GAAI,CAAC,CAAC,CAAC;SACrI,CAAC,CAAC,CAAC;QACJ,CAAC,EAAE,qBAAqB,EAAE,GAAG,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACX,OAAO,EAAE,CAAC;QACV,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC,CAAC;QAC9C,EAAE,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC,CA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AC,OAAO,EAAE,iBAAiB,CAAC,oCAAoC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,GAAI,CAAC,CAAC;YACzJ,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,0DAA0D,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;YAClG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAC5C,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { externalComponent } from '../../../given';
|
|
2
2
|
import { resolveFieldBinding } from '../resolveFieldBinding';
|
|
3
3
|
describe('when resolving a field binding', () => {
|
|
4
|
+
it('should preserve manually constructed field bindings without a native group name', () => {
|
|
5
|
+
const binding = { value: instance => instance.customerName, title: 'Customer' };
|
|
6
|
+
binding.value({ customerName: 'Acme' }).should.equal('Acme');
|
|
7
|
+
});
|
|
4
8
|
describe('and the element names a property with a title and description', () => {
|
|
5
9
|
const binding = resolveFieldBinding(externalComponent('Cratis.Components:inputTextField', {
|
|
6
10
|
property: 'customerName',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"when_resolving_a_field_binding.js","sourceRoot":"","sources":["../../../../../forms/fields/for_resolveFieldBinding/when_resolving_a_field_binding.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"when_resolving_a_field_binding.js","sourceRoot":"","sources":["../../../../../forms/fields/for_resolveFieldBinding/when_resolving_a_field_binding.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBA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C,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;QAC3G,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAChG,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC/C,MAAM,OAAO,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,kCAAkC,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;QAElH,EAAE,CAAC,sEAAsE,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC7H,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export { ArcRuntimeBoundary } from './bindings/ArcRuntimeBoundary.js';
|
|
|
8
8
|
export { ScenePage } from './pages/ScenePage.js';
|
|
9
9
|
export { SceneDataPage } from './pages/SceneDataPage.js';
|
|
10
10
|
export { SceneFormElement } from './pages/SceneFormElement.js';
|
|
11
|
+
export { SceneSingleResult } from './data/SceneSingleResult.js';
|
|
11
12
|
export { SceneDataTable } from './data/SceneDataTable.js';
|
|
12
13
|
export { SceneObservableDataTable } from './data/SceneObservableDataTable.js';
|
|
13
14
|
export { SceneCommandForm } from './forms/SceneCommandForm.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -7,7 +7,7 @@ import { ArcRuntimeBoundary } from '../bindings/ArcRuntimeBoundary.js';
|
|
|
7
7
|
import { stringArrayProperty, stringProperty } from '../properties.js';
|
|
8
8
|
|
|
9
9
|
const DataPage = /*#__PURE__*/ lazy(async ()=>({
|
|
10
|
-
default: (await import('
|
|
10
|
+
default: (await import('../bindings/ArcBoundComponents.js')).BoundDataPage
|
|
11
11
|
}));
|
|
12
12
|
/**
|
|
13
13
|
* The `Cratis.Components:dataPage` component - `DataPage` from `@cratis/components/DataPage`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneDataPage.js","sources":["../../../pages/SceneDataPage.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 DataPage = lazy(async () => ({ default: (await import('
|
|
1
|
+
{"version":3,"file":"SceneDataPage.js","sources":["../../../pages/SceneDataPage.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 DataPage = lazy(async () => ({ default: (await import('../bindings/ArcBoundComponents')).BoundDataPage }));\n\n/**\n * The `Cratis.Components:dataPage` component - `DataPage` from `@cratis/components/DataPage`.\n *\n * The library's whole list-screen composite in one name: title bar, action toolbar, filterable table and\n * optional details pane, all driven from a single query. It is the single highest-leverage thing this\n * package exposes, because reproducing it out of `table` and `toolbar` in a screen would be pages of\n * modeling for a worse result.\n *\n * The `query` property names an Arc query proxy; the columns and menu items come from the `content`\n * slot as `DataPage.Columns` / `DataPage.MenuItems` children.\n *\n * No `clientFiltering` property, for the same reason `dataTable` no longer exposes one: 3.0.0 keeps the\n * prop so call sites compile but never reads it, and a screen setting that cannot take effect is a worse\n * thing to offer than nothing.\n */\nexport function SceneDataPage({ 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 <DataPage\n title={stringProperty(element.properties, 'title') ?? ''}\n query={target}\n emptyMessage={stringProperty(element.properties, 'emptyMessage') ?? ''}\n dataKey={stringProperty(element.properties, 'dataKey')}\n globalFilterFields={stringArrayProperty(element.properties, 'globalFilterFields')}\n >\n {slots.content}\n </DataPage>\n </ArcRuntimeBoundary>\n );\n}\n"],"names":["DataPage","lazy","default","BoundDataPage","SceneDataPage","element","slots","name","target","resolveElementBinding","BindingKind","Query","_jsx","MissingBinding","kind","ArcRuntimeBoundary","title","stringProperty","properties","query","emptyMessage","dataKey","globalFilterFields","stringArrayProperty","content"],"mappings":";;;;;;;;AAQA,MAAMA,QAAAA,iBAAWC,IAAAA,CAAK,WAAa;AAAEC,QAAAA,OAAAA,EAAS,CAAC,MAAM,OAAO,mCAAA,CAAgC,EAAGC;KAAc,CAAA,CAAA;AAE7G;;;;;;;;;;;;;;AAcC,IACM,SAASC,aAAAA,CAAc,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;IACtE,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,QAAAA,EAAAA;AACGgB,YAAAA,KAAAA,EAAOC,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,OAAA,CAAA,IAAY,EAAA;YACtDC,KAAAA,EAAOX,MAAAA;AACPY,YAAAA,YAAAA,EAAcH,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,cAAA,CAAA,IAAmB,EAAA;YACpEG,OAAAA,EAASJ,cAAAA,CAAeZ,OAAAA,CAAQa,UAAU,EAAE,SAAA,CAAA;YAC5CI,kBAAAA,EAAoBC,mBAAAA,CAAoBlB,OAAAA,CAAQa,UAAU,EAAE,oBAAA,CAAA;AAE3DZ,YAAAA,QAAAA,EAAAA,KAAAA,CAAMkB;;;AAIvB;;"}
|