@fluentui/react-field 9.0.0-alpha.1 → 9.0.0-alpha.10
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +630 -1
- package/CHANGELOG.md +164 -2
- package/dist/index.d.ts +30 -95
- package/lib/Field.js.map +1 -1
- package/lib/components/Field/Field.types.js.map +1 -1
- package/lib/components/Field/SlotComponent.types.js.map +1 -1
- package/lib/components/Field/index.js.map +1 -1
- package/lib/components/Field/renderField.js.map +1 -1
- package/lib/components/Field/useField.js +30 -25
- package/lib/components/Field/useField.js.map +1 -1
- package/lib/components/Field/useFieldStyles.js +3 -3
- package/lib/components/Field/useFieldStyles.js.map +1 -1
- package/lib/index.js +0 -9
- package/lib/index.js.map +1 -1
- package/lib-amd/Field.js +6 -0
- package/lib-amd/Field.js.map +1 -0
- package/lib-amd/components/Field/Field.types.js +5 -0
- package/lib-amd/components/Field/Field.types.js.map +1 -0
- package/lib-amd/components/Field/SlotComponent.types.js +5 -0
- package/lib-amd/components/Field/SlotComponent.types.js.map +1 -0
- package/lib-amd/components/Field/index.js +9 -0
- package/lib-amd/components/Field/index.js.map +1 -0
- package/lib-amd/components/Field/renderField.js +20 -0
- package/lib-amd/components/Field/renderField.js.map +1 -0
- package/lib-amd/components/Field/useField.js +119 -0
- package/lib-amd/components/Field/useField.js.map +1 -0
- package/lib-amd/components/Field/useFieldStyles.js +97 -0
- package/lib-amd/components/Field/useFieldStyles.js.map +1 -0
- package/lib-amd/index.js +10 -0
- package/lib-amd/index.js.map +1 -0
- package/lib-commonjs/Field.js.map +1 -1
- package/lib-commonjs/components/Field/index.js.map +1 -1
- package/lib-commonjs/components/Field/renderField.js.map +1 -1
- package/lib-commonjs/components/Field/useField.js +30 -25
- package/lib-commonjs/components/Field/useField.js.map +1 -1
- package/lib-commonjs/components/Field/useFieldStyles.js +4 -4
- package/lib-commonjs/components/Field/useFieldStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -136
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +22 -24
- package/Spec.md +0 -354
- package/lib/CheckboxField.js +0 -2
- package/lib/CheckboxField.js.map +0 -1
- package/lib/ComboboxField.js +0 -2
- package/lib/ComboboxField.js.map +0 -1
- package/lib/InputField.js +0 -2
- package/lib/InputField.js.map +0 -1
- package/lib/RadioGroupField.js +0 -2
- package/lib/RadioGroupField.js.map +0 -1
- package/lib/SelectField.js +0 -2
- package/lib/SelectField.js.map +0 -1
- package/lib/SliderField.js +0 -2
- package/lib/SliderField.js.map +0 -1
- package/lib/SpinButtonField.js +0 -2
- package/lib/SpinButtonField.js.map +0 -1
- package/lib/SwitchField.js +0 -2
- package/lib/SwitchField.js.map +0 -1
- package/lib/TextareaField.js +0 -2
- package/lib/TextareaField.js.map +0 -1
- package/lib/components/CheckboxField/CheckboxField.js +0 -32
- package/lib/components/CheckboxField/CheckboxField.js.map +0 -1
- package/lib/components/CheckboxField/index.js +0 -2
- package/lib/components/CheckboxField/index.js.map +0 -1
- package/lib/components/ComboboxField/ComboboxField.js +0 -14
- package/lib/components/ComboboxField/ComboboxField.js.map +0 -1
- package/lib/components/ComboboxField/index.js +0 -2
- package/lib/components/ComboboxField/index.js.map +0 -1
- package/lib/components/InputField/InputField.js +0 -14
- package/lib/components/InputField/InputField.js.map +0 -1
- package/lib/components/InputField/index.js +0 -2
- package/lib/components/InputField/index.js.map +0 -1
- package/lib/components/RadioGroupField/RadioGroupField.js +0 -15
- package/lib/components/RadioGroupField/RadioGroupField.js.map +0 -1
- package/lib/components/RadioGroupField/index.js +0 -2
- package/lib/components/RadioGroupField/index.js.map +0 -1
- package/lib/components/SelectField/SelectField.js +0 -14
- package/lib/components/SelectField/SelectField.js.map +0 -1
- package/lib/components/SelectField/index.js +0 -2
- package/lib/components/SelectField/index.js.map +0 -1
- package/lib/components/SliderField/SliderField.js +0 -14
- package/lib/components/SliderField/SliderField.js.map +0 -1
- package/lib/components/SliderField/index.js +0 -2
- package/lib/components/SliderField/index.js.map +0 -1
- package/lib/components/SpinButtonField/SpinButtonField.js +0 -14
- package/lib/components/SpinButtonField/SpinButtonField.js.map +0 -1
- package/lib/components/SpinButtonField/index.js +0 -2
- package/lib/components/SpinButtonField/index.js.map +0 -1
- package/lib/components/SwitchField/SwitchField.js +0 -14
- package/lib/components/SwitchField/SwitchField.js.map +0 -1
- package/lib/components/SwitchField/index.js +0 -2
- package/lib/components/SwitchField/index.js.map +0 -1
- package/lib/components/TextareaField/TextareaField.js +0 -14
- package/lib/components/TextareaField/TextareaField.js.map +0 -1
- package/lib/components/TextareaField/index.js +0 -2
- package/lib/components/TextareaField/index.js.map +0 -1
- package/lib-commonjs/CheckboxField.js +0 -10
- package/lib-commonjs/CheckboxField.js.map +0 -1
- package/lib-commonjs/ComboboxField.js +0 -10
- package/lib-commonjs/ComboboxField.js.map +0 -1
- package/lib-commonjs/InputField.js +0 -10
- package/lib-commonjs/InputField.js.map +0 -1
- package/lib-commonjs/RadioGroupField.js +0 -10
- package/lib-commonjs/RadioGroupField.js.map +0 -1
- package/lib-commonjs/SelectField.js +0 -10
- package/lib-commonjs/SelectField.js.map +0 -1
- package/lib-commonjs/SliderField.js +0 -10
- package/lib-commonjs/SliderField.js.map +0 -1
- package/lib-commonjs/SpinButtonField.js +0 -10
- package/lib-commonjs/SpinButtonField.js.map +0 -1
- package/lib-commonjs/SwitchField.js +0 -10
- package/lib-commonjs/SwitchField.js.map +0 -1
- package/lib-commonjs/TextareaField.js +0 -10
- package/lib-commonjs/TextareaField.js.map +0 -1
- package/lib-commonjs/components/CheckboxField/CheckboxField.js +0 -42
- package/lib-commonjs/components/CheckboxField/CheckboxField.js.map +0 -1
- package/lib-commonjs/components/CheckboxField/index.js +0 -10
- package/lib-commonjs/components/CheckboxField/index.js.map +0 -1
- package/lib-commonjs/components/ComboboxField/ComboboxField.js +0 -24
- package/lib-commonjs/components/ComboboxField/ComboboxField.js.map +0 -1
- package/lib-commonjs/components/ComboboxField/index.js +0 -10
- package/lib-commonjs/components/ComboboxField/index.js.map +0 -1
- package/lib-commonjs/components/InputField/InputField.js +0 -24
- package/lib-commonjs/components/InputField/InputField.js.map +0 -1
- package/lib-commonjs/components/InputField/index.js +0 -10
- package/lib-commonjs/components/InputField/index.js.map +0 -1
- package/lib-commonjs/components/RadioGroupField/RadioGroupField.js +0 -25
- package/lib-commonjs/components/RadioGroupField/RadioGroupField.js.map +0 -1
- package/lib-commonjs/components/RadioGroupField/index.js +0 -10
- package/lib-commonjs/components/RadioGroupField/index.js.map +0 -1
- package/lib-commonjs/components/SelectField/SelectField.js +0 -24
- package/lib-commonjs/components/SelectField/SelectField.js.map +0 -1
- package/lib-commonjs/components/SelectField/index.js +0 -10
- package/lib-commonjs/components/SelectField/index.js.map +0 -1
- package/lib-commonjs/components/SliderField/SliderField.js +0 -24
- package/lib-commonjs/components/SliderField/SliderField.js.map +0 -1
- package/lib-commonjs/components/SliderField/index.js +0 -10
- package/lib-commonjs/components/SliderField/index.js.map +0 -1
- package/lib-commonjs/components/SpinButtonField/SpinButtonField.js +0 -24
- package/lib-commonjs/components/SpinButtonField/SpinButtonField.js.map +0 -1
- package/lib-commonjs/components/SpinButtonField/index.js +0 -10
- package/lib-commonjs/components/SpinButtonField/index.js.map +0 -1
- package/lib-commonjs/components/SwitchField/SwitchField.js +0 -24
- package/lib-commonjs/components/SwitchField/SwitchField.js.map +0 -1
- package/lib-commonjs/components/SwitchField/index.js +0 -10
- package/lib-commonjs/components/SwitchField/index.js.map +0 -1
- package/lib-commonjs/components/TextareaField/TextareaField.js +0 -24
- package/lib-commonjs/components/TextareaField/TextareaField.js.map +0 -1
- package/lib-commonjs/components/TextareaField/index.js +0 -10
- package/lib-commonjs/components/TextareaField/index.js.map +0 -1
package/Spec.md
DELETED
@@ -1,354 +0,0 @@
|
|
1
|
-
# @fluentui/react-field Spec
|
2
|
-
|
3
|
-
## Background
|
4
|
-
|
5
|
-
Field adds a label, validation text, and hint text to form input components. The existing input components (such as `Input` and `Combobox`) are wrapped to create field versions of them (such as `InputField` and `ComboboxField`).
|
6
|
-
|
7
|
-
Epic issue tracking implementation: https://github.com/microsoft/fluentui/issues/19627
|
8
|
-
|
9
|
-
## Prior Art
|
10
|
-
|
11
|
-
Existing libraries tend to take one of the following approaches to field.
|
12
|
-
|
13
|
-
1. Include support for label, error text, etc. in the base input component. Libraries using this approach include:
|
14
|
-
- **FluentUI v8** - [`TextField`](https://developer.microsoft.com/en-us/fluentui#/controls/web/textfield), [`Dropdown`](https://developer.microsoft.com/en-us/fluentui#/controls/web/dropdown), [`ChoiceGroup`](https://developer.microsoft.com/en-us/fluentui#/controls/web/choicegroup), etc.
|
15
|
-
- **Spectrum** - [`TextField`](https://react-spectrum.adobe.com/react-spectrum/TextField.html), [`Slider`](https://react-spectrum.adobe.com/react-spectrum/Slider.html), [`RadioGroup`](https://react-spectrum.adobe.com/react-spectrum/RadioGroup.html), etc.
|
16
|
-
2. Provide a set of components that are manually constructed into a field. This requires manually hooking up the components using props like `htmlFor` and `aria-describedby`. Libraries using this approach include:
|
17
|
-
- **FluentUI v0** - [`FormField`](https://fluentsite.z22.web.core.windows.net/0.64.0/components/form/props#form-field), [`FormLabel`](https://fluentsite.z22.web.core.windows.net/0.64.0/components/form/props#form-label), [`FormMessage`](https://fluentsite.z22.web.core.windows.net/0.64.0/components/form/props#form-message)
|
18
|
-
- **Ant** - [`Form.Item`](https://ant.design/components/form/#Form.Item) (uses context to do some of the hooking up between the item and the field component).
|
19
|
-
3. Provide base components without a label or descriptive text, and then Field versions of those controls. Libraries using this approach include:
|
20
|
-
- **FluentUI v0** - [`Input`](https://fluentsite.z22.web.core.windows.net/0.64.0/components/input/props) and [`FormInput`](https://fluentsite.z22.web.core.windows.net/0.64.0/components/form/props#form-input), for example.
|
21
|
-
- **Evergreen UI** - [`TextInput`](https://evergreen.segment.com/components/text-input) and [`TextInputField`](https://evergreen.segment.com/components/text-input#textinputfield), for example.
|
22
|
-
|
23
|
-
The Field implementation in this spec follows pattern (3). There are Field versions of all components that can be used as form inputs. There are several reasons, including:
|
24
|
-
|
25
|
-
- **Accessibility**: By combining a base component with the field props into a single component, all of the accessibility props like `htmlFor` and `aria-describedby` are set correctly for "free".
|
26
|
-
- **Simplicity**: All props related to the component (such as `label`, `id`, `validationState="error"`, etc.) are on the same component, rather than split between multiple components (like separate `Field` and `Input` components).
|
27
|
-
- **Consistency**: All of the Field components share a common set of props for the label, validationState, hint, etc.
|
28
|
-
- **Bundle size**: When the label and other field functionality is not needed, it is still possible to use the base components without pulling in unnecessary dependencies (like `Label` and the field styling).
|
29
|
-
|
30
|
-
## Sample Code
|
31
|
-
|
32
|
-
Each input component has a field version (such as `InputField`, `ComboboxField`, etc.) that includes the features of Field added to that component.
|
33
|
-
|
34
|
-
```jsx
|
35
|
-
<>
|
36
|
-
<InputField
|
37
|
-
// Field-specific props
|
38
|
-
label="This is the field label"
|
39
|
-
orientation="horizontal"
|
40
|
-
validationState="error"
|
41
|
-
validationMessage="This is error text"
|
42
|
-
// All props and slots of the underlying Input component are supported
|
43
|
-
required
|
44
|
-
size="small"
|
45
|
-
contentBefore="$"
|
46
|
-
contentAfter=".00"
|
47
|
-
/>
|
48
|
-
<RadioGroupField label="Radio group field">
|
49
|
-
<Radio value="one" label="Option one" />
|
50
|
-
<Radio value="two" label="Option two" />
|
51
|
-
<Radio value="three" label="Option three" />
|
52
|
-
</RadioGroupField>
|
53
|
-
<ComboboxField label="Combobox field" validationState="success" validationMessage="Success text">
|
54
|
-
<Option value="one">Option one</Option>
|
55
|
-
<Option value="two">Option two</Option>
|
56
|
-
<Option value="three">Option three</Option>
|
57
|
-
</ComboboxField>
|
58
|
-
<SliderField label="Slider field" validationState="warning" validationMessage="Warning text" />
|
59
|
-
<SpinButtonField label="Spin button field" hint="Hint text" />
|
60
|
-
</>
|
61
|
-
```
|
62
|
-
|
63
|
-
These field versions of the components use a common set of Field hooks, and can be defined using very little code.
|
64
|
-
|
65
|
-
```ts
|
66
|
-
export type InputFieldProps = FieldProps<typeof Input>;
|
67
|
-
|
68
|
-
export const InputField: ForwardRefComponent<InputFieldProps> = React.forwardRef((props, ref) => {
|
69
|
-
const state = useField_unstable(props, ref, Input);
|
70
|
-
useFieldStyles_unstable(state);
|
71
|
-
return renderField_unstable(state);
|
72
|
-
});
|
73
|
-
|
74
|
-
InputField.displayName = 'InputField';
|
75
|
-
```
|
76
|
-
|
77
|
-
## Components
|
78
|
-
|
79
|
-
The following field components will be defined. If more form components are added in the future, they should also include a Field version.
|
80
|
-
|
81
|
-
- `CheckboxField`
|
82
|
-
- `ComboboxField`
|
83
|
-
- `DropdownField`
|
84
|
-
- `InputField`
|
85
|
-
- `RadioGroupField`
|
86
|
-
- `SelectField`
|
87
|
-
- `SliderField`
|
88
|
-
- `SpinButtonField`
|
89
|
-
- `SwitchField`
|
90
|
-
- `TextareaField`
|
91
|
-
|
92
|
-
## Variants
|
93
|
-
|
94
|
-
- **Orientation**: The `orientation` prop affects the layout of the label and field component:
|
95
|
-
- `'vertical'` (default) - label is above the field component
|
96
|
-
- `'horizontal'` - label is to the left of the field component, and is 33% the width of the field (this allows multiple stacked fields to all align their labels)
|
97
|
-
- **Validation state**: The `validationState` prop affects the icon and color used by the `validationMessage`:
|
98
|
-
- `'error'` - Red x icon, red text color
|
99
|
-
- `'warning'` - Yellow exclamation icon, neutral color text
|
100
|
-
- `'success'` - Green check icon, neutral color text
|
101
|
-
- `undefined` (default): No validation message icon, neutral color text
|
102
|
-
- **Error**: Some control types (like `Input` and `Combobox`) have a prop that makes the border red. This prop will be set `validationState="error"`.
|
103
|
-
|
104
|
-
Field also forwards some props from the wrapped component to the label as well:
|
105
|
-
|
106
|
-
- **Size**: If the wrapped component supports a `size` prop, it will also be applied to the field's label.
|
107
|
-
- **Required**: If set, the Label will get a required asterisk: `*`
|
108
|
-
|
109
|
-
## API
|
110
|
-
|
111
|
-
### FieldComponent
|
112
|
-
|
113
|
-
The `FieldComponent` type defines the minimum set of props that the wrapped component must support. This is used for the generic types as the requirement for the type parameter: `FieldProps<T extends FieldComponent>`
|
114
|
-
|
115
|
-
```ts
|
116
|
-
/**
|
117
|
-
* The minimum requirement for a component used by Field.
|
118
|
-
*
|
119
|
-
* Note: the use of VoidFunctionComponent means that component is not *required* to have a children prop,
|
120
|
-
* but it is still allowed to have a children prop.
|
121
|
-
*/
|
122
|
-
export type FieldComponent = React.VoidFunctionComponent<
|
123
|
-
Pick<
|
124
|
-
React.HTMLAttributes<HTMLElement>,
|
125
|
-
'id' | 'className' | 'style' | 'aria-labelledby' | 'aria-describedby' | 'aria-invalid' | 'aria-errormessage'
|
126
|
-
>
|
127
|
-
>;
|
128
|
-
```
|
129
|
-
|
130
|
-
### Slots
|
131
|
-
|
132
|
-
_Note: TypeScript crashes if the `Slot` type is used with a template type parameter. The `SlotComponent` type is a simplified version of that type, which only supports `React.ComponentType`/`React.VoidFunctionComponent`._
|
133
|
-
|
134
|
-
```ts
|
135
|
-
export type FieldSlots<T extends FieldComponent> = {
|
136
|
-
root: NonNullable<Slot<'div'>>;
|
137
|
-
|
138
|
-
/**
|
139
|
-
* The underlying component wrapped by this field.
|
140
|
-
*
|
141
|
-
* This is the PRIMARY slot: all intrinsic HTML properties will be applied to this slot,
|
142
|
-
* except `className` and `style`, which remain on the root slot.
|
143
|
-
*/
|
144
|
-
control: SlotComponent<T>;
|
145
|
-
|
146
|
-
/**
|
147
|
-
* The label associated with the field.
|
148
|
-
*/
|
149
|
-
label?: Slot<typeof Label>;
|
150
|
-
|
151
|
-
/**
|
152
|
-
* A message about the validation state. The appearance of the `validationMessage` depends on `validationState`.
|
153
|
-
*/
|
154
|
-
validationMessage?: Slot<'span'>;
|
155
|
-
|
156
|
-
/**
|
157
|
-
* The icon associated with the `validationMessage`. If the `validationState` prop is set, this will default to an
|
158
|
-
* icon corresponding to that state.
|
159
|
-
*
|
160
|
-
* This will only be displayed if `validationMessage` is set.
|
161
|
-
*/
|
162
|
-
validationMessageIcon?: Slot<'span'>;
|
163
|
-
|
164
|
-
/**
|
165
|
-
* Additional hint text below the field.
|
166
|
-
*/
|
167
|
-
hint?: Slot<'span'>;
|
168
|
-
};
|
169
|
-
```
|
170
|
-
|
171
|
-
### Props
|
172
|
-
|
173
|
-
```ts
|
174
|
-
export type FieldProps<T extends FieldComponent> = ComponentProps<Partial<FieldSlots<T>>, 'control'> & {
|
175
|
-
/**
|
176
|
-
* The orientation of the label relative to the field component.
|
177
|
-
* This only affects the label, and not the validationMessage or hint (which always appear below the field component).
|
178
|
-
*
|
179
|
-
* @default vertical
|
180
|
-
*/
|
181
|
-
orientation?: 'vertical' | 'horizontal';
|
182
|
-
|
183
|
-
/**
|
184
|
-
* The `validationState` affects the color of the `validationMessage`, the `validationMessageIcon`, and for some
|
185
|
-
* field components, an `validationState="error"` causes the border to become red.
|
186
|
-
*
|
187
|
-
* @default undefined
|
188
|
-
*/
|
189
|
-
validationState?: 'error' | 'warning' | 'success';
|
190
|
-
};
|
191
|
-
```
|
192
|
-
|
193
|
-
Field also reads some props from the underlying component. These are not part of `FieldProps` because they are not added to the components that don't support them. However, they are accepted by `useField`:
|
194
|
-
|
195
|
-
```ts
|
196
|
-
/**
|
197
|
-
* Props that are supported by Field, but not required to be supported by the component that implements field.
|
198
|
-
*/
|
199
|
-
export type OptionalFieldComponentProps = {
|
200
|
-
/**
|
201
|
-
* Whether the field label should be marked as required.
|
202
|
-
*/
|
203
|
-
required?: boolean;
|
204
|
-
|
205
|
-
/**
|
206
|
-
* Size of the field label.
|
207
|
-
*
|
208
|
-
* Number sizes will be ignored, but are allowed because the HTML <input> element has a `size` prop of type `number`.
|
209
|
-
*/
|
210
|
-
size?: 'small' | 'medium' | 'large' | number;
|
211
|
-
};
|
212
|
-
```
|
213
|
-
|
214
|
-
### State
|
215
|
-
|
216
|
-
```ts
|
217
|
-
export type FieldState<T extends FieldComponent> = ComponentState<Required<FieldSlots<T>>> &
|
218
|
-
Pick<FieldProps<T>, 'orientation' | 'validationState'> & {
|
219
|
-
classNames: SlotClassNames<FieldSlots<T>>;
|
220
|
-
};
|
221
|
-
```
|
222
|
-
|
223
|
-
### Label for Checkbox and Switch
|
224
|
-
|
225
|
-
The Checkbox and Switch components already have a `label` prop, which conflicts with the Field's `label`.
|
226
|
-
|
227
|
-
#### `CheckboxField`
|
228
|
-
|
229
|
-
- The `label` prop will go to the Checkbox and NOT the Field
|
230
|
-
- New `fieldLabel` prop for the label of the Field
|
231
|
-
|
232
|
-
#### `SwitchField`
|
233
|
-
|
234
|
-
- New `valueLabel` prop for the label of the Switch
|
235
|
-
- The `label` prop will go to the Field and NOT the Switch
|
236
|
-
|
237
|
-
## Structure
|
238
|
-
|
239
|
-
### Public API
|
240
|
-
|
241
|
-
```jsx
|
242
|
-
<InputField
|
243
|
-
label="This is the field label"
|
244
|
-
orientation="horizontal"
|
245
|
-
validationState="error"
|
246
|
-
validationMessage="This is a validation message"
|
247
|
-
hint="This is a hint message"
|
248
|
-
/>
|
249
|
-
```
|
250
|
-
|
251
|
-
(similar API for other Field components)
|
252
|
-
|
253
|
-
### Slot structure
|
254
|
-
|
255
|
-
```jsx
|
256
|
-
<slots.root>
|
257
|
-
<slots.label {...slotProps.label} />
|
258
|
-
<slots.control {...slotProps.control} />
|
259
|
-
<slots.validationMessage {...slotProps.validationMessage}>
|
260
|
-
<slots.validationMessageIcon {...slotProps.validationMessageIcon} />
|
261
|
-
{slotProps.validationMessage.children}
|
262
|
-
</slots.validationMessage>
|
263
|
-
<slots.hint {...slotProps.hint} />
|
264
|
-
</slots.root>
|
265
|
-
```
|
266
|
-
|
267
|
-
### DOM structure
|
268
|
-
|
269
|
-
```html
|
270
|
-
<div className="fui-Field">
|
271
|
-
<label className="fui-Field__label fui-Label">This is the field label</label>
|
272
|
-
<!-- wrapped field component goes here -->
|
273
|
-
<span className="fui-Field__validationMessage">
|
274
|
-
<span className="fui-Field__validationMessageIcon"><svg>...</svg></span>
|
275
|
-
This is a validation message
|
276
|
-
</span>
|
277
|
-
<span className="fui-Field__hint">This is a hint message</span>
|
278
|
-
</div>
|
279
|
-
```
|
280
|
-
|
281
|
-
## Migration
|
282
|
-
|
283
|
-
### Migration from v8
|
284
|
-
|
285
|
-
Migration from v8 will require picking between the normal and `Field` version of an input control, depending on whether the field-specific features are required: (`label`, `validationState="error"`, `validationMessage`, `hint`)
|
286
|
-
|
287
|
-
See individual input components for more detailed migration guides.
|
288
|
-
|
289
|
-
| v8 Control | v9 Base control | v9 Field control | Notes |
|
290
|
-
| ------------- | --------------------- | ------------------------------- | -------------------------------------------------------------------------------------------- |
|
291
|
-
| `Checkbox` | `Checkbox` | `CheckboxField` | Only use `CheckboxField` if an error message is needed, or if required for layout in a form. |
|
292
|
-
| `ChoiceGroup` | `RadioGroup` | `RadioGroupField` | |
|
293
|
-
| `ComboBox` | `Combobox` | `ComboboxField` | `errorMessage="..."` is replaced by `validationState="error" validationMessage="..."` |
|
294
|
-
| `Dropdown` | `Dropdown` | `DropdownField` | `errorMessage="..."` is replaced by `validationState="error" validationMessage="..."` |
|
295
|
-
| `Slider` | `Slider` | `SliderField` | |
|
296
|
-
| `SpinButton` | `SpinButton` | `SpinButtonField` | |
|
297
|
-
| `TextField` | `Input` OR `Textarea` | `InputField` OR `TextareaField` | `errorMessage="..."` is replaced by `validationState="error" validationMessage="..."` |
|
298
|
-
| `Toggle` | `Switch` | `SwitchField` | |
|
299
|
-
|
300
|
-
### Migration from v0
|
301
|
-
|
302
|
-
Many components in v0 have `Form___` versions (such as `FormInput`). Those are replaced by the `___Field` equivalent. See the underlying component's migration guides for more detailed migration information.
|
303
|
-
|
304
|
-
Component mapping:
|
305
|
-
|
306
|
-
- `FormButton` => Not supported
|
307
|
-
- `FormCheckbox` => `CheckboxField` OR `SwitchField`
|
308
|
-
- `FormDatepicker` => _(Not yet implemented)_
|
309
|
-
- `FormDropdown` => `DropdownField`
|
310
|
-
- `FormField` => Not supported
|
311
|
-
- `FormFieldCustom` => Not supported
|
312
|
-
- `FormLabel` => The `label` prop of the field component
|
313
|
-
- `FormMessage` => Either the `validationMessage` or `hint` prop of the field component
|
314
|
-
- `FormRadioGroup` => `RadioGroupField`
|
315
|
-
- `FormSlider` => `SliderField`
|
316
|
-
- `FormTextArea` => `TextareaField`
|
317
|
-
|
318
|
-
The following props are common to each of the `Form___` components:
|
319
|
-
|
320
|
-
- `label` => `label`
|
321
|
-
- `message` => either `validationMessage` or `hint`
|
322
|
-
- `errorMessage` => `validationMessage` with `validationState="error"`
|
323
|
-
|
324
|
-
## Behaviors
|
325
|
-
|
326
|
-
### Form validation
|
327
|
-
|
328
|
-
Field has no logic to perform input validation. It is expected that the validation will be done externally (possibly using a third party form validation library like Formik).
|
329
|
-
|
330
|
-
### Interaction
|
331
|
-
|
332
|
-
The Field itself is not interactive. The wrapped component has the same interactions as it does outside of a field.
|
333
|
-
|
334
|
-
## Accessibility
|
335
|
-
|
336
|
-
- **ARIA pattern**
|
337
|
-
- Field itself does not implement a defined ARIA pattern. It has no role applied to the root element.
|
338
|
-
- **Attributes**
|
339
|
-
- The following are applied on the wrapped component:
|
340
|
-
- `aria-labelledby={label.id}`, if the label is present.
|
341
|
-
- `aria-describedby` is set to one of:
|
342
|
-
- `aria-describedby={validationMessage.id}`, if validationMessage is present, and _only if_ `validationState !== 'error'`
|
343
|
-
- `aria-describedby={hint.id}`, if hint is present
|
344
|
-
- `aria-describedby={validationMessage.id + ' ' + hint.id}`, if both conditions above apply
|
345
|
-
- `aria-errormessage={validationMessage.id}`, if validationMessage is present, and _only if_ `validationState === 'error'`
|
346
|
-
- `aria-invalid={true}`, _only if_ `validationState === 'error'`
|
347
|
-
- On the `label` slot:
|
348
|
-
- `htmlFor={control.id}` - the wrapped component's `id` (an ID is generated if not supplied via props).
|
349
|
-
- **Live regions** (state change announcements)
|
350
|
-
- TBD: Need to determine if the validation message should be an aria live region.
|
351
|
-
- **UI parts appearing on hover or focus**
|
352
|
-
- None.
|
353
|
-
- **Focus behavior**
|
354
|
-
- No special focus behavior: no focus trapping or programmatic focus moving.
|
package/lib/CheckboxField.js
DELETED
package/lib/CheckboxField.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CheckboxField.js","sourceRoot":"../src/","sources":["CheckboxField.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC","sourcesContent":["export * from './components/CheckboxField/index';\n"]}
|
package/lib/ComboboxField.js
DELETED
package/lib/ComboboxField.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ComboboxField.js","sourceRoot":"../src/","sources":["ComboboxField.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC","sourcesContent":["export * from './components/ComboboxField/index';\n"]}
|
package/lib/InputField.js
DELETED
package/lib/InputField.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"InputField.js","sourceRoot":"../src/","sources":["InputField.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC","sourcesContent":["export * from './components/InputField/index';\n"]}
|
package/lib/RadioGroupField.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"RadioGroupField.js","sourceRoot":"../src/","sources":["RadioGroupField.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC","sourcesContent":["export * from './components/RadioGroupField/index';\n"]}
|
package/lib/SelectField.js
DELETED
package/lib/SelectField.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"SelectField.js","sourceRoot":"../src/","sources":["SelectField.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './components/SelectField/index';\n"]}
|
package/lib/SliderField.js
DELETED
package/lib/SliderField.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"SliderField.js","sourceRoot":"../src/","sources":["SliderField.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './components/SliderField/index';\n"]}
|
package/lib/SpinButtonField.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"SpinButtonField.js","sourceRoot":"../src/","sources":["SpinButtonField.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC","sourcesContent":["export * from './components/SpinButtonField/index';\n"]}
|
package/lib/SwitchField.js
DELETED
package/lib/SwitchField.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"SwitchField.js","sourceRoot":"../src/","sources":["SwitchField.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './components/SwitchField/index';\n"]}
|
package/lib/TextareaField.js
DELETED
package/lib/TextareaField.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"TextareaField.js","sourceRoot":"../src/","sources":["TextareaField.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC","sourcesContent":["export * from './components/TextareaField/index';\n"]}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { Checkbox } from '@fluentui/react-checkbox';
|
3
|
-
import { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '../../Field';
|
4
|
-
export const checkboxFieldClassNames = /*#__PURE__*/getFieldClassNames('CheckboxField');
|
5
|
-
export const CheckboxField = /*#__PURE__*/React.forwardRef((props, ref) => {
|
6
|
-
const {
|
7
|
-
fieldLabel,
|
8
|
-
required,
|
9
|
-
label,
|
10
|
-
control,
|
11
|
-
...restOfProps
|
12
|
-
} = props;
|
13
|
-
props = {
|
14
|
-
// Use the fieldLabel prop as the Field's label
|
15
|
-
label: fieldLabel,
|
16
|
-
// Use the label prop as the Checkbox's label
|
17
|
-
control: {
|
18
|
-
label,
|
19
|
-
required,
|
20
|
-
...control
|
21
|
-
},
|
22
|
-
...restOfProps
|
23
|
-
};
|
24
|
-
const state = useField_unstable(props, ref, {
|
25
|
-
component: Checkbox,
|
26
|
-
classNames: checkboxFieldClassNames
|
27
|
-
});
|
28
|
-
useFieldStyles_unstable(state);
|
29
|
-
return renderField_unstable(state);
|
30
|
-
});
|
31
|
-
CheckboxField.displayName = 'CheckboxField';
|
32
|
-
//# sourceMappingURL=CheckboxField.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["components/CheckboxField/CheckboxField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SAAS,QAAT,QAAyB,0BAAzB;AAGA,SAAS,kBAAT,EAA6B,oBAA7B,EAAmD,uBAAnD,EAA4E,iBAA5E,QAAqG,aAArG;AAeA,OAAO,MAAM,uBAAuB,gBAAG,kBAAkB,CAAC,eAAD,CAAlD;AAEP,OAAO,MAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM;IAAE,UAAF;IAAc,QAAd;IAAwB,KAAxB;IAA+B,OAA/B;IAAwC,GAAG;EAA3C,IAA2D,KAAjE;EAEA,KAAK,GAAG;IACN;IACA,KAAK,EAAE,UAFD;IAGN;IACA,OAAO,EAAE;MAAE,KAAF;MAAS,QAAT;MAAmB,GAAG;IAAtB,CAJH;IAKN,GAAG;EALG,CAAR;EAQA,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,EAAa;IAAE,SAAS,EAAE,QAAb;IAAuB,UAAU,EAAE;EAAnC,CAAb,CAA/B;EACA,uBAAuB,CAAC,KAAD,CAAvB;EACA,OAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CAdqE,CAA/D;AAgBP,aAAa,CAAC,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport type { CheckboxProps } from '@fluentui/react-checkbox';\nimport { Checkbox } from '@fluentui/react-checkbox';\nimport { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { FieldProps } from '../../Field';\nimport { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '../../Field';\n\nexport type CheckboxFieldProps = Omit<FieldProps<typeof Checkbox>, 'label'> & {\n /**\n * The Checkbox's label.\n */\n label?: CheckboxProps['label'];\n\n /**\n * The label for the CheckboxField, which appears above or before the Checkbox, depending on the `orientation` prop.\n * It is recommended to only set the `label` prop, and not `fieldLabel`.\n */\n fieldLabel?: FieldProps<typeof Checkbox>['label'];\n};\n\nexport const checkboxFieldClassNames = getFieldClassNames('CheckboxField');\n\nexport const CheckboxField: ForwardRefComponent<CheckboxFieldProps> = React.forwardRef((props, ref) => {\n const { fieldLabel, required, label, control, ...restOfProps } = props;\n\n props = {\n // Use the fieldLabel prop as the Field's label\n label: fieldLabel,\n // Use the label prop as the Checkbox's label\n control: { label, required, ...control },\n ...restOfProps,\n };\n\n const state = useField_unstable(props, ref, { component: Checkbox, classNames: checkboxFieldClassNames });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nCheckboxField.displayName = 'CheckboxField';\n"],"sourceRoot":"../src/"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/CheckboxField/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './CheckboxField';\n"]}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { Combobox } from '@fluentui/react-combobox';
|
3
|
-
import { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '../../Field';
|
4
|
-
export const comboboxFieldClassNames = /*#__PURE__*/getFieldClassNames('ComboboxField');
|
5
|
-
export const ComboboxField = /*#__PURE__*/React.forwardRef((props, ref) => {
|
6
|
-
const state = useField_unstable(props, ref, {
|
7
|
-
component: Combobox,
|
8
|
-
classNames: comboboxFieldClassNames
|
9
|
-
});
|
10
|
-
useFieldStyles_unstable(state);
|
11
|
-
return renderField_unstable(state);
|
12
|
-
});
|
13
|
-
ComboboxField.displayName = 'ComboboxField';
|
14
|
-
//# sourceMappingURL=ComboboxField.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["components/ComboboxField/ComboboxField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,0BAAzB;AAGA,SAAS,kBAAT,EAA6B,oBAA7B,EAAmD,uBAAnD,EAA4E,iBAA5E,QAAqG,aAArG;AAIA,OAAO,MAAM,uBAAuB,gBAAG,kBAAkB,CAAC,eAAD,CAAlD;AAEP,OAAO,MAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,EAAa;IAAE,SAAS,EAAE,QAAb;IAAuB,UAAU,EAAE;EAAnC,CAAb,CAA/B;EACA,uBAAuB,CAAC,KAAD,CAAvB;EACA,OAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CAJqE,CAA/D;AAMP,aAAa,CAAC,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport { Combobox } from '@fluentui/react-combobox';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { FieldProps } from '../../Field';\nimport { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '../../Field';\n\nexport type ComboboxFieldProps = FieldProps<typeof Combobox>;\n\nexport const comboboxFieldClassNames = getFieldClassNames('ComboboxField');\n\nexport const ComboboxField: ForwardRefComponent<ComboboxFieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref, { component: Combobox, classNames: comboboxFieldClassNames });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nComboboxField.displayName = 'ComboboxField';\n"],"sourceRoot":"../src/"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/ComboboxField/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './ComboboxField';\n"]}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { Input } from '@fluentui/react-input';
|
3
|
-
import { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '../../Field';
|
4
|
-
export const inputFieldClassNames = /*#__PURE__*/getFieldClassNames('InputField');
|
5
|
-
export const InputField = /*#__PURE__*/React.forwardRef((props, ref) => {
|
6
|
-
const state = useField_unstable(props, ref, {
|
7
|
-
component: Input,
|
8
|
-
classNames: inputFieldClassNames
|
9
|
-
});
|
10
|
-
useFieldStyles_unstable(state);
|
11
|
-
return renderField_unstable(state);
|
12
|
-
});
|
13
|
-
InputField.displayName = 'InputField';
|
14
|
-
//# sourceMappingURL=InputField.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["components/InputField/InputField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,KAAT,QAAsB,uBAAtB;AAGA,SAAS,kBAAT,EAA6B,oBAA7B,EAAmD,uBAAnD,EAA4E,iBAA5E,QAAqG,aAArG;AAIA,OAAO,MAAM,oBAAoB,gBAAG,kBAAkB,CAAC,YAAD,CAA/C;AAEP,OAAO,MAAM,UAAU,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAC9F,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,EAAa;IAAE,SAAS,EAAE,KAAb;IAAoB,UAAU,EAAE;EAAhC,CAAb,CAA/B;EACA,uBAAuB,CAAC,KAAD,CAAvB;EACA,OAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CAJ+D,CAAzD;AAMP,UAAU,CAAC,WAAX,GAAyB,YAAzB","sourcesContent":["import * as React from 'react';\nimport { Input } from '@fluentui/react-input';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { FieldProps } from '../../Field';\nimport { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '../../Field';\n\nexport type InputFieldProps = FieldProps<typeof Input>;\n\nexport const inputFieldClassNames = getFieldClassNames('InputField');\n\nexport const InputField: ForwardRefComponent<InputFieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref, { component: Input, classNames: inputFieldClassNames });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nInputField.displayName = 'InputField';\n"],"sourceRoot":"../src/"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/InputField/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC","sourcesContent":["export * from './InputField';\n"]}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { RadioGroup } from '@fluentui/react-radio';
|
3
|
-
import { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '../../Field';
|
4
|
-
export const radioGroupFieldClassNames = /*#__PURE__*/getFieldClassNames('RadioGroupField');
|
5
|
-
export const RadioGroupField = /*#__PURE__*/React.forwardRef((props, ref) => {
|
6
|
-
const state = useField_unstable(props, ref, {
|
7
|
-
component: RadioGroup,
|
8
|
-
classNames: radioGroupFieldClassNames,
|
9
|
-
labelConnection: 'aria-labelledby'
|
10
|
-
});
|
11
|
-
useFieldStyles_unstable(state);
|
12
|
-
return renderField_unstable(state);
|
13
|
-
});
|
14
|
-
RadioGroupField.displayName = 'RadioGroupField';
|
15
|
-
//# sourceMappingURL=RadioGroupField.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["components/RadioGroupField/RadioGroupField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,UAAT,QAA2B,uBAA3B;AAGA,SAAS,kBAAT,EAA6B,oBAA7B,EAAmD,uBAAnD,EAA4E,iBAA5E,QAAqG,aAArG;AAIA,OAAO,MAAM,yBAAyB,gBAAG,kBAAkB,CAAC,iBAAD,CAApD;AAEP,OAAO,MAAM,eAAe,gBAA8C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACxG,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,EAAa;IAC1C,SAAS,EAAE,UAD+B;IAE1C,UAAU,EAAE,yBAF8B;IAG1C,eAAe,EAAE;EAHyB,CAAb,CAA/B;EAKA,uBAAuB,CAAC,KAAD,CAAvB;EACA,OAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CARyE,CAAnE;AAUP,eAAe,CAAC,WAAhB,GAA8B,iBAA9B","sourcesContent":["import * as React from 'react';\nimport { RadioGroup } from '@fluentui/react-radio';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { FieldProps } from '../../Field';\nimport { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '../../Field';\n\nexport type RadioGroupFieldProps = FieldProps<typeof RadioGroup>;\n\nexport const radioGroupFieldClassNames = getFieldClassNames('RadioGroupField');\n\nexport const RadioGroupField: ForwardRefComponent<RadioGroupFieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref, {\n component: RadioGroup,\n classNames: radioGroupFieldClassNames,\n labelConnection: 'aria-labelledby',\n });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nRadioGroupField.displayName = 'RadioGroupField';\n"],"sourceRoot":"../src/"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/RadioGroupField/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './RadioGroupField';\n"]}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { Select } from '@fluentui/react-select';
|
3
|
-
import { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '../../Field';
|
4
|
-
export const selectFieldClassNames = /*#__PURE__*/getFieldClassNames('SelectField');
|
5
|
-
export const SelectField = /*#__PURE__*/React.forwardRef((props, ref) => {
|
6
|
-
const state = useField_unstable(props, ref, {
|
7
|
-
component: Select,
|
8
|
-
classNames: selectFieldClassNames
|
9
|
-
});
|
10
|
-
useFieldStyles_unstable(state);
|
11
|
-
return renderField_unstable(state);
|
12
|
-
});
|
13
|
-
SelectField.displayName = 'SelectField';
|
14
|
-
//# sourceMappingURL=SelectField.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["components/SelectField/SelectField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,MAAT,QAAuB,wBAAvB;AAGA,SAAS,kBAAT,EAA6B,oBAA7B,EAAmD,uBAAnD,EAA4E,iBAA5E,QAAqG,aAArG;AAIA,OAAO,MAAM,qBAAqB,gBAAG,kBAAkB,CAAC,aAAD,CAAhD;AAEP,OAAO,MAAM,WAAW,gBAA0C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAChG,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,EAAa;IAAE,SAAS,EAAE,MAAb;IAAqB,UAAU,EAAE;EAAjC,CAAb,CAA/B;EACA,uBAAuB,CAAC,KAAD,CAAvB;EACA,OAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CAJiE,CAA3D;AAMP,WAAW,CAAC,WAAZ,GAA0B,aAA1B","sourcesContent":["import * as React from 'react';\nimport { Select } from '@fluentui/react-select';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { FieldProps } from '../../Field';\nimport { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '../../Field';\n\nexport type SelectFieldProps = FieldProps<typeof Select>;\n\nexport const selectFieldClassNames = getFieldClassNames('SelectField');\n\nexport const SelectField: ForwardRefComponent<SelectFieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref, { component: Select, classNames: selectFieldClassNames });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nSelectField.displayName = 'SelectField';\n"],"sourceRoot":"../src/"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/SelectField/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC","sourcesContent":["export * from './SelectField';\n"]}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { Slider } from '@fluentui/react-slider';
|
3
|
-
import { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '../../Field';
|
4
|
-
export const sliderFieldClassNames = /*#__PURE__*/getFieldClassNames('SliderField');
|
5
|
-
export const SliderField = /*#__PURE__*/React.forwardRef((props, ref) => {
|
6
|
-
const state = useField_unstable(props, ref, {
|
7
|
-
component: Slider,
|
8
|
-
classNames: sliderFieldClassNames
|
9
|
-
});
|
10
|
-
useFieldStyles_unstable(state);
|
11
|
-
return renderField_unstable(state);
|
12
|
-
});
|
13
|
-
SliderField.displayName = 'SliderField';
|
14
|
-
//# sourceMappingURL=SliderField.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["components/SliderField/SliderField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,MAAT,QAAuB,wBAAvB;AAGA,SAAS,kBAAT,EAA6B,oBAA7B,EAAmD,uBAAnD,EAA4E,iBAA5E,QAAqG,aAArG;AAIA,OAAO,MAAM,qBAAqB,gBAAG,kBAAkB,CAAC,aAAD,CAAhD;AAEP,OAAO,MAAM,WAAW,gBAA0C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAChG,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,EAAa;IAAE,SAAS,EAAE,MAAb;IAAqB,UAAU,EAAE;EAAjC,CAAb,CAA/B;EACA,uBAAuB,CAAC,KAAD,CAAvB;EACA,OAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CAJiE,CAA3D;AAMP,WAAW,CAAC,WAAZ,GAA0B,aAA1B","sourcesContent":["import * as React from 'react';\nimport { Slider } from '@fluentui/react-slider';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { FieldProps } from '../../Field';\nimport { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '../../Field';\n\nexport type SliderFieldProps = FieldProps<typeof Slider>;\n\nexport const sliderFieldClassNames = getFieldClassNames('SliderField');\n\nexport const SliderField: ForwardRefComponent<SliderFieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref, { component: Slider, classNames: sliderFieldClassNames });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nSliderField.displayName = 'SliderField';\n"],"sourceRoot":"../src/"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/SliderField/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC","sourcesContent":["export * from './SliderField';\n"]}
|