mlform 0.1.9 → 0.1.11
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 +18 -16
- package/dist/builtins-D8rXH4ED.js +725 -0
- package/dist/{design-system-CIU_vH6O.js → design-6suKVQDo.js} +15 -15
- package/dist/mlform/builtins.mjs +2 -0
- package/dist/mlform/{design-system.mjs → design.mjs} +2 -2
- package/dist/mlform/kit.mjs +1896 -3
- package/dist/mlform/primitives.mjs +2 -2
- package/dist/mlform/runtime.mjs +3 -4
- package/dist/mlform/schema.mjs +2 -102
- package/dist/mlform/transport.mjs +2 -2
- package/dist/{primitives-Di95y_ur.js → primitives-k9HTnd72.js} +2303 -3384
- package/dist/{runtime-C5iTM3uu.js → runtime-CI7vlp9i.js} +655 -791
- package/dist/schema-DSAZ6bts.js +88 -0
- package/dist/{transport-B6ePTLFK.js → transport-CO6udZ6z.js} +605 -575
- package/dist/types/{builtins-ml/definitions/index.d.ts → builtins/definitions/collections.d.ts} +1 -15
- package/dist/types/{shared/object.d.ts → builtins/definitions/fields/value-helpers.d.ts} +1 -0
- package/dist/types/builtins/definitions/index.d.ts +16 -0
- package/dist/types/{builtins-ml → builtins}/definitions/shared.d.ts +2 -9
- package/dist/types/builtins/index.d.ts +6 -0
- package/dist/types/builtins/mapped-category-behavior.d.ts +2 -0
- package/dist/types/builtins/registry-pack.d.ts +10 -0
- package/dist/types/{design-system → design}/index.d.ts +1 -1
- package/dist/types/{design-system/recipes/index.d.ts → design/recipes/collections.d.ts} +0 -1
- package/dist/types/design/recipes/index.d.ts +2 -0
- package/dist/types/design/resolve/index.d.ts +4 -0
- package/dist/types/{design-system/resolve/index.d.ts → design/resolve/resolve-design.d.ts} +0 -3
- package/dist/types/{design-system → design}/runtime/index.d.ts +3 -3
- package/dist/types/{design-system/themes/index.d.ts → design/themes/collections.d.ts} +0 -2
- package/dist/types/design/themes/index.d.ts +3 -0
- package/dist/types/{design-system → design}/types.d.ts +1 -1
- package/dist/types/kit/constants.d.ts +2 -10
- package/dist/types/kit/defaults.d.ts +1 -1
- package/dist/types/kit/disclosure-root-styles.d.ts +1 -0
- package/dist/types/kit/error-navigation.d.ts +2 -1
- package/dist/types/kit/index.d.ts +4 -5
- package/dist/types/{presentation → kit/kinds}/define-field-kind.d.ts +11 -3
- package/dist/types/kit/kinds/define-report-kind.d.ts +40 -0
- package/dist/types/kit/kinds/index.d.ts +3 -0
- package/dist/types/kit/kinds/register-kind.d.ts +5 -0
- package/dist/types/kit/layout-helpers.d.ts +7 -11
- package/dist/types/kit/layout-node-render.d.ts +4 -4
- package/dist/types/kit/layout-node-resolver.d.ts +1 -1
- package/dist/types/kit/{accordion-root.d.ts → layout-root.d.ts} +3 -4
- package/dist/types/kit/layout-types.d.ts +8 -36
- package/dist/types/kit/layout-utils.d.ts +0 -1
- package/dist/types/kit/layout.d.ts +2 -2
- package/dist/types/kit/mount-types.d.ts +8 -7
- package/dist/types/kit/panel-nav.d.ts +1 -1
- package/dist/types/kit/tabs-root.d.ts +1 -2
- package/dist/types/kit/types.d.ts +2 -3
- package/dist/types/kit/view-core-types.d.ts +110 -0
- package/dist/types/kit/view-layout-state.d.ts +10 -3
- package/dist/types/kit/view-navigation.d.ts +3 -3
- package/dist/types/kit/view-snapshot-cache.d.ts +3 -3
- package/dist/types/kit/view-snapshot.d.ts +4 -4
- package/dist/types/kit/view-types.d.ts +1 -172
- package/dist/types/kit/view.d.ts +2 -8
- package/dist/types/kit/wizard-root.d.ts +1 -2
- package/dist/types/primitives/base-async-report-element.d.ts +1 -1
- package/dist/types/primitives/base-field-element.d.ts +3 -3
- package/dist/types/primitives/base-report-element.d.ts +3 -3
- package/dist/types/primitives/components/descriptor-content.d.ts +4 -0
- package/dist/types/primitives/components/error-focus.d.ts +3 -2
- package/dist/types/primitives/components/field-frame-feedback.d.ts +3 -3
- package/dist/types/primitives/components/field-frame.d.ts +3 -3
- package/dist/types/primitives/components/form-errors.d.ts +2 -2
- package/dist/types/primitives/components/form-root-presenters.d.ts +6 -11
- package/dist/types/primitives/components/form-root-state.d.ts +4 -6
- package/dist/types/primitives/components/form-root-templates.d.ts +4 -8
- package/dist/types/primitives/components/form-root.d.ts +4 -4
- package/dist/types/primitives/components/report-frame.d.ts +4 -4
- package/dist/types/primitives/components/submit-button.d.ts +2 -2
- package/dist/types/primitives/constants.d.ts +6 -9
- package/dist/types/primitives/controller-types.d.ts +96 -0
- package/dist/types/primitives/descriptor-resolution.d.ts +6 -0
- package/dist/types/primitives/descriptors/content.d.ts +61 -0
- package/dist/types/primitives/descriptors/field.d.ts +32 -0
- package/dist/types/primitives/descriptors/index.d.ts +5 -0
- package/dist/types/primitives/descriptors/registry.d.ts +11 -0
- package/dist/types/primitives/descriptors/report.d.ts +20 -0
- package/dist/types/primitives/index.d.ts +8 -3
- package/dist/types/primitives/mount-form.d.ts +2 -2
- package/dist/types/primitives/request-runner.d.ts +13 -0
- package/dist/types/primitives/types.d.ts +16 -53
- package/dist/types/runtime/errors.d.ts +1 -2
- package/dist/types/runtime/index.d.ts +2 -4
- package/dist/types/runtime/reports/controller.d.ts +3 -2
- package/dist/types/runtime/runtime-controller.d.ts +1 -5
- package/dist/types/runtime/state/engine.d.ts +1 -2
- package/dist/types/runtime/submission/create-submitter.d.ts +1 -1
- package/dist/types/runtime/submission/index.d.ts +1 -1
- package/dist/types/runtime/submission/lifecycle.d.ts +1 -2
- package/dist/types/runtime/submission/pipeline.d.ts +1 -1
- package/dist/types/runtime/submission/report-fetches.d.ts +2 -0
- package/dist/types/runtime/submission/types.d.ts +1 -2
- package/dist/types/runtime/types/form.d.ts +9 -13
- package/dist/types/runtime/types/index.d.ts +0 -1
- package/dist/types/runtime/types/pipeline.d.ts +10 -10
- package/dist/types/runtime/types/registry.d.ts +2 -3
- package/dist/types/runtime/types/report.d.ts +4 -1
- package/dist/types/runtime/types/transport.d.ts +3 -4
- package/dist/types/runtime/utils.d.ts +1 -3
- package/dist/types/runtime/validation/form.d.ts +1 -1
- package/dist/types/schema/ids.d.ts +1 -0
- package/dist/types/schema/index.d.ts +3 -1
- package/dist/types/schema/registry.d.ts +2 -4
- package/dist/types/schema/report-fetch-request.d.ts +6 -0
- package/dist/types/schema/types/form.d.ts +0 -3
- package/dist/types/schema/types/registry.d.ts +0 -5
- package/dist/types/schema/types/report.d.ts +25 -3
- package/dist/types/schema/types/submit.d.ts +11 -0
- package/dist/types/transport/errors.d.ts +1 -2
- package/dist/types/transport/index.d.ts +2 -0
- package/dist/types/transport/request-runner.d.ts +16 -0
- package/package.json +14 -27
- package/dist/builtins-ml-pjab8_gu.js +0 -3878
- package/dist/errors-CTNw8fwS.js +0 -8
- package/dist/kit-QY6zff-h.js +0 -1888
- package/dist/mlform/behaviors.mjs +0 -32
- package/dist/mlform/builtins-ml.mjs +0 -2
- package/dist/mlform/presentation.mjs +0 -2
- package/dist/mlform.mjs +0 -8
- package/dist/presentation-BrlVO4oV.js +0 -200
- package/dist/strings-CWwrrYzz.js +0 -4
- package/dist/types/behaviors/index.d.ts +0 -3
- package/dist/types/builtins-ml/index.d.ts +0 -5
- package/dist/types/index.d.ts +0 -13
- package/dist/types/kit/accordion-root-styles.d.ts +0 -1
- package/dist/types/kit/accordion.d.ts +0 -2
- package/dist/types/kit/tabs.d.ts +0 -2
- package/dist/types/kit/wizard.d.ts +0 -2
- package/dist/types/packs/default.d.ts +0 -2
- package/dist/types/packs/index.d.ts +0 -3
- package/dist/types/packs/ml.d.ts +0 -2
- package/dist/types/packs/shared.d.ts +0 -24
- package/dist/types/presentation/define-explanation-kind.d.ts +0 -11
- package/dist/types/presentation/define-report-kind.d.ts +0 -15
- package/dist/types/presentation/index.d.ts +0 -10
- package/dist/types/presentation/register-kind.d.ts +0 -6
- package/dist/types/presentation/registry.d.ts +0 -15
- package/dist/types/presentation/types/explanation.d.ts +0 -32
- package/dist/types/presentation/types/field.d.ts +0 -36
- package/dist/types/presentation/types/presentation.d.ts +0 -61
- package/dist/types/presentation/types/report.d.ts +0 -41
- package/dist/types/primitives/base-explanation-element.d.ts +0 -22
- package/dist/types/primitives/components/declarative-explanation.d.ts +0 -5
- package/dist/types/primitives/components/explanation-panel.d.ts +0 -24
- package/dist/types/primitives/components/presentation.d.ts +0 -4
- package/dist/types/primitives/presentation.d.ts +0 -8
- package/dist/types/runtime/explanations/controller.d.ts +0 -13
- package/dist/types/runtime/explanations/index.d.ts +0 -1
- package/dist/types/runtime/schema/index.d.ts +0 -7
- package/dist/types/runtime/submission/explanations.d.ts +0 -2
- package/dist/types/runtime/types/explanation.d.ts +0 -15
- package/dist/types/schema/types/explanation.d.ts +0 -43
- package/dist/types/shared/errors.d.ts +0 -3
- package/dist/types/shared/index.d.ts +0 -3
- package/dist/types/shared/strings.d.ts +0 -1
- package/dist/utils-J5o8lkea.js +0 -29
- /package/dist/types/{runtime → builtins}/constants.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/boolean.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/category.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/date.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/long-text.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/mapped-category.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/multi-choice.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/number.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/rating.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/series-helpers.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/series.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/single-choice.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/fields/text.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/reports/classifier.d.ts +0 -0
- /package/dist/types/{builtins-ml → builtins}/definitions/reports/regressor.d.ts +0 -0
- /package/dist/types/{design-system → design}/constants.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/component-keys.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/component-tokens.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/global-tokens.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/index.d.ts +0 -0
- /package/dist/types/{design-system → design}/contract/token-keys.d.ts +0 -0
- /package/dist/types/{design-system → design}/recipes/contrast.d.ts +0 -0
- /package/dist/types/{design-system → design}/recipes/default.d.ts +0 -0
- /package/dist/types/{design-system → design}/recipes/minimal.d.ts +0 -0
- /package/dist/types/{design-system → design}/recipes/soft.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/builtins.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/create-registry.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/deep-freeze.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/define-recipe.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/define-theme.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/define-token-maps.d.ts +0 -0
- /package/dist/types/{design-system → design}/registry/index.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/diagnostics.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/merge-config.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/migrate-tokens.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/resolve-mode.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/resolve-recipe.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/resolve-theme.d.ts +0 -0
- /package/dist/types/{design-system → design}/resolve/resolve-tokens.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/apply-tokens.d.ts +0 -0
- /package/dist/types/{design-system/runtime/attach-design-system.d.ts → design/runtime/attach-design.d.ts} +0 -0
- /package/dist/types/{design-system → design}/runtime/controller-helpers.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/create-stylesheet.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/declarations.d.ts +0 -0
- /package/dist/types/{design-system/runtime/design-system-controller.d.ts → design/runtime/design-controller.d.ts} +0 -0
- /package/dist/types/{design-system → design}/runtime/fingerprint.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/host-observer.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/host-state.d.ts +0 -0
- /package/dist/types/{design-system/runtime/hydrate-design-system.d.ts → design/runtime/hydrate-design.d.ts} +0 -0
- /package/dist/types/{design-system → design}/runtime/hydration-state.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/inherited-scheme.d.ts +0 -0
- /package/dist/types/{design-system → design}/runtime/media.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/airbnb.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/clickhouse.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/cobalt.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/graphite.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/neutral.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/sage.d.ts +0 -0
- /package/dist/types/{design-system → design}/themes/sunset.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/base.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/contrast.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/density.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/forced-colors.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/index.d.ts +0 -0
- /package/dist/types/{design-system → design}/tokens/motion.d.ts +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { FieldDescriptor, PrimitiveDescriptorRegistry, ReportDescriptor } from '../primitives';
|
|
2
|
+
import { FieldController, FieldStateSnapshot, FormController, FormHooks, FormSchema, FormState, FormValidationResult, FormValidator, InactiveFieldPolicy, Registry, ReportController, ReportStateSnapshot, RuntimeBehavior, SubmitOptions, SubmitResult, Transport } from '../runtime';
|
|
3
|
+
import { LayoutReferences } from './layout-utils';
|
|
4
|
+
import { FormLayoutConfig, ResolvedFormLayout, ResolvedFormLayoutNode } from './layout-types';
|
|
5
|
+
import { PanelState } from './panel-nav';
|
|
6
|
+
export interface WizardState {
|
|
7
|
+
stepIndex: number;
|
|
8
|
+
stepCount: number;
|
|
9
|
+
currentStepId: string;
|
|
10
|
+
canNext: boolean;
|
|
11
|
+
canPrev: boolean;
|
|
12
|
+
isLastStep: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface TabsState {
|
|
15
|
+
activeTabIndex: number;
|
|
16
|
+
tabCount: number;
|
|
17
|
+
currentTabId: string;
|
|
18
|
+
canGoNext: boolean;
|
|
19
|
+
canGoPrev: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface DisclosureState {
|
|
22
|
+
openSectionIds: string[];
|
|
23
|
+
sectionCount: number;
|
|
24
|
+
}
|
|
25
|
+
export interface FormViewFieldItem {
|
|
26
|
+
id: string;
|
|
27
|
+
kind: string;
|
|
28
|
+
config: FieldController["config"];
|
|
29
|
+
controller: FieldController;
|
|
30
|
+
state: FieldStateSnapshot;
|
|
31
|
+
descriptor: FieldDescriptor;
|
|
32
|
+
stepId: string | null;
|
|
33
|
+
tabId: string | null;
|
|
34
|
+
sectionId: string | null;
|
|
35
|
+
visibleInLayout: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface FormViewReportItem {
|
|
38
|
+
id: string;
|
|
39
|
+
kind: string;
|
|
40
|
+
config: ReportController["config"];
|
|
41
|
+
controller: ReportController;
|
|
42
|
+
state: ReportStateSnapshot;
|
|
43
|
+
descriptor: ReportDescriptor | null;
|
|
44
|
+
stepId: string | null;
|
|
45
|
+
tabId: string | null;
|
|
46
|
+
sectionId: string | null;
|
|
47
|
+
visibleInLayout: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface FormViewState {
|
|
50
|
+
form: FormState;
|
|
51
|
+
wizard: WizardState | null;
|
|
52
|
+
tabs: TabsState | null;
|
|
53
|
+
disclosure: DisclosureState | null;
|
|
54
|
+
}
|
|
55
|
+
export interface FormViewSnapshot {
|
|
56
|
+
form: FormState;
|
|
57
|
+
layout: ResolvedFormLayout;
|
|
58
|
+
fields: FormViewFieldItem[];
|
|
59
|
+
reports: FormViewReportItem[];
|
|
60
|
+
wizard: WizardState | null;
|
|
61
|
+
tabs: TabsState | null;
|
|
62
|
+
disclosure: DisclosureState | null;
|
|
63
|
+
}
|
|
64
|
+
export interface CreateFormViewOptions {
|
|
65
|
+
schema: FormSchema;
|
|
66
|
+
transport: Transport;
|
|
67
|
+
registry?: Registry;
|
|
68
|
+
descriptorRegistry?: PrimitiveDescriptorRegistry;
|
|
69
|
+
behaviors?: RuntimeBehavior[];
|
|
70
|
+
initialValues?: Record<string, unknown>;
|
|
71
|
+
validators?: FormValidator[];
|
|
72
|
+
hooks?: FormHooks;
|
|
73
|
+
hookFailurePolicy?: {
|
|
74
|
+
afterSubmit?: "fail-submit" | "preserve-success";
|
|
75
|
+
};
|
|
76
|
+
inactiveFieldPolicy?: InactiveFieldPolicy;
|
|
77
|
+
listenerErrorPolicy?: "ignore" | "throw-aggregate";
|
|
78
|
+
onListenerError?: (error: unknown) => void;
|
|
79
|
+
layout?: FormLayoutConfig;
|
|
80
|
+
}
|
|
81
|
+
export interface FormViewController {
|
|
82
|
+
readonly form: FormController;
|
|
83
|
+
readonly engineRegistry: Registry;
|
|
84
|
+
readonly descriptorRegistry: PrimitiveDescriptorRegistry;
|
|
85
|
+
readonly state: FormViewState;
|
|
86
|
+
getSnapshot(): FormViewSnapshot;
|
|
87
|
+
getNodeById(id: string): ResolvedFormLayoutNode | undefined;
|
|
88
|
+
getField(id: string): FormViewFieldItem | undefined;
|
|
89
|
+
getReport(id: string): FormViewReportItem | undefined;
|
|
90
|
+
getVisibleFields(): FormViewFieldItem[];
|
|
91
|
+
getVisibleReports(): FormViewReportItem[];
|
|
92
|
+
getActiveLayoutNodes(): ResolvedFormLayoutNode[];
|
|
93
|
+
getLayoutReferences(): LayoutReferences;
|
|
94
|
+
validate(): Promise<FormValidationResult>;
|
|
95
|
+
submit(options?: SubmitOptions): Promise<SubmitResult>;
|
|
96
|
+
reset(): void;
|
|
97
|
+
subscribe(listener: (snapshot: FormViewSnapshot) => void): () => void;
|
|
98
|
+
nextStep(): Promise<boolean>;
|
|
99
|
+
prevStep(): void;
|
|
100
|
+
goToStep(stepId: string): Promise<boolean>;
|
|
101
|
+
setActiveTab(tabId: string): void;
|
|
102
|
+
nextTab(): boolean;
|
|
103
|
+
prevTab(): boolean;
|
|
104
|
+
toggleSection(sectionId: string): void;
|
|
105
|
+
openSection(sectionId: string): void;
|
|
106
|
+
closeSection(sectionId: string): void;
|
|
107
|
+
openAllSections(): void;
|
|
108
|
+
closeAllSections(): void;
|
|
109
|
+
}
|
|
110
|
+
export type { LayoutReferences, PanelState, ResolvedFormLayoutNode };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DisclosureState, FormViewState, ResolvedFormLayoutNode, TabsState, WizardState, ResolvedFormLayout } from './types';
|
|
2
2
|
type LayoutStateOptions = {
|
|
3
3
|
layout: ResolvedFormLayout;
|
|
4
4
|
stepIndex: number;
|
|
@@ -8,7 +8,14 @@ type LayoutStateOptions = {
|
|
|
8
8
|
};
|
|
9
9
|
export declare const getWizardState: ({ layout, stepIndex, formState, }: LayoutStateOptions) => WizardState | null;
|
|
10
10
|
export declare const getTabsState: ({ layout, activeTabIndex }: LayoutStateOptions) => TabsState | null;
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const collectDisclosureSections: (nodes: readonly ResolvedFormLayoutNode[], sections?: {
|
|
12
|
+
id: string;
|
|
13
|
+
defaultOpen: boolean;
|
|
14
|
+
}[]) => {
|
|
15
|
+
id: string;
|
|
16
|
+
defaultOpen: boolean;
|
|
17
|
+
}[];
|
|
18
|
+
export declare const getDisclosureState: ({ layout, openSectionIds, }: LayoutStateOptions) => DisclosureState | null;
|
|
12
19
|
export declare const createFormViewState: (options: LayoutStateOptions) => FormViewState;
|
|
13
|
-
export declare const isVisibleInLayout: (layout: ResolvedFormLayout, stepIndex: number, activeTabIndex: number, openSectionIds: Set<string>, stepId: string | null, tabId: string | null) => boolean;
|
|
20
|
+
export declare const isVisibleInLayout: (layout: ResolvedFormLayout, stepIndex: number, activeTabIndex: number, openSectionIds: Set<string>, stepId: string | null, tabId: string | null, sectionId: string | null) => boolean;
|
|
14
21
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FormController } from '../runtime';
|
|
2
2
|
import { ResolvedLayoutResult } from './layout';
|
|
3
|
+
import { ResolvedFormLayoutNode } from './types';
|
|
3
4
|
export declare const validateCurrentWizardStep: (form: FormController, resolvedLayout: ResolvedLayoutResult, stepIndex: number) => Promise<boolean>;
|
|
4
|
-
export declare const getActiveLayoutNodes: (resolvedLayout: ResolvedLayoutResult, stepIndex: number, activeTabIndex: number, openSectionIds: Set<string>) =>
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const getActiveLayoutNodes: (resolvedLayout: ResolvedLayoutResult, stepIndex: number, activeTabIndex: number, openSectionIds: Set<string>) => ResolvedFormLayoutNode[];
|
|
6
|
+
export declare const assertDisclosureSection: (disclosureSections: readonly {
|
|
6
7
|
id: string;
|
|
7
8
|
}[], sectionId: string) => void;
|
|
8
|
-
export declare const assertAccordionLayout: (resolvedLayout: ResolvedLayoutResult) => void;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PrimitiveDescriptorRegistry } from '../primitives';
|
|
2
2
|
import { FormController } from '../runtime';
|
|
3
3
|
import { ResolvedLayoutResult } from './layout';
|
|
4
4
|
import { FormViewSnapshot } from './types';
|
|
5
5
|
type SnapshotCacheOptions = {
|
|
6
6
|
form: FormController;
|
|
7
|
-
|
|
7
|
+
descriptorRegistry: PrimitiveDescriptorRegistry;
|
|
8
8
|
resolvedLayout: ResolvedLayoutResult;
|
|
9
9
|
getStepIndex: () => number;
|
|
10
10
|
getActiveTabIndex: () => number;
|
|
11
11
|
getOpenSectionIds: () => Set<string>;
|
|
12
12
|
};
|
|
13
|
-
export declare const createFormViewSnapshotCache: ({ form,
|
|
13
|
+
export declare const createFormViewSnapshotCache: ({ form, descriptorRegistry, resolvedLayout, getStepIndex, getActiveTabIndex, getOpenSectionIds, }: SnapshotCacheOptions) => (() => FormViewSnapshot);
|
|
14
14
|
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PrimitiveDescriptorRegistry } from '../primitives';
|
|
2
2
|
import { FormController } from '../runtime';
|
|
3
3
|
import { FormViewSnapshot } from './types';
|
|
4
4
|
import { ResolvedLayoutResult } from './layout';
|
|
5
5
|
type BuildSnapshotOptions = {
|
|
6
6
|
form: FormController;
|
|
7
|
-
|
|
7
|
+
descriptorRegistry: PrimitiveDescriptorRegistry;
|
|
8
8
|
resolvedLayout: ResolvedLayoutResult;
|
|
9
9
|
stepIndex: number;
|
|
10
10
|
activeTabIndex: number;
|
|
11
11
|
openSectionIds: Set<string>;
|
|
12
12
|
};
|
|
13
|
-
export declare const buildFormViewSnapshot: ({ form,
|
|
14
|
-
export declare const createViewState: (form: FormController, layout: ResolvedLayoutResult["layout"], stepIndex: number, activeTabIndex: number, openSectionIds: Set<string>) => import('./view-types').FormViewState;
|
|
13
|
+
export declare const buildFormViewSnapshot: ({ form, descriptorRegistry, resolvedLayout, stepIndex, activeTabIndex, openSectionIds, }: BuildSnapshotOptions) => FormViewSnapshot;
|
|
14
|
+
export declare const createViewState: (form: FormController, layout: ResolvedLayoutResult["layout"], stepIndex: number, activeTabIndex: number, openSectionIds: Set<string>) => import('./view-core-types').FormViewState;
|
|
15
15
|
export {};
|
|
@@ -1,172 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ExplanationDescriptor, FieldDescriptor, PresentationRegistry, ReportDescriptor } from '../presentation';
|
|
3
|
-
import { ExplanationController, ExplanationStateSnapshot, FieldController, FieldStateSnapshot, FormController, FormState, FormValidationResult, Registry, ReportController, ReportStateSnapshot, SubmitOptions, SubmitResult } from '../runtime';
|
|
4
|
-
import { PrimitiveRegistry, PrimitiveTextOverrides } from '../primitives';
|
|
5
|
-
import { LayoutReferences } from './layout-utils';
|
|
6
|
-
import { FormLayoutConfig, ResolvedFormLayout, ResolvedFormLayoutNode } from './layout-types';
|
|
7
|
-
import { MountFormOptions, KitLabels } from './mount-types';
|
|
8
|
-
import { PanelState } from './panel-nav';
|
|
9
|
-
import { WizardLabels, WizardTextOverrides } from './wizard-constants';
|
|
10
|
-
export interface WizardState {
|
|
11
|
-
stepIndex: number;
|
|
12
|
-
stepCount: number;
|
|
13
|
-
currentStepId: string;
|
|
14
|
-
canNext: boolean;
|
|
15
|
-
canPrev: boolean;
|
|
16
|
-
isLastStep: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface TabsState {
|
|
19
|
-
activeTabIndex: number;
|
|
20
|
-
tabCount: number;
|
|
21
|
-
currentTabId: string;
|
|
22
|
-
canGoNext: boolean;
|
|
23
|
-
canGoPrev: boolean;
|
|
24
|
-
}
|
|
25
|
-
export interface AccordionState {
|
|
26
|
-
openSectionIds: string[];
|
|
27
|
-
sectionCount: number;
|
|
28
|
-
}
|
|
29
|
-
export interface FormViewFieldItem {
|
|
30
|
-
id: string;
|
|
31
|
-
kind: string;
|
|
32
|
-
config: FieldController["config"];
|
|
33
|
-
controller: FieldController;
|
|
34
|
-
state: FieldStateSnapshot;
|
|
35
|
-
descriptor: FieldDescriptor;
|
|
36
|
-
stepId: string | null;
|
|
37
|
-
tabId: string | null;
|
|
38
|
-
visibleInLayout: boolean;
|
|
39
|
-
}
|
|
40
|
-
export interface FormViewReportItem {
|
|
41
|
-
id: string;
|
|
42
|
-
kind: string;
|
|
43
|
-
config: ReportController["config"];
|
|
44
|
-
controller: ReportController;
|
|
45
|
-
state: ReportStateSnapshot;
|
|
46
|
-
descriptor: ReportDescriptor | null;
|
|
47
|
-
stepId: string | null;
|
|
48
|
-
tabId: string | null;
|
|
49
|
-
visibleInLayout: boolean;
|
|
50
|
-
}
|
|
51
|
-
export interface FormViewExplanationItem {
|
|
52
|
-
id: string;
|
|
53
|
-
kind: string;
|
|
54
|
-
config: ExplanationController["config"];
|
|
55
|
-
controller: ExplanationController;
|
|
56
|
-
state: ExplanationStateSnapshot;
|
|
57
|
-
descriptor: ExplanationDescriptor | null;
|
|
58
|
-
stepId: string | null;
|
|
59
|
-
tabId: string | null;
|
|
60
|
-
visibleInLayout: boolean;
|
|
61
|
-
}
|
|
62
|
-
export interface FormViewState {
|
|
63
|
-
form: FormState;
|
|
64
|
-
wizard: WizardState | null;
|
|
65
|
-
tabs: TabsState | null;
|
|
66
|
-
accordion: AccordionState | null;
|
|
67
|
-
}
|
|
68
|
-
export interface FormViewSnapshot {
|
|
69
|
-
form: FormState;
|
|
70
|
-
layout: ResolvedFormLayout;
|
|
71
|
-
fields: FormViewFieldItem[];
|
|
72
|
-
reports: FormViewReportItem[];
|
|
73
|
-
explanations: FormViewExplanationItem[];
|
|
74
|
-
wizard: WizardState | null;
|
|
75
|
-
tabs: TabsState | null;
|
|
76
|
-
accordion: AccordionState | null;
|
|
77
|
-
}
|
|
78
|
-
export interface CreateFormViewOptions extends Omit<MountFormOptions, "layout"> {
|
|
79
|
-
layout?: FormLayoutConfig;
|
|
80
|
-
}
|
|
81
|
-
export interface FormViewController {
|
|
82
|
-
readonly form: FormController;
|
|
83
|
-
readonly engineRegistry: Registry;
|
|
84
|
-
readonly presentationRegistry: PresentationRegistry;
|
|
85
|
-
readonly primitiveRegistry: PrimitiveRegistry;
|
|
86
|
-
readonly designSystemRegistry: DesignSystemRegistry;
|
|
87
|
-
readonly state: FormViewState;
|
|
88
|
-
getSnapshot(): FormViewSnapshot;
|
|
89
|
-
getNodeById(id: string): ResolvedFormLayoutNode | undefined;
|
|
90
|
-
getField(id: string): FormViewFieldItem | undefined;
|
|
91
|
-
getReport(id: string): FormViewReportItem | undefined;
|
|
92
|
-
getExplanation(id: string): FormViewExplanationItem | undefined;
|
|
93
|
-
getVisibleFields(): FormViewFieldItem[];
|
|
94
|
-
getVisibleReports(): FormViewReportItem[];
|
|
95
|
-
getVisibleExplanations(): FormViewExplanationItem[];
|
|
96
|
-
getActiveLayoutNodes(): ResolvedFormLayoutNode[];
|
|
97
|
-
getLayoutReferences(): LayoutReferences;
|
|
98
|
-
validate(): Promise<FormValidationResult>;
|
|
99
|
-
submit(options?: SubmitOptions): Promise<SubmitResult>;
|
|
100
|
-
reset(): void;
|
|
101
|
-
subscribe(listener: (snapshot: FormViewSnapshot) => void): () => void;
|
|
102
|
-
nextStep(): Promise<boolean>;
|
|
103
|
-
prevStep(): void;
|
|
104
|
-
goToStep(stepId: string): Promise<boolean>;
|
|
105
|
-
setActiveTab(tabId: string): void;
|
|
106
|
-
nextTab(): boolean;
|
|
107
|
-
prevTab(): boolean;
|
|
108
|
-
toggleSection(sectionId: string): void;
|
|
109
|
-
openSection(sectionId: string): void;
|
|
110
|
-
closeSection(sectionId: string): void;
|
|
111
|
-
openAllSections(): void;
|
|
112
|
-
closeAllSections(): void;
|
|
113
|
-
}
|
|
114
|
-
export interface WizardMountUiOptions {
|
|
115
|
-
labels?: WizardLabels;
|
|
116
|
-
text?: WizardTextOverrides;
|
|
117
|
-
primitiveText?: PrimitiveTextOverrides;
|
|
118
|
-
designSystem?: DesignSystemConfig;
|
|
119
|
-
designSystemRegistry?: DesignSystemRegistry;
|
|
120
|
-
onDesignSystemChange?: (resolved: ResolvedDesignSystem) => void;
|
|
121
|
-
}
|
|
122
|
-
export type MountWizardFormOptions = ({
|
|
123
|
-
view: FormViewController;
|
|
124
|
-
} & WizardMountUiOptions) | (CreateFormViewOptions & WizardMountUiOptions & {
|
|
125
|
-
layout: import('./layout-types').WizardLayoutConfig;
|
|
126
|
-
});
|
|
127
|
-
export interface MountedWizardForm {
|
|
128
|
-
readonly view: FormViewController;
|
|
129
|
-
readonly form: FormController;
|
|
130
|
-
readonly host: HTMLElement;
|
|
131
|
-
readonly designSystem: AttachedDesignSystem;
|
|
132
|
-
unmount(): void;
|
|
133
|
-
}
|
|
134
|
-
export interface TabsMountUiOptions {
|
|
135
|
-
labels?: KitLabels;
|
|
136
|
-
primitiveText?: PrimitiveTextOverrides;
|
|
137
|
-
designSystem?: DesignSystemConfig;
|
|
138
|
-
designSystemRegistry?: DesignSystemRegistry;
|
|
139
|
-
onDesignSystemChange?: (resolved: ResolvedDesignSystem) => void;
|
|
140
|
-
}
|
|
141
|
-
export type MountTabsFormOptions = ({
|
|
142
|
-
view: FormViewController;
|
|
143
|
-
} & TabsMountUiOptions) | (CreateFormViewOptions & TabsMountUiOptions & {
|
|
144
|
-
layout: import('./layout-types').TabsLayoutConfig;
|
|
145
|
-
});
|
|
146
|
-
export interface MountedTabsForm {
|
|
147
|
-
readonly view: FormViewController;
|
|
148
|
-
readonly form: FormController;
|
|
149
|
-
readonly host: HTMLElement;
|
|
150
|
-
readonly designSystem: AttachedDesignSystem;
|
|
151
|
-
unmount(): void;
|
|
152
|
-
}
|
|
153
|
-
export interface AccordionMountUiOptions {
|
|
154
|
-
labels?: KitLabels;
|
|
155
|
-
primitiveText?: PrimitiveTextOverrides;
|
|
156
|
-
designSystem?: DesignSystemConfig;
|
|
157
|
-
designSystemRegistry?: DesignSystemRegistry;
|
|
158
|
-
onDesignSystemChange?: (resolved: ResolvedDesignSystem) => void;
|
|
159
|
-
}
|
|
160
|
-
export type MountAccordionFormOptions = ({
|
|
161
|
-
view: FormViewController;
|
|
162
|
-
} & AccordionMountUiOptions) | (CreateFormViewOptions & AccordionMountUiOptions & {
|
|
163
|
-
layout: import('./layout-types').AccordionLayoutConfig;
|
|
164
|
-
});
|
|
165
|
-
export interface MountedAccordionForm {
|
|
166
|
-
readonly view: FormViewController;
|
|
167
|
-
readonly form: FormController;
|
|
168
|
-
readonly host: HTMLElement;
|
|
169
|
-
readonly designSystem: AttachedDesignSystem;
|
|
170
|
-
unmount(): void;
|
|
171
|
-
}
|
|
172
|
-
export type { LayoutReferences, PanelState };
|
|
1
|
+
export type { DisclosureState, CreateFormViewOptions, FormViewController, FormViewFieldItem, FormViewReportItem, FormViewSnapshot, FormViewState, LayoutReferences, PanelState, TabsState, WizardState, } from './view-core-types';
|
package/dist/types/kit/view.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
type InternalCreateFormViewOptions = CreateFormViewOptions & {
|
|
4
|
-
presentationRegistry?: PresentationRegistry;
|
|
5
|
-
behaviors?: import('../runtime').RuntimeBehavior[];
|
|
6
|
-
};
|
|
7
|
-
export declare const createFormView: (options: InternalCreateFormViewOptions) => FormViewController;
|
|
8
|
-
export {};
|
|
1
|
+
import { CreateFormViewOptions, FormViewController } from './view-core-types';
|
|
2
|
+
export declare const createFormView: (options: CreateFormViewOptions) => FormViewController;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import { PrimitiveText } from '../primitives
|
|
3
|
-
import { PrimitiveRegistry } from '../primitives/types';
|
|
2
|
+
import { PrimitiveRegistry, PrimitiveText } from '../primitives';
|
|
4
3
|
import { kitTagNames } from './constants';
|
|
5
4
|
import { FormViewController } from './types';
|
|
6
5
|
export declare class KitWizardElement extends LitElement {
|
|
@@ -15,5 +15,5 @@ export declare abstract class PrimitiveAsyncReportElement extends PrimitiveRepor
|
|
|
15
15
|
protected get transportResultStatus(): PrimitiveAsyncReportStatus;
|
|
16
16
|
protected get transportResult(): unknown;
|
|
17
17
|
protected get transportError(): string | null;
|
|
18
|
-
protected renderTransportPanel(text: PrimitiveText): import('lit').TemplateResult<1
|
|
18
|
+
protected renderTransportPanel(text: PrimitiveText): typeof nothing | import('lit').TemplateResult<1>;
|
|
19
19
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { LitElement, nothing, CSSResultGroup, TemplateResult } from 'lit';
|
|
2
|
-
import { FieldDescriptor } from '
|
|
3
|
-
import {
|
|
2
|
+
import { FieldDescriptor } from './descriptors';
|
|
3
|
+
import { PrimitiveFieldController } from './controller-types';
|
|
4
4
|
import { PrimitiveText } from './constants';
|
|
5
5
|
import { PrimitiveFieldRenderContext } from './types';
|
|
6
6
|
export declare abstract class PrimitiveFieldElement extends LitElement {
|
|
7
7
|
static styles: CSSResultGroup;
|
|
8
|
-
accessor controller:
|
|
8
|
+
accessor controller: PrimitiveFieldController | undefined;
|
|
9
9
|
accessor descriptor: FieldDescriptor | null;
|
|
10
10
|
accessor context: PrimitiveFieldRenderContext | undefined;
|
|
11
11
|
accessor text: PrimitiveText;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { LitElement, CSSResultGroup } from 'lit';
|
|
2
|
-
import { ReportDescriptor } from '
|
|
3
|
-
import {
|
|
2
|
+
import { ReportDescriptor } from './descriptors';
|
|
3
|
+
import { PrimitiveReportController } from './controller-types';
|
|
4
4
|
import { PrimitiveText } from './constants';
|
|
5
5
|
import { PrimitiveReportRenderContext, PrimitiveReportRequest, PrimitiveReportTransport } from './types';
|
|
6
6
|
export declare abstract class PrimitiveReportElement extends LitElement {
|
|
7
7
|
static styles: CSSResultGroup;
|
|
8
|
-
accessor controller:
|
|
8
|
+
accessor controller: PrimitiveReportController | undefined;
|
|
9
9
|
accessor descriptor: ReportDescriptor | null;
|
|
10
10
|
accessor context: PrimitiveReportRenderContext | undefined;
|
|
11
11
|
accessor text: PrimitiveText;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { nothing, TemplateResult } from 'lit';
|
|
2
|
+
import { DescriptorNode, DescriptorSummary } from '../descriptors';
|
|
3
|
+
export declare const renderDescriptorSummary: (summary: DescriptorSummary | null | undefined, fallbackTitle?: string) => TemplateResult | typeof nothing;
|
|
4
|
+
export declare const renderDescriptorNodes: (nodes: DescriptorNode[]) => TemplateResult | typeof nothing;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PrimitiveFieldController } from '../controller-types';
|
|
2
2
|
export declare const findFieldFrame: (root: ParentNode, fieldId: string) => HTMLElement | null;
|
|
3
3
|
export declare const scrollFieldFrameIntoView: (frame: HTMLElement | null) => Promise<boolean>;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const focusPrimitiveField: (host: HTMLElement, fieldId: string) => Promise<boolean>;
|
|
5
|
+
export declare const findFirstInvalidField: (fields: readonly PrimitiveFieldController[]) => PrimitiveFieldController | null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PrimitiveFieldStateSnapshot } from '../controller-types';
|
|
2
2
|
import { PrimitiveText } from '../constants';
|
|
3
3
|
export declare const resolveFieldFeedbackComponent: (component: string, props: Record<string, unknown>) => string;
|
|
4
4
|
export declare const resolveCategorySelection: (props: Record<string, unknown>, value: unknown) => {
|
|
5
5
|
label: string;
|
|
6
6
|
value: string;
|
|
7
7
|
} | null;
|
|
8
|
-
export declare const hasIntroducedValue: (component: string, props: Record<string, unknown>, state:
|
|
9
|
-
export declare const createFieldSuccessMessage: (component: string, props: Record<string, unknown>, state:
|
|
8
|
+
export declare const hasIntroducedValue: (component: string, props: Record<string, unknown>, state: PrimitiveFieldStateSnapshot, defaultValue: unknown) => boolean;
|
|
9
|
+
export declare const createFieldSuccessMessage: (component: string, props: Record<string, unknown>, state: PrimitiveFieldStateSnapshot, text: PrimitiveText) => string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import {
|
|
3
|
-
import { FieldDescriptor } from '
|
|
2
|
+
import { PrimitiveFieldController } from '../controller-types';
|
|
3
|
+
import { FieldDescriptor } from '../descriptors';
|
|
4
4
|
import { primitiveTagNames, PrimitiveText } from '../constants';
|
|
5
5
|
import { PrimitiveRegistry } from '../types';
|
|
6
6
|
export declare class PrimitiveFieldFrameElement extends LitElement {
|
|
7
7
|
#private;
|
|
8
8
|
static styles: import('lit').CSSResult;
|
|
9
|
-
accessor controller:
|
|
9
|
+
accessor controller: PrimitiveFieldController | undefined;
|
|
10
10
|
accessor descriptor: FieldDescriptor | null;
|
|
11
11
|
accessor registry: PrimitiveRegistry | undefined;
|
|
12
12
|
accessor text: PrimitiveText;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import { PrimitiveFormController } from '../controller-types';
|
|
3
3
|
import { primitiveTagNames, PrimitiveText } from '../constants';
|
|
4
4
|
export declare class PrimitiveFormErrorsElement extends LitElement {
|
|
5
5
|
#private;
|
|
6
6
|
static styles: import('lit').CSSResult;
|
|
7
|
-
accessor form:
|
|
7
|
+
accessor form: PrimitiveFormController | undefined;
|
|
8
8
|
accessor text: PrimitiveText;
|
|
9
9
|
private accessor formErrors;
|
|
10
10
|
protected willUpdate(changedProperties: Map<string, unknown>): void;
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import { FieldDescriptor,
|
|
2
|
-
import {
|
|
1
|
+
import { FieldDescriptor, PrimitiveDescriptorRegistry, ReportDescriptor } from '../descriptors';
|
|
2
|
+
import { PrimitiveFormController, PrimitiveReportController } from '../controller-types';
|
|
3
3
|
export type PresentedField = {
|
|
4
|
-
controller: NonNullable<ReturnType<
|
|
4
|
+
controller: NonNullable<ReturnType<PrimitiveFormController["getField"]>>;
|
|
5
5
|
descriptor: FieldDescriptor;
|
|
6
6
|
};
|
|
7
7
|
export type PresentedReport = {
|
|
8
|
-
controller:
|
|
8
|
+
controller: PrimitiveReportController;
|
|
9
9
|
descriptor: ReportDescriptor | null;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
descriptor: import('../../presentation').ExplanationDescriptor | null;
|
|
14
|
-
};
|
|
15
|
-
export declare const presentVisibleFields: (form: FormController, fieldIds: readonly string[], presentationRegistry: PresentationRegistry | undefined) => PresentedField[];
|
|
16
|
-
export declare const presentVisibleReports: (form: FormController, reportIds: readonly string[], reportPane: "auto" | "always" | "hidden", presentationRegistry: PresentationRegistry | undefined) => PresentedReport[];
|
|
17
|
-
export declare const presentExplanations: (form: FormController, explanationIds: readonly string[], presentationRegistry: PresentationRegistry | undefined) => PresentedExplanation[];
|
|
11
|
+
export declare const presentVisibleFields: (form: PrimitiveFormController, fieldIds: readonly string[], descriptorRegistry: PrimitiveDescriptorRegistry | undefined) => PresentedField[];
|
|
12
|
+
export declare const presentVisibleReports: (form: PrimitiveFormController, reportIds: readonly string[], reportPane: "auto" | "always" | "hidden", descriptorRegistry: PrimitiveDescriptorRegistry | undefined) => PresentedReport[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PrimitiveFormController, PrimitiveFormStatus, PrimitiveReportController } from '../controller-types';
|
|
2
2
|
export type FormRenderState = {
|
|
3
|
-
status:
|
|
3
|
+
status: PrimitiveFormStatus;
|
|
4
4
|
submitCount: number;
|
|
5
5
|
hasFormErrors: boolean;
|
|
6
6
|
hasLastResult: boolean;
|
|
@@ -10,10 +10,8 @@ export type FormRenderState = {
|
|
|
10
10
|
submissionSessionMessageCount?: number;
|
|
11
11
|
visibleFieldIds: string[];
|
|
12
12
|
visibleReportIds: string[];
|
|
13
|
-
explanationIds: string[];
|
|
14
13
|
reportStateKeys: string[];
|
|
15
|
-
explanationStateKeys: string[];
|
|
16
14
|
};
|
|
17
15
|
export declare const sameFormRenderState: (left: FormRenderState, right: FormRenderState) => boolean;
|
|
18
|
-
export declare const selectFormRenderState: (form:
|
|
19
|
-
export declare const resolveVisibleReports: (form:
|
|
16
|
+
export declare const selectFormRenderState: (form: PrimitiveFormController) => FormRenderState;
|
|
17
|
+
export declare const resolveVisibleReports: (form: PrimitiveFormController, visibleReportIds: string[], reportPane: "auto" | "always" | "hidden") => readonly PrimitiveReportController[];
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { FormController } from '../../runtime';
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import { PrimitiveFormController } from '../controller-types';
|
|
4
3
|
import { PrimitiveText } from '../constants';
|
|
5
4
|
import { PrimitiveRegistry, PrimitiveReportTransport } from '../types';
|
|
6
5
|
import { FormRenderState } from './form-root-state';
|
|
7
6
|
import { PresentedField, PresentedReport } from './form-root-presenters';
|
|
8
|
-
export declare const renderExplanations: (form: FormController, state: FormRenderState, registry: PrimitiveRegistry | undefined, presentationRegistry: PresentationRegistry | undefined, text: PrimitiveText) => TemplateResult | typeof nothing;
|
|
9
7
|
export declare const renderStackedLayout: (options: {
|
|
10
|
-
form:
|
|
8
|
+
form: PrimitiveFormController;
|
|
11
9
|
state: FormRenderState;
|
|
12
10
|
visibleFields: readonly PresentedField[];
|
|
13
11
|
reportsToRender: readonly PresentedReport[];
|
|
14
12
|
showReports: boolean;
|
|
15
13
|
registry: PrimitiveRegistry | undefined;
|
|
16
|
-
presentationRegistry: PresentationRegistry | undefined;
|
|
17
14
|
text: PrimitiveText;
|
|
18
15
|
formLabel: string;
|
|
19
16
|
reportsLabel: string;
|
|
@@ -24,13 +21,12 @@ export declare const renderStackedLayout: (options: {
|
|
|
24
21
|
onSubmitRequest: () => Promise<void>;
|
|
25
22
|
}) => TemplateResult;
|
|
26
23
|
export declare const renderSplitLayout: (options: {
|
|
27
|
-
form:
|
|
24
|
+
form: PrimitiveFormController;
|
|
28
25
|
state: FormRenderState;
|
|
29
26
|
visibleFields: readonly PresentedField[];
|
|
30
27
|
reportsToRender: readonly PresentedReport[];
|
|
31
28
|
showReports: boolean;
|
|
32
29
|
registry: PrimitiveRegistry | undefined;
|
|
33
|
-
presentationRegistry: PresentationRegistry | undefined;
|
|
34
30
|
text: PrimitiveText;
|
|
35
31
|
formLabel: string;
|
|
36
32
|
reportsLabel: string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { PrimitiveDescriptorRegistry } from '../descriptors';
|
|
3
|
+
import { PrimitiveFormController } from '../controller-types';
|
|
4
4
|
import { primitiveTagNames, PrimitiveText } from '../constants';
|
|
5
5
|
import { PrimitiveLayout, PrimitiveRegistry, PrimitiveReportTransport } from '../types';
|
|
6
6
|
export declare class PrimitiveFormElement extends LitElement {
|
|
7
7
|
#private;
|
|
8
8
|
static styles: import('lit').CSSResult;
|
|
9
|
-
accessor form:
|
|
9
|
+
accessor form: PrimitiveFormController | undefined;
|
|
10
10
|
accessor registry: PrimitiveRegistry | undefined;
|
|
11
|
-
accessor
|
|
11
|
+
accessor descriptorRegistry: PrimitiveDescriptorRegistry | undefined;
|
|
12
12
|
accessor layout: PrimitiveLayout;
|
|
13
13
|
accessor formLabel: string;
|
|
14
14
|
accessor reportsLabel: string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import {
|
|
3
|
-
import { ReportDescriptor } from '
|
|
2
|
+
import { PrimitiveReportController, PrimitiveSubmitResult } from '../controller-types';
|
|
3
|
+
import { ReportDescriptor } from '../descriptors';
|
|
4
4
|
import { primitiveTagNames, PrimitiveText } from '../constants';
|
|
5
5
|
import { PrimitiveReportTransport, PrimitiveRegistry } from '../types';
|
|
6
6
|
export declare class PrimitiveReportFrameElement extends LitElement {
|
|
7
7
|
#private;
|
|
8
8
|
static styles: import('lit').CSSResult;
|
|
9
|
-
accessor controller:
|
|
9
|
+
accessor controller: PrimitiveReportController | undefined;
|
|
10
10
|
accessor registry: PrimitiveRegistry | undefined;
|
|
11
11
|
accessor text: PrimitiveText;
|
|
12
12
|
accessor transport: PrimitiveReportTransport | undefined;
|
|
13
|
-
accessor lastResult:
|
|
13
|
+
accessor lastResult: PrimitiveSubmitResult | null;
|
|
14
14
|
accessor descriptor: ReportDescriptor | null;
|
|
15
15
|
private accessor resolvedDescriptor;
|
|
16
16
|
private accessor reportState;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import {
|
|
2
|
+
import { PrimitiveFormStatus } from '../controller-types';
|
|
3
3
|
import { primitiveTagNames } from '../constants';
|
|
4
4
|
export declare class PrimitiveSubmitButtonElement extends LitElement {
|
|
5
5
|
#private;
|
|
6
6
|
static styles: import('lit').CSSResult;
|
|
7
|
-
accessor status:
|
|
7
|
+
accessor status: PrimitiveFormStatus;
|
|
8
8
|
accessor idleLabel: string;
|
|
9
9
|
accessor validatingLabel: string;
|
|
10
10
|
accessor submittingLabel: string;
|