@form-eng/fluent 1.0.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 +136 -0
- package/dist/index.d.mts +190 -0
- package/dist/index.d.ts +190 -0
- package/dist/index.js +1034 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +968 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# @form-eng/fluent
|
|
2
|
+
|
|
3
|
+
Fluent UI v9 field components for [`@form-eng/core`](https://www.npmjs.com/package/@form-eng/core). Provides 13 editable and 6 read-only field types that plug into the core form engine.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @form-eng/core @form-eng/fluent
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependencies: `react`, `react-dom`, `react-hook-form`, `@fluentui/react-components`, `@form-eng/core`
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import {
|
|
17
|
+
RulesEngineProvider,
|
|
18
|
+
InjectedFieldProvider,
|
|
19
|
+
UseInjectedFieldContext,
|
|
20
|
+
FormEngine,
|
|
21
|
+
} from "@form-eng/core";
|
|
22
|
+
import { createFluentFieldRegistry } from "@form-eng/fluent";
|
|
23
|
+
import { FluentProvider, webLightTheme } from "@fluentui/react-components";
|
|
24
|
+
import { useEffect } from "react";
|
|
25
|
+
|
|
26
|
+
function FieldRegistrar({ children }: { children: React.ReactNode }) {
|
|
27
|
+
const { setInjectedFields } = UseInjectedFieldContext();
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
setInjectedFields(createFluentFieldRegistry());
|
|
30
|
+
}, []);
|
|
31
|
+
return <>{children}</>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function App() {
|
|
35
|
+
return (
|
|
36
|
+
<FluentProvider theme={webLightTheme}>
|
|
37
|
+
<RulesEngineProvider>
|
|
38
|
+
<InjectedFieldProvider>
|
|
39
|
+
<FieldRegistrar>
|
|
40
|
+
<FormEngine
|
|
41
|
+
configName="myForm"
|
|
42
|
+
programName="myApp"
|
|
43
|
+
fieldConfigs={{
|
|
44
|
+
name: { type: "Textbox", label: "Name", required: true },
|
|
45
|
+
status: {
|
|
46
|
+
type: "Dropdown",
|
|
47
|
+
label: "Status",
|
|
48
|
+
options: [
|
|
49
|
+
{ value: "Active", label: "Active" },
|
|
50
|
+
{ value: "Inactive", label: "Inactive" },
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
}}
|
|
54
|
+
defaultValues={{ name: "", status: "Active" }}
|
|
55
|
+
saveData={async (data) => data}
|
|
56
|
+
/>
|
|
57
|
+
</FieldRegistrar>
|
|
58
|
+
</InjectedFieldProvider>
|
|
59
|
+
</RulesEngineProvider>
|
|
60
|
+
</FluentProvider>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Available Fields
|
|
66
|
+
|
|
67
|
+
### Editable Fields
|
|
68
|
+
|
|
69
|
+
| Component Key | Component | Description |
|
|
70
|
+
|---------------|-----------|-------------|
|
|
71
|
+
| `Textbox` | `HookTextbox` | Single-line text input |
|
|
72
|
+
| `Number` | `HookNumber` | Numeric input with validation |
|
|
73
|
+
| `Toggle` | `HookToggle` | Boolean toggle switch |
|
|
74
|
+
| `Dropdown` | `HookDropdown` | Single-select dropdown |
|
|
75
|
+
| `Multiselect` | `HookMultiSelect` | Multi-select dropdown |
|
|
76
|
+
| `DateControl` | `HookDateControl` | Date picker with clear button |
|
|
77
|
+
| `Slider` | `HookSlider` | Numeric slider |
|
|
78
|
+
| `SimpleDropdown` | `HookSimpleDropdown` | Dropdown from string array in config |
|
|
79
|
+
| `MultiSelectSearch` | `HookMultiSelectSearch` | Searchable multi-select (ComboBox) |
|
|
80
|
+
| `Textarea` | `HookPopOutEditor` | Multiline text with expand-to-modal |
|
|
81
|
+
| `DocumentLinks` | `HookDocumentLinks` | URL link CRUD |
|
|
82
|
+
| `StatusDropdown` | `HookStatusDropdown` | Dropdown with color status indicator |
|
|
83
|
+
| `DynamicFragment` | `HookFragment` | Hidden field (form state only) |
|
|
84
|
+
|
|
85
|
+
### Read-Only Fields
|
|
86
|
+
|
|
87
|
+
| Component Key | Component | Description |
|
|
88
|
+
|---------------|-----------|-------------|
|
|
89
|
+
| `ReadOnly` | `HookReadOnly` | Plain text display |
|
|
90
|
+
| `ReadOnlyArray` | `HookReadOnlyArray` | Array of strings |
|
|
91
|
+
| `ReadOnlyDateTime` | `HookReadOnlyDateTime` | Formatted date/time |
|
|
92
|
+
| `ReadOnlyCumulativeNumber` | `HookReadOnlyCumulativeNumber` | Computed sum of other fields |
|
|
93
|
+
| `ReadOnlyRichText` | `HookReadOnlyRichText` | Rendered HTML |
|
|
94
|
+
| `ReadOnlyWithButton` | `HookReadOnlyWithButton` | Text with action button |
|
|
95
|
+
|
|
96
|
+
## Registry Setup
|
|
97
|
+
|
|
98
|
+
`createFluentFieldRegistry()` returns a `Dictionary<JSX.Element>` mapping all component keys to their Fluent UI implementations. You can extend or override individual fields:
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
import { createFluentFieldRegistry } from "@form-eng/fluent";
|
|
102
|
+
|
|
103
|
+
const fields = {
|
|
104
|
+
...createFluentFieldRegistry(),
|
|
105
|
+
Textbox: <MyCustomTextbox />, // override built-in
|
|
106
|
+
RichEditor: <MyRichEditor />, // add new type
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
setInjectedFields(fields);
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Supporting Components
|
|
113
|
+
|
|
114
|
+
The package also exports supporting components:
|
|
115
|
+
|
|
116
|
+
- **`ReadOnlyText`** -- Read-only text display
|
|
117
|
+
- **`StatusMessage`** -- Error/warning/saving status messages
|
|
118
|
+
- **`HookFormLoading`** -- Shimmer loading placeholder
|
|
119
|
+
|
|
120
|
+
## Works with Core v1.3.0
|
|
121
|
+
|
|
122
|
+
When paired with `@form-eng/core` v1.3.0+, you automatically get:
|
|
123
|
+
|
|
124
|
+
- **Error boundary** -- each field is individually wrapped in `FormErrorBoundary`, so one crashing field does not take down the form
|
|
125
|
+
- **Save reliability** -- AbortController cancels in-flight saves, configurable timeout and retry with exponential backoff
|
|
126
|
+
- **Accessibility** -- focus trap in modals, focus-to-first-error on validation failure, ARIA live regions for status announcements
|
|
127
|
+
- **Draft persistence** -- `useDraftPersistence` hook auto-saves form state to localStorage; `useBeforeUnload` warns on page leave
|
|
128
|
+
- **Theming render props** -- `FieldWrapper` accepts `renderLabel`, `renderError`, `renderStatus` for custom field chrome
|
|
129
|
+
- **CSS custom properties** -- override `--fe-error-color`, `--fe-field-gap`, etc. via optional `styles.css`
|
|
130
|
+
- **DevTools** -- `FormDevTools` component for debugging business rules, form values, and errors
|
|
131
|
+
- **JSON Schema import** -- `jsonSchemaToFieldConfig()` converts JSON Schema to field configs
|
|
132
|
+
- **Lazy field registry** -- `createLazyFieldRegistry()` for on-demand field component loading
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
MIT
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { IFieldProps, Dictionary, IOption } from '@form-eng/core';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { FieldError } from 'react-hook-form';
|
|
5
|
+
import { OptionOnSelectData } from '@fluentui/react-components';
|
|
6
|
+
|
|
7
|
+
interface IHookTextboxProps {
|
|
8
|
+
ellipsifyTextCharacters?: number;
|
|
9
|
+
placeHolder?: string;
|
|
10
|
+
multiline?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const Textbox: (props: IFieldProps<IHookTextboxProps>) => react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
declare const NumberField: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
declare const Toggle: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
interface IHookDropdownProps {
|
|
19
|
+
placeHolder?: string;
|
|
20
|
+
setDefaultKeyIfOnlyOneOption?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const DropdownField: (props: IFieldProps<IHookDropdownProps>) => react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
declare const MultiSelect: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
declare const DateControl: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
27
|
+
|
|
28
|
+
interface IHookSliderProps {
|
|
29
|
+
max?: number;
|
|
30
|
+
min?: number;
|
|
31
|
+
step?: number;
|
|
32
|
+
}
|
|
33
|
+
declare const SliderField: (props: IFieldProps<IHookSliderProps>) => react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
declare const Fragment: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
|
|
37
|
+
interface IHookSimpleDropdownProps {
|
|
38
|
+
dropdownOptions?: string[];
|
|
39
|
+
placeHolder?: string;
|
|
40
|
+
}
|
|
41
|
+
declare const SimpleDropdown: (props: IFieldProps<IHookSimpleDropdownProps>) => react_jsx_runtime.JSX.Element;
|
|
42
|
+
|
|
43
|
+
declare const MultiSelectSearch: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
44
|
+
|
|
45
|
+
interface IHookPopOutEditorProps {
|
|
46
|
+
autoAdjustHeight?: boolean;
|
|
47
|
+
numberOfRows?: number;
|
|
48
|
+
ellipsifyTextCharacters?: number;
|
|
49
|
+
additionalInfo?: string;
|
|
50
|
+
maxLimit?: number;
|
|
51
|
+
saveCallback?: () => void;
|
|
52
|
+
renderExtraModalFooter?: () => React.ReactNode;
|
|
53
|
+
}
|
|
54
|
+
declare const PopOutEditor: (props: IFieldProps<IHookPopOutEditorProps>) => react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
declare const DocumentLinksField: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
57
|
+
|
|
58
|
+
interface IHookStatusDropdownProps {
|
|
59
|
+
placeHolder?: string;
|
|
60
|
+
statusColors?: Dictionary<string>;
|
|
61
|
+
}
|
|
62
|
+
declare const StatusDropdownField: (props: IFieldProps<IHookStatusDropdownProps>) => react_jsx_runtime.JSX.Element;
|
|
63
|
+
|
|
64
|
+
interface IReadOnlyFieldProps {
|
|
65
|
+
readonly value?: string;
|
|
66
|
+
readonly fieldName?: string;
|
|
67
|
+
readonly labelClassName?: string;
|
|
68
|
+
readonly valueClassName?: string;
|
|
69
|
+
readonly showControlOnSide?: boolean;
|
|
70
|
+
readonly containerClassName?: string;
|
|
71
|
+
readonly ellipsifyTextCharacters?: number;
|
|
72
|
+
}
|
|
73
|
+
declare const ReadOnlyText: React.FunctionComponent<IReadOnlyFieldProps>;
|
|
74
|
+
|
|
75
|
+
interface IHookReadOnlyProps extends IReadOnlyFieldProps {
|
|
76
|
+
}
|
|
77
|
+
declare const ReadOnly: (props: IFieldProps<IHookReadOnlyProps>) => react_jsx_runtime.JSX.Element;
|
|
78
|
+
|
|
79
|
+
declare const ReadOnlyArray: (props: IFieldProps<IReadOnlyFieldProps>) => react_jsx_runtime.JSX.Element;
|
|
80
|
+
|
|
81
|
+
interface IHookReadOnlyDateTimeProps {
|
|
82
|
+
isListView?: boolean;
|
|
83
|
+
hidetimeStamp?: boolean;
|
|
84
|
+
}
|
|
85
|
+
declare const ReadOnlyDateTime: (props: IFieldProps<IHookReadOnlyDateTimeProps>) => react_jsx_runtime.JSX.Element;
|
|
86
|
+
|
|
87
|
+
interface IHookReadOnlyCumulativeNumberProps extends IReadOnlyFieldProps {
|
|
88
|
+
dependencyFields?: string[];
|
|
89
|
+
}
|
|
90
|
+
declare const ReadOnlyCumulativeNumber: (props: IFieldProps<IHookReadOnlyCumulativeNumberProps>) => react_jsx_runtime.JSX.Element;
|
|
91
|
+
|
|
92
|
+
declare const ReadOnlyRichText: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
93
|
+
|
|
94
|
+
interface IReadOnlyWithButtonProps extends IReadOnlyFieldProps {
|
|
95
|
+
containerClassName?: string;
|
|
96
|
+
buttonText?: string;
|
|
97
|
+
onButtonClick?: () => void;
|
|
98
|
+
}
|
|
99
|
+
declare const ReadOnlyWithButton: (props: IFieldProps<IReadOnlyWithButtonProps>) => react_jsx_runtime.JSX.Element;
|
|
100
|
+
|
|
101
|
+
interface IStatusMessageProps {
|
|
102
|
+
id?: string;
|
|
103
|
+
readonly error?: FieldError;
|
|
104
|
+
readonly errorCount?: number;
|
|
105
|
+
readonly savePending?: boolean;
|
|
106
|
+
readonly saving?: boolean;
|
|
107
|
+
}
|
|
108
|
+
declare const StatusMessage: React.FunctionComponent<IStatusMessageProps>;
|
|
109
|
+
|
|
110
|
+
interface IFormLoadingProps {
|
|
111
|
+
loadingShimmerCount?: number;
|
|
112
|
+
loadingFieldShimmerHeight?: number;
|
|
113
|
+
inPanel?: boolean;
|
|
114
|
+
hideTitleShimmer?: boolean;
|
|
115
|
+
}
|
|
116
|
+
declare const FormLoading: (props: IFormLoadingProps) => react_jsx_runtime.JSX.Element;
|
|
117
|
+
|
|
118
|
+
interface IStatusColorProps {
|
|
119
|
+
statusColors: Dictionary<string>;
|
|
120
|
+
status: string;
|
|
121
|
+
}
|
|
122
|
+
declare const StatusColor: (props: IStatusColorProps) => react_jsx_runtime.JSX.Element;
|
|
123
|
+
|
|
124
|
+
interface IStatusDropdownProps {
|
|
125
|
+
className: string;
|
|
126
|
+
entityId?: string;
|
|
127
|
+
entityType?: string;
|
|
128
|
+
programName?: string;
|
|
129
|
+
fieldName: string;
|
|
130
|
+
status: string;
|
|
131
|
+
dropdownOptions: IOption[];
|
|
132
|
+
meta?: Record<string, unknown>;
|
|
133
|
+
onOptionSelect: (event: unknown, data: OptionOnSelectData) => void;
|
|
134
|
+
}
|
|
135
|
+
declare const StatusDropdown: (props: IStatusDropdownProps) => react_jsx_runtime.JSX.Element;
|
|
136
|
+
|
|
137
|
+
interface IDocumentLink {
|
|
138
|
+
title: string;
|
|
139
|
+
url: string;
|
|
140
|
+
}
|
|
141
|
+
interface IDocumentLinksProps {
|
|
142
|
+
fieldName: string;
|
|
143
|
+
programName?: string;
|
|
144
|
+
entityType?: string;
|
|
145
|
+
entityId?: string;
|
|
146
|
+
className?: string;
|
|
147
|
+
readOnly?: boolean;
|
|
148
|
+
links: IDocumentLink[];
|
|
149
|
+
onUpdateLinks?: (newLink: IDocumentLink, addNewLink?: boolean, index?: number) => void;
|
|
150
|
+
onDeleteLink?: (index: number) => void;
|
|
151
|
+
}
|
|
152
|
+
declare const DocumentLinks: (props: IDocumentLinksProps) => react_jsx_runtime.JSX.Element;
|
|
153
|
+
|
|
154
|
+
interface IDocumentLinkProps {
|
|
155
|
+
fieldName: string;
|
|
156
|
+
programName?: string;
|
|
157
|
+
entityType?: string;
|
|
158
|
+
entityId?: string;
|
|
159
|
+
readOnly?: boolean;
|
|
160
|
+
index?: number;
|
|
161
|
+
title?: string;
|
|
162
|
+
url?: string;
|
|
163
|
+
addNewLink?: boolean;
|
|
164
|
+
saveLinks: (newLink: IDocumentLink, addNewLink?: boolean, index?: number) => void;
|
|
165
|
+
onCancelAddLink?: () => void;
|
|
166
|
+
onConfirmDeleteLink?: (index: number) => void;
|
|
167
|
+
}
|
|
168
|
+
declare const DocumentLink: (props: IDocumentLinkProps) => react_jsx_runtime.JSX.Element;
|
|
169
|
+
|
|
170
|
+
/** Creates the default Fluent UI v9 field registry for use with InjectedFieldProvider */
|
|
171
|
+
declare function createFluentFieldRegistry(): Dictionary<React.JSX.Element>;
|
|
172
|
+
|
|
173
|
+
declare const FieldClassName: (className: string, error?: FieldError) => string;
|
|
174
|
+
declare const GetFieldDataTestId: (fieldName: string, programName?: string, entityType?: string, entityId?: string) => string;
|
|
175
|
+
declare function formatDateTime(dateStr: string, options?: {
|
|
176
|
+
hideTimestamp?: boolean;
|
|
177
|
+
}): string;
|
|
178
|
+
declare const DocumentLinksStrings: {
|
|
179
|
+
link: string;
|
|
180
|
+
addLink: string;
|
|
181
|
+
addAnotherLink: string;
|
|
182
|
+
deleteLink: string;
|
|
183
|
+
confirmDeleteLink: string;
|
|
184
|
+
delete: string;
|
|
185
|
+
cancel: string;
|
|
186
|
+
saveChanges: string;
|
|
187
|
+
save: string;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export { DateControl, DocumentLink, DocumentLinks, DocumentLinksField, DocumentLinksStrings, DropdownField, FieldClassName, FormLoading, Fragment, GetFieldDataTestId, type IDocumentLink, type IReadOnlyFieldProps, MultiSelect, MultiSelectSearch, NumberField, PopOutEditor, ReadOnly, ReadOnlyArray, ReadOnlyCumulativeNumber, ReadOnlyDateTime, ReadOnlyRichText, ReadOnlyText, ReadOnlyWithButton, SimpleDropdown, SliderField, StatusColor, StatusDropdown, StatusDropdownField, StatusMessage, Textbox, Toggle, createFluentFieldRegistry, formatDateTime };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { IFieldProps, Dictionary, IOption } from '@form-eng/core';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { FieldError } from 'react-hook-form';
|
|
5
|
+
import { OptionOnSelectData } from '@fluentui/react-components';
|
|
6
|
+
|
|
7
|
+
interface IHookTextboxProps {
|
|
8
|
+
ellipsifyTextCharacters?: number;
|
|
9
|
+
placeHolder?: string;
|
|
10
|
+
multiline?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const Textbox: (props: IFieldProps<IHookTextboxProps>) => react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
declare const NumberField: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
declare const Toggle: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
interface IHookDropdownProps {
|
|
19
|
+
placeHolder?: string;
|
|
20
|
+
setDefaultKeyIfOnlyOneOption?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const DropdownField: (props: IFieldProps<IHookDropdownProps>) => react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
declare const MultiSelect: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
declare const DateControl: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
27
|
+
|
|
28
|
+
interface IHookSliderProps {
|
|
29
|
+
max?: number;
|
|
30
|
+
min?: number;
|
|
31
|
+
step?: number;
|
|
32
|
+
}
|
|
33
|
+
declare const SliderField: (props: IFieldProps<IHookSliderProps>) => react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
declare const Fragment: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
|
|
37
|
+
interface IHookSimpleDropdownProps {
|
|
38
|
+
dropdownOptions?: string[];
|
|
39
|
+
placeHolder?: string;
|
|
40
|
+
}
|
|
41
|
+
declare const SimpleDropdown: (props: IFieldProps<IHookSimpleDropdownProps>) => react_jsx_runtime.JSX.Element;
|
|
42
|
+
|
|
43
|
+
declare const MultiSelectSearch: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
44
|
+
|
|
45
|
+
interface IHookPopOutEditorProps {
|
|
46
|
+
autoAdjustHeight?: boolean;
|
|
47
|
+
numberOfRows?: number;
|
|
48
|
+
ellipsifyTextCharacters?: number;
|
|
49
|
+
additionalInfo?: string;
|
|
50
|
+
maxLimit?: number;
|
|
51
|
+
saveCallback?: () => void;
|
|
52
|
+
renderExtraModalFooter?: () => React.ReactNode;
|
|
53
|
+
}
|
|
54
|
+
declare const PopOutEditor: (props: IFieldProps<IHookPopOutEditorProps>) => react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
declare const DocumentLinksField: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
57
|
+
|
|
58
|
+
interface IHookStatusDropdownProps {
|
|
59
|
+
placeHolder?: string;
|
|
60
|
+
statusColors?: Dictionary<string>;
|
|
61
|
+
}
|
|
62
|
+
declare const StatusDropdownField: (props: IFieldProps<IHookStatusDropdownProps>) => react_jsx_runtime.JSX.Element;
|
|
63
|
+
|
|
64
|
+
interface IReadOnlyFieldProps {
|
|
65
|
+
readonly value?: string;
|
|
66
|
+
readonly fieldName?: string;
|
|
67
|
+
readonly labelClassName?: string;
|
|
68
|
+
readonly valueClassName?: string;
|
|
69
|
+
readonly showControlOnSide?: boolean;
|
|
70
|
+
readonly containerClassName?: string;
|
|
71
|
+
readonly ellipsifyTextCharacters?: number;
|
|
72
|
+
}
|
|
73
|
+
declare const ReadOnlyText: React.FunctionComponent<IReadOnlyFieldProps>;
|
|
74
|
+
|
|
75
|
+
interface IHookReadOnlyProps extends IReadOnlyFieldProps {
|
|
76
|
+
}
|
|
77
|
+
declare const ReadOnly: (props: IFieldProps<IHookReadOnlyProps>) => react_jsx_runtime.JSX.Element;
|
|
78
|
+
|
|
79
|
+
declare const ReadOnlyArray: (props: IFieldProps<IReadOnlyFieldProps>) => react_jsx_runtime.JSX.Element;
|
|
80
|
+
|
|
81
|
+
interface IHookReadOnlyDateTimeProps {
|
|
82
|
+
isListView?: boolean;
|
|
83
|
+
hidetimeStamp?: boolean;
|
|
84
|
+
}
|
|
85
|
+
declare const ReadOnlyDateTime: (props: IFieldProps<IHookReadOnlyDateTimeProps>) => react_jsx_runtime.JSX.Element;
|
|
86
|
+
|
|
87
|
+
interface IHookReadOnlyCumulativeNumberProps extends IReadOnlyFieldProps {
|
|
88
|
+
dependencyFields?: string[];
|
|
89
|
+
}
|
|
90
|
+
declare const ReadOnlyCumulativeNumber: (props: IFieldProps<IHookReadOnlyCumulativeNumberProps>) => react_jsx_runtime.JSX.Element;
|
|
91
|
+
|
|
92
|
+
declare const ReadOnlyRichText: (props: IFieldProps<{}>) => react_jsx_runtime.JSX.Element;
|
|
93
|
+
|
|
94
|
+
interface IReadOnlyWithButtonProps extends IReadOnlyFieldProps {
|
|
95
|
+
containerClassName?: string;
|
|
96
|
+
buttonText?: string;
|
|
97
|
+
onButtonClick?: () => void;
|
|
98
|
+
}
|
|
99
|
+
declare const ReadOnlyWithButton: (props: IFieldProps<IReadOnlyWithButtonProps>) => react_jsx_runtime.JSX.Element;
|
|
100
|
+
|
|
101
|
+
interface IStatusMessageProps {
|
|
102
|
+
id?: string;
|
|
103
|
+
readonly error?: FieldError;
|
|
104
|
+
readonly errorCount?: number;
|
|
105
|
+
readonly savePending?: boolean;
|
|
106
|
+
readonly saving?: boolean;
|
|
107
|
+
}
|
|
108
|
+
declare const StatusMessage: React.FunctionComponent<IStatusMessageProps>;
|
|
109
|
+
|
|
110
|
+
interface IFormLoadingProps {
|
|
111
|
+
loadingShimmerCount?: number;
|
|
112
|
+
loadingFieldShimmerHeight?: number;
|
|
113
|
+
inPanel?: boolean;
|
|
114
|
+
hideTitleShimmer?: boolean;
|
|
115
|
+
}
|
|
116
|
+
declare const FormLoading: (props: IFormLoadingProps) => react_jsx_runtime.JSX.Element;
|
|
117
|
+
|
|
118
|
+
interface IStatusColorProps {
|
|
119
|
+
statusColors: Dictionary<string>;
|
|
120
|
+
status: string;
|
|
121
|
+
}
|
|
122
|
+
declare const StatusColor: (props: IStatusColorProps) => react_jsx_runtime.JSX.Element;
|
|
123
|
+
|
|
124
|
+
interface IStatusDropdownProps {
|
|
125
|
+
className: string;
|
|
126
|
+
entityId?: string;
|
|
127
|
+
entityType?: string;
|
|
128
|
+
programName?: string;
|
|
129
|
+
fieldName: string;
|
|
130
|
+
status: string;
|
|
131
|
+
dropdownOptions: IOption[];
|
|
132
|
+
meta?: Record<string, unknown>;
|
|
133
|
+
onOptionSelect: (event: unknown, data: OptionOnSelectData) => void;
|
|
134
|
+
}
|
|
135
|
+
declare const StatusDropdown: (props: IStatusDropdownProps) => react_jsx_runtime.JSX.Element;
|
|
136
|
+
|
|
137
|
+
interface IDocumentLink {
|
|
138
|
+
title: string;
|
|
139
|
+
url: string;
|
|
140
|
+
}
|
|
141
|
+
interface IDocumentLinksProps {
|
|
142
|
+
fieldName: string;
|
|
143
|
+
programName?: string;
|
|
144
|
+
entityType?: string;
|
|
145
|
+
entityId?: string;
|
|
146
|
+
className?: string;
|
|
147
|
+
readOnly?: boolean;
|
|
148
|
+
links: IDocumentLink[];
|
|
149
|
+
onUpdateLinks?: (newLink: IDocumentLink, addNewLink?: boolean, index?: number) => void;
|
|
150
|
+
onDeleteLink?: (index: number) => void;
|
|
151
|
+
}
|
|
152
|
+
declare const DocumentLinks: (props: IDocumentLinksProps) => react_jsx_runtime.JSX.Element;
|
|
153
|
+
|
|
154
|
+
interface IDocumentLinkProps {
|
|
155
|
+
fieldName: string;
|
|
156
|
+
programName?: string;
|
|
157
|
+
entityType?: string;
|
|
158
|
+
entityId?: string;
|
|
159
|
+
readOnly?: boolean;
|
|
160
|
+
index?: number;
|
|
161
|
+
title?: string;
|
|
162
|
+
url?: string;
|
|
163
|
+
addNewLink?: boolean;
|
|
164
|
+
saveLinks: (newLink: IDocumentLink, addNewLink?: boolean, index?: number) => void;
|
|
165
|
+
onCancelAddLink?: () => void;
|
|
166
|
+
onConfirmDeleteLink?: (index: number) => void;
|
|
167
|
+
}
|
|
168
|
+
declare const DocumentLink: (props: IDocumentLinkProps) => react_jsx_runtime.JSX.Element;
|
|
169
|
+
|
|
170
|
+
/** Creates the default Fluent UI v9 field registry for use with InjectedFieldProvider */
|
|
171
|
+
declare function createFluentFieldRegistry(): Dictionary<React.JSX.Element>;
|
|
172
|
+
|
|
173
|
+
declare const FieldClassName: (className: string, error?: FieldError) => string;
|
|
174
|
+
declare const GetFieldDataTestId: (fieldName: string, programName?: string, entityType?: string, entityId?: string) => string;
|
|
175
|
+
declare function formatDateTime(dateStr: string, options?: {
|
|
176
|
+
hideTimestamp?: boolean;
|
|
177
|
+
}): string;
|
|
178
|
+
declare const DocumentLinksStrings: {
|
|
179
|
+
link: string;
|
|
180
|
+
addLink: string;
|
|
181
|
+
addAnotherLink: string;
|
|
182
|
+
deleteLink: string;
|
|
183
|
+
confirmDeleteLink: string;
|
|
184
|
+
delete: string;
|
|
185
|
+
cancel: string;
|
|
186
|
+
saveChanges: string;
|
|
187
|
+
save: string;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export { DateControl, DocumentLink, DocumentLinks, DocumentLinksField, DocumentLinksStrings, DropdownField, FieldClassName, FormLoading, Fragment, GetFieldDataTestId, type IDocumentLink, type IReadOnlyFieldProps, MultiSelect, MultiSelectSearch, NumberField, PopOutEditor, ReadOnly, ReadOnlyArray, ReadOnlyCumulativeNumber, ReadOnlyDateTime, ReadOnlyRichText, ReadOnlyText, ReadOnlyWithButton, SimpleDropdown, SliderField, StatusColor, StatusDropdown, StatusDropdownField, StatusMessage, Textbox, Toggle, createFluentFieldRegistry, formatDateTime };
|