@dfds-ui/forms 2.0.13-alpha.387f7b2c → 2.0.13-alpha.578b87f7
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/assistive-text/AssistiveText.d.ts +2 -1
- package/assistive-text/AssistiveText.js +3 -1
- package/checkbox/Checkbox.d.ts +0 -6
- package/checkbox/Checkbox.js +8 -13
- package/checkbox/CheckboxGroup.d.ts +2 -2
- package/checkbox/CheckboxGroup.js +6 -14
- package/cjs/assistive-text/AssistiveText.d.ts +9 -0
- package/cjs/assistive-text/AssistiveText.js +2 -1
- package/cjs/asterisk/Asterisk.d.ts +11 -0
- package/cjs/checkbox/Checkbox.d.ts +59 -0
- package/cjs/checkbox/Checkbox.js +8 -13
- package/cjs/checkbox/CheckboxContext.d.ts +13 -0
- package/cjs/checkbox/CheckboxGroup.d.ts +20 -0
- package/cjs/checkbox/CheckboxGroup.js +6 -14
- package/cjs/checkbox/index.d.ts +2 -0
- package/cjs/counter/Counter.d.ts +66 -0
- package/cjs/counter/index.d.ts +1 -0
- package/cjs/enhanced/EnhancedField.d.ts +20 -0
- package/cjs/enhanced/index.d.ts +1 -0
- package/cjs/error-text/ErrorText.d.ts +8 -0
- package/cjs/field-wrap/FieldWrap.d.ts +9 -0
- package/cjs/field-wrap/FieldWrap.js +3 -3
- package/cjs/field-wrap/index.d.ts +1 -0
- package/cjs/help-icon/HelpIcon.d.ts +7 -0
- package/cjs/index.d.ts +15 -0
- package/cjs/label/Label.d.ts +11 -0
- package/cjs/label/Label.js +4 -2
- package/cjs/password-field/PasswordField.d.ts +4 -0
- package/cjs/radio/Radio.d.ts +51 -0
- package/cjs/radio/RadioContext.d.ts +13 -0
- package/cjs/radio/RadioGroup.d.ts +12 -0
- package/cjs/radio/RadioGroup.js +4 -10
- package/cjs/radio/index.d.ts +2 -0
- package/cjs/rating/Rating.d.ts +55 -0
- package/cjs/rating/index.d.ts +1 -0
- package/cjs/select-field/NativeSelectField.d.ts +8 -0
- package/cjs/select-field/SelectField.d.ts +83 -0
- package/cjs/select-field/SelectField.js +48 -88
- package/cjs/switch/Switch.d.ts +32 -0
- package/cjs/switch/SwitchContext.d.ts +11 -0
- package/cjs/switch/SwitchGroup.d.ts +10 -0
- package/cjs/switch/SwitchGroup.js +1 -11
- package/cjs/switch/index.d.ts +1 -0
- package/cjs/switch/index.js +6 -21
- package/cjs/tel-field/TelField.d.ts +67 -0
- package/cjs/text-field/TextField.d.ts +47 -0
- package/cjs/text-field/TextField.js +4 -4
- package/cjs/textarea-field/TextareaField.d.ts +44 -0
- package/cjs/types/field.d.ts +52 -0
- package/cjs/types/index.d.ts +2 -0
- package/cjs/types/size.d.ts +1 -0
- package/field-wrap/FieldWrap.js +3 -3
- package/label/Label.d.ts +2 -1
- package/label/Label.js +4 -2
- package/package.json +7 -7
- package/radio/RadioGroup.d.ts +2 -2
- package/radio/RadioGroup.js +4 -10
- package/select-field/SelectField.d.ts +1 -11
- package/select-field/SelectField.js +49 -89
- package/switch/SwitchGroup.js +12 -22
- package/switch/index.d.ts +1 -2
- package/switch/index.js +1 -2
- package/text-field/TextField.d.ts +2 -10
- package/text-field/TextField.js +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Rating';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseFieldProps, Size } from '../types';
|
|
3
|
+
export declare type NativeSelectFieldProps = BaseFieldProps & React.ComponentPropsWithRef<'select'> & {
|
|
4
|
+
className?: string;
|
|
5
|
+
visualSize?: Size;
|
|
6
|
+
};
|
|
7
|
+
export declare const NativeSelectField: React.ForwardRefExoticComponent<Pick<NativeSelectFieldProps, "required" | "key" | "id" | "name" | "color" | "translate" | "value" | "hidden" | "form" | "label" | "slot" | "style" | "title" | "dir" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "tabIndex" | "disabled" | "multiple" | "size" | "help" | "autoComplete" | "autoFocus" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "hideAsterisk" | "assistiveText" | "errorMessage" | "visualSize" | "helpPlacement"> & React.RefAttributes<HTMLSelectElement>>;
|
|
8
|
+
export default NativeSelectField;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Select, { createFilter, GroupBase, OptionsOrGroups, SingleValue } from 'react-select';
|
|
3
|
+
import { BaseFieldProps } from '../types';
|
|
4
|
+
export declare type BaseReactSelectProps = Omit<React.PropsWithRef<Select>, 'size' | 'css'>;
|
|
5
|
+
export declare type Size = 'small' | 'medium' | 'large';
|
|
6
|
+
export declare const ReactSelectWrapper: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: React.ElementType<any> | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
error?: boolean | undefined;
|
|
11
|
+
size?: string | undefined;
|
|
12
|
+
arrow?: boolean | undefined;
|
|
13
|
+
selected?: boolean | undefined;
|
|
14
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
15
|
+
export declare const Menu: (props: any) => JSX.Element;
|
|
16
|
+
export declare type SelectFieldProps<T = string> = BaseFieldProps & {
|
|
17
|
+
defaultValue?: SingleValue<T>;
|
|
18
|
+
className?: string;
|
|
19
|
+
components?: any;
|
|
20
|
+
value?: SingleValue<T>;
|
|
21
|
+
visualSize?: Size;
|
|
22
|
+
options?: OptionsOrGroups<T, GroupBase<T>>;
|
|
23
|
+
isSearchable?: boolean;
|
|
24
|
+
onSelect?: (value: SingleValue<T>) => void;
|
|
25
|
+
onChange?: (value: SingleValue<T>) => void;
|
|
26
|
+
onBlur?: (value: any) => void;
|
|
27
|
+
menuIsOpen?: boolean;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
assistiveText?: string;
|
|
30
|
+
errorMessage?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Indicates that the Select can be cleared after selecting an Option.
|
|
33
|
+
*
|
|
34
|
+
* Setting this to true will display a small dismiss cross when a value is selected
|
|
35
|
+
*/
|
|
36
|
+
isClearable?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Configuration object passed to react-select createFilter function to create [custom filter
|
|
39
|
+
* logic](https://react-select.com/advanced#custom-filter-logic)
|
|
40
|
+
* @param ignoreCase - boolean (optional)
|
|
41
|
+
* @param ignoreAccents - boolean (optional)
|
|
42
|
+
* @param stringify (obj: any) => string (optional)
|
|
43
|
+
* @param trim - boolean (optional)
|
|
44
|
+
* @param matchForm - 'any' | 'start'
|
|
45
|
+
*/
|
|
46
|
+
filterConfig?: Parameters<typeof createFilter>[0];
|
|
47
|
+
};
|
|
48
|
+
declare function SelectFieldInner<T>({ components, name, label, defaultValue, value, placeholder, onSelect, onChange, isSearchable, onBlur, assistiveText, options, errorMessage, isClearable, disabled, visualSize, required, hideAsterisk, filterConfig, ...rest }: SelectFieldProps<T>, ref: React.ForwardedRef<any>): JSX.Element;
|
|
49
|
+
export declare const SelectField: <T>(props: BaseFieldProps & {
|
|
50
|
+
defaultValue?: SingleValue<T> | undefined;
|
|
51
|
+
className?: string | undefined;
|
|
52
|
+
components?: any;
|
|
53
|
+
value?: SingleValue<T> | undefined;
|
|
54
|
+
visualSize?: Size | undefined;
|
|
55
|
+
options?: OptionsOrGroups<T, GroupBase<T>> | undefined;
|
|
56
|
+
isSearchable?: boolean | undefined;
|
|
57
|
+
onSelect?: ((value: SingleValue<T>) => void) | undefined;
|
|
58
|
+
onChange?: ((value: SingleValue<T>) => void) | undefined;
|
|
59
|
+
onBlur?: ((value: any) => void) | undefined;
|
|
60
|
+
menuIsOpen?: boolean | undefined;
|
|
61
|
+
placeholder?: string | undefined;
|
|
62
|
+
assistiveText?: string | undefined;
|
|
63
|
+
errorMessage?: string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Indicates that the Select can be cleared after selecting an Option.
|
|
66
|
+
*
|
|
67
|
+
* Setting this to true will display a small dismiss cross when a value is selected
|
|
68
|
+
*/
|
|
69
|
+
isClearable?: boolean | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Configuration object passed to react-select createFilter function to create [custom filter
|
|
72
|
+
* logic](https://react-select.com/advanced#custom-filter-logic)
|
|
73
|
+
* @param ignoreCase - boolean (optional)
|
|
74
|
+
* @param ignoreAccents - boolean (optional)
|
|
75
|
+
* @param stringify (obj: any) => string (optional)
|
|
76
|
+
* @param trim - boolean (optional)
|
|
77
|
+
* @param matchForm - 'any' | 'start'
|
|
78
|
+
*/
|
|
79
|
+
filterConfig?: Parameters<typeof createFilter>[0];
|
|
80
|
+
} & {
|
|
81
|
+
ref?: React.ForwardedRef<any> | undefined;
|
|
82
|
+
}) => ReturnType<typeof SelectFieldInner>;
|
|
83
|
+
export default SelectField;
|