uniforms-bootstrap4
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -1,7 +0,41 @@ | ||
import { ComponentType } from 'react'; | ||
import { Override, connectField } from 'uniforms'; | ||
export declare type AutoFieldProps = Override<Record<string, unknown>, { | ||
component?: ComponentType<any> | ReturnType<typeof connectField>; | ||
name: string; | ||
}>; | ||
export default function AutoField(originalProps: AutoFieldProps): import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, string | any | (new (props: any) => import("react").Component<any, any, any>)> | null) | (new (props: any) => import("react").Component<any, any, any>)>; | ||
/// <reference types="react" /> | ||
export declare type AutoFieldProps = Parameters<typeof AutoField>[0]; | ||
declare const AutoField: { | ||
(rawProps: import("uniforms").Override<Record<string, unknown>, { | ||
component?: import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | (import("react").FunctionComponent<import("uniforms").Override<Partial<import("uniforms").GuaranteedProps<any>>, import("uniforms").Override<Partial<import("uniforms").GuaranteedProps<unknown>>, { | ||
label?: import("react").ReactNode; | ||
name: string; | ||
placeholder?: string | boolean | null | undefined; | ||
}>>> & { | ||
Component: import("react").ComponentType<Partial<import("uniforms").GuaranteedProps<any>>>; | ||
options: { | ||
initialValue?: boolean | undefined; | ||
kind?: "leaf" | "node" | undefined; | ||
} | undefined; | ||
}) | undefined; | ||
name: string; | ||
}>): import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>; | ||
componentDetectorContext: import("react").Context<(props: import("uniforms").GuaranteedProps<unknown> & Record<string, any>, uniforms: import("uniforms").Context<unknown>) => import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | (import("react").FunctionComponent<import("uniforms").Override<Partial<import("uniforms").GuaranteedProps<any>>, import("uniforms").Override<Partial<import("uniforms").GuaranteedProps<unknown>>, { | ||
label?: import("react").ReactNode; | ||
name: string; | ||
placeholder?: string | boolean | null | undefined; | ||
}>>> & { | ||
Component: import("react").ComponentType<Partial<import("uniforms").GuaranteedProps<any>>>; | ||
options: { | ||
initialValue?: boolean | undefined; | ||
kind?: "leaf" | "node" | undefined; | ||
} | undefined; | ||
})>; | ||
defaultComponentDetector: (props: import("uniforms").GuaranteedProps<unknown> & Record<string, any>, uniforms: import("uniforms").Context<unknown>) => import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | (import("react").FunctionComponent<import("uniforms").Override<Partial<import("uniforms").GuaranteedProps<any>>, import("uniforms").Override<Partial<import("uniforms").GuaranteedProps<unknown>>, { | ||
label?: import("react").ReactNode; | ||
name: string; | ||
placeholder?: string | boolean | null | undefined; | ||
}>>> & { | ||
Component: import("react").ComponentType<Partial<import("uniforms").GuaranteedProps<any>>>; | ||
options: { | ||
initialValue?: boolean | undefined; | ||
kind?: "leaf" | "node" | undefined; | ||
} | undefined; | ||
}); | ||
}; | ||
export default AutoField; |
@@ -5,3 +5,2 @@ "use strict"; | ||
var invariant_1 = tslib_1.__importDefault(require("invariant")); | ||
var react_1 = require("react"); | ||
var uniforms_1 = require("uniforms"); | ||
@@ -16,44 +15,24 @@ var BoolField_1 = tslib_1.__importDefault(require("./BoolField")); | ||
var TextField_1 = tslib_1.__importDefault(require("./TextField")); | ||
function AutoField(originalProps) { | ||
var _a; | ||
var props = uniforms_1.useField(originalProps.name, originalProps)[0]; | ||
var allowedValues = props.allowedValues, checkboxes = props.checkboxes, fieldType = props.fieldType; | ||
var component = props.component; | ||
if (component === undefined) { | ||
if (allowedValues) { | ||
if (checkboxes && fieldType !== Array) { | ||
component = RadioField_1.default; | ||
} | ||
else { | ||
component = SelectField_1.default; | ||
} | ||
} | ||
else { | ||
switch (fieldType) { | ||
case Array: | ||
component = ListField_1.default; | ||
break; | ||
case Boolean: | ||
component = BoolField_1.default; | ||
break; | ||
case Date: | ||
component = DateField_1.default; | ||
break; | ||
case Number: | ||
component = NumField_1.default; | ||
break; | ||
case Object: | ||
component = NestField_1.default; | ||
break; | ||
case String: | ||
component = TextField_1.default; | ||
break; | ||
} | ||
invariant_1.default(component, 'Unsupported field type: %s', fieldType); | ||
} | ||
var AutoField = uniforms_1.createAutoField(function (props) { | ||
if (props.allowedValues) { | ||
return props.checkboxes && props.fieldType !== Array | ||
? RadioField_1.default | ||
: SelectField_1.default; | ||
} | ||
return 'options' in component && ((_a = component.options) === null || _a === void 0 ? void 0 : _a.kind) === 'leaf' | ||
? react_1.createElement(component.Component, props) | ||
: react_1.createElement(component, originalProps); | ||
} | ||
switch (props.fieldType) { | ||
case Array: | ||
return ListField_1.default; | ||
case Boolean: | ||
return BoolField_1.default; | ||
case Date: | ||
return DateField_1.default; | ||
case Number: | ||
return NumField_1.default; | ||
case Object: | ||
return NestField_1.default; | ||
case String: | ||
return TextField_1.default; | ||
} | ||
return invariant_1.default(false, 'Unsupported field type: %s', props.fieldType); | ||
}); | ||
exports.default = AutoField; |
@@ -10,3 +10,3 @@ "use strict"; | ||
var onChange = _a.onChange, props = tslib_1.__rest(_a, ["onChange"]); | ||
var disabled = props.disabled, error = props.error, inline = props.inline, inputClassName = props.inputClassName, inputRef = props.inputRef, label = props.label, labelBefore = props.labelBefore, name = props.name, value = props.value; | ||
var disabled = props.disabled, error = props.error, inline = props.inline, inputClassName = props.inputClassName, inputRef = props.inputRef, label = props.label, labelBefore = props.labelBefore, name = props.name, readOnly = props.readOnly, value = props.value; | ||
return wrapField_1.default(tslib_1.__assign(tslib_1.__assign({}, props), { label: labelBefore, value: props.value }), react_1.default.createElement("div", { className: classnames_1.default(inputClassName, 'form-check', 'checkbox', { | ||
@@ -17,3 +17,7 @@ 'text-danger': error, | ||
react_1.default.createElement("label", { htmlFor: props.id, className: "form-check-label" }, | ||
react_1.default.createElement("input", { checked: value || false, className: "form-check-input", disabled: disabled, id: props.id, name: name, onChange: function () { return onChange(!value); }, ref: inputRef, type: "checkbox" }), | ||
react_1.default.createElement("input", { checked: value || false, className: "form-check-input", disabled: disabled, id: props.id, name: name, onChange: function () { | ||
if (!readOnly) { | ||
onChange(!value); | ||
} | ||
}, ref: inputRef, type: "checkbox" }), | ||
"\u00A0", | ||
@@ -20,0 +24,0 @@ label))); |
@@ -12,3 +12,3 @@ "use strict"; | ||
var _b; | ||
var disabled = _a.disabled, error = _a.error, id = _a.id, inputClassName = _a.inputClassName, inputRef = _a.inputRef, max = _a.max, min = _a.min, name = _a.name, onChange = _a.onChange, placeholder = _a.placeholder, value = _a.value, props = tslib_1.__rest(_a, ["disabled", "error", "id", "inputClassName", "inputRef", "max", "min", "name", "onChange", "placeholder", "value"]); | ||
var disabled = _a.disabled, error = _a.error, id = _a.id, inputClassName = _a.inputClassName, inputRef = _a.inputRef, max = _a.max, min = _a.min, name = _a.name, onChange = _a.onChange, placeholder = _a.placeholder, readOnly = _a.readOnly, value = _a.value, props = tslib_1.__rest(_a, ["disabled", "error", "id", "inputClassName", "inputRef", "max", "min", "name", "onChange", "placeholder", "readOnly", "value"]); | ||
return wrapField_1.default(tslib_1.__assign(tslib_1.__assign({}, props), { id: id }), react_1.default.createElement("input", { className: classnames_1.default(inputClassName, 'form-control', { | ||
@@ -24,4 +24,4 @@ 'is-invalid': error, | ||
} | ||
}, placeholder: placeholder, ref: inputRef, type: "datetime-local", value: (_b = dateFormat(value)) !== null && _b !== void 0 ? _b : '' })); | ||
}, placeholder: placeholder, readOnly: readOnly, ref: inputRef, type: "datetime-local", value: (_b = dateFormat(value)) !== null && _b !== void 0 ? _b : '' })); | ||
} | ||
exports.default = uniforms_1.connectField(Date, { kind: 'leaf' }); |
@@ -7,3 +7,3 @@ import React, { HTMLProps } from 'react'; | ||
}>; | ||
declare const _default: React.FunctionComponent<Override<Override<Pick<React.HTMLProps<HTMLDivElement>, "start" | "hidden" | "color" | "content" | "size" | "style" | "default" | "wrap" | "open" | "multiple" | "disabled" | "height" | "translate" | "width" | "prefix" | "src" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "children" | "ref" | "key" | "list" | "step" | "async" | "id" | "name" | "placeholder" | "value" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "target" | "type" | "useMap" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "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" | "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">, { | ||
declare const _default: React.FunctionComponent<Override<Override<Pick<React.HTMLProps<HTMLDivElement>, "start" | "hidden" | "color" | "content" | "size" | "style" | "default" | "wrap" | "open" | "multiple" | "disabled" | "height" | "translate" | "width" | "prefix" | "src" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "children" | "ref" | "key" | "list" | "step" | "async" | "id" | "name" | "placeholder" | "readOnly" | "value" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "target" | "type" | "useMap" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "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" | "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">, { | ||
error?: any; | ||
@@ -16,3 +16,3 @@ errorMessage?: string | undefined; | ||
}>>> & { | ||
Component: React.ComponentType<Override<Pick<React.HTMLProps<HTMLDivElement>, "start" | "hidden" | "color" | "content" | "size" | "style" | "default" | "wrap" | "open" | "multiple" | "disabled" | "height" | "translate" | "width" | "prefix" | "src" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "children" | "ref" | "key" | "list" | "step" | "async" | "id" | "name" | "placeholder" | "value" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "target" | "type" | "useMap" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "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" | "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">, { | ||
Component: React.ComponentType<Override<Pick<React.HTMLProps<HTMLDivElement>, "start" | "hidden" | "color" | "content" | "size" | "style" | "default" | "wrap" | "open" | "multiple" | "disabled" | "height" | "translate" | "width" | "prefix" | "src" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "children" | "ref" | "key" | "list" | "step" | "async" | "id" | "name" | "placeholder" | "readOnly" | "value" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "target" | "type" | "useMap" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "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" | "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">, { | ||
error?: any; | ||
@@ -19,0 +19,0 @@ errorMessage?: string | undefined; |
@@ -15,4 +15,4 @@ "use strict"; | ||
}); | ||
return props.noDOM ? null : (react_1.default.createElement("input", tslib_1.__assign({ disabled: props.disabled, name: props.name, ref: props.inputRef, type: "hidden", value: (_b = value !== null && value !== void 0 ? value : props.value) !== null && _b !== void 0 ? _b : '' }, uniforms_1.filterDOMProps(props)))); | ||
return props.noDOM ? null : (react_1.default.createElement("input", tslib_1.__assign({ disabled: props.disabled, name: props.name, readOnly: props.readOnly, ref: props.inputRef, type: "hidden", value: (_b = value !== null && value !== void 0 ? value : props.value) !== null && _b !== void 0 ? _b : '' }, uniforms_1.filterDOMProps(props)))); | ||
} | ||
exports.default = HiddenField; |
@@ -9,3 +9,3 @@ "use strict"; | ||
function ListAdd(_a) { | ||
var name = _a.name, addIcon = _a.addIcon, className = _a.className, disabled = _a.disabled, value = _a.value, props = tslib_1.__rest(_a, ["name", "addIcon", "className", "disabled", "value"]); | ||
var addIcon = _a.addIcon, className = _a.className, disabled = _a.disabled, name = _a.name, readOnly = _a.readOnly, value = _a.value, props = tslib_1.__rest(_a, ["addIcon", "className", "disabled", "name", "readOnly", "value"]); | ||
var nameParts = uniforms_1.joinName(null, name); | ||
@@ -16,3 +16,3 @@ var parentName = uniforms_1.joinName(nameParts.slice(0, -1)); | ||
return (react_1.default.createElement("div", tslib_1.__assign({}, uniforms_1.filterDOMProps(props), { className: classnames_1.default('badge badge-pill float-right', className), onClick: function () { | ||
if (limitNotReached) { | ||
if (limitNotReached && !readOnly) { | ||
parent.onChange(parent.value.concat([cloneDeep_1.default(value)])); | ||
@@ -19,0 +19,0 @@ } |
@@ -8,3 +8,3 @@ "use strict"; | ||
function ListDel(_a) { | ||
var name = _a.name, className = _a.className, disabled = _a.disabled, removeIcon = _a.removeIcon, props = tslib_1.__rest(_a, ["name", "className", "disabled", "removeIcon"]); | ||
var className = _a.className, disabled = _a.disabled, name = _a.name, readOnly = _a.readOnly, removeIcon = _a.removeIcon, props = tslib_1.__rest(_a, ["className", "disabled", "name", "readOnly", "removeIcon"]); | ||
var nameParts = uniforms_1.joinName(null, name); | ||
@@ -16,3 +16,3 @@ var nameIndex = +nameParts[nameParts.length - 1]; | ||
return (react_1.default.createElement("span", tslib_1.__assign({}, uniforms_1.filterDOMProps(props), { className: classnames_1.default('badge badge-pill', className), onClick: function () { | ||
if (limitNotReached) { | ||
if (limitNotReached && !readOnly) { | ||
var value = parent.value.slice(); | ||
@@ -19,0 +19,0 @@ value.splice(nameIndex, 1); |
@@ -12,4 +12,4 @@ "use strict"; | ||
'is-invalid': props.error, | ||
}), disabled: props.disabled, id: props.id, name: props.name, onChange: function (event) { return props.onChange(event.target.value); }, placeholder: props.placeholder, ref: props.inputRef, rows: props.rows, value: (_a = props.value) !== null && _a !== void 0 ? _a : '' })); | ||
}), disabled: props.disabled, id: props.id, name: props.name, onChange: function (event) { return props.onChange(event.target.value); }, placeholder: props.placeholder, readOnly: props.readOnly, ref: props.inputRef, rows: props.rows, value: (_a = props.value) !== null && _a !== void 0 ? _a : '' })); | ||
} | ||
exports.default = uniforms_1.connectField(LongText, { kind: 'leaf' }); |
@@ -16,4 +16,4 @@ "use strict"; | ||
props.onChange(isNaN(value) ? undefined : value); | ||
}, placeholder: props.placeholder, ref: props.inputRef, step: props.step || (props.decimal ? 0.01 : 1), type: "number", value: (_a = props.value) !== null && _a !== void 0 ? _a : '' })); | ||
}, placeholder: props.placeholder, readOnly: props.readOnly, ref: props.inputRef, step: props.step || (props.decimal ? 0.01 : 1), type: "number", value: (_a = props.value) !== null && _a !== void 0 ? _a : '' })); | ||
} | ||
exports.default = uniforms_1.connectField(Num, { kind: 'leaf' }); |
@@ -19,3 +19,7 @@ "use strict"; | ||
react_1.default.createElement("label", { htmlFor: props.id + "-" + escape(item), className: "form-check-label" }, | ||
react_1.default.createElement("input", { checked: item === props.value, className: "form-check-input", disabled: props.disabled, id: props.id + "-" + escape(item), name: props.name, onChange: function () { return props.onChange(item); }, type: "radio" }), | ||
react_1.default.createElement("input", { checked: item === props.value, className: "form-check-input", disabled: props.disabled, id: props.id + "-" + escape(item), name: props.name, onChange: function () { | ||
if (!props.readOnly) { | ||
props.onChange(item); | ||
} | ||
}, type: "radio" }), | ||
' ', | ||
@@ -22,0 +26,0 @@ props.transform ? props.transform(item) : item))); })); |
@@ -14,3 +14,4 @@ "use strict"; | ||
function Select(_a) { | ||
var allowedValues = _a.allowedValues, checkboxes = _a.checkboxes, disableItem = _a.disableItem, disabled = _a.disabled, error = _a.error, fieldType = _a.fieldType, id = _a.id, inline = _a.inline, inputClassName = _a.inputClassName, inputRef = _a.inputRef, label = _a.label, name = _a.name, onChange = _a.onChange, placeholder = _a.placeholder, required = _a.required, transform = _a.transform, value = _a.value, props = tslib_1.__rest(_a, ["allowedValues", "checkboxes", "disableItem", "disabled", "error", "fieldType", "id", "inline", "inputClassName", "inputRef", "label", "name", "onChange", "placeholder", "required", "transform", "value"]); | ||
var allowedValues = _a.allowedValues, checkboxes = _a.checkboxes, disableItem = _a.disableItem, disabled = _a.disabled, error = _a.error, fieldType = _a.fieldType, id = _a.id, inline = _a.inline, inputClassName = _a.inputClassName, inputRef = _a.inputRef, label = _a.label, name = _a.name, onChange = _a.onChange, placeholder = _a.placeholder, readOnly = _a.readOnly, required = _a.required, transform = _a.transform, value = _a.value, props = tslib_1.__rest(_a, ["allowedValues", "checkboxes", "disableItem", "disabled", "error", "fieldType", "id", "inline", "inputClassName", "inputRef", "label", "name", "onChange", "placeholder", "readOnly", "required", "transform", "value"]); | ||
var multiple = fieldType === Array; | ||
return wrapField_1.default(tslib_1.__assign(tslib_1.__assign({}, props), { disabled: disabled, | ||
@@ -20,15 +21,26 @@ error: error, | ||
label: label, | ||
required: required }), checkboxes || fieldType === Array ? (allowedValues === null || allowedValues === void 0 ? void 0 : allowedValues.map(function (item) { return (react_1.default.createElement("div", { key: item, className: classnames_1.default(inputClassName, "checkbox" + (inline ? '-inline' : '')) }, | ||
required: required }), checkboxes ? (allowedValues === null || allowedValues === void 0 ? void 0 : allowedValues.map(function (item) { return (react_1.default.createElement("div", { key: item, className: classnames_1.default(inputClassName, "checkbox" + (inline ? '-inline' : '')) }, | ||
react_1.default.createElement("label", { htmlFor: id + "-" + escape(item) }, | ||
react_1.default.createElement("input", { checked: fieldType === Array ? value === null || value === void 0 ? void 0 : value.includes(item) : value === item, disabled: (disableItem === null || disableItem === void 0 ? void 0 : disableItem(item)) || disabled, id: id + "-" + escape(item), name: name, onChange: function () { | ||
return onChange(fieldType === Array ? xor_1.default([item], value) : item); | ||
react_1.default.createElement("input", { checked: multiple ? value === null || value === void 0 ? void 0 : value.includes(item) : value === item, disabled: (disableItem === null || disableItem === void 0 ? void 0 : disableItem(item)) || disabled, id: id + "-" + escape(item), name: name, onChange: function () { | ||
if (!readOnly) { | ||
onChange(multiple ? xor_1.default([item], value) : item); | ||
} | ||
}, type: "checkbox" }), | ||
transform ? transform(item) : item))); })) : (react_1.default.createElement("select", { className: classnames_1.default(inputClassName, 'c-select form-control', { | ||
'is-invalid': error, | ||
}), disabled: disabled, id: id, name: name, onChange: function (event) { | ||
return onChange(event.target.value !== '' ? event.target.value : undefined); | ||
}), disabled: disabled, id: id, multiple: multiple, name: name, onChange: function (event) { | ||
if (!readOnly) { | ||
var item = event.target.value; | ||
if (multiple) { | ||
var clear = event.target.selectedIndex === -1; | ||
onChange(clear ? [] : xor_1.default([item], value)); | ||
} | ||
else { | ||
onChange(item !== '' ? item : undefined); | ||
} | ||
} | ||
}, ref: inputRef, value: value !== null && value !== void 0 ? value : '' }, | ||
(!!placeholder || !required || value === undefined) && (react_1.default.createElement("option", { value: "", disabled: required, hidden: required }, placeholder || label)), allowedValues === null || allowedValues === void 0 ? void 0 : | ||
allowedValues.map(function (value) { return (react_1.default.createElement("option", { disabled: disableItem === null || disableItem === void 0 ? void 0 : disableItem(value), key: value, value: value }, transform ? transform(value) : value)); })))); | ||
(!!placeholder || !required || value === undefined) && !multiple && (react_1.default.createElement("option", { value: "", disabled: required, hidden: required }, placeholder || label)), allowedValues === null || allowedValues === void 0 ? void 0 : | ||
allowedValues.map(function (allowedValue) { return (react_1.default.createElement("option", { disabled: disableItem === null || disableItem === void 0 ? void 0 : disableItem(allowedValue), key: allowedValue, value: allowedValue }, transform ? transform(allowedValue) : allowedValue)); })))); | ||
} | ||
exports.default = uniforms_1.connectField(Select, { kind: 'leaf' }); |
@@ -8,3 +8,3 @@ import { HTMLProps, Ref } from 'react'; | ||
}>; | ||
declare function SubmitField({ className, disabled, inputClassName, inputRef, value, wrapClassName, ...props }: SubmitFieldProps): JSX.Element; | ||
declare function SubmitField({ className, disabled, inputClassName, inputRef, readOnly, value, wrapClassName, ...props }: SubmitFieldProps): JSX.Element; | ||
declare namespace SubmitField { | ||
@@ -11,0 +11,0 @@ var defaultProps: { |
@@ -9,7 +9,7 @@ "use strict"; | ||
function SubmitField(_a) { | ||
var className = _a.className, disabled = _a.disabled, inputClassName = _a.inputClassName, inputRef = _a.inputRef, value = _a.value, wrapClassName = _a.wrapClassName, props = tslib_1.__rest(_a, ["className", "disabled", "inputClassName", "inputRef", "value", "wrapClassName"]); | ||
var className = _a.className, disabled = _a.disabled, inputClassName = _a.inputClassName, inputRef = _a.inputRef, readOnly = _a.readOnly, value = _a.value, wrapClassName = _a.wrapClassName, props = tslib_1.__rest(_a, ["className", "disabled", "inputClassName", "inputRef", "readOnly", "value", "wrapClassName"]); | ||
var _b = uniforms_1.useForm(), error = _b.error, anyState = _b.state; | ||
var state = anyState; | ||
var hasWrap = !!(state.grid || wrapClassName); | ||
var blockInput = (react_1.default.createElement("input", tslib_1.__assign({ className: inputClassName, disabled: disabled === undefined ? !!(error || state.disabled) : disabled, ref: inputRef, type: "submit" }, (value ? { value: value } : {})))); | ||
var blockInput = (react_1.default.createElement("input", tslib_1.__assign({ className: inputClassName, disabled: disabled === undefined ? !!(error || state.disabled) : disabled, readOnly: readOnly, ref: inputRef, type: "submit" }, (value ? { value: value } : {})))); | ||
return (react_1.default.createElement("div", tslib_1.__assign({ className: classnames_1.default(className, { | ||
@@ -16,0 +16,0 @@ 'is-invalid': error, |
@@ -13,4 +13,4 @@ "use strict"; | ||
'is-invalid': props.error, | ||
}), disabled: props.disabled, id: props.id, name: props.name, onChange: function (event) { return props.onChange(event.target.value); }, placeholder: props.placeholder, ref: props.inputRef, type: (_a = props.type) !== null && _a !== void 0 ? _a : 'text', value: (_b = props.value) !== null && _b !== void 0 ? _b : '' })); | ||
}), disabled: props.disabled, id: props.id, name: props.name, onChange: function (event) { return props.onChange(event.target.value); }, placeholder: props.placeholder, readOnly: props.readOnly, ref: props.inputRef, type: (_a = props.type) !== null && _a !== void 0 ? _a : 'text', value: (_b = props.value) !== null && _b !== void 0 ? _b : '' })); | ||
} | ||
exports.default = uniforms_1.connectField(Text, { kind: 'leaf' }); |
@@ -1,7 +0,41 @@ | ||
import { ComponentType } from 'react'; | ||
import { Override, connectField } from 'uniforms'; | ||
export declare type AutoFieldProps = Override<Record<string, unknown>, { | ||
component?: ComponentType<any> | ReturnType<typeof connectField>; | ||
name: string; | ||
}>; | ||
export default function AutoField(originalProps: AutoFieldProps): import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, string | any | (new (props: any) => import("react").Component<any, any, any>)> | null) | (new (props: any) => import("react").Component<any, any, any>)>; | ||
/// <reference types="react" /> | ||
export declare type AutoFieldProps = Parameters<typeof AutoField>[0]; | ||
declare const AutoField: { | ||
(rawProps: import("uniforms").Override<Record<string, unknown>, { | ||
component?: import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | (import("react").FunctionComponent<import("uniforms").Override<Partial<import("uniforms").GuaranteedProps<any>>, import("uniforms").Override<Partial<import("uniforms").GuaranteedProps<unknown>>, { | ||
label?: import("react").ReactNode; | ||
name: string; | ||
placeholder?: string | boolean | null | undefined; | ||
}>>> & { | ||
Component: import("react").ComponentType<Partial<import("uniforms").GuaranteedProps<any>>>; | ||
options: { | ||
initialValue?: boolean | undefined; | ||
kind?: "leaf" | "node" | undefined; | ||
} | undefined; | ||
}) | undefined; | ||
name: string; | ||
}>): import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>; | ||
componentDetectorContext: import("react").Context<(props: import("uniforms").GuaranteedProps<unknown> & Record<string, any>, uniforms: import("uniforms").Context<unknown>) => import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | (import("react").FunctionComponent<import("uniforms").Override<Partial<import("uniforms").GuaranteedProps<any>>, import("uniforms").Override<Partial<import("uniforms").GuaranteedProps<unknown>>, { | ||
label?: import("react").ReactNode; | ||
name: string; | ||
placeholder?: string | boolean | null | undefined; | ||
}>>> & { | ||
Component: import("react").ComponentType<Partial<import("uniforms").GuaranteedProps<any>>>; | ||
options: { | ||
initialValue?: boolean | undefined; | ||
kind?: "leaf" | "node" | undefined; | ||
} | undefined; | ||
})>; | ||
defaultComponentDetector: (props: import("uniforms").GuaranteedProps<unknown> & Record<string, any>, uniforms: import("uniforms").Context<unknown>) => import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | (import("react").FunctionComponent<import("uniforms").Override<Partial<import("uniforms").GuaranteedProps<any>>, import("uniforms").Override<Partial<import("uniforms").GuaranteedProps<unknown>>, { | ||
label?: import("react").ReactNode; | ||
name: string; | ||
placeholder?: string | boolean | null | undefined; | ||
}>>> & { | ||
Component: import("react").ComponentType<Partial<import("uniforms").GuaranteedProps<any>>>; | ||
options: { | ||
initialValue?: boolean | undefined; | ||
kind?: "leaf" | "node" | undefined; | ||
} | undefined; | ||
}); | ||
}; | ||
export default AutoField; |
import invariant from 'invariant'; | ||
import { createElement } from 'react'; | ||
import { useField } from 'uniforms'; | ||
import { createAutoField } from 'uniforms'; | ||
import BoolField from './BoolField'; | ||
@@ -12,43 +11,24 @@ import DateField from './DateField'; | ||
import TextField from './TextField'; | ||
export default function AutoField(originalProps) { | ||
var _a; | ||
const props = useField(originalProps.name, originalProps)[0]; | ||
const { allowedValues, checkboxes, fieldType } = props; | ||
let { component } = props; | ||
if (component === undefined) { | ||
if (allowedValues) { | ||
if (checkboxes && fieldType !== Array) { | ||
component = RadioField; | ||
} | ||
else { | ||
component = SelectField; | ||
} | ||
} | ||
else { | ||
switch (fieldType) { | ||
case Array: | ||
component = ListField; | ||
break; | ||
case Boolean: | ||
component = BoolField; | ||
break; | ||
case Date: | ||
component = DateField; | ||
break; | ||
case Number: | ||
component = NumField; | ||
break; | ||
case Object: | ||
component = NestField; | ||
break; | ||
case String: | ||
component = TextField; | ||
break; | ||
} | ||
invariant(component, 'Unsupported field type: %s', fieldType); | ||
} | ||
const AutoField = createAutoField(props => { | ||
if (props.allowedValues) { | ||
return props.checkboxes && props.fieldType !== Array | ||
? RadioField | ||
: SelectField; | ||
} | ||
return 'options' in component && ((_a = component.options) === null || _a === void 0 ? void 0 : _a.kind) === 'leaf' | ||
? createElement(component.Component, props) | ||
: createElement(component, originalProps); | ||
} | ||
switch (props.fieldType) { | ||
case Array: | ||
return ListField; | ||
case Boolean: | ||
return BoolField; | ||
case Date: | ||
return DateField; | ||
case Number: | ||
return NumField; | ||
case Object: | ||
return NestField; | ||
case String: | ||
return TextField; | ||
} | ||
return invariant(false, 'Unsupported field type: %s', props.fieldType); | ||
}); | ||
export default AutoField; |
@@ -8,3 +8,3 @@ import { __rest } from "tslib"; | ||
var { onChange } = _a, props = __rest(_a, ["onChange"]); | ||
const { disabled, error, inline, inputClassName, inputRef, label, labelBefore, name, value, } = props; | ||
const { disabled, error, inline, inputClassName, inputRef, label, labelBefore, name, readOnly, value, } = props; | ||
return wrapField(Object.assign(Object.assign({}, props), { label: labelBefore, value: props.value }), React.createElement("div", { className: classnames(inputClassName, 'form-check', 'checkbox', { | ||
@@ -15,3 +15,7 @@ 'text-danger': error, | ||
React.createElement("label", { htmlFor: props.id, className: "form-check-label" }, | ||
React.createElement("input", { checked: value || false, className: "form-check-input", disabled: disabled, id: props.id, name: name, onChange: () => onChange(!value), ref: inputRef, type: "checkbox" }), | ||
React.createElement("input", { checked: value || false, className: "form-check-input", disabled: disabled, id: props.id, name: name, onChange: () => { | ||
if (!readOnly) { | ||
onChange(!value); | ||
} | ||
}, ref: inputRef, type: "checkbox" }), | ||
"\u00A0", | ||
@@ -18,0 +22,0 @@ label))); |
@@ -10,3 +10,3 @@ import { __rest } from "tslib"; | ||
var _b; | ||
var { disabled, error, id, inputClassName, inputRef, max, min, name, onChange, placeholder, value } = _a, props = __rest(_a, ["disabled", "error", "id", "inputClassName", "inputRef", "max", "min", "name", "onChange", "placeholder", "value"]); | ||
var { disabled, error, id, inputClassName, inputRef, max, min, name, onChange, placeholder, readOnly, value } = _a, props = __rest(_a, ["disabled", "error", "id", "inputClassName", "inputRef", "max", "min", "name", "onChange", "placeholder", "readOnly", "value"]); | ||
return wrapField(Object.assign(Object.assign({}, props), { id }), React.createElement("input", { className: classnames(inputClassName, 'form-control', { | ||
@@ -22,4 +22,4 @@ 'is-invalid': error, | ||
} | ||
}, placeholder: placeholder, ref: inputRef, type: "datetime-local", value: (_b = dateFormat(value)) !== null && _b !== void 0 ? _b : '' })); | ||
}, placeholder: placeholder, readOnly: readOnly, ref: inputRef, type: "datetime-local", value: (_b = dateFormat(value)) !== null && _b !== void 0 ? _b : '' })); | ||
} | ||
export default connectField(Date, { kind: 'leaf' }); |
@@ -7,3 +7,3 @@ import React, { HTMLProps } from 'react'; | ||
}>; | ||
declare const _default: React.FunctionComponent<Override<Override<Pick<React.HTMLProps<HTMLDivElement>, "start" | "hidden" | "color" | "content" | "size" | "style" | "default" | "wrap" | "open" | "multiple" | "disabled" | "height" | "translate" | "width" | "prefix" | "src" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "children" | "ref" | "key" | "list" | "step" | "async" | "id" | "name" | "placeholder" | "value" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "target" | "type" | "useMap" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "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" | "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">, { | ||
declare const _default: React.FunctionComponent<Override<Override<Pick<React.HTMLProps<HTMLDivElement>, "start" | "hidden" | "color" | "content" | "size" | "style" | "default" | "wrap" | "open" | "multiple" | "disabled" | "height" | "translate" | "width" | "prefix" | "src" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "children" | "ref" | "key" | "list" | "step" | "async" | "id" | "name" | "placeholder" | "readOnly" | "value" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "target" | "type" | "useMap" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "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" | "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">, { | ||
error?: any; | ||
@@ -16,3 +16,3 @@ errorMessage?: string | undefined; | ||
}>>> & { | ||
Component: React.ComponentType<Override<Pick<React.HTMLProps<HTMLDivElement>, "start" | "hidden" | "color" | "content" | "size" | "style" | "default" | "wrap" | "open" | "multiple" | "disabled" | "height" | "translate" | "width" | "prefix" | "src" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "children" | "ref" | "key" | "list" | "step" | "async" | "id" | "name" | "placeholder" | "value" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "target" | "type" | "useMap" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "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" | "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">, { | ||
Component: React.ComponentType<Override<Pick<React.HTMLProps<HTMLDivElement>, "start" | "hidden" | "color" | "content" | "size" | "style" | "default" | "wrap" | "open" | "multiple" | "disabled" | "height" | "translate" | "width" | "prefix" | "src" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "children" | "ref" | "key" | "list" | "step" | "async" | "id" | "name" | "placeholder" | "readOnly" | "value" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "playsInline" | "poster" | "preload" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "target" | "type" | "useMap" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "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" | "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">, { | ||
error?: any; | ||
@@ -19,0 +19,0 @@ errorMessage?: string | undefined; |
@@ -13,3 +13,3 @@ import { __rest } from "tslib"; | ||
}); | ||
return props.noDOM ? null : (React.createElement("input", Object.assign({ disabled: props.disabled, name: props.name, ref: props.inputRef, type: "hidden", value: (_b = value !== null && value !== void 0 ? value : props.value) !== null && _b !== void 0 ? _b : '' }, filterDOMProps(props)))); | ||
return props.noDOM ? null : (React.createElement("input", Object.assign({ disabled: props.disabled, name: props.name, readOnly: props.readOnly, ref: props.inputRef, type: "hidden", value: (_b = value !== null && value !== void 0 ? value : props.value) !== null && _b !== void 0 ? _b : '' }, filterDOMProps(props)))); | ||
} |
@@ -7,3 +7,3 @@ import { __rest } from "tslib"; | ||
function ListAdd(_a) { | ||
var { name, addIcon, className, disabled, value } = _a, props = __rest(_a, ["name", "addIcon", "className", "disabled", "value"]); | ||
var { addIcon, className, disabled, name, readOnly, value } = _a, props = __rest(_a, ["addIcon", "className", "disabled", "name", "readOnly", "value"]); | ||
const nameParts = joinName(null, name); | ||
@@ -14,3 +14,3 @@ const parentName = joinName(nameParts.slice(0, -1)); | ||
return (React.createElement("div", Object.assign({}, filterDOMProps(props), { className: classnames('badge badge-pill float-right', className), onClick: () => { | ||
if (limitNotReached) { | ||
if (limitNotReached && !readOnly) { | ||
parent.onChange(parent.value.concat([cloneDeep(value)])); | ||
@@ -17,0 +17,0 @@ } |
@@ -6,3 +6,3 @@ import { __rest } from "tslib"; | ||
function ListDel(_a) { | ||
var { name, className, disabled, removeIcon } = _a, props = __rest(_a, ["name", "className", "disabled", "removeIcon"]); | ||
var { className, disabled, name, readOnly, removeIcon } = _a, props = __rest(_a, ["className", "disabled", "name", "readOnly", "removeIcon"]); | ||
const nameParts = joinName(null, name); | ||
@@ -14,3 +14,3 @@ const nameIndex = +nameParts[nameParts.length - 1]; | ||
return (React.createElement("span", Object.assign({}, filterDOMProps(props), { className: classnames('badge badge-pill', className), onClick: () => { | ||
if (limitNotReached) { | ||
if (limitNotReached && !readOnly) { | ||
const value = parent.value.slice(); | ||
@@ -17,0 +17,0 @@ value.splice(nameIndex, 1); |
@@ -9,4 +9,4 @@ import classnames from 'classnames'; | ||
'is-invalid': props.error, | ||
}), disabled: props.disabled, id: props.id, name: props.name, onChange: event => props.onChange(event.target.value), placeholder: props.placeholder, ref: props.inputRef, rows: props.rows, value: (_a = props.value) !== null && _a !== void 0 ? _a : '' })); | ||
}), disabled: props.disabled, id: props.id, name: props.name, onChange: event => props.onChange(event.target.value), placeholder: props.placeholder, readOnly: props.readOnly, ref: props.inputRef, rows: props.rows, value: (_a = props.value) !== null && _a !== void 0 ? _a : '' })); | ||
} | ||
export default connectField(LongText, { kind: 'leaf' }); |
@@ -13,4 +13,4 @@ import classnames from 'classnames'; | ||
props.onChange(isNaN(value) ? undefined : value); | ||
}, placeholder: props.placeholder, ref: props.inputRef, step: props.step || (props.decimal ? 0.01 : 1), type: "number", value: (_a = props.value) !== null && _a !== void 0 ? _a : '' })); | ||
}, placeholder: props.placeholder, readOnly: props.readOnly, ref: props.inputRef, step: props.step || (props.decimal ? 0.01 : 1), type: "number", value: (_a = props.value) !== null && _a !== void 0 ? _a : '' })); | ||
} | ||
export default connectField(Num, { kind: 'leaf' }); |
@@ -16,3 +16,7 @@ import classnames from 'classnames'; | ||
React.createElement("label", { htmlFor: `${props.id}-${escape(item)}`, className: "form-check-label" }, | ||
React.createElement("input", { checked: item === props.value, className: "form-check-input", disabled: props.disabled, id: `${props.id}-${escape(item)}`, name: props.name, onChange: () => props.onChange(item), type: "radio" }), | ||
React.createElement("input", { checked: item === props.value, className: "form-check-input", disabled: props.disabled, id: `${props.id}-${escape(item)}`, name: props.name, onChange: () => { | ||
if (!props.readOnly) { | ||
props.onChange(item); | ||
} | ||
}, type: "radio" }), | ||
' ', | ||
@@ -19,0 +23,0 @@ props.transform ? props.transform(item) : item))))); |
@@ -12,3 +12,4 @@ import { __rest } from "tslib"; | ||
function Select(_a) { | ||
var { allowedValues, checkboxes, disableItem, disabled, error, fieldType, id, inline, inputClassName, inputRef, label, name, onChange, placeholder, required, transform, value } = _a, props = __rest(_a, ["allowedValues", "checkboxes", "disableItem", "disabled", "error", "fieldType", "id", "inline", "inputClassName", "inputRef", "label", "name", "onChange", "placeholder", "required", "transform", "value"]); | ||
var { allowedValues, checkboxes, disableItem, disabled, error, fieldType, id, inline, inputClassName, inputRef, label, name, onChange, placeholder, readOnly, required, transform, value } = _a, props = __rest(_a, ["allowedValues", "checkboxes", "disableItem", "disabled", "error", "fieldType", "id", "inline", "inputClassName", "inputRef", "label", "name", "onChange", "placeholder", "readOnly", "required", "transform", "value"]); | ||
const multiple = fieldType === Array; | ||
return wrapField(Object.assign(Object.assign({}, props), { disabled, | ||
@@ -18,11 +19,26 @@ error, | ||
label, | ||
required }), checkboxes || fieldType === Array ? (allowedValues === null || allowedValues === void 0 ? void 0 : allowedValues.map(item => (React.createElement("div", { key: item, className: classnames(inputClassName, `checkbox${inline ? '-inline' : ''}`) }, | ||
required }), checkboxes ? (allowedValues === null || allowedValues === void 0 ? void 0 : allowedValues.map(item => (React.createElement("div", { key: item, className: classnames(inputClassName, `checkbox${inline ? '-inline' : ''}`) }, | ||
React.createElement("label", { htmlFor: `${id}-${escape(item)}` }, | ||
React.createElement("input", { checked: fieldType === Array ? value === null || value === void 0 ? void 0 : value.includes(item) : value === item, disabled: (disableItem === null || disableItem === void 0 ? void 0 : disableItem(item)) || disabled, id: `${id}-${escape(item)}`, name: name, onChange: () => onChange(fieldType === Array ? xor([item], value) : item), type: "checkbox" }), | ||
React.createElement("input", { checked: multiple ? value === null || value === void 0 ? void 0 : value.includes(item) : value === item, disabled: (disableItem === null || disableItem === void 0 ? void 0 : disableItem(item)) || disabled, id: `${id}-${escape(item)}`, name: name, onChange: () => { | ||
if (!readOnly) { | ||
onChange(multiple ? xor([item], value) : item); | ||
} | ||
}, type: "checkbox" }), | ||
transform ? transform(item) : item))))) : (React.createElement("select", { className: classnames(inputClassName, 'c-select form-control', { | ||
'is-invalid': error, | ||
}), disabled: disabled, id: id, name: name, onChange: event => onChange(event.target.value !== '' ? event.target.value : undefined), ref: inputRef, value: value !== null && value !== void 0 ? value : '' }, | ||
(!!placeholder || !required || value === undefined) && (React.createElement("option", { value: "", disabled: required, hidden: required }, placeholder || label)), allowedValues === null || allowedValues === void 0 ? void 0 : | ||
allowedValues.map(value => (React.createElement("option", { disabled: disableItem === null || disableItem === void 0 ? void 0 : disableItem(value), key: value, value: value }, transform ? transform(value) : value)))))); | ||
}), disabled: disabled, id: id, multiple: multiple, name: name, onChange: event => { | ||
if (!readOnly) { | ||
const item = event.target.value; | ||
if (multiple) { | ||
const clear = event.target.selectedIndex === -1; | ||
onChange(clear ? [] : xor([item], value)); | ||
} | ||
else { | ||
onChange(item !== '' ? item : undefined); | ||
} | ||
} | ||
}, ref: inputRef, value: value !== null && value !== void 0 ? value : '' }, | ||
(!!placeholder || !required || value === undefined) && !multiple && (React.createElement("option", { value: "", disabled: required, hidden: required }, placeholder || label)), allowedValues === null || allowedValues === void 0 ? void 0 : | ||
allowedValues.map(allowedValue => (React.createElement("option", { disabled: disableItem === null || disableItem === void 0 ? void 0 : disableItem(allowedValue), key: allowedValue, value: allowedValue }, transform ? transform(allowedValue) : allowedValue)))))); | ||
} | ||
export default connectField(Select, { kind: 'leaf' }); |
@@ -8,3 +8,3 @@ import { HTMLProps, Ref } from 'react'; | ||
}>; | ||
declare function SubmitField({ className, disabled, inputClassName, inputRef, value, wrapClassName, ...props }: SubmitFieldProps): JSX.Element; | ||
declare function SubmitField({ className, disabled, inputClassName, inputRef, readOnly, value, wrapClassName, ...props }: SubmitFieldProps): JSX.Element; | ||
declare namespace SubmitField { | ||
@@ -11,0 +11,0 @@ var defaultProps: { |
@@ -7,7 +7,7 @@ import { __rest } from "tslib"; | ||
function SubmitField(_a) { | ||
var { className, disabled, inputClassName, inputRef, value, wrapClassName } = _a, props = __rest(_a, ["className", "disabled", "inputClassName", "inputRef", "value", "wrapClassName"]); | ||
var { className, disabled, inputClassName, inputRef, readOnly, value, wrapClassName } = _a, props = __rest(_a, ["className", "disabled", "inputClassName", "inputRef", "readOnly", "value", "wrapClassName"]); | ||
const { error, state: anyState } = useForm(); | ||
const state = anyState; | ||
const hasWrap = !!(state.grid || wrapClassName); | ||
const blockInput = (React.createElement("input", Object.assign({ className: inputClassName, disabled: disabled === undefined ? !!(error || state.disabled) : disabled, ref: inputRef, type: "submit" }, (value ? { value } : {})))); | ||
const blockInput = (React.createElement("input", Object.assign({ className: inputClassName, disabled: disabled === undefined ? !!(error || state.disabled) : disabled, readOnly: readOnly, ref: inputRef, type: "submit" }, (value ? { value } : {})))); | ||
return (React.createElement("div", Object.assign({ className: classnames(className, { | ||
@@ -14,0 +14,0 @@ 'is-invalid': error, |
@@ -10,4 +10,4 @@ import classnames from 'classnames'; | ||
'is-invalid': props.error, | ||
}), disabled: props.disabled, id: props.id, name: props.name, onChange: event => props.onChange(event.target.value), placeholder: props.placeholder, ref: props.inputRef, type: (_a = props.type) !== null && _a !== void 0 ? _a : 'text', value: (_b = props.value) !== null && _b !== void 0 ? _b : '' })); | ||
}), disabled: props.disabled, id: props.id, name: props.name, onChange: event => props.onChange(event.target.value), placeholder: props.placeholder, readOnly: props.readOnly, ref: props.inputRef, type: (_a = props.type) !== null && _a !== void 0 ? _a : 'text', value: (_b = props.value) !== null && _b !== void 0 ? _b : '' })); | ||
} | ||
export default connectField(Text, { kind: 'leaf' }); |
{ | ||
"name": "uniforms-bootstrap4", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"license": "MIT", | ||
@@ -36,6 +36,6 @@ "main": "es5/index.js", | ||
"tslib": "^1.10.0", | ||
"uniforms": "^3.0.1", | ||
"uniforms": "^3.1.0", | ||
"warning": "^4.0.0" | ||
}, | ||
"gitHead": "26ecd38d3aecdd540a000e817c9108a777de8972" | ||
"gitHead": "ec5030886f0af285657583e58654b29ef280c153" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
169388
3282
Updateduniforms@^3.1.0