@epam/ai-dial-builder-form 1.2.0-dev.176 → 1.2.0-dev.181
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/components/DeploymentCreationForm/DeploymentCreationForm.d.ts +5 -1
- package/components/DeploymentCreationForm/DeploymentCreationForm.d.ts.map +1 -1
- package/components/EntityEditor/EntityEditor.d.ts +4 -0
- package/components/EntityEditor/EntityEditor.d.ts.map +1 -0
- package/components/MetadataForm/MetadataForm.d.ts +4 -0
- package/components/MetadataForm/MetadataForm.d.ts.map +1 -0
- package/constants/metadata-form.d.ts +7 -0
- package/constants/metadata-form.d.ts.map +1 -0
- package/constants/public-class-names.d.ts +4 -0
- package/constants/public-class-names.d.ts.map +1 -1
- package/hooks/useMetadataForm.d.ts +13 -0
- package/hooks/useMetadataForm.d.ts.map +1 -0
- package/index.css +1 -1
- package/index.d.ts +8 -0
- package/index.d.ts.map +1 -1
- package/index.js +418 -179
- package/models/deployment-creation-form.d.ts +29 -16
- package/models/deployment-creation-form.d.ts.map +1 -1
- package/models/entity-editor-props.d.ts +70 -0
- package/models/entity-editor-props.d.ts.map +1 -0
- package/models/metadata-field.d.ts +18 -0
- package/models/metadata-field.d.ts.map +1 -0
- package/models/metadata-form-props.d.ts +62 -0
- package/models/metadata-form-props.d.ts.map +1 -0
- package/models/use-metadata-form.d.ts +36 -0
- package/models/use-metadata-form.d.ts.map +1 -0
- package/package.json +2 -2
- package/utils/metadata-form.d.ts +7 -0
- package/utils/metadata-form.d.ts.map +1 -0
|
@@ -1,21 +1,10 @@
|
|
|
1
|
+
import { LocaleOption, LocalizedTextEntry } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { MetadataField } from './metadata-field';
|
|
1
4
|
/** One additional (non-primary) locale's name/description translation, edited via the "Add locale" popup. */
|
|
2
|
-
export
|
|
3
|
-
/** Stable client-side id for list rendering; not part of the persisted locale map. */
|
|
4
|
-
id: string;
|
|
5
|
-
/** Locale code this entry translates into (e.g. `'de'`). */
|
|
6
|
-
language: string;
|
|
7
|
-
/** Translated name for this locale. */
|
|
8
|
-
name: string;
|
|
9
|
-
/** Translated description for this locale. */
|
|
10
|
-
description: string;
|
|
11
|
-
}
|
|
5
|
+
export type DeploymentCreationFormLocaleEntry = LocalizedTextEntry;
|
|
12
6
|
/** A selectable language option for an additional-locale row. */
|
|
13
|
-
export
|
|
14
|
-
/** Locale code (e.g. `'de'`). */
|
|
15
|
-
code: string;
|
|
16
|
-
/** Display label for the option (e.g. `'DE'`). */
|
|
17
|
-
label: string;
|
|
18
|
-
}
|
|
7
|
+
export type DeploymentCreationFormLocaleOption = LocaleOption;
|
|
19
8
|
/** Field values shared by Quick App and Toolset creation's General step. */
|
|
20
9
|
export interface DeploymentCreationFormValues {
|
|
21
10
|
/** Display name of the entity being created. */
|
|
@@ -137,5 +126,29 @@ export interface DeploymentCreationFormProps {
|
|
|
137
126
|
styles?: DeploymentCreationFormStyles;
|
|
138
127
|
/** Selectable language options for additional-locale rows. Defaults to an empty list (no locales addable). */
|
|
139
128
|
availableLocaleOptions?: DeploymentCreationFormLocaleOption[];
|
|
129
|
+
/**
|
|
130
|
+
* Fields to render, always in the fixed order Avatar, Name + Version,
|
|
131
|
+
* Description, Locales, Tags. Defaults to every field. When `Version` is
|
|
132
|
+
* absent, Name takes the full row.
|
|
133
|
+
*/
|
|
134
|
+
fields?: readonly MetadataField[];
|
|
135
|
+
/** Renders the name field read-only, e.g. when the entity cannot be renamed after creation. */
|
|
136
|
+
isNameReadOnly?: boolean;
|
|
137
|
+
/** Helper text rendered under the name field. */
|
|
138
|
+
nameCaption?: string;
|
|
139
|
+
/** Marks the description field as required. The host still owns the validation. */
|
|
140
|
+
isDescriptionRequired?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Wraps the Description textarea, e.g. in a label row with extra actions.
|
|
143
|
+
* When set, the textarea renders without its own label, so the returned node
|
|
144
|
+
* must label the control whose id is `fieldId`.
|
|
145
|
+
*/
|
|
146
|
+
renderDescription?: (textarea: ReactNode, fieldId: string) => ReactNode;
|
|
147
|
+
/**
|
|
148
|
+
* Changes on every submit attempt; each change moves focus to the first
|
|
149
|
+
* invalid field. When set, errors appearing for any other reason (e.g. on
|
|
150
|
+
* blur) never move focus. When unset, focus moves when errors first appear.
|
|
151
|
+
*/
|
|
152
|
+
focusRequestKey?: number;
|
|
140
153
|
}
|
|
141
154
|
//# sourceMappingURL=deployment-creation-form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment-creation-form.d.ts","sourceRoot":"","sources":["../../src/models/deployment-creation-form.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"deployment-creation-form.d.ts","sourceRoot":"","sources":["../../src/models/deployment-creation-form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,6GAA6G;AAC7G,MAAM,MAAM,iCAAiC,GAAG,kBAAkB,CAAC;AAEnE,iEAAiE;AACjE,MAAM,MAAM,kCAAkC,GAAG,YAAY,CAAC;AAE9D,4EAA4E;AAC5E,MAAM,WAAW,4BAA4B;IAC3C,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,qGAAqG;IACrG,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,uGAAuG;IACvG,YAAY,EAAE,iCAAiC,EAAE,CAAC;CACnD;AAED,kEAAkE;AAClE,MAAM,WAAW,iCAAiC;IAChD,wCAAwC;IACxC,I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AAC,EAAE,MAAM,CAAC;IACrB,mFAAmF;IACnF,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,SAAS,CAAC;IACxE;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { EditorLayoutStyles } from './editor-layout-props';
|
|
3
|
+
import { EditorSectionStyles } from './editor-section-props';
|
|
4
|
+
/** Text labels for `EntityEditor`. All strings have English defaults. */
|
|
5
|
+
export interface EntityEditorLabels {
|
|
6
|
+
/** Heading of the left section. Defaults to `'Metadata'`. */
|
|
7
|
+
metadataTitle?: string;
|
|
8
|
+
/** Heading of the right section when `setupTitle` is not set. Defaults to `'Setup'`. */
|
|
9
|
+
setupTitle?: string;
|
|
10
|
+
/** Label of the Cancel button. Defaults to `'Cancel'`. */
|
|
11
|
+
cancelLabel?: string;
|
|
12
|
+
/** Accessible name of the back-arrow button. Defaults to `'Back'`. */
|
|
13
|
+
backAriaLabel?: string;
|
|
14
|
+
/** SR-only text announced while submitting. Defaults to `'Saving'`. */
|
|
15
|
+
savingStatusLabel?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Style overrides for `EntityEditor`. */
|
|
18
|
+
export interface EntityEditorStyles {
|
|
19
|
+
/** Overrides forwarded to the inner `EditorLayout`. */
|
|
20
|
+
layout?: EditorLayoutStyles;
|
|
21
|
+
/** Overrides forwarded to both inner `EditorSection`s. */
|
|
22
|
+
section?: EditorSectionStyles;
|
|
23
|
+
}
|
|
24
|
+
/** Props for `EntityEditor`. */
|
|
25
|
+
export interface EntityEditorProps {
|
|
26
|
+
/** Heading text rendered as `<h1>` in the header row. */
|
|
27
|
+
title: string;
|
|
28
|
+
/** Called when the back-arrow button is clicked. */
|
|
29
|
+
onBack: () => void;
|
|
30
|
+
/** Called when the Cancel button is clicked. */
|
|
31
|
+
onCancel: () => void;
|
|
32
|
+
/** Called when the primary button is clicked. */
|
|
33
|
+
onSubmit: () => void;
|
|
34
|
+
/** Label of the primary button, resolved by the host (e.g. Create or Save). */
|
|
35
|
+
submitLabel: string;
|
|
36
|
+
/** Disables Cancel and the primary button and announces the saving status. Defaults to `false`. */
|
|
37
|
+
isSubmitting?: boolean;
|
|
38
|
+
/** Disables the primary button for a host-owned readiness reason, never for validation. Defaults to `false`. */
|
|
39
|
+
isSubmitDisabled?: boolean;
|
|
40
|
+
/** Header actions rendered before Cancel, e.g. a Preview toggle. */
|
|
41
|
+
extraActions?: ReactNode;
|
|
42
|
+
/** Hides Cancel and the primary button so only `extraActions` remain. Defaults to `false`. */
|
|
43
|
+
hideStandardActions?: boolean;
|
|
44
|
+
/** Content of the Metadata section in the left column. */
|
|
45
|
+
metadata: ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* Heading of the Metadata section; overrides `labels.metadataTitle`.
|
|
48
|
+
* `null` renders the section without a heading, for a left column whose content carries its own.
|
|
49
|
+
*/
|
|
50
|
+
metadataTitle?: string | null;
|
|
51
|
+
/** Extra left-column content rendered below the Metadata section. */
|
|
52
|
+
metadataFooter?: ReactNode;
|
|
53
|
+
/** Content of the Setup section in the right column. When absent, the left column fills the width. */
|
|
54
|
+
setup?: ReactNode;
|
|
55
|
+
/** Heading of the Setup section; overrides `labels.setupTitle`. */
|
|
56
|
+
setupTitle?: string;
|
|
57
|
+
/** Inline error or conflict message, rendered in a `role="alert"` region above the Setup section. */
|
|
58
|
+
alert?: ReactNode;
|
|
59
|
+
/** Class added to the Metadata section root, e.g. an embedding editor's own public class. */
|
|
60
|
+
metadataSectionClassName?: string;
|
|
61
|
+
/** Class added to the Setup section root, e.g. an embedding editor's own public class. */
|
|
62
|
+
setupSectionClassName?: string;
|
|
63
|
+
/** Text labels with English defaults. */
|
|
64
|
+
labels?: EntityEditorLabels;
|
|
65
|
+
/** Style overrides. */
|
|
66
|
+
styles?: EntityEditorStyles;
|
|
67
|
+
/** `dir` attribute forwarded to the layout root for an explicit direction override. */
|
|
68
|
+
dir?: 'ltr' | 'rtl';
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=entity-editor-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-editor-props.d.ts","sourceRoot":"","sources":["../../src/models/entity-editor-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,yEAAyE;AACzE,MAAM,WAAW,kBAAkB;IACjC,6DAA6D;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IACjC,uDAAuD;IACvD,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,0DAA0D;IAC1D,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED,gCAAgC;AAChC,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,gDAAgD;IAChD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,iDAAiD;IACjD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,mGAAmG;IACnG,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gHAAgH;IAChH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oEAAoE;IACpE,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,8FAA8F;IAC9F,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,0DAA0D;IAC1D,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,qEAAqE;IACrE,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,sGAAsG;IACtG,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qGAAqG;IACrG,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,6FAA6F;IAC7F,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,0FAA0F;IAC1F,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,yCAAyC;IACzC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,uBAAuB;IACvB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,uFAAuF;IACvF,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;CACrB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** A field of the shared Metadata field set; an editor lists the ones its entity type has. */
|
|
2
|
+
export declare enum MetadataField {
|
|
3
|
+
/** The avatar preview and "Add avatar" control. */
|
|
4
|
+
Avatar = "avatar",
|
|
5
|
+
/** The required display name. */
|
|
6
|
+
Name = "name",
|
|
7
|
+
/** The version string, rendered beside Name. */
|
|
8
|
+
Version = "version",
|
|
9
|
+
/** The long-form description. */
|
|
10
|
+
Description = "description",
|
|
11
|
+
/** The additional-locale summary row and popup. */
|
|
12
|
+
Locales = "locales",
|
|
13
|
+
/** The free-entry tags. */
|
|
14
|
+
Tags = "tags"
|
|
15
|
+
}
|
|
16
|
+
/** Every Metadata field, in render order — the default when an editor does not narrow the set. */
|
|
17
|
+
export declare const ALL_METADATA_FIELDS: readonly MetadataField[];
|
|
18
|
+
//# sourceMappingURL=metadata-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata-field.d.ts","sourceRoot":"","sources":["../../src/models/metadata-field.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,oBAAY,aAAa;IACvB,mDAAmD;IACnD,MAAM,WAAW;IACjB,iCAAiC;IACjC,IAAI,SAAS;IACb,gDAAgD;IAChD,OAAO,YAAY;IACnB,iCAAiC;IACjC,WAAW,gBAAgB;IAC3B,mDAAmD;IACnD,OAAO,YAAY;IACnB,2BAA2B;IAC3B,IAAI,SAAS;CACd;AAED,kGAAkG;AAClG,eAAO,MAAM,mBAAmB,EAAE,SAAS,aAAa,EAOvD,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AttachResult } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { ComponentType, ReactNode } from 'react';
|
|
3
|
+
import { AvatarPickerFileManagerModalProps, AvatarPickerModalLabels } from './avatar-picker-modal';
|
|
4
|
+
import { DeploymentCreationFormFieldErrors, DeploymentCreationFormLabels, DeploymentCreationFormLocaleOption, DeploymentCreationFormValues } from './deployment-creation-form';
|
|
5
|
+
import { MetadataField } from './metadata-field';
|
|
6
|
+
/**
|
|
7
|
+
* Pre-translated labels for `MetadataForm`. Each group is optional and
|
|
8
|
+
* replaced as a whole; omitting one falls back to the library's English defaults.
|
|
9
|
+
*/
|
|
10
|
+
export interface MetadataFormLabels {
|
|
11
|
+
/** Labels for the embedded `DeploymentCreationForm` fields. */
|
|
12
|
+
form?: DeploymentCreationFormLabels;
|
|
13
|
+
/** Labels for the avatar picker modal. */
|
|
14
|
+
avatarPicker?: AvatarPickerModalLabels;
|
|
15
|
+
}
|
|
16
|
+
/** Host-supplied wiring for the avatar picker; every value is resolved by the host. */
|
|
17
|
+
export interface MetadataFormAvatarPicker {
|
|
18
|
+
/** Storage bucket whose files the avatar picker browses. */
|
|
19
|
+
bucket: string;
|
|
20
|
+
/** Host file-manager modal rendered inside the avatar picker. */
|
|
21
|
+
FileManagerModal: ComponentType<AvatarPickerFileManagerModalProps>;
|
|
22
|
+
/** Resolves the current icon value into the previewable URL the form renders. */
|
|
23
|
+
resolveIconUrl: (url: string) => string;
|
|
24
|
+
/** Returns the icon value to store for a picked file, or `undefined` to leave the icon unchanged. */
|
|
25
|
+
resolveAttachedIconUrl: (result: AttachResult) => string | undefined;
|
|
26
|
+
/** MIME types the avatar picker accepts. */
|
|
27
|
+
allowedMimeTypes: string[];
|
|
28
|
+
/** Maximum avatar file size in bytes. */
|
|
29
|
+
maxFileSizeBytes: number;
|
|
30
|
+
}
|
|
31
|
+
/** Props of `MetadataForm`. */
|
|
32
|
+
export interface MetadataFormProps {
|
|
33
|
+
/** Current metadata values. The component holds no field state of its own. */
|
|
34
|
+
values: DeploymentCreationFormValues;
|
|
35
|
+
/** Field error messages, already translated by the host. */
|
|
36
|
+
errors: DeploymentCreationFormFieldErrors;
|
|
37
|
+
/** Called with the changed subset of metadata values. */
|
|
38
|
+
onChange: (patch: Partial<DeploymentCreationFormValues>) => void;
|
|
39
|
+
/** Called when the Name field loses focus. */
|
|
40
|
+
onNameBlur?: () => void;
|
|
41
|
+
/** Called when the Version field loses focus. */
|
|
42
|
+
onVersionBlur?: () => void;
|
|
43
|
+
/** Avatar picker wiring. The Avatar field renders only when this is set and `fields` includes `Avatar`. */
|
|
44
|
+
avatarPicker?: MetadataFormAvatarPicker;
|
|
45
|
+
/** Locale options offered by the "Add locale" popup. Defaults to an empty list. */
|
|
46
|
+
availableLocaleOptions?: DeploymentCreationFormLocaleOption[];
|
|
47
|
+
/** Fields to render, in fixed order. Defaults to every field. */
|
|
48
|
+
fields?: readonly MetadataField[];
|
|
49
|
+
/** Renders the Name field read-only. Defaults to `false`. */
|
|
50
|
+
isNameReadOnly?: boolean;
|
|
51
|
+
/** Helper text rendered under the Name field. */
|
|
52
|
+
nameCaption?: string;
|
|
53
|
+
/** Marks the Description field as required. Defaults to `false`. */
|
|
54
|
+
isDescriptionRequired?: boolean;
|
|
55
|
+
/** Wraps the Description textarea, which then renders without its own label; see `DeploymentCreationFormProps.renderDescription`. */
|
|
56
|
+
renderDescription?: (textarea: ReactNode, fieldId: string) => ReactNode;
|
|
57
|
+
/** Changes on every submit attempt to move focus to the first invalid field; see `DeploymentCreationFormProps.focusRequestKey`. */
|
|
58
|
+
focusRequestKey?: number;
|
|
59
|
+
/** Pre-translated labels; each group falls back to English defaults. */
|
|
60
|
+
labels?: MetadataFormLabels;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=metadata-form-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata-form-props.d.ts","sourceRoot":"","sources":["../../src/models/metadata-form-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EACV,iCAAiC,EACjC,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,iCAAiC,EACjC,4BAA4B,EAC5B,kCAAkC,EAClC,4BAA4B,EAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,+DAA+D;IAC/D,IAAI,CAAC,EAAE,4BAA4B,CAAC;IACpC,0CAA0C;IAC1C,YAAY,CAAC,EAAE,uBAAuB,CAAC;CACxC;AAED,uFAAuF;AACvF,MAAM,WAAW,wBAAwB;IACvC,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,gBAAgB,EAAE,aAAa,CAAC,iCAAiC,CAA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ymentCreationFormValues } from './deployment-creation-form';
|
|
2
|
+
import { MetadataField } from './metadata-field';
|
|
3
|
+
import { DeploymentCreationFormErrorCodes, DeploymentCreationFormValidationOptions } from './validation';
|
|
4
|
+
/** Options accepted by `useMetadataForm`. */
|
|
5
|
+
export interface UseMetadataFormOptions {
|
|
6
|
+
/** Values the form starts from; applied once per `reseedKey`. */
|
|
7
|
+
initialValues: DeploymentCreationFormValues;
|
|
8
|
+
/** Pattern checks passed to `validateDeploymentCreationFields`. Defaults to none. */
|
|
9
|
+
validationOptions?: DeploymentCreationFormValidationOptions;
|
|
10
|
+
/** Changing this re-seeds the form from `initialValues` and clears touched state. */
|
|
11
|
+
reseedKey?: string | number;
|
|
12
|
+
}
|
|
13
|
+
/** State and actions returned by `useMetadataForm`. */
|
|
14
|
+
export interface UseMetadataFormResult {
|
|
15
|
+
/** Current metadata values. */
|
|
16
|
+
values: DeploymentCreationFormValues;
|
|
17
|
+
/** Merges a partial patch into `values`. */
|
|
18
|
+
setValues: (patch: Partial<DeploymentCreationFormValues>) => void;
|
|
19
|
+
/** Fields the user has left (blurred) at least once. */
|
|
20
|
+
touched: Partial<Record<MetadataField, boolean>>;
|
|
21
|
+
/** Marks one field as touched so its error becomes visible. */
|
|
22
|
+
markTouched: (field: MetadataField) => void;
|
|
23
|
+
/** Every validation error for the current values, visible or not. */
|
|
24
|
+
errorCodes: DeploymentCreationFormErrorCodes;
|
|
25
|
+
/** Errors for touched fields only, or for every field after `attemptSubmit`. */
|
|
26
|
+
visibleErrorCodes: DeploymentCreationFormErrorCodes;
|
|
27
|
+
/** Makes every error visible and returns whether the values are valid. */
|
|
28
|
+
attemptSubmit: () => boolean;
|
|
29
|
+
/** Number of submit attempts; pass it as `MetadataForm.focusRequestKey` to focus the first invalid field on each one. */
|
|
30
|
+
submitAttemptCount: number;
|
|
31
|
+
/** Whether `values` differ from the last seeded or reset values. */
|
|
32
|
+
isDirty: boolean;
|
|
33
|
+
/** Replaces the values and the dirty baseline, and clears touched state. Defaults to the current `initialValues`. */
|
|
34
|
+
reset: (values?: DeploymentCreationFormValues) => void;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=use-metadata-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-metadata-form.d.ts","sourceRoot":"","sources":["../../src/models/use-metadata-form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EACV,gCAAgC,EAChC,uCAAuC,EACxC,MAAM,cAAc,CAAC;AAEtB,6CAA6C;AAC7C,MAAM,WAAW,sBAAsB;IACrC,iEAAiE;IACjE,aAAa,EAAE,4BAA4B,CAAC;IAC5C,qFAAqF;IACrF,iBAAiB,CAAC,EAAE,uCAAuC,CAAC;IAC5D,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B;AAED,uDAAuD;AACvD,MAAM,WAAW,qBAAqB;IACpC,+BAA+B;IAC/B,MAAM,EAAE,4BAA4B,CAAC;IACrC,4CAA4C;IAC5C,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,4BAA4B,CAAC,KAAK,IAAI,CAAC;IAClE,wDAAwD;IACxD,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD,+DAA+D;IAC/D,WAAW,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,qEAAqE;IACrE,UAAU,EAAE,gCAAgC,CAAC;IAC7C,gFAAgF;IAChF,iBAAiB,EAAE,gCAAgC,CAAC;IACpD,0EAA0E;IAC1E,aAAa,EAAE,MAAM,OAAO,CAAC;IAC7B,yHAAyH;IACzH,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,OAAO,EAAE,OAAO,CAAC;IACjB,qHAAqH;IACrH,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;CACxD"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-builder-form",
|
|
3
3
|
"description": "Presentational builder form shells, editor layouts, and shared deployment field sets for composing and editing DIAL entities",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.181",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@tabler/icons-react": "^3.44.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
23
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.181",
|
|
24
24
|
"@epam/ai-dial-ui-kit": "^0.15.0-dev.21",
|
|
25
25
|
"react": "^19.2.8"
|
|
26
26
|
},
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DeploymentCreationFormValues } from '../models/deployment-creation-form';
|
|
2
|
+
import { DeploymentCreationFormErrorCodes } from '../models/validation';
|
|
3
|
+
/** Returns whether two metadata value sets hold the same field values. */
|
|
4
|
+
export declare const areMetadataValuesEqual: (left: DeploymentCreationFormValues, right: DeploymentCreationFormValues) => boolean;
|
|
5
|
+
/** Returns whether an error-code set holds no error. */
|
|
6
|
+
export declare const hasNoMetadataErrors: (errorCodes: DeploymentCreationFormErrorCodes) => boolean;
|
|
7
|
+
//# sourceMappingURL=metadata-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata-form.d.ts","sourceRoot":"","sources":["../../src/utils/metadata-form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,4BAA4B,EAC7B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAe7E,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB,GACjC,MAAM,4BAA4B,EAClC,OAAO,4BAA4B,KAClC,OAO2D,CAAC;AAE/D,wDAAwD;AACxD,eAAO,MAAM,mBAAmB,GAC9B,YAAY,gCAAgC,KAC3C,OAAkE,CAAC"}
|