@mackin.com/styleguide 8.11.0 → 9.0.0-beta.1
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/index.d.ts +21 -20
- package/index.js +43 -23
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -209,8 +209,8 @@ interface FileUploaderProps {
|
|
|
209
209
|
declare const FileUploader: (p: FileUploaderProps) => JSX.Element;
|
|
210
210
|
declare const getFileSizeDisplay: (size: number) => string;
|
|
211
211
|
|
|
212
|
-
declare type BaseProps$
|
|
213
|
-
interface FormProps extends BaseProps$
|
|
212
|
+
declare type BaseProps$4 = React.ClassAttributes<HTMLFormElement> & React.FormHTMLAttributes<HTMLFormElement>;
|
|
213
|
+
interface FormProps extends BaseProps$4 {
|
|
214
214
|
inline?: boolean;
|
|
215
215
|
/** If true, preventDefault and stopPropagation will be applied prior to onSubmit being called. Defaults to true. */
|
|
216
216
|
ajax?: boolean;
|
|
@@ -326,8 +326,8 @@ interface ValidationMessageProps {
|
|
|
326
326
|
patternErrorMessage?: string;
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
declare type BaseProps$
|
|
330
|
-
interface DateInputProps extends BaseProps$
|
|
329
|
+
declare type BaseProps$3 = Omit<BaseInputProps, 'type' | 'value' | 'min' | 'max' | 'step' | 'pattern' | 'maxLength' | 'rightControl' | 'ref'> & Omit<ValidationMessageProps, 'pattern'>;
|
|
330
|
+
interface DateInputProps extends BaseProps$3 {
|
|
331
331
|
/** The epoch timestamp. Equivalent to Date.valueOf(). */
|
|
332
332
|
value?: number;
|
|
333
333
|
/** The min epoch timestamp. */
|
|
@@ -384,8 +384,8 @@ interface InputProps {
|
|
|
384
384
|
/** @deprecated Use DateInput, NumberInput, or TextInput instead. */
|
|
385
385
|
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<any>>;
|
|
386
386
|
|
|
387
|
-
declare type BaseProps$
|
|
388
|
-
interface NumberInputProps extends BaseProps$
|
|
387
|
+
declare type BaseProps$2 = Omit<BaseInputProps, 'type' | 'value' | 'min' | 'max' | 'step' | 'maxLength' | 'error' | 'pattern'> & Omit<ValidationMessageProps, 'pattern'>;
|
|
388
|
+
interface NumberInputProps extends BaseProps$2 {
|
|
389
389
|
value?: number;
|
|
390
390
|
min?: number;
|
|
391
391
|
max?: number;
|
|
@@ -397,8 +397,8 @@ interface NumberInputProps extends BaseProps$1 {
|
|
|
397
397
|
}
|
|
398
398
|
declare const NumberInput: React.ForwardRefExoticComponent<Pick<NumberInputProps, "value" | "min" | "max" | "step" | "rightControl" | "round" | "wrapperClassName" | "showErrorDisplay" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "enterKeyHint" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "list" | "minLength" | "multiple" | "name" | "placeholder" | "readOnly" | "required" | "size" | "src" | "width" | "onChange" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "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" | "children" | "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" | "customError" | "patternErrorMessage" | "onValueChange"> & React.RefAttributes<HTMLInputElement>>;
|
|
399
399
|
|
|
400
|
-
declare type BaseProps = Omit<BaseInputProps, 'type' | 'value' | 'max' | 'min' | 'step' | 'error'> & ValidationMessageProps;
|
|
401
|
-
interface TextInputProps extends BaseProps {
|
|
400
|
+
declare type BaseProps$1 = Omit<BaseInputProps, 'type' | 'value' | 'max' | 'min' | 'step' | 'error'> & ValidationMessageProps;
|
|
401
|
+
interface TextInputProps extends BaseProps$1 {
|
|
402
402
|
value?: string;
|
|
403
403
|
/** Defaults to 'text'. */
|
|
404
404
|
type?: 'text' | 'email' | 'url' | 'password';
|
|
@@ -717,25 +717,23 @@ declare const ProgressBar: (props: {
|
|
|
717
717
|
className?: string;
|
|
718
718
|
}) => JSX.Element;
|
|
719
719
|
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
placeholder?: string;
|
|
725
|
-
round?: boolean;
|
|
726
|
-
/** Defaults to 250ms */
|
|
727
|
-
debounceMs?: number;
|
|
728
|
-
autoFocus?: boolean;
|
|
729
|
-
/** This will be applied to the containing element (Form). */
|
|
730
|
-
className?: string;
|
|
720
|
+
declare type BaseProps = Omit<TextInputProps, 'rightControl' | 'wrapperClassName' | 'type' | 'className'>;
|
|
721
|
+
interface SearchBoxProps extends BaseProps {
|
|
722
|
+
/** This will be applied to the containing element (Form or DIV when 'noForm'=true). */
|
|
723
|
+
wrapperClassName?: string;
|
|
731
724
|
buttonClassName?: string;
|
|
725
|
+
inputWrapperClassName?: string;
|
|
732
726
|
inputClassName?: string;
|
|
733
727
|
/** This will be ignored if 'noForm' is true. */
|
|
734
728
|
onSubmit?: () => Promise<void>;
|
|
735
729
|
/** If true, the controls will not be wrapped in a Form component. In addition, 'onSubmit' will be ignored. */
|
|
736
730
|
noForm?: boolean;
|
|
731
|
+
/** If true, the onSubmit handler will not be called when the input value is nullish or empty string. Defaults to 'true'. */
|
|
732
|
+
noSubmitWhenEmpty?: boolean;
|
|
733
|
+
/** The submit button will change to clear if present and there is a value. */
|
|
734
|
+
onClear?: () => void;
|
|
737
735
|
}
|
|
738
|
-
declare const SearchBox:
|
|
736
|
+
declare const SearchBox: React.ForwardRefExoticComponent<Pick<SearchBoxProps, "wrapperClassName" | "value" | "round" | "showErrorDisplay" | "key" | "accept" | "alt" | "autoComplete" | "autoFocus" | "capture" | "checked" | "crossOrigin" | "disabled" | "enterKeyHint" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "height" | "list" | "maxLength" | "minLength" | "multiple" | "name" | "pattern" | "placeholder" | "readOnly" | "required" | "size" | "src" | "width" | "onChange" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "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" | "children" | "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" | "trim" | "emptyString" | "onValueChange" | "customError" | "patternErrorMessage" | "buttonClassName" | "inputWrapperClassName" | "inputClassName" | "noForm" | "noSubmitWhenEmpty" | "onClear"> & React.RefAttributes<HTMLInputElement>>;
|
|
739
737
|
|
|
740
738
|
declare type Alignment = 'left' | 'right' | 'center';
|
|
741
739
|
|
|
@@ -930,9 +928,12 @@ declare const Table: (props: {
|
|
|
930
928
|
caption?: string | JSX.Element;
|
|
931
929
|
children?: any;
|
|
932
930
|
noCellBorder?: boolean;
|
|
931
|
+
/** Styles applied to the table element. */
|
|
933
932
|
className?: string;
|
|
934
933
|
/** Colors alternate rows. */
|
|
935
934
|
altRows?: boolean;
|
|
935
|
+
/** Styles applied to the table wrapper scroll container. */
|
|
936
|
+
wrapperClassName?: string;
|
|
936
937
|
}) => JSX.Element;
|
|
937
938
|
declare const Tr: (props: {
|
|
938
939
|
className?: string;
|
package/index.js
CHANGED
|
@@ -891,17 +891,17 @@ const TabLocker = (props) => {
|
|
|
891
891
|
const defaultMaxShownValues = 7;
|
|
892
892
|
const buttonMarkerClass = 'ListItem__button';
|
|
893
893
|
const Autocomplete = (p) => {
|
|
894
|
-
var _a;
|
|
894
|
+
var _a, _b;
|
|
895
895
|
const theme = useThemeSafely();
|
|
896
896
|
const element = React__namespace.useRef(null);
|
|
897
897
|
const input = React__namespace.useRef(null);
|
|
898
898
|
const list = React__namespace.useRef(null);
|
|
899
899
|
const [values, setValues] = React__namespace.useState([]);
|
|
900
900
|
const showValues = React__namespace.useMemo(() => values.length > 0, [values]);
|
|
901
|
+
const maxShowValues = (_a = p.maxShownValues) !== null && _a !== void 0 ? _a : defaultMaxShownValues;
|
|
901
902
|
const shownValues = React__namespace.useMemo(() => {
|
|
902
|
-
var _a;
|
|
903
903
|
if (!p.allowScroll) {
|
|
904
|
-
return values.slice(0,
|
|
904
|
+
return values.slice(0, maxShowValues);
|
|
905
905
|
}
|
|
906
906
|
return values.slice();
|
|
907
907
|
}, [values]);
|
|
@@ -917,7 +917,7 @@ const Autocomplete = (p) => {
|
|
|
917
917
|
else {
|
|
918
918
|
setValues([]);
|
|
919
919
|
}
|
|
920
|
-
}, (
|
|
920
|
+
}, (_b = p.getOptionsDebounceMs) !== null && _b !== void 0 ? _b : 0, { leading: false, trailing: true }));
|
|
921
921
|
const getNextTabElement = (fromIndex, direction) => {
|
|
922
922
|
var _a, _b, _c;
|
|
923
923
|
if (fromIndex === -1) {
|
|
@@ -1003,9 +1003,9 @@ const Autocomplete = (p) => {
|
|
|
1003
1003
|
borderBottomRightRadius: listBorderRadius,
|
|
1004
1004
|
borderBottomLeftRadius: listBorderRadius,
|
|
1005
1005
|
}
|
|
1006
|
-
}), p.allowScroll && css.css({
|
|
1006
|
+
}), p.allowScroll && shownValues.length > maxShowValues && css.css({
|
|
1007
1007
|
overflowY: 'scroll',
|
|
1008
|
-
maxHeight: `calc(${theme.controls.height} * ${
|
|
1008
|
+
maxHeight: `calc(${theme.controls.height} * ${maxShowValues})`
|
|
1009
1009
|
})) },
|
|
1010
1010
|
shownValues.map((value, listItemIndex) => {
|
|
1011
1011
|
return (React__namespace.createElement(ListItem, { key: getAutocompleteValueId(value), variant: "full" },
|
|
@@ -3833,31 +3833,49 @@ const useWaiting = (func) => {
|
|
|
3833
3833
|
return [waiting, wrappedFunc];
|
|
3834
3834
|
};
|
|
3835
3835
|
|
|
3836
|
-
const SearchBox = (props) => {
|
|
3837
|
-
const
|
|
3836
|
+
const SearchBox = React__namespace.forwardRef((props, ref) => {
|
|
3837
|
+
const { wrapperClassName, buttonClassName, inputWrapperClassName, inputClassName, onSubmit, noForm, noSubmitWhenEmpty: onSubmitWhenEmpty, onClear } = props, inputProps = __rest(props, ["wrapperClassName", "buttonClassName", "inputWrapperClassName", "inputClassName", "onSubmit", "noForm", "noSubmitWhenEmpty", "onClear"]);
|
|
3838
|
+
const [waiting, handleSubmit] = useWaiting(async () => {
|
|
3838
3839
|
var _a, _b, _c;
|
|
3840
|
+
if (noForm) {
|
|
3841
|
+
return;
|
|
3842
|
+
}
|
|
3843
|
+
if (!props.onSubmit) {
|
|
3844
|
+
return;
|
|
3845
|
+
}
|
|
3846
|
+
if (((_a = props.noSubmitWhenEmpty) !== null && _a !== void 0 ? _a : true) && !props.value) {
|
|
3847
|
+
return;
|
|
3848
|
+
}
|
|
3839
3849
|
// the active element will be the input. if the submit action changes props.value it will
|
|
3840
3850
|
// be ignored due to Inputs focused handling.
|
|
3841
3851
|
if (document.activeElement) {
|
|
3842
|
-
(
|
|
3852
|
+
(_c = (_b = document.activeElement).blur) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
3843
3853
|
}
|
|
3844
|
-
return
|
|
3854
|
+
return props.onSubmit();
|
|
3845
3855
|
});
|
|
3846
3856
|
const theme = useThemeSafely();
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3857
|
+
let button;
|
|
3858
|
+
const buttonStyles = css.cx(css.css({
|
|
3859
|
+
color: `${theme.colors.font} !important;`,
|
|
3860
|
+
fontSize: '1rem'
|
|
3861
|
+
}), props.buttonClassName);
|
|
3862
|
+
if (props.onClear && !!props.value) {
|
|
3863
|
+
button = (React__namespace.createElement(Button, { onClick: props.onClear, tabIndex: -1, disabled: waiting, className: buttonStyles, variant: "icon", small: true },
|
|
3864
|
+
React__namespace.createElement(Icon, { id: waiting ? 'waiting' : 'clear', spin: waiting })));
|
|
3865
|
+
}
|
|
3866
|
+
else {
|
|
3867
|
+
button = (React__namespace.createElement(Button, { tabIndex: -1, disabled: waiting, readOnly: !props.onSubmit, type: "submit", className: buttonStyles, variant: "icon", small: true },
|
|
3868
|
+
React__namespace.createElement(Icon, { id: waiting ? 'waiting' : 'search', spin: waiting })));
|
|
3869
|
+
}
|
|
3870
|
+
const input = (React__namespace.createElement(TextInput, Object.assign({}, inputProps, { ref: ref, wrapperClassName: props.inputWrapperClassName, className: props.inputClassName, rightControl: button })));
|
|
3871
|
+
const searchBoxWrapperStyles = css.cx(css.css({
|
|
3872
|
+
label: 'SearchBox'
|
|
3873
|
+
}), props.wrapperClassName);
|
|
3856
3874
|
if (!props.noForm) {
|
|
3857
|
-
return (React__namespace.createElement(Form, { role: "search", className:
|
|
3875
|
+
return (React__namespace.createElement(Form, { role: "search", className: searchBoxWrapperStyles, onSubmit: handleSubmit }, input));
|
|
3858
3876
|
}
|
|
3859
|
-
return (React__namespace.createElement("div", { className:
|
|
3860
|
-
};
|
|
3877
|
+
return (React__namespace.createElement("div", { className: searchBoxWrapperStyles }, input));
|
|
3878
|
+
});
|
|
3861
3879
|
|
|
3862
3880
|
const GlobalStyles = (p) => {
|
|
3863
3881
|
const theme = useThemeSafely();
|
|
@@ -4089,6 +4107,7 @@ const TabHeader = (p) => {
|
|
|
4089
4107
|
const Table = (props) => {
|
|
4090
4108
|
const theme = useThemeSafely();
|
|
4091
4109
|
const tableStyles = css.css `
|
|
4110
|
+
label: Table;
|
|
4092
4111
|
width: 100%;
|
|
4093
4112
|
border-collapse: collapse;
|
|
4094
4113
|
${props.noCellBorder && `
|
|
@@ -4104,11 +4123,12 @@ const Table = (props) => {
|
|
|
4104
4123
|
`}
|
|
4105
4124
|
`;
|
|
4106
4125
|
const wrapperStyles = css.css `
|
|
4126
|
+
label: TableScrollWrapper;
|
|
4107
4127
|
width:100%;
|
|
4108
4128
|
overflow-y: auto;
|
|
4109
4129
|
padding:0 1px; //fixes always showing of the table scroller
|
|
4110
4130
|
`;
|
|
4111
|
-
return (React__namespace.createElement("div", { className: wrapperStyles },
|
|
4131
|
+
return (React__namespace.createElement("div", { className: css.cx(wrapperStyles, props.wrapperClassName) },
|
|
4112
4132
|
React__namespace.createElement("table", { className: css.cx(tableStyles, props.className) },
|
|
4113
4133
|
props.caption && React__namespace.createElement("caption", { className: css.css({
|
|
4114
4134
|
fontWeight: 'bold',
|