@procore/core-react 11.24.3 → 11.25.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/dist/Avatar/Avatar.styles.js +5 -5
- package/dist/AvatarStack/AvatarStack.styles.js +7 -7
- package/dist/Badge/Badge.styles.js +2 -2
- package/dist/Banner/Banner.styles.js +10 -10
- package/dist/Box/Box.styles.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
- package/dist/Button/Button.styles.js +5 -5
- package/dist/Calendar/Calendar.styles.js +8 -8
- package/dist/Card/Card.styles.js +1 -1
- package/dist/Checkbox/Checkbox.d.ts +1 -1
- package/dist/Checkbox/Checkbox.js +26 -6
- package/dist/Checkbox/Checkbox.js.map +1 -1
- package/dist/Checkbox/Checkbox.styles.d.ts +6 -2
- package/dist/Checkbox/Checkbox.styles.js +21 -17
- package/dist/Checkbox/Checkbox.styles.js.map +1 -1
- package/dist/Checkbox/Checkbox.types.d.ts +10 -0
- package/dist/Checkbox/Checkbox.types.js.map +1 -1
- package/dist/ContactItem/ContactItem.styles.js +5 -5
- package/dist/Content/Content.styles.js +2 -2
- package/dist/DateInput/DateInput.styles.js +6 -6
- package/dist/DetailPage/DetailPage.styles.js +7 -7
- package/dist/Dropdown/Dropdown.styles.js +3 -3
- package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
- package/dist/Dropzone/Dropzone.js +1 -1
- package/dist/Dropzone/Dropzone.styles.js +9 -9
- package/dist/EmptyState/EmptyState.styles.js +6 -6
- package/dist/Field/Field.styles.js +3 -3
- package/dist/FileList/FileList.styles.js +4 -4
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
- package/dist/FileSelect/FileSelect.styles.js +2 -2
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
- package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
- package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
- package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
- package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
- package/dist/FileToken/FileToken.styles.js +4 -4
- package/dist/FilterToken/FilterToken.styles.js +2 -2
- package/dist/FlexList/FlexList.styles.js +1 -1
- package/dist/Form/Form.d.ts +1 -1
- package/dist/Form/Form.js +68 -36
- package/dist/Form/Form.js.map +1 -1
- package/dist/Form/Form.styles.d.ts +8 -5
- package/dist/Form/Form.styles.js +49 -40
- package/dist/Form/Form.styles.js.map +1 -1
- package/dist/Form/Form.types.d.ts +28 -1
- package/dist/Form/Form.types.js.map +1 -1
- package/dist/Form/FormFieldTooltip.d.ts +4 -0
- package/dist/Form/FormFieldTooltip.js +18 -0
- package/dist/Form/FormFieldTooltip.js.map +1 -0
- package/dist/Form/stories/util.d.ts +2 -0
- package/dist/Form/stories/util.js +61 -17
- package/dist/Form/stories/util.js.map +1 -1
- package/dist/Grid/Grid.styles.js +2 -2
- package/dist/GroupSelect/GroupSelect.styles.js +1 -1
- package/dist/Input/Input.styles.js +1 -1
- package/dist/Link/Link.styles.js +1 -1
- package/dist/ListPage/ListPage.styles.js +8 -8
- package/dist/Loader/Loader.styles.js +2 -2
- package/dist/MenuImperative/MenuImperative.styles.js +10 -10
- package/dist/Modal/Modal.styles.js +13 -13
- package/dist/MultiSelect/MultiSelect.styles.js +6 -6
- package/dist/NextMenu/NextMenu.styles.js +3 -3
- package/dist/Notation/Notation.js +1 -1
- package/dist/NumberInput/NumberInput.styles.js +7 -7
- package/dist/Overlay/OverlayArrow.styles.js +1 -1
- package/dist/PageLayout/PageLayout.styles.js +13 -13
- package/dist/Pagination/Pagination.styles.js +5 -5
- package/dist/Panel/Panel.styles.js +11 -11
- package/dist/Pill/Pill.styles.js +2 -2
- package/dist/PillSelect/PillSelect.styles.js +4 -4
- package/dist/Popover/Popover.styles.js +2 -2
- package/dist/Portal/Portal.styles.js +1 -1
- package/dist/ProgressBar/ProgressBar.styles.js +2 -2
- package/dist/RadioButton/RadioButton.styles.js +3 -3
- package/dist/Required/Required.styles.js +6 -4
- package/dist/Required/Required.styles.js.map +1 -1
- package/dist/Search/Search.styles.js +5 -5
- package/dist/Section/Section.styles.js +6 -6
- package/dist/SegmentedController/SegmentedController.styles.js +4 -4
- package/dist/Select/Select.styles.js +7 -7
- package/dist/Semantic/Semantic.styles.js +8 -8
- package/dist/Sidebar/Sidebar.styles.js +7 -7
- package/dist/Slider/Slider.styles.js +5 -5
- package/dist/Spinner/Spinner.styles.js +7 -7
- package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
- package/dist/SuperSelect/SuperSelect.styles.js +37 -37
- package/dist/Switch/Switch.styles.js +4 -4
- package/dist/Table/Table.styles.js +28 -28
- package/dist/TableShelf/TableShelf.styles.js +5 -5
- package/dist/Tabs/Tabs.styles.js +8 -8
- package/dist/Tearsheet/Tearsheet.styles.js +5 -5
- package/dist/TextArea/TextArea.styles.js +1 -1
- package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
- package/dist/Thumbnail/Thumbnail.styles.js +17 -17
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
- package/dist/TieredSelect/TieredSelect.styles.js +9 -9
- package/dist/Tile/Tile.styles.js +8 -8
- package/dist/Title/Title.styles.js +7 -7
- package/dist/Toast/Toast.styles.js +3 -3
- package/dist/ToggleButton/ToggleButton.styles.js +1 -1
- package/dist/Token/Token.styles.js +3 -3
- package/dist/ToolHeader/ToolHeader.styles.js +6 -6
- package/dist/Tooltip/Tooltip.styles.js +2 -2
- package/dist/Tree/Tree.hooks.js +58 -36
- package/dist/Tree/Tree.hooks.js.map +1 -1
- package/dist/Tree/Tree.js +1 -1
- package/dist/Tree/Tree.js.map +1 -1
- package/dist/Tree/Tree.styles.js +9 -9
- package/dist/Tree/Tree.types.d.ts +7 -3
- package/dist/Tree/Tree.types.js.map +1 -1
- package/dist/Typeahead/Typeahead.styles.js +3 -3
- package/dist/Typography/Typography.styles.js +1 -1
- package/dist/Typography/Typography.table.story.js +2 -2
- package/dist/_hooks/I18n.d.ts +386 -1
- package/dist/_hooks/useSet.js +3 -3
- package/dist/_hooks/useSet.js.map +1 -1
- package/dist/_locales/de-DE.json +3 -1
- package/dist/_locales/en-AU.json +3 -1
- package/dist/_locales/en-CA.json +3 -1
- package/dist/_locales/en-GB.json +3 -1
- package/dist/_locales/en.json +3 -1
- package/dist/_locales/es-ES.json +3 -1
- package/dist/_locales/es.json +3 -1
- package/dist/_locales/fr-CA.json +3 -1
- package/dist/_locales/fr-FR.json +3 -1
- package/dist/_locales/is-IS.json +3 -1
- package/dist/_locales/ja-JP.json +360 -1
- package/dist/_locales/pt-BR.json +3 -1
- package/dist/_locales/th-TH.json +3 -1
- package/dist/_locales/zh-SG.json +3 -1
- package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
- package/dist/_typedoc/AvatarStack/AvatarStack.types.json +23 -23
- package/dist/_typedoc/Badge/Badge.types.json +6 -6
- package/dist/_typedoc/Banner/Banner.types.json +13 -13
- package/dist/_typedoc/Box/Box.types.json +68 -68
- package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
- package/dist/_typedoc/Button/Button.types.json +11 -11
- package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
- package/dist/_typedoc/Card/Card.types.json +6 -6
- package/dist/_typedoc/Checkbox/Checkbox.types.json +27 -7
- package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
- package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
- package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
- package/dist/_typedoc/DetailPage/DetailPage.types.json +4 -4
- package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
- package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +29 -29
- package/dist/_typedoc/Dropzone/Dropzone.types.json +41 -41
- package/dist/_typedoc/EmptyState/EmptyState.types.json +14 -14
- package/dist/_typedoc/FileList/FileList.types.json +9 -9
- package/dist/_typedoc/FileSelect/FileSelect.types.json +26 -26
- package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
- package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
- package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +11 -11
- package/dist/_typedoc/Flex/Flex.types.json +27 -27
- package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
- package/dist/_typedoc/Form/Form.types.json +938 -698
- package/dist/_typedoc/Grid/Grid.types.json +8 -8
- package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
- package/dist/_typedoc/Input/Input.types.json +2 -2
- package/dist/_typedoc/Link/Link.types.json +4 -4
- package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
- package/dist/_typedoc/Menu/Menu.types.json +62 -62
- package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
- package/dist/_typedoc/Modal/Modal.types.json +41 -41
- package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
- package/dist/_typedoc/Notation/Notation.types.json +4 -4
- package/dist/_typedoc/NumberInput/NumberInput.types.json +38 -38
- package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +30 -30
- package/dist/_typedoc/PageLayout/PageLayout.types.json +22 -22
- package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
- package/dist/_typedoc/Panel/Panel.types.json +27 -27
- package/dist/_typedoc/Pill/Pill.types.json +2 -2
- package/dist/_typedoc/PillSelect/PillSelect.types.json +46 -46
- package/dist/_typedoc/Popover/Popover.types.json +14 -14
- package/dist/_typedoc/ProgressBar/ProgressBar.types.json +6 -6
- package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
- package/dist/_typedoc/Required/Required.types.json +5 -5
- package/dist/_typedoc/Search/Search.types.json +18 -18
- package/dist/_typedoc/Section/Section.types.json +14 -14
- package/dist/_typedoc/SegmentedController/SegmentedController.types.json +20 -20
- package/dist/_typedoc/Select/Select.types.json +55 -55
- package/dist/_typedoc/Slider/Slider.types.json +6 -6
- package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
- package/dist/_typedoc/Switch/Switch.types.json +3 -3
- package/dist/_typedoc/Table/Table.types.json +96 -96
- package/dist/_typedoc/Tabs/Tabs.types.json +17 -17
- package/dist/_typedoc/Tearsheet/Tearsheet.types.json +16 -16
- package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
- package/dist/_typedoc/TextEditor/TextEditor.types.json +9 -9
- package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +4 -4
- package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
- package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
- package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
- package/dist/_typedoc/Tile/Tile.types.json +30 -30
- package/dist/_typedoc/Toast/Toast.types.json +4 -4
- package/dist/_typedoc/ToggleButton/ToggleButton.types.json +3 -3
- package/dist/_typedoc/Token/Token.types.json +4 -4
- package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
- package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
- package/dist/_typedoc/Tree/Tree.types.json +94 -94
- package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
- package/dist/_typedoc/Typography/Typography.types.json +8 -8
- package/dist/_typedoc/_utils/types.json +3 -3
- package/package.json +1 -1
|
@@ -6,6 +6,14 @@ export declare const StyledFormFieldMain: import("styled-components").StyledComp
|
|
|
6
6
|
$colEnd: number;
|
|
7
7
|
$colIeSpan: number;
|
|
8
8
|
}, never>;
|
|
9
|
+
export declare const StyledLabel: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLLabelElement> & {
|
|
10
|
+
htmlFor?: string | undefined;
|
|
11
|
+
block?: boolean | undefined;
|
|
12
|
+
} & import("react").RefAttributes<HTMLLabelElement>>, any, {}, never>;
|
|
13
|
+
export declare const StyledDescription: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
14
|
+
export declare const StyledCheckboxInlineDescription: import("styled-components").StyledComponent<"div", any, {
|
|
15
|
+
$read: boolean;
|
|
16
|
+
}, never>;
|
|
9
17
|
export declare const StyledFormFieldHeader: import("styled-components").StyledComponent<"div", any, {
|
|
10
18
|
$colStart: number;
|
|
11
19
|
$colEnd: number;
|
|
@@ -30,7 +38,6 @@ export declare const StyledTraditionalFormLabel: import("styled-components").Sty
|
|
|
30
38
|
$view: View;
|
|
31
39
|
}, never>;
|
|
32
40
|
export declare const StyledFormOutputTextArea: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
33
|
-
export declare const StyledFormCheckboxInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Checkbox").CheckboxProps & import("react").RefAttributes<HTMLInputElement>>, any, {}, never>;
|
|
34
41
|
export declare const StyledFormOutputFiledset: import("styled-components").StyledComponent<"fieldset", any, {}, never>;
|
|
35
42
|
export declare const StyledFormRow: import("styled-components").StyledComponent<"div", any, {
|
|
36
43
|
$traditional?: boolean | undefined;
|
|
@@ -38,7 +45,3 @@ export declare const StyledFormRow: import("styled-components").StyledComponent<
|
|
|
38
45
|
}, never>;
|
|
39
46
|
export declare const StyledFormikForm: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "color" | "children" | "className" | "style" | "slot" | "title" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "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" | "method" | "target" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate"> & import("react").RefAttributes<HTMLFormElement>>, any, {}, never>;
|
|
40
47
|
export declare const StyledForm: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
41
|
-
export declare const StyledLabel: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLLabelElement> & {
|
|
42
|
-
htmlFor?: string | undefined;
|
|
43
|
-
block?: boolean | undefined;
|
|
44
|
-
} & import("react").RefAttributes<HTMLLabelElement>>, any, {}, never>;
|
package/dist/Form/Form.styles.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Error, Help } from '@procore/core-icons/dist';
|
|
2
2
|
import { Form as FormikForm } from 'formik';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import {
|
|
4
|
+
import { checkboxSize } from '../Checkbox/Checkbox.styles';
|
|
5
5
|
import { StyledFieldHeader } from '../Field/Field.styles';
|
|
6
6
|
import { Required } from '../Required/Required';
|
|
7
7
|
import { Label } from '../Semantic/Semantic';
|
|
@@ -26,7 +26,7 @@ function applyStylesOnlyToIE11(styles) {
|
|
|
26
26
|
}
|
|
27
27
|
export var StyledFormFieldMain = /*#__PURE__*/styled.div.withConfig({
|
|
28
28
|
displayName: "StyledFormFieldMain",
|
|
29
|
-
componentId: "core-
|
|
29
|
+
componentId: "core-11_25_0__sc-ncj3pf-0"
|
|
30
30
|
})(["-ms-grid-row:2;grid-row:2;", " ", " ", ""], function (_ref) {
|
|
31
31
|
var $colStart = _ref.$colStart,
|
|
32
32
|
$colEnd = _ref.$colEnd,
|
|
@@ -36,18 +36,35 @@ export var StyledFormFieldMain = /*#__PURE__*/styled.div.withConfig({
|
|
|
36
36
|
var $read = _ref2.$read;
|
|
37
37
|
return $read && css(["word-wrap:break-word;color:", ";", ";"], colors.gray15, getTypographyIntent('body'));
|
|
38
38
|
}, applyStylesOnlyToIE11("\n padding-left: ".concat(columnGutter, ";\n\n &:nth-child(2) {\n padding-left: 0;\n }\n ")));
|
|
39
|
+
export var StyledLabel = /*#__PURE__*/styled(Label).withConfig({
|
|
40
|
+
displayName: "StyledLabel",
|
|
41
|
+
componentId: "core-11_25_0__sc-ncj3pf-1"
|
|
42
|
+
})(["word-wrap:break-word;word-break:break-word;"]);
|
|
43
|
+
export var StyledDescription = /*#__PURE__*/styled.div.withConfig({
|
|
44
|
+
displayName: "StyledDescription",
|
|
45
|
+
componentId: "core-11_25_0__sc-ncj3pf-2"
|
|
46
|
+
})(["", " color:", ";word-wrap:break-word;word-break:break-word;"], getTypographyIntent('body'), colors.gray45);
|
|
47
|
+
export var StyledCheckboxInlineDescription = /*#__PURE__*/styled(StyledDescription).withConfig({
|
|
48
|
+
displayName: "StyledCheckboxInlineDescription",
|
|
49
|
+
componentId: "core-11_25_0__sc-ncj3pf-3"
|
|
50
|
+
})(["margin-top:", "px;", ""], spacing.xs, function (_ref3) {
|
|
51
|
+
var $read = _ref3.$read;
|
|
52
|
+
if (!$read) {
|
|
53
|
+
return css(["padding-left:", "px;"], checkboxSize + spacing.md);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
39
56
|
export var StyledFormFieldHeader = /*#__PURE__*/styled(StyledFieldHeader).withConfig({
|
|
40
57
|
displayName: "StyledFormFieldHeader",
|
|
41
|
-
componentId: "core-
|
|
42
|
-
})(["-ms-grid-row:1;grid-row:1;align-self:end;", " ", ""], function (
|
|
43
|
-
var $colStart =
|
|
44
|
-
$colEnd =
|
|
45
|
-
$colIeSpan =
|
|
58
|
+
componentId: "core-11_25_0__sc-ncj3pf-4"
|
|
59
|
+
})(["-ms-grid-row:1;grid-row:1;align-self:end;margin-bottom:", "px;", " ", " * + ", "{margin-top:", "px;}"], spacing.xs, function (_ref4) {
|
|
60
|
+
var $colStart = _ref4.$colStart,
|
|
61
|
+
$colEnd = _ref4.$colEnd,
|
|
62
|
+
$colIeSpan = _ref4.$colIeSpan;
|
|
46
63
|
return getGridColumns($colStart, $colEnd, $colIeSpan);
|
|
47
|
-
}, applyStylesOnlyToIE11("\n padding-left: ".concat(columnGutter, ";\n\n &:first-child {\n padding-left: 0;\n }\n\n ").concat(StyledFormFieldMain, " {\n padding-left: ").concat(columnGutter, ";\n\n &:nth-child(2) {\n padding-left: 0;\n }\n }\n ")));
|
|
64
|
+
}, applyStylesOnlyToIE11("\n padding-left: ".concat(columnGutter, ";\n\n &:first-child {\n padding-left: 0;\n }\n\n ").concat(StyledFormFieldMain, " {\n padding-left: ").concat(columnGutter, ";\n\n &:nth-child(2) {\n padding-left: 0;\n }\n }\n ")), StyledDescription, spacing.xs);
|
|
48
65
|
export var StyledFormFieldRequiredMark = /*#__PURE__*/styled(Required).withConfig({
|
|
49
66
|
displayName: "StyledFormFieldRequiredMark",
|
|
50
|
-
componentId: "core-
|
|
67
|
+
componentId: "core-11_25_0__sc-ncj3pf-5"
|
|
51
68
|
})(["padding-left:", "px;vertical-align:top;"], spacing.xs);
|
|
52
69
|
export var dataQaFieldTooltipIcon = 'form-field-tooltip-icon';
|
|
53
70
|
export var StyledFormFieldTooltipIcon = /*#__PURE__*/styled(Help).attrs(function () {
|
|
@@ -56,68 +73,60 @@ export var StyledFormFieldTooltipIcon = /*#__PURE__*/styled(Help).attrs(function
|
|
|
56
73
|
};
|
|
57
74
|
}).withConfig({
|
|
58
75
|
displayName: "StyledFormFieldTooltipIcon",
|
|
59
|
-
componentId: "core-
|
|
76
|
+
componentId: "core-11_25_0__sc-ncj3pf-6"
|
|
60
77
|
})(["margin-left:", "px;color:", ";vertical-align:middle;&:focus-visible{border-radius:50%;", " outline-offset:0;}"], spacing.sm, colors.gray45, getGapOutlineFocus);
|
|
61
78
|
export var StyledFormFieldErrorIcon = /*#__PURE__*/styled(Error).withConfig({
|
|
62
79
|
displayName: "StyledFormFieldErrorIcon",
|
|
63
|
-
componentId: "core-
|
|
80
|
+
componentId: "core-11_25_0__sc-ncj3pf-7"
|
|
64
81
|
})(["vertical-align:sub;"]);
|
|
65
82
|
export var StyledFormFieldBanner = /*#__PURE__*/styled.div.withConfig({
|
|
66
83
|
displayName: "StyledFormFieldBanner",
|
|
67
|
-
componentId: "core-
|
|
84
|
+
componentId: "core-11_25_0__sc-ncj3pf-8"
|
|
68
85
|
})(["display:flex;align-items:flex-start;min-height:22px;margin-top:", "px;margin-bottom:2px;word-break:break-word;word-wrap:break-word;color:", ";", ""], spacing.xs, colors.red50, getTypographyIntent('body'));
|
|
69
86
|
export var StyledTraditionalFormColumn = /*#__PURE__*/styled.div.withConfig({
|
|
70
87
|
displayName: "StyledTraditionalFormColumn",
|
|
71
|
-
componentId: "core-
|
|
72
|
-
})(["padding:", ";align-self:center;height:100%;&:nth-child(1){-ms-grid-column:1;}&:nth-child(2){-ms-grid-column:2;}&:nth-child(3){-ms-grid-column:3;}&:nth-child(4){-ms-grid-column:4;}", " ", ""], traditionalPadding, function (
|
|
73
|
-
var
|
|
74
|
-
$fullWidth =
|
|
88
|
+
componentId: "core-11_25_0__sc-ncj3pf-9"
|
|
89
|
+
})(["padding:", ";align-self:center;height:100%;&:nth-child(1){-ms-grid-column:1;}&:nth-child(2){-ms-grid-column:2;}&:nth-child(3){-ms-grid-column:3;}&:nth-child(4){-ms-grid-column:4;}", " ", ""], traditionalPadding, function (_ref5) {
|
|
90
|
+
var _ref5$$fullWidth = _ref5.$fullWidth,
|
|
91
|
+
$fullWidth = _ref5$$fullWidth === void 0 ? false : _ref5$$fullWidth;
|
|
75
92
|
return $fullWidth && css(["grid-column:2 / 5;-ms-grid-column-span:3;"]);
|
|
76
|
-
}, function (
|
|
77
|
-
var
|
|
78
|
-
$output =
|
|
93
|
+
}, function (_ref6) {
|
|
94
|
+
var _ref6$$output = _ref6.$output,
|
|
95
|
+
$output = _ref6$$output === void 0 ? false : _ref6$$output;
|
|
79
96
|
return $output && css(["font-weight:bold;font-size:", ";line-height:", ";word-wrap:break-word;"], traditionalFontSize, traditionalLineHeight);
|
|
80
97
|
});
|
|
81
98
|
export var StyledTraditionalFormLabel = /*#__PURE__*/styled(Typography).withConfig({
|
|
82
99
|
displayName: "StyledTraditionalFormLabel",
|
|
83
|
-
componentId: "core-
|
|
84
|
-
})(["display:inline-block;word-break:break-word;word-wrap:break-word;", ""], function (
|
|
85
|
-
var $view =
|
|
100
|
+
componentId: "core-11_25_0__sc-ncj3pf-10"
|
|
101
|
+
})(["display:inline-block;word-break:break-word;word-wrap:break-word;", ""], function (_ref7) {
|
|
102
|
+
var $view = _ref7.$view;
|
|
86
103
|
return ['create', 'update'].includes($view) && css(["padding-top:", "px;"], spacing.sm);
|
|
87
104
|
});
|
|
88
105
|
export var StyledFormOutputTextArea = /*#__PURE__*/styled.span.withConfig({
|
|
89
106
|
displayName: "StyledFormOutputTextArea",
|
|
90
|
-
componentId: "core-
|
|
107
|
+
componentId: "core-11_25_0__sc-ncj3pf-11"
|
|
91
108
|
})(["white-space:pre-wrap;"]);
|
|
92
|
-
export var StyledFormCheckboxInput = /*#__PURE__*/styled(Checkbox).withConfig({
|
|
93
|
-
displayName: "StyledFormCheckboxInput",
|
|
94
|
-
componentId: "core-11_24_3__sc-ncj3pf-9"
|
|
95
|
-
})(["margin-top:", "px;"], spacing.xs);
|
|
96
109
|
export var StyledFormOutputFiledset = /*#__PURE__*/styled.fieldset.withConfig({
|
|
97
110
|
displayName: "StyledFormOutputFiledset",
|
|
98
|
-
componentId: "core-
|
|
111
|
+
componentId: "core-11_25_0__sc-ncj3pf-12"
|
|
99
112
|
})(["border:none;padding:0;margin-top:", "px;"], spacing.xs);
|
|
100
113
|
export var StyledFormRow = /*#__PURE__*/styled.div.withConfig({
|
|
101
114
|
displayName: "StyledFormRow",
|
|
102
|
-
componentId: "core-
|
|
103
|
-
})(["", ""], function (
|
|
104
|
-
var
|
|
105
|
-
$traditional =
|
|
106
|
-
|
|
107
|
-
$read =
|
|
115
|
+
componentId: "core-11_25_0__sc-ncj3pf-13"
|
|
116
|
+
})(["", ""], function (_ref8) {
|
|
117
|
+
var _ref8$$traditional = _ref8.$traditional,
|
|
118
|
+
$traditional = _ref8$$traditional === void 0 ? false : _ref8$$traditional,
|
|
119
|
+
_ref8$$read = _ref8.$read,
|
|
120
|
+
$read = _ref8$$read === void 0 ? false : _ref8$$read;
|
|
108
121
|
return $traditional ? css(["display:-ms-grid;display:grid;-ms-grid-columns:20% 30% 20% 30%;grid-template-columns:20% 30% 20% 30%;-ms-grid-rows:auto;grid-template-rows:auto;border-top:1px solid ", ";background-color:", ";&:last-of-type{border-bottom:1px solid ", ";}", ""], traditionalBorder, colors.white, traditionalBorder, $read && "\n &:nth-child(2n + 1) {\n background-color: ".concat(traditionalBgGray, ";\n }\n \n & > ").concat(StyledTraditionalFormColumn, ":nth-child(2) {\n border-right: 1px solid ").concat(traditionalBorder, ";\n \n &:last-child {\n border-right: none;\n }\n }\n ")) : css(["display:-ms-grid;display:grid;-ms-grid-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);grid-template-columns:repeat(12,minmax(0,1fr));-ms-grid-rows:minmax(", ",max-content) minmax(", ",max-content);grid-template-rows:minmax(", ",auto) minmax( ", ",auto );justify-content:space-between;grid-column-gap:", ";"], defaultLineHeight, defaultLineHeight, defaultLineHeight, defaultLineHeight, columnGutter);
|
|
109
122
|
});
|
|
110
123
|
var formWrapper = /*#__PURE__*/css(["display:inherit;flex-direction:inherit;height:inherit;max-height:inherit;"]);
|
|
111
124
|
export var StyledFormikForm = /*#__PURE__*/styled(FormikForm).withConfig({
|
|
112
125
|
displayName: "StyledFormikForm",
|
|
113
|
-
componentId: "core-
|
|
126
|
+
componentId: "core-11_25_0__sc-ncj3pf-14"
|
|
114
127
|
})(["", ""], formWrapper);
|
|
115
128
|
export var StyledForm = /*#__PURE__*/styled.div.withConfig({
|
|
116
129
|
displayName: "StyledForm",
|
|
117
|
-
componentId: "core-
|
|
130
|
+
componentId: "core-11_25_0__sc-ncj3pf-15"
|
|
118
131
|
})(["", ""], formWrapper);
|
|
119
|
-
export var StyledLabel = /*#__PURE__*/styled(Label).withConfig({
|
|
120
|
-
displayName: "StyledLabel",
|
|
121
|
-
componentId: "core-11_24_3__sc-ncj3pf-14"
|
|
122
|
-
})(["word-wrap:break-word;word-break:break-word;"]);
|
|
123
132
|
//# sourceMappingURL=Form.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.styles.js","names":["Error","Help","Form","FormikForm","styled","css","Checkbox","StyledFieldHeader","Required","Label","Typography","getTypographyIntent","colors","getGapOutlineFocus","spacing","columnGutter","defaultLineHeight","textEditorOutputListPadding","traditionalBorder","traditionalBgGray","traditionalPadding","traditionalFontSize","traditionalLineHeight","getGridColumns","colStart","colEnd","colIeSpan","applyStylesOnlyToIE11","styles","StyledFormFieldMain","div","withConfig","displayName","componentId","_ref","$colStart","$colEnd","$colIeSpan","_ref2","$read","gray15","concat","StyledFormFieldHeader","_ref3","StyledFormFieldRequiredMark","xs","dataQaFieldTooltipIcon","StyledFormFieldTooltipIcon","attrs","sm","gray45","StyledFormFieldErrorIcon","StyledFormFieldBanner","red50","StyledTraditionalFormColumn","_ref4","_ref4$$fullWidth","$fullWidth","_ref5","_ref5$$output","$output","StyledTraditionalFormLabel","_ref6","$view","includes","StyledFormOutputTextArea","span","StyledFormCheckboxInput","StyledFormOutputFiledset","fieldset","StyledFormRow","_ref7","_ref7$$traditional","$traditional","_ref7$$read","white","formWrapper","StyledFormikForm","StyledForm","StyledLabel"],"sources":["../../src/Form/Form.styles.tsx"],"sourcesContent":["import { Error, Help } from '@procore/core-icons/dist'\nimport { Form as FormikForm } from 'formik'\nimport styled, { css } from 'styled-components'\nimport { Checkbox } from '../Checkbox'\nimport { StyledFieldHeader } from '../Field/Field.styles'\nimport { Required } from '../Required/Required'\nimport { Label } from '../Semantic/Semantic'\nimport { Typography } from '../Typography'\nimport { getTypographyIntent } from '../Typography/Typography.styles'\nimport { colors } from '../_styles/colors'\nimport { getGapOutlineFocus } from '../_styles/mixins'\nimport { spacing } from '../_styles/spacing'\nimport type { View } from './Form.types'\n\nconst columnGutter = '24px'\nconst defaultLineHeight = '20px'\nconst textEditorOutputListPadding = '10px 0 10px 40px'\n\nconst traditionalBorder = 'rgb(216, 216, 216)'\nconst traditionalBgGray = 'rgb(242, 242, 242)'\nconst traditionalPadding = '10px'\nconst traditionalFontSize = '13px'\nconst traditionalLineHeight = '20px'\n\nfunction getGridColumns(colStart: number, colEnd: number, colIeSpan: number) {\n return css`\n -ms-grid-column: ${colStart};\n grid-column-start: ${colStart};\n grid-column-end: ${colEnd};\n -ms-grid-column-span: ${colIeSpan};\n `\n}\n\nfunction applyStylesOnlyToIE11(styles: string) {\n return css`\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n ${styles}\n }\n `\n}\n\nexport const StyledFormFieldMain = styled.div<{\n $read: boolean\n $colStart: number\n $colEnd: number\n $colIeSpan: number\n}>`\n -ms-grid-row: 2;\n grid-row: 2;\n\n ${({ $colStart, $colEnd, $colIeSpan }) =>\n getGridColumns($colStart, $colEnd, $colIeSpan)}\n\n ${({ $read }) =>\n $read &&\n css`\n word-wrap: break-word;\n color: ${colors.gray15};\n ${getTypographyIntent('body')};\n `}\n\n // IE11 support grid-column-gap\n // bug: if a field's first column isn't at 1,\n // the field will fill the padding and be wider\n ${applyStylesOnlyToIE11(`\n padding-left: ${columnGutter};\n\n &:nth-child(2) {\n padding-left: 0;\n }\n `)}\n`\n\nexport const StyledFormFieldHeader = styled(StyledFieldHeader)<{\n $colStart: number\n $colEnd: number\n $colIeSpan: number\n}>`\n -ms-grid-row: 1;\n grid-row: 1;\n align-self: end;\n\n ${({ $colStart, $colEnd, $colIeSpan }) =>\n getGridColumns($colStart, $colEnd, $colIeSpan)}\n\n // IE11 support grid-column-gap\n // bug: if a field's first column isn't at 1,\n // the field will fill the padding and be wider\n ${applyStylesOnlyToIE11(`\n padding-left: ${columnGutter};\n\n &:first-child {\n padding-left: 0;\n }\n\n ${StyledFormFieldMain} {\n padding-left: ${columnGutter};\n\n &:nth-child(2) {\n padding-left: 0;\n }\n }\n `)}\n`\n\nexport const StyledFormFieldRequiredMark = styled(Required)`\n padding-left: ${spacing.xs}px;\n vertical-align: top;\n`\n\nexport const dataQaFieldTooltipIcon = 'form-field-tooltip-icon'\n\nexport const StyledFormFieldTooltipIcon = styled(Help).attrs(() => ({\n 'data-qa': dataQaFieldTooltipIcon,\n}))`\n margin-left: ${spacing.sm}px;\n color: ${colors.gray45};\n vertical-align: middle;\n\n &:focus-visible {\n border-radius: 50%;\n ${getGapOutlineFocus}\n // Icon does not touch viewBox borders. Already has 1px gap\n outline-offset: 0;\n }\n`\n\nexport const StyledFormFieldErrorIcon = styled(Error)`\n vertical-align: sub;\n`\n\nexport const StyledFormFieldBanner = styled.div`\n display: flex;\n align-items: flex-start;\n min-height: 22px;\n margin-top: ${spacing.xs}px;\n margin-bottom: 2px;\n word-break: break-word;\n word-wrap: break-word;\n color: ${colors.red50};\n\n ${getTypographyIntent('body')}\n`\nexport const StyledTraditionalFormColumn = styled.div<{\n $fullWidth?: boolean\n $output?: boolean\n}>`\n padding: ${traditionalPadding};\n align-self: center;\n height: 100%;\n\n &:nth-child(1) {\n -ms-grid-column: 1;\n }\n &:nth-child(2) {\n -ms-grid-column: 2;\n }\n &:nth-child(3) {\n -ms-grid-column: 3;\n }\n &:nth-child(4) {\n -ms-grid-column: 4;\n }\n\n ${({ $fullWidth = false }) =>\n $fullWidth &&\n css`\n grid-column: 2 / 5;\n -ms-grid-column-span: 3;\n `}\n\n ${({ $output = false }) =>\n $output &&\n css`\n font-weight: bold;\n font-size: ${traditionalFontSize};\n line-height: ${traditionalLineHeight};\n word-wrap: break-word;\n `}\n`\n\nexport const StyledTraditionalFormLabel = styled(Typography)<{ $view: View }>`\n display: inline-block;\n word-break: break-word;\n word-wrap: break-word;\n\n ${({ $view }) =>\n ['create', 'update'].includes($view) &&\n css`\n padding-top: ${spacing.sm}px;\n `}\n`\n\nexport const StyledFormOutputTextArea = styled.span`\n white-space: pre-wrap;\n`\n\nexport const StyledFormCheckboxInput = styled(Checkbox)`\n margin-top: ${spacing.xs}px;\n`\n\nexport const StyledFormOutputFiledset = styled.fieldset`\n border: none;\n padding: 0;\n margin-top: ${spacing.xs}px;\n`\nexport const StyledFormRow = styled.div<{\n $traditional?: boolean\n $read?: boolean\n}>`\n ${({ $traditional = false, $read = false }) =>\n $traditional\n ? css`\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: 20% 30% 20% 30%;\n grid-template-columns: 20% 30% 20% 30%;\n -ms-grid-rows: auto;\n grid-template-rows: auto;\n border-top: 1px solid ${traditionalBorder};\n background-color: ${colors.white};\n\n &:last-of-type {\n border-bottom: 1px solid ${traditionalBorder};\n }\n\n ${$read &&\n `\n &:nth-child(2n + 1) {\n background-color: ${traditionalBgGray};\n }\n \n & > ${StyledTraditionalFormColumn}:nth-child(2) {\n border-right: 1px solid ${traditionalBorder};\n \n &:last-child {\n border-right: none;\n }\n }\n `}\n `\n : css`\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)\n minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)\n minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)\n minmax(0, 1fr);\n grid-template-columns: repeat(12, minmax(0, 1fr));\n -ms-grid-rows: minmax(${defaultLineHeight}, max-content)\n minmax(${defaultLineHeight}, max-content);\n grid-template-rows: minmax(${defaultLineHeight}, auto) minmax(\n ${defaultLineHeight},\n auto\n );\n justify-content: space-between;\n grid-column-gap: ${columnGutter};\n `}\n`\n\nconst formWrapper = css`\n display: inherit;\n flex-direction: inherit;\n height: inherit;\n max-height: inherit;\n`\n\nexport const StyledFormikForm = styled(FormikForm)`\n ${formWrapper}\n`\n\nexport const StyledForm = styled.div`\n ${formWrapper}\n`\n\nexport const StyledLabel = styled(Label)`\n word-wrap: break-word;\n word-break: break-word;\n`\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,IAAI,QAAQ,0BAA0B;AACtD,SAASC,IAAI,IAAIC,UAAU,QAAQ,QAAQ;AAC3C,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,KAAK,QAAQ,sBAAsB;AAC5C,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,kBAAkB,QAAQ,mBAAmB;AACtD,SAASC,OAAO,QAAQ,oBAAoB;AAG5C,IAAMC,YAAY,GAAG,MAAM;AAC3B,IAAMC,iBAAiB,GAAG,MAAM;AAChC,IAAMC,2BAA2B,GAAG,kBAAkB;AAEtD,IAAMC,iBAAiB,GAAG,oBAAoB;AAC9C,IAAMC,iBAAiB,GAAG,oBAAoB;AAC9C,IAAMC,kBAAkB,GAAG,MAAM;AACjC,IAAMC,mBAAmB,GAAG,MAAM;AAClC,IAAMC,qBAAqB,GAAG,MAAM;AAEpC,SAASC,cAAcA,CAACC,QAAgB,EAAEC,MAAc,EAAEC,SAAiB,EAAE;EAC3E,OAAOrB,GAAG,kGACWmB,QAAQ,EACNA,QAAQ,EACVC,MAAM,EACDC,SAAS;AAErC;AAEA,SAASC,qBAAqBA,CAACC,MAAc,EAAE;EAC7C,OAAOvB,GAAG,kFAEJuB,MAAM;AAGd;AAEA,OAAO,IAAMC,mBAAmB,gBAAGzB,MAAM,CAAC0B,GAAG,CAAAC,UAAA;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WAAA;AAAA,aAC9C2C,WAAW,CACd;AAED,OAAO,IAAME,UAAU,gBAAG1E,MAAM,CAAC0B,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aAChC2C,WAAW,CACd;AAED,OAAO,IAAMG,WAAW,gBAAG3E,MAAM,CAACK,KAAK,CAAC,CAAAsB,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,mDAGvC"}
|
|
1
|
+
{"version":3,"file":"Form.styles.js","names":["Error","Help","Form","FormikForm","styled","css","checkboxSize","StyledFieldHeader","Required","Label","Typography","getTypographyIntent","colors","getGapOutlineFocus","spacing","columnGutter","defaultLineHeight","textEditorOutputListPadding","traditionalBorder","traditionalBgGray","traditionalPadding","traditionalFontSize","traditionalLineHeight","getGridColumns","colStart","colEnd","colIeSpan","applyStylesOnlyToIE11","styles","StyledFormFieldMain","div","withConfig","displayName","componentId","_ref","$colStart","$colEnd","$colIeSpan","_ref2","$read","gray15","concat","StyledLabel","StyledDescription","gray45","StyledCheckboxInlineDescription","xs","_ref3","md","StyledFormFieldHeader","_ref4","StyledFormFieldRequiredMark","dataQaFieldTooltipIcon","StyledFormFieldTooltipIcon","attrs","sm","StyledFormFieldErrorIcon","StyledFormFieldBanner","red50","StyledTraditionalFormColumn","_ref5","_ref5$$fullWidth","$fullWidth","_ref6","_ref6$$output","$output","StyledTraditionalFormLabel","_ref7","$view","includes","StyledFormOutputTextArea","span","StyledFormOutputFiledset","fieldset","StyledFormRow","_ref8","_ref8$$traditional","$traditional","_ref8$$read","white","formWrapper","StyledFormikForm","StyledForm"],"sources":["../../src/Form/Form.styles.tsx"],"sourcesContent":["import { Error, Help } from '@procore/core-icons/dist'\nimport { Form as FormikForm } from 'formik'\nimport styled, { css } from 'styled-components'\nimport { checkboxSize } from '../Checkbox/Checkbox.styles'\nimport { StyledFieldHeader } from '../Field/Field.styles'\nimport { Required } from '../Required/Required'\nimport { Label } from '../Semantic/Semantic'\nimport { Typography } from '../Typography'\nimport { getTypographyIntent } from '../Typography/Typography.styles'\nimport { colors } from '../_styles/colors'\nimport { getGapOutlineFocus } from '../_styles/mixins'\nimport { spacing } from '../_styles/spacing'\nimport type { View } from './Form.types'\n\nconst columnGutter = '24px'\nconst defaultLineHeight = '20px'\nconst textEditorOutputListPadding = '10px 0 10px 40px'\n\nconst traditionalBorder = 'rgb(216, 216, 216)'\nconst traditionalBgGray = 'rgb(242, 242, 242)'\nconst traditionalPadding = '10px'\nconst traditionalFontSize = '13px'\nconst traditionalLineHeight = '20px'\n\nfunction getGridColumns(colStart: number, colEnd: number, colIeSpan: number) {\n return css`\n -ms-grid-column: ${colStart};\n grid-column-start: ${colStart};\n grid-column-end: ${colEnd};\n -ms-grid-column-span: ${colIeSpan};\n `\n}\n\nfunction applyStylesOnlyToIE11(styles: string) {\n return css`\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n ${styles}\n }\n `\n}\n\nexport const StyledFormFieldMain = styled.div<{\n $read: boolean\n $colStart: number\n $colEnd: number\n $colIeSpan: number\n}>`\n -ms-grid-row: 2;\n grid-row: 2;\n\n ${({ $colStart, $colEnd, $colIeSpan }) =>\n getGridColumns($colStart, $colEnd, $colIeSpan)}\n\n ${({ $read }) =>\n $read &&\n css`\n word-wrap: break-word;\n color: ${colors.gray15};\n ${getTypographyIntent('body')};\n `}\n\n // IE11 support grid-column-gap\n // bug: if a field's first column isn't at 1,\n // the field will fill the padding and be wider\n ${applyStylesOnlyToIE11(`\n padding-left: ${columnGutter};\n\n &:nth-child(2) {\n padding-left: 0;\n }\n `)}\n`\n\nexport const StyledLabel = styled(Label)`\n word-wrap: break-word;\n word-break: break-word;\n`\n\nexport const StyledDescription = styled.div`\n ${getTypographyIntent('body')}\n color: ${colors.gray45};\n word-wrap: break-word;\n word-break: break-word;\n`\n\nexport const StyledCheckboxInlineDescription = styled(StyledDescription)<{\n $read: boolean\n}>`\n margin-top: ${spacing.xs}px;\n ${({ $read }) => {\n if (!$read) {\n return css`\n padding-left: ${checkboxSize + spacing.md}px;\n `\n }\n }}\n`\n\nexport const StyledFormFieldHeader = styled(StyledFieldHeader)<{\n $colStart: number\n $colEnd: number\n $colIeSpan: number\n}>`\n -ms-grid-row: 1;\n grid-row: 1;\n align-self: end;\n margin-bottom: ${spacing.xs}px;\n\n ${({ $colStart, $colEnd, $colIeSpan }) =>\n getGridColumns($colStart, $colEnd, $colIeSpan)}\n\n // IE11 support grid-column-gap\n // bug: if a field's first column isn't at 1,\n // the field will fill the padding and be wider\n ${applyStylesOnlyToIE11(`\n padding-left: ${columnGutter};\n\n &:first-child {\n padding-left: 0;\n }\n\n ${StyledFormFieldMain} {\n padding-left: ${columnGutter};\n\n &:nth-child(2) {\n padding-left: 0;\n }\n }\n `)}\n\n * + ${StyledDescription} {\n margin-top: ${spacing.xs}px;\n }\n`\n\nexport const StyledFormFieldRequiredMark = styled(Required)`\n padding-left: ${spacing.xs}px;\n vertical-align: top;\n`\n\nexport const dataQaFieldTooltipIcon = 'form-field-tooltip-icon'\n\nexport const StyledFormFieldTooltipIcon = styled(Help).attrs(() => ({\n 'data-qa': dataQaFieldTooltipIcon,\n}))`\n margin-left: ${spacing.sm}px;\n color: ${colors.gray45};\n vertical-align: middle;\n\n &:focus-visible {\n border-radius: 50%;\n ${getGapOutlineFocus}\n // Icon does not touch viewBox borders. Already has 1px gap\n outline-offset: 0;\n }\n`\n\nexport const StyledFormFieldErrorIcon = styled(Error)`\n vertical-align: sub;\n`\n\nexport const StyledFormFieldBanner = styled.div`\n display: flex;\n align-items: flex-start;\n min-height: 22px;\n margin-top: ${spacing.xs}px;\n margin-bottom: 2px;\n word-break: break-word;\n word-wrap: break-word;\n color: ${colors.red50};\n\n ${getTypographyIntent('body')}\n`\nexport const StyledTraditionalFormColumn = styled.div<{\n $fullWidth?: boolean\n $output?: boolean\n}>`\n padding: ${traditionalPadding};\n align-self: center;\n height: 100%;\n\n &:nth-child(1) {\n -ms-grid-column: 1;\n }\n &:nth-child(2) {\n -ms-grid-column: 2;\n }\n &:nth-child(3) {\n -ms-grid-column: 3;\n }\n &:nth-child(4) {\n -ms-grid-column: 4;\n }\n\n ${({ $fullWidth = false }) =>\n $fullWidth &&\n css`\n grid-column: 2 / 5;\n -ms-grid-column-span: 3;\n `}\n\n ${({ $output = false }) =>\n $output &&\n css`\n font-weight: bold;\n font-size: ${traditionalFontSize};\n line-height: ${traditionalLineHeight};\n word-wrap: break-word;\n `}\n`\n\nexport const StyledTraditionalFormLabel = styled(Typography)<{ $view: View }>`\n display: inline-block;\n word-break: break-word;\n word-wrap: break-word;\n\n ${({ $view }) =>\n ['create', 'update'].includes($view) &&\n css`\n padding-top: ${spacing.sm}px;\n `}\n`\n\nexport const StyledFormOutputTextArea = styled.span`\n white-space: pre-wrap;\n`\n\nexport const StyledFormOutputFiledset = styled.fieldset`\n border: none;\n padding: 0;\n margin-top: ${spacing.xs}px;\n`\nexport const StyledFormRow = styled.div<{\n $traditional?: boolean\n $read?: boolean\n}>`\n ${({ $traditional = false, $read = false }) =>\n $traditional\n ? css`\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: 20% 30% 20% 30%;\n grid-template-columns: 20% 30% 20% 30%;\n -ms-grid-rows: auto;\n grid-template-rows: auto;\n border-top: 1px solid ${traditionalBorder};\n background-color: ${colors.white};\n\n &:last-of-type {\n border-bottom: 1px solid ${traditionalBorder};\n }\n\n ${$read &&\n `\n &:nth-child(2n + 1) {\n background-color: ${traditionalBgGray};\n }\n \n & > ${StyledTraditionalFormColumn}:nth-child(2) {\n border-right: 1px solid ${traditionalBorder};\n \n &:last-child {\n border-right: none;\n }\n }\n `}\n `\n : css`\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)\n minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)\n minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)\n minmax(0, 1fr);\n grid-template-columns: repeat(12, minmax(0, 1fr));\n -ms-grid-rows: minmax(${defaultLineHeight}, max-content)\n minmax(${defaultLineHeight}, max-content);\n grid-template-rows: minmax(${defaultLineHeight}, auto) minmax(\n ${defaultLineHeight},\n auto\n );\n justify-content: space-between;\n grid-column-gap: ${columnGutter};\n `}\n`\n\nconst formWrapper = css`\n display: inherit;\n flex-direction: inherit;\n height: inherit;\n max-height: inherit;\n`\n\nexport const StyledFormikForm = styled(FormikForm)`\n ${formWrapper}\n`\n\nexport const StyledForm = styled.div`\n ${formWrapper}\n`\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,IAAI,QAAQ,0BAA0B;AACtD,SAASC,IAAI,IAAIC,UAAU,QAAQ,QAAQ;AAC3C,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,KAAK,QAAQ,sBAAsB;AAC5C,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,kBAAkB,QAAQ,mBAAmB;AACtD,SAASC,OAAO,QAAQ,oBAAoB;AAG5C,IAAMC,YAAY,GAAG,MAAM;AAC3B,IAAMC,iBAAiB,GAAG,MAAM;AAChC,IAAMC,2BAA2B,GAAG,kBAAkB;AAEtD,IAAMC,iBAAiB,GAAG,oBAAoB;AAC9C,IAAMC,iBAAiB,GAAG,oBAAoB;AAC9C,IAAMC,kBAAkB,GAAG,MAAM;AACjC,IAAMC,mBAAmB,GAAG,MAAM;AAClC,IAAMC,qBAAqB,GAAG,MAAM;AAEpC,SAASC,cAAcA,CAACC,QAAgB,EAAEC,MAAc,EAAEC,SAAiB,EAAE;EAC3E,OAAOrB,GAAG,kGACWmB,QAAQ,EACNA,QAAQ,EACVC,MAAM,EACDC,SAAS;AAErC;AAE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AA,aAInC,UAAA0C,KAAA;EAAA,IAAAC,kBAAA,GAAAD,KAAA,CAAGE,YAAY;IAAZA,YAAY,GAAAD,kBAAA,cAAG,KAAK,GAAAA,kBAAA;IAAAE,WAAA,GAAAH,KAAA,CAAEpC,KAAK;IAALA,KAAK,GAAAuC,WAAA,cAAG,KAAK,GAAAA,WAAA;EAAA,OACtCD,YAAY,GACRxE,GAAG,wPAOuBa,iBAAiB,EACrBN,MAAM,CAACmE,KAAK,EAGH7D,iBAAiB,EAG5CqB,KAAK,4EAAAE,MAAA,CAGiBtB,iBAAiB,sDAAAsB,MAAA,CAGjCkB,2BAA2B,6DAAAlB,MAAA,CACLvB,iBAAiB,6HAM9C,IAEHb,GAAG,ybAQuBW,iBAAiB,EAC9BA,iBAAiB,EACCA,iBAAiB,EACxCA,iBAAiB,EAIJD,YAAY,CAChC;AAAA,EACR;AAED,IAAMiE,WAAW,gBAAG3E,GAAG,+EAKtB;AAED,OAAO,IAAM4E,gBAAgB,gBAAG7E,MAAM,CAACD,UAAU,CAAC,CAAA4B,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aAC9C+C,WAAW,CACd;AAED,OAAO,IAAME,UAAU,gBAAG9E,MAAM,CAAC0B,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aAChC+C,WAAW,CACd"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { FieldHelperProps, FieldInputProps, FieldMetaProps as FormikFieldMetaProps, FieldValidator, FormikConfig } from 'formik';
|
|
2
|
+
import type React from 'react';
|
|
3
3
|
import type { CheckboxProps } from '../Checkbox/Checkbox.types';
|
|
4
4
|
import type { DateSelectProps } from '../DateSelect';
|
|
5
5
|
import type { GroupSelectProps } from '../GroupSelect/GroupSelect.types';
|
|
@@ -226,6 +226,10 @@ export interface BaseFieldProps<Value, ComponentProps extends FormFieldValueComp
|
|
|
226
226
|
* @since 10.19.0
|
|
227
227
|
*/
|
|
228
228
|
label?: string;
|
|
229
|
+
/**
|
|
230
|
+
* @since 11.25.0
|
|
231
|
+
*/
|
|
232
|
+
description?: React.ReactNode;
|
|
229
233
|
/**
|
|
230
234
|
* Key path in store. Accepts <Code>bracket[notation]</Code> or{' '}
|
|
231
235
|
* <Code>dot.notation</Code>.
|
|
@@ -343,12 +347,35 @@ export interface FormDateProps<Value = FieldDateValueType> extends FormFieldProp
|
|
|
343
347
|
}
|
|
344
348
|
export declare type FieldCheckboxValueType = boolean;
|
|
345
349
|
export interface FieldCheckboxComponentProps<Value = FieldCheckboxValueType> extends FormFieldValueComponentProps<Value>, CheckboxProps {
|
|
350
|
+
/**
|
|
351
|
+
* Next to checkbox label
|
|
352
|
+
* @since 11.25.0
|
|
353
|
+
*/
|
|
354
|
+
inlineLabel?: string;
|
|
346
355
|
/**
|
|
347
356
|
* @since 10.19.0
|
|
348
357
|
*/
|
|
349
358
|
i18nScope?: string;
|
|
359
|
+
/**
|
|
360
|
+
* @since 11.25.0
|
|
361
|
+
*/
|
|
362
|
+
tooltip?: TooltipProps['overlay'];
|
|
363
|
+
/**
|
|
364
|
+
* @since 11.25.0
|
|
365
|
+
*/
|
|
366
|
+
hasRequiredMark?: boolean;
|
|
350
367
|
}
|
|
351
368
|
export interface FormCheckboxProps<Value = FieldCheckboxValueType> extends FormFieldProps<Value>, Omit<CheckboxProps, 'name' | 'error' | 'children'> {
|
|
369
|
+
/**
|
|
370
|
+
* Next to checkbox label
|
|
371
|
+
* @since 11.25.0
|
|
372
|
+
*/
|
|
373
|
+
inlineLabel?: string;
|
|
374
|
+
/**
|
|
375
|
+
* Below checkbox description
|
|
376
|
+
* @since 11.25.0
|
|
377
|
+
*/
|
|
378
|
+
inlineDescription?: React.ReactNode;
|
|
352
379
|
/**
|
|
353
380
|
* @since 10.19.0
|
|
354
381
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.types.js","names":[],"sources":["../../src/Form/Form.types.ts"],"sourcesContent":["import type {\n FieldHelperProps,\n FieldInputProps,\n FieldMetaProps as FormikFieldMetaProps,\n FieldValidator,\n FormikConfig,\n} from 'formik'\nimport type { CheckboxProps } from '../Checkbox/Checkbox.types'\nimport type { DateSelectProps } from '../DateSelect'\nimport type { GroupSelectProps } from '../GroupSelect/GroupSelect.types'\nimport type { InputProps } from '../Input/Input.types'\nimport type { MultiSelectProps } from '../MultiSelect/MultiSelect.types'\nimport type {\n CurrencyInputProps,\n InputValue as BaseNumberInputValueType,\n NumberInputProps,\n} from '../NumberInput/NumberInput.types'\nimport type { PillSelectProps } from '../PillSelect/PillSelect.types'\nimport type { SelectButtonProps, SelectProps } from '../Select/Select.types'\nimport type { TextAreaProps } from '../TextArea/TextArea.types'\nimport type { TextEditorProps } from '../TextEditor'\nimport type { TieredSelectProps } from '../TieredSelect/TieredSelect.types'\nimport type { TooltipProps } from '../Tooltip/Tooltip.types'\nimport type { Props } from '../_utils/types'\n\nexport type ValueInArray<V> = V[keyof V]\nexport type View = 'create' | 'read' | 'update'\nexport type Layout = 'wxp' | 'traditional'\n\nexport interface FormContextAPI {\n /**\n * @since 10.19.0\n */\n different: boolean\n /**\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n enableReinitialize?: boolean\n /**\n * @since 10.19.0\n */\n setFieldDifferent: (key: string, different: boolean) => void\n\n /**\n * A <a href=\"https://github.com/jquense/yup\">Yup</a> object schema to\n * validate all values.\n * <CodeBlock>\n * {`Yup.object().shape({\n * input_name: Yup.mixed().required()\n * })`}\n * </CodeBlock>\n * This is a great way to get error messages into the component. In\n * addition, if using Yup for required, those fields will automatically\n * get the required asterisk and highlight error.\n * @since 10.19.0\n */\n validationSchema?: FormikConfig<unknown>['validationSchema']\n\n /**\n * Toggle between modern and traditional form styles. Leave blank for the\n * modern label-above layout.\n * @since 10.19.0\n */\n variant: Layout\n\n /**\n * Determines show or edit state of form.\n * @default 'create'\n * @since 10.19.0\n */\n view: View\n}\n\ninterface FieldMetaProps<Value>\n extends Omit<FormikFieldMetaProps<Value>, 'error'> {\n /**\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n error: boolean\n /**\n * @since 10.19.0\n */\n required: boolean\n /**\n * @since 10.19.0\n */\n view: View\n}\n\nexport interface FieldConfig {\n /**\n * @since 10.19.0\n */\n disabled?: boolean\n /**\n * @since 10.19.0\n */\n error?: boolean | string\n /**\n * @since 10.19.0\n */\n getId?: (item: any) => string | number\n /**\n * @since 10.19.0\n */\n name: string\n /**\n * @since 10.19.0\n */\n required?: boolean\n /**\n * @since 10.19.0\n */\n validate?: FieldValidator\n /**\n * @since 10.19.0\n */\n view?: View\n}\n\nexport interface FormFieldAPI<Value> {\n /**\n * @since 10.19.0\n */\n input: FieldInputProps<Value>\n /**\n * @since 10.19.0\n */\n helpers: {\n setValue: (\n value: Value,\n shouldValidate?: boolean,\n shouldMarkDifferent?: boolean\n ) => void\n setTouched: FieldHelperProps<Value>['setTouched']\n setError: FieldHelperProps<Value>['setError']\n }\n\n /**\n * @since 10.19.0\n */\n messages: {\n error?: string\n }\n /**\n * @since 10.19.0\n */\n meta: FieldMetaProps<Value>\n}\n\nexport interface FormProps<Values> extends Partial<FormikConfig<Values>> {\n /**\n * @since 10.19.0\n */\n children: React.ReactNode\n\n /**\n * Enable a browser confirmation about losing of unsaved data when the\n * form values are visually different from the initial values. Uses\n * `window.onbeforeunload` and `window.confirm` for dialogs(Modal, Tearsheet).\n * **Requires `onSubmit` to return a promise to remove onbeforeunload.**\n */\n enableConfirmNavigation?: boolean\n\n /**\n * Disable all fields at once.\n * @default false\n */\n disabled?: boolean\n\n /**\n * Toggle between modern and traditional form styles. Leave blank for the modern label-above layout.\n *\n */\n variant?: Layout\n\n /**\n * Determines show or edit state of form.\n * @default 'create'\n */\n view?: View\n}\n\nexport type FormFieldValueComponentProps<Value = any> = {\n field: FormFieldAPI<Value>\n}\n\nexport type ComponentWithFieldProp<\n Value,\n Props extends FormFieldValueComponentProps<Value>\n> =\n | React.FunctionComponent<Props>\n | React.ForwardRefExoticComponent<Props>\n | ((p: Props) => React.ReactNode)\n\nexport interface BaseFieldProps<\n Value,\n ComponentProps extends FormFieldValueComponentProps<Value>\n> {\n /**\n * Customize the input component, either a single component for all views\n * or an object with the keys of the views to render on that particular\n * view. This input component will receive the <Code>field</Code> prop.\n * If using TypeScript, these components will need to extend a specific\n * type from Core React, read more about the{' '}\n * <a href=\"#typescript-and-as-prop-components\">props per view</a>.\n * <br />\n * <br />\n * One of:\n * <br />\n * <Code>ReactComponent</Code>or\n * <Code>\n * {\n * '{ read: ReactComponent, create: ReactComponent, update: ReactComponent }'\n * }\n * </Code>\n * @since 10.19.0\n */\n as?:\n | ComponentWithFieldProp<Value, ComponentProps>\n | { [V in View]: ComponentWithFieldProp<Value, ComponentProps> }\n\n /**\n * A subcomponent to render on a particular view.\n * <br />\n * <br />\n * One or all of:\n * <br />\n * <Code>Form.X.Create, Form.X.Read, Form.X.Update</Code>\n * @since 10.19.0\n */\n children?: ((field: FormFieldAPI<Value>) => React.ReactNode) | React.ReactNode\n\n /**\n * Starting location of column. For traditional variant, this does not exist\n * and is not necessary.\n * @since 10.19.0\n * */\n colStart?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12\n\n /**\n * Width of column. For traditional variant, will be either 6 or 12.\n * @default 6\n * @since 10.19.0\n */\n colWidth?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12\n /**\n * @since 10.19.0\n */\n ['data-qa']?: string\n\n /**\n * Specify disabled. Field disabled replaces the overall Form disabled state.\n * @since 10.19.0\n */\n disabled?: boolean\n /**\n * @since 10.19.0\n */\n error?: boolean | string\n /**\n * @since 10.19.0\n */\n label?: string\n\n /**\n * Key path in store. Accepts <Code>bracket[notation]</Code> or{' '}\n * <Code>dot.notation</Code>.\n * @since 10.19.0\n */\n name: string\n\n /**\n * The required asterisk if not using Yup <Code>required</Code>\n * <CodeBlock>\n * {`<Form\n * validationSchema={Yup.object().shape({\n * input_name: Yup.mixed().required(),\n * })}>`}\n * </CodeBlock>\n * @since 10.19.0\n */\n required?: boolean\n\n /**\n * @since 10.19.0\n */\n tooltip?: TooltipProps['overlay']\n\n /**\n * The validate function from Formik for single field validation.\n * <CodeBlock>\n * {`(value: Value = any) => undefined | string | Promise<Value>`}\n * </CodeBlock>\n * @since 10.19.0\n */\n validate?: FieldValidator\n\n /**\n * Determines show or edit state of field.\n * @since 10.19.0\n */\n view?: View\n}\n\nexport interface TraditionalBaseFieldProps<\n Value,\n ComponentProps extends FormFieldValueComponentProps<Value>\n> extends Omit<BaseFieldProps<Value, ComponentProps>, 'colWidth' | 'colStart'> {\n /**\n * @since 10.19.0\n */\n colWidth?: 6 | 12\n}\n\nexport interface FormFieldProps<Value>\n extends Omit<\n BaseFieldProps<Value, FormFieldValueComponentProps<Value>>,\n 'children'\n > {\n /**\n * @since 10.19.0\n */\n children?:\n | React.ReactElement<\n BaseFieldProps<Value, FormFieldValueComponentProps<Value>>\n >\n | React.ReactElement<\n BaseFieldProps<Value, FormFieldValueComponentProps<Value>>\n >[]\n}\n\nexport type OptionList<OptionShape = any> = {\n /**\n * <div>\n * The id of an option{' '}\n * <Code>{'(option: OptionItem) => string | number'}</Code>\n * </div>\n * <br />\n * <div>\n * Default:\n * <Code>{'(option: OptionItem) => option.id'}</Code>\n * </div>\n * @since 10.19.0\n */\n getId: (option: OptionShape) => string | number\n\n /**\n * <div>\n * The display label of an option\n * <Code>{'(option: OptionItem) => string'}</Code>\n * </div>\n * <br />\n * <div>\n * Default:\n * <Code>{'(option: OptionItem) => option.label || option.name'}</Code>\n * </div>\n * @since 10.19.0\n */\n getLabel: (option: OptionShape) => string\n\n /**\n * @since 10.19.0\n */\n options?: OptionShape[]\n}\n\nexport interface FormErrorBannerProps {\n /**\n * @since 10.19.0\n */\n i18nScope?: string\n /**\n * @since 10.19.0\n */\n item: string\n}\n\n// MAKE\n\nexport type ViewFieldProps<\n Value,\n FieldTypeProps extends FormFieldProps<Value>,\n ComponentProps extends FormFieldValueComponentProps<Value>\n> = Partial<Omit<FieldTypeProps, 'children'>> & {\n /**\n * @since 10.19.0\n */\n children?: BaseFieldProps<Value, ComponentProps>['children']\n}\n\n// TEXT\n\nexport type FieldTextValueType = string\n\nexport interface FieldTextComponentProps<Value = FieldTextValueType>\n extends FormFieldValueComponentProps<Value>,\n InputProps {}\nexport interface FormTextProps<Value = FieldTextValueType>\n extends FormFieldProps<Value>,\n Omit<InputProps, 'name' | 'children' | 'error'> {}\n\n// NUMBER\n\nexport type FieldNumberValueType = BaseNumberInputValueType\n\nexport interface FieldNumberComponentProps<Value = FieldNumberValueType>\n extends FormFieldValueComponentProps<Value>,\n NumberInputProps {}\n\nexport interface FormNumberProps<Value = FieldNumberValueType>\n extends FormFieldProps<Value>,\n Omit<NumberInputProps, 'name' | 'children' | 'error'> {}\n\n// CURRENCY\n\nexport type FieldCurrencyValueType = BaseNumberInputValueType\n\nexport interface FieldCurrencyComponentProps<Value = FieldCurrencyValueType>\n extends FormFieldValueComponentProps<Value>,\n CurrencyInputProps {}\n\nexport interface FormCurrencyProps<Value = FieldCurrencyValueType>\n extends FormFieldProps<Value>,\n Omit<CurrencyInputProps, 'name' | 'children' | 'error'> {}\n\n// DATE\nexport type FieldDateValueType = null | string | Date\n\nexport interface FieldDateComponentProps<Value = FieldDateValueType>\n extends FormFieldValueComponentProps<Value>,\n DateSelectProps {}\n\nexport interface FormDateProps<Value = FieldDateValueType>\n extends FormFieldProps<Value>,\n Omit<DateSelectProps, 'error'> {}\n\n// CHECKBOX\n\nexport type FieldCheckboxValueType = boolean\n\nexport interface FieldCheckboxComponentProps<Value = FieldCheckboxValueType>\n extends FormFieldValueComponentProps<Value>,\n CheckboxProps {\n /**\n * @since 10.19.0\n */\n i18nScope?: string\n}\n\nexport interface FormCheckboxProps<Value = FieldCheckboxValueType>\n extends FormFieldProps<Value>,\n Omit<CheckboxProps, 'name' | 'error' | 'children'> {\n /**\n * @since 10.19.0\n */\n i18nScope?: string\n}\n\n// TEXTAREA\n\nexport type FieldTextAreaValueType = string\n\nexport interface FieldTextAreaComponentProps<Value = FieldTextAreaValueType>\n extends FormFieldValueComponentProps<Value>,\n TextAreaProps {}\nexport interface FormTextAreaProps<Value = FieldTextAreaValueType>\n extends FormFieldProps<Value>,\n Omit<TextAreaProps, 'name' | 'error' | 'children'> {}\n\n// RICHTEXT\n\nexport type FieldRichTextValueType = string\n\nexport interface FieldRichTextComponentProps<Value = FieldRichTextValueType>\n extends FormFieldValueComponentProps<Value>,\n TextEditorProps {}\n\nexport interface FormRichTextProps<Value = FieldRichTextValueType>\n extends Omit<FormFieldProps<Value>, 'error'>,\n TextEditorProps {}\n\n// RADIO BUTTONS\n\nexport type FieldRadioButtonsValueType = any\n\nexport interface FieldRadioButtonsComponentProps<\n Value = FieldRadioButtonsValueType\n> extends FormFieldValueComponentProps<Value>,\n Partial<OptionList<Value>>,\n Pick<Props, 'className' | 'style'> {\n /**\n * @since 10.19.0\n */\n isDisabledOption?: (option: Value) => boolean\n}\n\nexport interface FormRadioButtonsProps<Value = FieldRadioButtonsValueType>\n extends FormFieldProps<Value>,\n Partial<OptionList<Value>>,\n Pick<Props, 'className' | 'style'>,\n Pick<FieldRadioButtonsComponentProps, 'isDisabledOption'> {}\n\n// CHECKBOXES\n\nexport type FieldCheckboxesValueType = any[]\n\nexport interface FieldCheckboxesComponentProps<Value = FieldCheckboxesValueType>\n extends FormFieldValueComponentProps<Value>,\n Partial<OptionList<ValueInArray<Value>>>,\n Pick<Props, 'className' | 'style'> {\n /**\n * @since 10.19.0\n */\n isDisabledOption?: (option: Value) => boolean\n /**\n * @since 10.19.0\n */\n isIndeterminateOption?: (option: Value) => boolean\n}\n\nexport interface FormCheckboxesProps<Value = FieldCheckboxesValueType>\n extends FormFieldProps<Value>,\n Partial<OptionList<ValueInArray<Value>>>,\n Pick<Props, 'className' | 'style'>,\n Pick<\n FieldCheckboxesComponentProps,\n 'isDisabledOption' | 'isIndeterminateOption'\n > {}\n\n// SELECT\n\nexport type FieldSelectValueType = any\nexport type FieldSelectOptionItem = FieldSelectValueType\nexport type FieldSelectGroupItem = any\nexport type FieldSelectGroupHeader = FieldSelectGroupItem & {\n isGroupHeader: boolean\n}\n\nexport interface GroupedOptionsConfig<OptionItem, GroupItem>\n extends OptionList<OptionItem> {\n /**\n * @since 10.19.0\n */\n comparator?: (query: string, value: string) => boolean\n /**\n * @since 10.19.0\n */\n getGroup: (option: OptionItem) => number | string\n /**\n * <div>\n * The id of group{' '}\n * <Code>{'(group: GroupItem) => string | number'}</Code>\n * </div>\n * <br />\n * <div>\n * Default:\n * <Code>{'(group) => group.id'}</Code>\n * </div>\n * @since 10.19.0\n */\n groupGetId: (group: GroupItem) => number | string\n /**\n * @since 10.19.0\n */\n optgroups?: GroupItem[]\n /**\n * @since 10.19.0\n */\n value?: OptionItem\n}\n\nexport interface FieldSelectComponentProps<\n Value = FieldSelectValueType,\n OptionItem = FieldSelectOptionItem,\n GroupItem = FieldSelectGroupItem\n> extends FormFieldValueComponentProps<Value>,\n Partial<OptionList<OptionItem>>,\n Omit<SelectProps, 'onClear' | 'onSearch' | 'error' | 'children'> {\n /**\n * Callback for each entry in <Code>options</Code> to define relation to\n * group in <Code>optgroups</Code>\n * <Code>{'(option: OptionItem) => string | number'}</Code>\n * @since 10.19.0\n * */\n getGroup?: (option: OptionItem) => number | string\n /**\n * @since 10.19.0\n */\n groupGetId?: (group: GroupItem) => number | string\n\n /**\n * <div>\n * The display label of a group\n * <Code>{'(group: GroupItem) => string'}</Code>\n * </div>\n * <br />\n * <div>\n * Default:\n * <Code>{'(group: GroupItem) => group.label || group.name'}</Code>\n * </div>\n * @since 10.19.0\n */\n groupGetLabel?: (group: GroupItem) => string\n\n /**\n * Callback for rendering header for each entry in <Code>optgroups</Code>\n * <Code>{'(group: GroupItem) => React.ReactNode'}</Code>\n * @since 10.19.0\n */\n groupHeaderRenderer?: (group: GroupItem) => React.ReactNode\n\n /**\n * If nothing is selected, suggest this option. From{' '}\n * <Code>{'Select.Option suggested'}</Code>.\n * <Code>{'(option: OptionItem) => boolean'}</Code>\n * @since 10.19.0\n */\n isSuggestedOption?: (option: OptionItem) => boolean\n\n /**\n * Array of available option groups\n * @since 10.19.0\n */\n optgroups?: GroupItem[]\n\n /**\n * Callback for rendering each <Code>option</Code>\n * <Code>{'(option: OptionItem) => React.ReactNode'}</Code>\n * @since 10.19.0\n */\n optionRenderer?: (option: OptionItem) => React.ReactNode\n /**\n * @since 10.19.0\n */\n onBlur?: (e: React.FocusEvent<HTMLDivElement>) => void\n\n /**\n * Callback for when cleared. Default enabled, has clear icon.\n * @since 10.19.0\n */\n onClear?: false | SelectButtonProps['onClear']\n\n /**\n * Callback for when searching. Default enabled, has seach bar in menu.\n * @since 10.19.0\n */\n onSearch?: false | SelectProps['onSearch']\n\n /**\n * <div>Customize how search works</div>\n * <Code>{'(query: string, value: string) => boolean'}</Code>\n * @since 10.19.0\n */\n searchComparator?: (query: string, value: string) => boolean\n}\nexport interface FormSelectProps<\n Value = FieldSelectValueType,\n OptionItem = FieldSelectOptionItem,\n GroupItem = FieldSelectGroupItem\n> extends FormFieldProps<Value>,\n Partial<OptionList<OptionItem>>,\n Pick<\n FieldSelectComponentProps<Value, OptionItem, GroupItem>,\n | 'getGroup'\n | 'groupGetId'\n | 'groupGetLabel'\n | 'groupHeaderRenderer'\n | 'isSuggestedOption'\n | 'onBlur'\n | 'onClear'\n | 'optgroups'\n | 'onSearch'\n | 'optionRenderer'\n | 'searchComparator'\n >,\n Omit<\n SelectProps,\n 'onClear' | 'onSearch' | 'error' | 'children' | 'label'\n > {}\n\n// PILL SELECT\n\nexport type FieldPillSelectValueType = any\n\ninterface PillSelectCommon\n extends Omit<PillSelectProps, 'children' | 'onClear' | 'error' | 'value'> {\n /**\n * @since 10.19.0\n */\n onClear?: false | PillSelectProps['onClear']\n}\n\nexport interface FieldPillSelectComponentProps<Value = FieldPillSelectValueType>\n extends FormFieldValueComponentProps<Value>,\n PillSelectCommon {}\n\nexport interface FormPillSelectProps<Value = FieldPillSelectValueType>\n extends FormFieldProps<Value>,\n PillSelectCommon {}\n\n// MULTISELECT\n\nexport type FieldMultiSelectValueType = any[]\n\ninterface MultiSelectCommon<Value>\n extends Partial<OptionList<ValueInArray<Value>>>,\n Omit<MultiSelectProps, 'options' | 'getLabel' | 'getId' | 'error'> {}\n\nexport interface FieldMultiSelectComponentProps<\n Value = FieldMultiSelectValueType\n> extends FormFieldValueComponentProps<Value>,\n MultiSelectCommon<Value> {}\n\nexport interface FormMultiSelectProps<Value = FieldMultiSelectValueType>\n extends FormFieldProps<Value>,\n MultiSelectCommon<Value> {}\n\n// GROUP SELECT\n\nexport type FieldGroupSelectValueType = any[]\n\ninterface GroupSelectCommon<Value>\n extends Partial<OptionList<Value[keyof Value]>>,\n Omit<GroupSelectProps, 'options' | 'getLabel' | 'getId' | 'error'> {}\n\nexport interface FieldGroupSelectComponentProps<\n Value = FieldGroupSelectValueType\n> extends FormFieldValueComponentProps<Value>,\n GroupSelectCommon<Value> {}\n\nexport interface FormGroupSelectProps<Value = FieldGroupSelectValueType>\n extends FormFieldProps<Value>,\n GroupSelectCommon<Value> {}\n\n// TIERED SELECT\n\nexport type FieldTieredSelectValueType = any[]\n\ninterface TieredSelectCommon<Value>\n extends Partial<OptionList<Value[keyof Value]>>,\n Omit<\n TieredSelectProps,\n 'options' | 'getLabel' | 'getId' | 'error' | 'children'\n > {}\n\nexport interface FieldTieredSelectComponentProps<\n Value = FieldTieredSelectValueType\n> extends FormFieldValueComponentProps<Value>,\n TieredSelectCommon<Value> {}\n\nexport interface FormTieredSelectProps<Value = FieldTieredSelectValueType>\n extends FormFieldProps<Value>,\n TieredSelectCommon<Value> {}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Form.types.js","names":[],"sources":["../../src/Form/Form.types.ts"],"sourcesContent":["import type {\n FieldHelperProps,\n FieldInputProps,\n FieldMetaProps as FormikFieldMetaProps,\n FieldValidator,\n FormikConfig,\n} from 'formik'\nimport type React from 'react'\nimport type { CheckboxProps } from '../Checkbox/Checkbox.types'\nimport type { DateSelectProps } from '../DateSelect'\nimport type { GroupSelectProps } from '../GroupSelect/GroupSelect.types'\nimport type { InputProps } from '../Input/Input.types'\nimport type { MultiSelectProps } from '../MultiSelect/MultiSelect.types'\nimport type {\n CurrencyInputProps,\n InputValue as BaseNumberInputValueType,\n NumberInputProps,\n} from '../NumberInput/NumberInput.types'\nimport type { PillSelectProps } from '../PillSelect/PillSelect.types'\nimport type { SelectButtonProps, SelectProps } from '../Select/Select.types'\nimport type { TextAreaProps } from '../TextArea/TextArea.types'\nimport type { TextEditorProps } from '../TextEditor'\nimport type { TieredSelectProps } from '../TieredSelect/TieredSelect.types'\nimport type { TooltipProps } from '../Tooltip/Tooltip.types'\nimport type { Props } from '../_utils/types'\n\nexport type ValueInArray<V> = V[keyof V]\nexport type View = 'create' | 'read' | 'update'\nexport type Layout = 'wxp' | 'traditional'\n\nexport interface FormContextAPI {\n /**\n * @since 10.19.0\n */\n different: boolean\n /**\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n enableReinitialize?: boolean\n /**\n * @since 10.19.0\n */\n setFieldDifferent: (key: string, different: boolean) => void\n\n /**\n * A <a href=\"https://github.com/jquense/yup\">Yup</a> object schema to\n * validate all values.\n * <CodeBlock>\n * {`Yup.object().shape({\n * input_name: Yup.mixed().required()\n * })`}\n * </CodeBlock>\n * This is a great way to get error messages into the component. In\n * addition, if using Yup for required, those fields will automatically\n * get the required asterisk and highlight error.\n * @since 10.19.0\n */\n validationSchema?: FormikConfig<unknown>['validationSchema']\n\n /**\n * Toggle between modern and traditional form styles. Leave blank for the\n * modern label-above layout.\n * @since 10.19.0\n */\n variant: Layout\n\n /**\n * Determines show or edit state of form.\n * @default 'create'\n * @since 10.19.0\n */\n view: View\n}\n\ninterface FieldMetaProps<Value>\n extends Omit<FormikFieldMetaProps<Value>, 'error'> {\n /**\n * @since 10.19.0\n */\n disabled: boolean\n /**\n * @since 10.19.0\n */\n error: boolean\n /**\n * @since 10.19.0\n */\n required: boolean\n /**\n * @since 10.19.0\n */\n view: View\n}\n\nexport interface FieldConfig {\n /**\n * @since 10.19.0\n */\n disabled?: boolean\n /**\n * @since 10.19.0\n */\n error?: boolean | string\n /**\n * @since 10.19.0\n */\n getId?: (item: any) => string | number\n /**\n * @since 10.19.0\n */\n name: string\n /**\n * @since 10.19.0\n */\n required?: boolean\n /**\n * @since 10.19.0\n */\n validate?: FieldValidator\n /**\n * @since 10.19.0\n */\n view?: View\n}\n\nexport interface FormFieldAPI<Value> {\n /**\n * @since 10.19.0\n */\n input: FieldInputProps<Value>\n /**\n * @since 10.19.0\n */\n helpers: {\n setValue: (\n value: Value,\n shouldValidate?: boolean,\n shouldMarkDifferent?: boolean\n ) => void\n setTouched: FieldHelperProps<Value>['setTouched']\n setError: FieldHelperProps<Value>['setError']\n }\n\n /**\n * @since 10.19.0\n */\n messages: {\n error?: string\n }\n /**\n * @since 10.19.0\n */\n meta: FieldMetaProps<Value>\n}\n\nexport interface FormProps<Values> extends Partial<FormikConfig<Values>> {\n /**\n * @since 10.19.0\n */\n children: React.ReactNode\n\n /**\n * Enable a browser confirmation about losing of unsaved data when the\n * form values are visually different from the initial values. Uses\n * `window.onbeforeunload` and `window.confirm` for dialogs(Modal, Tearsheet).\n * **Requires `onSubmit` to return a promise to remove onbeforeunload.**\n */\n enableConfirmNavigation?: boolean\n\n /**\n * Disable all fields at once.\n * @default false\n */\n disabled?: boolean\n\n /**\n * Toggle between modern and traditional form styles. Leave blank for the modern label-above layout.\n *\n */\n variant?: Layout\n\n /**\n * Determines show or edit state of form.\n * @default 'create'\n */\n view?: View\n}\n\nexport type FormFieldValueComponentProps<Value = any> = {\n field: FormFieldAPI<Value>\n}\n\nexport type ComponentWithFieldProp<\n Value,\n Props extends FormFieldValueComponentProps<Value>\n> =\n | React.FunctionComponent<Props>\n | React.ForwardRefExoticComponent<Props>\n | ((p: Props) => React.ReactNode)\n\nexport interface BaseFieldProps<\n Value,\n ComponentProps extends FormFieldValueComponentProps<Value>\n> {\n /**\n * Customize the input component, either a single component for all views\n * or an object with the keys of the views to render on that particular\n * view. This input component will receive the <Code>field</Code> prop.\n * If using TypeScript, these components will need to extend a specific\n * type from Core React, read more about the{' '}\n * <a href=\"#typescript-and-as-prop-components\">props per view</a>.\n * <br />\n * <br />\n * One of:\n * <br />\n * <Code>ReactComponent</Code>or\n * <Code>\n * {\n * '{ read: ReactComponent, create: ReactComponent, update: ReactComponent }'\n * }\n * </Code>\n * @since 10.19.0\n */\n as?:\n | ComponentWithFieldProp<Value, ComponentProps>\n | { [V in View]: ComponentWithFieldProp<Value, ComponentProps> }\n\n /**\n * A subcomponent to render on a particular view.\n * <br />\n * <br />\n * One or all of:\n * <br />\n * <Code>Form.X.Create, Form.X.Read, Form.X.Update</Code>\n * @since 10.19.0\n */\n children?: ((field: FormFieldAPI<Value>) => React.ReactNode) | React.ReactNode\n\n /**\n * Starting location of column. For traditional variant, this does not exist\n * and is not necessary.\n * @since 10.19.0\n * */\n colStart?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12\n\n /**\n * Width of column. For traditional variant, will be either 6 or 12.\n * @default 6\n * @since 10.19.0\n */\n colWidth?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12\n /**\n * @since 10.19.0\n */\n ['data-qa']?: string\n\n /**\n * Specify disabled. Field disabled replaces the overall Form disabled state.\n * @since 10.19.0\n */\n disabled?: boolean\n /**\n * @since 10.19.0\n */\n error?: boolean | string\n /**\n * @since 10.19.0\n */\n label?: string\n /**\n * @since 11.25.0\n */\n description?: React.ReactNode\n /**\n * Key path in store. Accepts <Code>bracket[notation]</Code> or{' '}\n * <Code>dot.notation</Code>.\n * @since 10.19.0\n */\n name: string\n\n /**\n * The required asterisk if not using Yup <Code>required</Code>\n * <CodeBlock>\n * {`<Form\n * validationSchema={Yup.object().shape({\n * input_name: Yup.mixed().required(),\n * })}>`}\n * </CodeBlock>\n * @since 10.19.0\n */\n required?: boolean\n\n /**\n * @since 10.19.0\n */\n tooltip?: TooltipProps['overlay']\n\n /**\n * The validate function from Formik for single field validation.\n * <CodeBlock>\n * {`(value: Value = any) => undefined | string | Promise<Value>`}\n * </CodeBlock>\n * @since 10.19.0\n */\n validate?: FieldValidator\n\n /**\n * Determines show or edit state of field.\n * @since 10.19.0\n */\n view?: View\n}\n\nexport interface TraditionalBaseFieldProps<\n Value,\n ComponentProps extends FormFieldValueComponentProps<Value>\n> extends Omit<BaseFieldProps<Value, ComponentProps>, 'colWidth' | 'colStart'> {\n /**\n * @since 10.19.0\n */\n colWidth?: 6 | 12\n}\n\nexport interface FormFieldProps<Value>\n extends Omit<\n BaseFieldProps<Value, FormFieldValueComponentProps<Value>>,\n 'children'\n > {\n /**\n * @since 10.19.0\n */\n children?:\n | React.ReactElement<\n BaseFieldProps<Value, FormFieldValueComponentProps<Value>>\n >\n | React.ReactElement<\n BaseFieldProps<Value, FormFieldValueComponentProps<Value>>\n >[]\n}\n\nexport type OptionList<OptionShape = any> = {\n /**\n * <div>\n * The id of an option{' '}\n * <Code>{'(option: OptionItem) => string | number'}</Code>\n * </div>\n * <br />\n * <div>\n * Default:\n * <Code>{'(option: OptionItem) => option.id'}</Code>\n * </div>\n * @since 10.19.0\n */\n getId: (option: OptionShape) => string | number\n\n /**\n * <div>\n * The display label of an option\n * <Code>{'(option: OptionItem) => string'}</Code>\n * </div>\n * <br />\n * <div>\n * Default:\n * <Code>{'(option: OptionItem) => option.label || option.name'}</Code>\n * </div>\n * @since 10.19.0\n */\n getLabel: (option: OptionShape) => string\n\n /**\n * @since 10.19.0\n */\n options?: OptionShape[]\n}\n\nexport interface FormErrorBannerProps {\n /**\n * @since 10.19.0\n */\n i18nScope?: string\n /**\n * @since 10.19.0\n */\n item: string\n}\n\n// MAKE\n\nexport type ViewFieldProps<\n Value,\n FieldTypeProps extends FormFieldProps<Value>,\n ComponentProps extends FormFieldValueComponentProps<Value>\n> = Partial<Omit<FieldTypeProps, 'children'>> & {\n /**\n * @since 10.19.0\n */\n children?: BaseFieldProps<Value, ComponentProps>['children']\n}\n\n// TEXT\n\nexport type FieldTextValueType = string\n\nexport interface FieldTextComponentProps<Value = FieldTextValueType>\n extends FormFieldValueComponentProps<Value>,\n InputProps {}\nexport interface FormTextProps<Value = FieldTextValueType>\n extends FormFieldProps<Value>,\n Omit<InputProps, 'name' | 'children' | 'error'> {}\n\n// NUMBER\n\nexport type FieldNumberValueType = BaseNumberInputValueType\n\nexport interface FieldNumberComponentProps<Value = FieldNumberValueType>\n extends FormFieldValueComponentProps<Value>,\n NumberInputProps {}\n\nexport interface FormNumberProps<Value = FieldNumberValueType>\n extends FormFieldProps<Value>,\n Omit<NumberInputProps, 'name' | 'children' | 'error'> {}\n\n// CURRENCY\n\nexport type FieldCurrencyValueType = BaseNumberInputValueType\n\nexport interface FieldCurrencyComponentProps<Value = FieldCurrencyValueType>\n extends FormFieldValueComponentProps<Value>,\n CurrencyInputProps {}\n\nexport interface FormCurrencyProps<Value = FieldCurrencyValueType>\n extends FormFieldProps<Value>,\n Omit<CurrencyInputProps, 'name' | 'children' | 'error'> {}\n\n// DATE\nexport type FieldDateValueType = null | string | Date\n\nexport interface FieldDateComponentProps<Value = FieldDateValueType>\n extends FormFieldValueComponentProps<Value>,\n DateSelectProps {}\n\nexport interface FormDateProps<Value = FieldDateValueType>\n extends FormFieldProps<Value>,\n Omit<DateSelectProps, 'error'> {}\n\n// CHECKBOX\n\nexport type FieldCheckboxValueType = boolean\n\nexport interface FieldCheckboxComponentProps<Value = FieldCheckboxValueType>\n extends FormFieldValueComponentProps<Value>,\n CheckboxProps {\n /**\n * Next to checkbox label\n * @since 11.25.0\n */\n inlineLabel?: string\n /**\n * @since 10.19.0\n */\n i18nScope?: string\n /**\n * @since 11.25.0\n */\n tooltip?: TooltipProps['overlay']\n /**\n * @since 11.25.0\n */\n hasRequiredMark?: boolean\n}\n\nexport interface FormCheckboxProps<Value = FieldCheckboxValueType>\n extends FormFieldProps<Value>,\n Omit<CheckboxProps, 'name' | 'error' | 'children'> {\n /**\n * Next to checkbox label\n * @since 11.25.0\n */\n inlineLabel?: string\n /**\n * Below checkbox description\n * @since 11.25.0\n */\n inlineDescription?: React.ReactNode\n /**\n * @since 10.19.0\n */\n i18nScope?: string\n}\n\n// TEXTAREA\n\nexport type FieldTextAreaValueType = string\n\nexport interface FieldTextAreaComponentProps<Value = FieldTextAreaValueType>\n extends FormFieldValueComponentProps<Value>,\n TextAreaProps {}\nexport interface FormTextAreaProps<Value = FieldTextAreaValueType>\n extends FormFieldProps<Value>,\n Omit<TextAreaProps, 'name' | 'error' | 'children'> {}\n\n// RICHTEXT\n\nexport type FieldRichTextValueType = string\n\nexport interface FieldRichTextComponentProps<Value = FieldRichTextValueType>\n extends FormFieldValueComponentProps<Value>,\n TextEditorProps {}\n\nexport interface FormRichTextProps<Value = FieldRichTextValueType>\n extends Omit<FormFieldProps<Value>, 'error'>,\n TextEditorProps {}\n\n// RADIO BUTTONS\n\nexport type FieldRadioButtonsValueType = any\n\nexport interface FieldRadioButtonsComponentProps<\n Value = FieldRadioButtonsValueType\n> extends FormFieldValueComponentProps<Value>,\n Partial<OptionList<Value>>,\n Pick<Props, 'className' | 'style'> {\n /**\n * @since 10.19.0\n */\n isDisabledOption?: (option: Value) => boolean\n}\n\nexport interface FormRadioButtonsProps<Value = FieldRadioButtonsValueType>\n extends FormFieldProps<Value>,\n Partial<OptionList<Value>>,\n Pick<Props, 'className' | 'style'>,\n Pick<FieldRadioButtonsComponentProps, 'isDisabledOption'> {}\n\n// CHECKBOXES\n\nexport type FieldCheckboxesValueType = any[]\n\nexport interface FieldCheckboxesComponentProps<Value = FieldCheckboxesValueType>\n extends FormFieldValueComponentProps<Value>,\n Partial<OptionList<ValueInArray<Value>>>,\n Pick<Props, 'className' | 'style'> {\n /**\n * @since 10.19.0\n */\n isDisabledOption?: (option: Value) => boolean\n /**\n * @since 10.19.0\n */\n isIndeterminateOption?: (option: Value) => boolean\n}\n\nexport interface FormCheckboxesProps<Value = FieldCheckboxesValueType>\n extends FormFieldProps<Value>,\n Partial<OptionList<ValueInArray<Value>>>,\n Pick<Props, 'className' | 'style'>,\n Pick<\n FieldCheckboxesComponentProps,\n 'isDisabledOption' | 'isIndeterminateOption'\n > {}\n\n// SELECT\n\nexport type FieldSelectValueType = any\nexport type FieldSelectOptionItem = FieldSelectValueType\nexport type FieldSelectGroupItem = any\nexport type FieldSelectGroupHeader = FieldSelectGroupItem & {\n isGroupHeader: boolean\n}\n\nexport interface GroupedOptionsConfig<OptionItem, GroupItem>\n extends OptionList<OptionItem> {\n /**\n * @since 10.19.0\n */\n comparator?: (query: string, value: string) => boolean\n /**\n * @since 10.19.0\n */\n getGroup: (option: OptionItem) => number | string\n /**\n * <div>\n * The id of group{' '}\n * <Code>{'(group: GroupItem) => string | number'}</Code>\n * </div>\n * <br />\n * <div>\n * Default:\n * <Code>{'(group) => group.id'}</Code>\n * </div>\n * @since 10.19.0\n */\n groupGetId: (group: GroupItem) => number | string\n /**\n * @since 10.19.0\n */\n optgroups?: GroupItem[]\n /**\n * @since 10.19.0\n */\n value?: OptionItem\n}\n\nexport interface FieldSelectComponentProps<\n Value = FieldSelectValueType,\n OptionItem = FieldSelectOptionItem,\n GroupItem = FieldSelectGroupItem\n> extends FormFieldValueComponentProps<Value>,\n Partial<OptionList<OptionItem>>,\n Omit<SelectProps, 'onClear' | 'onSearch' | 'error' | 'children'> {\n /**\n * Callback for each entry in <Code>options</Code> to define relation to\n * group in <Code>optgroups</Code>\n * <Code>{'(option: OptionItem) => string | number'}</Code>\n * @since 10.19.0\n * */\n getGroup?: (option: OptionItem) => number | string\n /**\n * @since 10.19.0\n */\n groupGetId?: (group: GroupItem) => number | string\n\n /**\n * <div>\n * The display label of a group\n * <Code>{'(group: GroupItem) => string'}</Code>\n * </div>\n * <br />\n * <div>\n * Default:\n * <Code>{'(group: GroupItem) => group.label || group.name'}</Code>\n * </div>\n * @since 10.19.0\n */\n groupGetLabel?: (group: GroupItem) => string\n\n /**\n * Callback for rendering header for each entry in <Code>optgroups</Code>\n * <Code>{'(group: GroupItem) => React.ReactNode'}</Code>\n * @since 10.19.0\n */\n groupHeaderRenderer?: (group: GroupItem) => React.ReactNode\n\n /**\n * If nothing is selected, suggest this option. From{' '}\n * <Code>{'Select.Option suggested'}</Code>.\n * <Code>{'(option: OptionItem) => boolean'}</Code>\n * @since 10.19.0\n */\n isSuggestedOption?: (option: OptionItem) => boolean\n\n /**\n * Array of available option groups\n * @since 10.19.0\n */\n optgroups?: GroupItem[]\n\n /**\n * Callback for rendering each <Code>option</Code>\n * <Code>{'(option: OptionItem) => React.ReactNode'}</Code>\n * @since 10.19.0\n */\n optionRenderer?: (option: OptionItem) => React.ReactNode\n /**\n * @since 10.19.0\n */\n onBlur?: (e: React.FocusEvent<HTMLDivElement>) => void\n\n /**\n * Callback for when cleared. Default enabled, has clear icon.\n * @since 10.19.0\n */\n onClear?: false | SelectButtonProps['onClear']\n\n /**\n * Callback for when searching. Default enabled, has seach bar in menu.\n * @since 10.19.0\n */\n onSearch?: false | SelectProps['onSearch']\n\n /**\n * <div>Customize how search works</div>\n * <Code>{'(query: string, value: string) => boolean'}</Code>\n * @since 10.19.0\n */\n searchComparator?: (query: string, value: string) => boolean\n}\nexport interface FormSelectProps<\n Value = FieldSelectValueType,\n OptionItem = FieldSelectOptionItem,\n GroupItem = FieldSelectGroupItem\n> extends FormFieldProps<Value>,\n Partial<OptionList<OptionItem>>,\n Pick<\n FieldSelectComponentProps<Value, OptionItem, GroupItem>,\n | 'getGroup'\n | 'groupGetId'\n | 'groupGetLabel'\n | 'groupHeaderRenderer'\n | 'isSuggestedOption'\n | 'onBlur'\n | 'onClear'\n | 'optgroups'\n | 'onSearch'\n | 'optionRenderer'\n | 'searchComparator'\n >,\n Omit<\n SelectProps,\n 'onClear' | 'onSearch' | 'error' | 'children' | 'label'\n > {}\n\n// PILL SELECT\n\nexport type FieldPillSelectValueType = any\n\ninterface PillSelectCommon\n extends Omit<PillSelectProps, 'children' | 'onClear' | 'error' | 'value'> {\n /**\n * @since 10.19.0\n */\n onClear?: false | PillSelectProps['onClear']\n}\n\nexport interface FieldPillSelectComponentProps<Value = FieldPillSelectValueType>\n extends FormFieldValueComponentProps<Value>,\n PillSelectCommon {}\n\nexport interface FormPillSelectProps<Value = FieldPillSelectValueType>\n extends FormFieldProps<Value>,\n PillSelectCommon {}\n\n// MULTISELECT\n\nexport type FieldMultiSelectValueType = any[]\n\ninterface MultiSelectCommon<Value>\n extends Partial<OptionList<ValueInArray<Value>>>,\n Omit<MultiSelectProps, 'options' | 'getLabel' | 'getId' | 'error'> {}\n\nexport interface FieldMultiSelectComponentProps<\n Value = FieldMultiSelectValueType\n> extends FormFieldValueComponentProps<Value>,\n MultiSelectCommon<Value> {}\n\nexport interface FormMultiSelectProps<Value = FieldMultiSelectValueType>\n extends FormFieldProps<Value>,\n MultiSelectCommon<Value> {}\n\n// GROUP SELECT\n\nexport type FieldGroupSelectValueType = any[]\n\ninterface GroupSelectCommon<Value>\n extends Partial<OptionList<Value[keyof Value]>>,\n Omit<GroupSelectProps, 'options' | 'getLabel' | 'getId' | 'error'> {}\n\nexport interface FieldGroupSelectComponentProps<\n Value = FieldGroupSelectValueType\n> extends FormFieldValueComponentProps<Value>,\n GroupSelectCommon<Value> {}\n\nexport interface FormGroupSelectProps<Value = FieldGroupSelectValueType>\n extends FormFieldProps<Value>,\n GroupSelectCommon<Value> {}\n\n// TIERED SELECT\n\nexport type FieldTieredSelectValueType = any[]\n\ninterface TieredSelectCommon<Value>\n extends Partial<OptionList<Value[keyof Value]>>,\n Omit<\n TieredSelectProps,\n 'options' | 'getLabel' | 'getId' | 'error' | 'children'\n > {}\n\nexport interface FieldTieredSelectComponentProps<\n Value = FieldTieredSelectValueType\n> extends FormFieldValueComponentProps<Value>,\n TieredSelectCommon<Value> {}\n\nexport interface FormTieredSelectProps<Value = FieldTieredSelectValueType>\n extends FormFieldProps<Value>,\n TieredSelectCommon<Value> {}\n"],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Tooltip } from '../Tooltip';
|
|
4
|
+
import { useI18nContext } from '../_hooks/I18n';
|
|
5
|
+
import { StyledFormFieldTooltipIcon } from './Form.styles';
|
|
6
|
+
export var FormFieldTooltip = function FormFieldTooltip(props) {
|
|
7
|
+
var i18n = useI18nContext();
|
|
8
|
+
return /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
9
|
+
role: "tooltip",
|
|
10
|
+
trigger: ['hover', 'focus']
|
|
11
|
+
}, props), /*#__PURE__*/React.createElement(StyledFormFieldTooltipIcon, {
|
|
12
|
+
"aria-label": i18n.t('core.form.field.tooltipHelp'),
|
|
13
|
+
"aria-hidden": false,
|
|
14
|
+
size: "sm",
|
|
15
|
+
tabIndex: 0
|
|
16
|
+
}));
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=FormFieldTooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormFieldTooltip.js","names":["React","Tooltip","useI18nContext","StyledFormFieldTooltipIcon","FormFieldTooltip","props","i18n","createElement","_extends","role","trigger","t","size","tabIndex"],"sources":["../../src/Form/FormFieldTooltip.tsx"],"sourcesContent":["import React from 'react'\nimport type { OverlayTriggerProps } from '../OverlayTrigger'\nimport type { TooltipProps } from '../Tooltip'\nimport { Tooltip } from '../Tooltip'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { StyledFormFieldTooltipIcon } from './Form.styles'\n\nexport const FormFieldTooltip: React.FC<\n Omit<OverlayTriggerProps & TooltipProps, 'children'>\n> = (props) => {\n const i18n = useI18nContext()\n\n return (\n <Tooltip role=\"tooltip\" trigger={['hover', 'focus']} {...props}>\n <StyledFormFieldTooltipIcon\n aria-label={i18n.t('core.form.field.tooltipHelp')}\n aria-hidden={false}\n size=\"sm\"\n tabIndex={0}\n />\n </Tooltip>\n )\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SAASC,OAAO,QAAQ,YAAY;AACpC,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,0BAA0B,QAAQ,eAAe;AAE1D,OAAO,IAAMC,gBAEZ,GAAG,SAFSA,gBAEZA,CAAIC,KAAK,EAAK;EACb,IAAMC,IAAI,GAAGJ,cAAc,CAAC,CAAC;EAE7B,oBACEF,KAAA,CAAAO,aAAA,CAACN,OAAO,EAAAO,QAAA;IAACC,IAAI,EAAC,SAAS;IAACC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO;EAAE,GAAKL,KAAK,gBAC5DL,KAAA,CAAAO,aAAA,CAACJ,0BAA0B;IACzB,cAAYG,IAAI,CAACK,CAAC,CAAC,6BAA6B,CAAE;IAClD,eAAa,KAAM;IACnBC,IAAI,EAAC,IAAI;IACTC,QAAQ,EAAE;EAAE,CACb,CACM,CAAC;AAEd,CAAC"}
|
|
@@ -8,6 +8,8 @@ interface SingleFormProps {
|
|
|
8
8
|
initialValue?: any;
|
|
9
9
|
variant?: React.ComponentProps<typeof Form>['variant'];
|
|
10
10
|
view?: React.ComponentProps<typeof Form>['view'];
|
|
11
|
+
useLabelAsInlineLabel?: boolean;
|
|
12
|
+
useDescriptionAsInlineDescription?: boolean;
|
|
11
13
|
}
|
|
12
14
|
interface DemoFormProps {
|
|
13
15
|
view?: React.ComponentProps<typeof Form>['view'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["component", "debug", "initialValue", "view", "variant"];
|
|
2
|
+
var _excluded = ["component", "debug", "initialValue", "view", "variant", "useLabelAsInlineLabel", "useDescriptionAsInlineDescription"];
|
|
3
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -48,6 +48,8 @@ var SingleForm = function SingleForm(_ref) {
|
|
|
48
48
|
initialValue = _ref.initialValue,
|
|
49
49
|
view = _ref.view,
|
|
50
50
|
variant = _ref.variant,
|
|
51
|
+
useLabelAsInlineLabel = _ref.useLabelAsInlineLabel,
|
|
52
|
+
useDescriptionAsInlineDescription = _ref.useDescriptionAsInlineDescription,
|
|
51
53
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
52
54
|
// removes colStart from DOM for traditional variant
|
|
53
55
|
var columnOne = variant === 'traditional' ? {} : {
|
|
@@ -67,27 +69,69 @@ var SingleForm = function SingleForm(_ref) {
|
|
|
67
69
|
return alert(JSON.stringify(values, null, 2));
|
|
68
70
|
}
|
|
69
71
|
}, /*#__PURE__*/React.createElement(Form.Form, null, debug && /*#__PURE__*/React.createElement(FormDebugger, null), /*#__PURE__*/React.createElement(Form.Row, null, /*#__PURE__*/React.createElement(FieldComponent, _extends({
|
|
70
|
-
name: "empty"
|
|
71
|
-
|
|
72
|
+
name: "empty"
|
|
73
|
+
}, useLabelAsInlineLabel ? {
|
|
74
|
+
inlineLabel: 'Empty Text'
|
|
75
|
+
} : {
|
|
76
|
+
label: 'Empty Text'
|
|
77
|
+
}, useDescriptionAsInlineDescription ? {
|
|
78
|
+
inlineDescription: 'Empty Description'
|
|
79
|
+
} : {
|
|
80
|
+
description: 'Empty Description'
|
|
72
81
|
}, columnOne, props)), /*#__PURE__*/React.createElement(FieldComponent, _extends({
|
|
73
|
-
name: "value"
|
|
74
|
-
|
|
82
|
+
name: "value"
|
|
83
|
+
}, useLabelAsInlineLabel ? {
|
|
84
|
+
inlineLabel: 'Initial Value Text'
|
|
85
|
+
} : {
|
|
86
|
+
label: 'Initial Value Text'
|
|
87
|
+
}, useDescriptionAsInlineDescription ? {
|
|
88
|
+
inlineDescription: 'Initial Value Description'
|
|
89
|
+
} : {
|
|
90
|
+
description: 'Initial Value Description'
|
|
75
91
|
}, columnTwo, props))), /*#__PURE__*/React.createElement(Form.Row, null, /*#__PURE__*/React.createElement(FieldComponent, _extends({
|
|
76
|
-
name: "empty",
|
|
77
|
-
disabled: true
|
|
78
|
-
|
|
92
|
+
name: "disabled-empty",
|
|
93
|
+
disabled: true
|
|
94
|
+
}, useLabelAsInlineLabel ? {
|
|
95
|
+
inlineLabel: 'Disabled Empty Text'
|
|
96
|
+
} : {
|
|
97
|
+
label: 'Disabled Empty Text'
|
|
98
|
+
}, useDescriptionAsInlineDescription ? {
|
|
99
|
+
inlineDescription: 'Disabled Empty Description'
|
|
100
|
+
} : {
|
|
101
|
+
description: 'Disabled Empty Description'
|
|
79
102
|
}, columnOne, props)), /*#__PURE__*/React.createElement(FieldComponent, _extends({
|
|
80
|
-
name: "value",
|
|
81
|
-
disabled: true
|
|
82
|
-
|
|
103
|
+
name: "disabled-value",
|
|
104
|
+
disabled: true
|
|
105
|
+
}, useLabelAsInlineLabel ? {
|
|
106
|
+
inlineLabel: 'Disabled Initial Value Text'
|
|
107
|
+
} : {
|
|
108
|
+
label: 'Disabled Initial Value Text'
|
|
109
|
+
}, useDescriptionAsInlineDescription ? {
|
|
110
|
+
inlineDescription: 'Disabled Initial Description'
|
|
111
|
+
} : {
|
|
112
|
+
description: 'Disabled Initial Description'
|
|
83
113
|
}, columnTwo, props))), /*#__PURE__*/React.createElement(Form.Row, null, /*#__PURE__*/React.createElement(FieldComponent, _extends({
|
|
84
|
-
name: "empty",
|
|
85
|
-
error: true
|
|
86
|
-
|
|
114
|
+
name: "error-empty",
|
|
115
|
+
error: true
|
|
116
|
+
}, useLabelAsInlineLabel ? {
|
|
117
|
+
inlineLabel: 'Error Boolean Empty Text'
|
|
118
|
+
} : {
|
|
119
|
+
label: 'Error Boolean Empty Text'
|
|
120
|
+
}, useDescriptionAsInlineDescription ? {
|
|
121
|
+
inlineDescription: 'Error Boolean Description'
|
|
122
|
+
} : {
|
|
123
|
+
description: 'Error Boolean Description'
|
|
87
124
|
}, columnOne, props)), /*#__PURE__*/React.createElement(FieldComponent, _extends({
|
|
88
|
-
name: "value",
|
|
89
|
-
error: "Some error message that should be read red"
|
|
90
|
-
|
|
125
|
+
name: "error-value",
|
|
126
|
+
error: "Some error message that should be read red"
|
|
127
|
+
}, useLabelAsInlineLabel ? {
|
|
128
|
+
inlineLabel: 'Error Message Initial Value Text'
|
|
129
|
+
} : {
|
|
130
|
+
label: 'Error Message Initial Value Text'
|
|
131
|
+
}, useDescriptionAsInlineDescription ? {
|
|
132
|
+
inlineDescription: 'Error Message Initial Description'
|
|
133
|
+
} : {
|
|
134
|
+
description: 'Error Message Initial Description'
|
|
91
135
|
}, columnTwo, props)))));
|
|
92
136
|
};
|
|
93
137
|
export var DemoForm = function DemoForm(_ref2) {
|