@mackin.com/styleguide 7.8.0 → 7.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +9 -24
- package/index.js +99 -42
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -59,15 +59,7 @@ declare const Backdrop: (p: {
|
|
|
59
59
|
}) => JSX.Element;
|
|
60
60
|
|
|
61
61
|
declare type ButtonVariant = 'label' | 'circle' | 'icon' | 'link' | 'inlineLink' | 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
|
|
62
|
-
interface ButtonProps {
|
|
63
|
-
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
64
|
-
onMouseLeave?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
65
|
-
onMouseEnter?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
66
|
-
onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;
|
|
67
|
-
onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;
|
|
68
|
-
type?: 'button' | 'submit';
|
|
69
|
-
children?: any;
|
|
70
|
-
style?: React.CSSProperties;
|
|
62
|
+
interface ButtonProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
71
63
|
variant?: ButtonVariant;
|
|
72
64
|
/** Defaults to 'center'. */
|
|
73
65
|
textAlign?: 'left' | 'center' | 'right';
|
|
@@ -76,21 +68,16 @@ interface ButtonProps {
|
|
|
76
68
|
round?: boolean;
|
|
77
69
|
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
78
70
|
rounded?: boolean;
|
|
79
|
-
className?: string;
|
|
80
71
|
rightIcon?: JSX.Element;
|
|
81
72
|
leftIcon?: JSX.Element;
|
|
82
73
|
/** full width with max space between the text and the icon */
|
|
83
74
|
iconBlock?: boolean;
|
|
84
75
|
small?: boolean;
|
|
85
|
-
disabled?: boolean;
|
|
86
76
|
/** The button will not respond to click or mouse events, but it will appear normal. */
|
|
87
77
|
readonly?: boolean;
|
|
88
78
|
waiting?: boolean;
|
|
89
79
|
/** The minimum button size will be set to the themes' formButtonMinWidth. */
|
|
90
80
|
enforceMinWidth?: boolean;
|
|
91
|
-
title?: string;
|
|
92
|
-
tabIndex?: number;
|
|
93
|
-
id?: string;
|
|
94
81
|
}
|
|
95
82
|
declare const Button: (props: ButtonProps) => JSX.Element;
|
|
96
83
|
|
|
@@ -415,20 +402,17 @@ interface LabelProps {
|
|
|
415
402
|
}
|
|
416
403
|
declare const Label: (props: LabelProps) => JSX.Element;
|
|
417
404
|
|
|
418
|
-
|
|
419
|
-
children?: any;
|
|
405
|
+
interface ListProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement> {
|
|
420
406
|
altRowColor?: boolean;
|
|
421
407
|
noLines?: boolean;
|
|
422
|
-
className?: string;
|
|
423
408
|
items?: (string | JSX.Element)[];
|
|
424
|
-
}
|
|
425
|
-
declare const
|
|
426
|
-
|
|
427
|
-
id?: string | number;
|
|
409
|
+
}
|
|
410
|
+
declare const List: React.ForwardRefExoticComponent<Pick<ListProps, "altRowColor" | "noLines" | "items" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "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" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLUListElement>>;
|
|
411
|
+
interface ListItemProps extends React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> {
|
|
428
412
|
/** For variant 'full', the content will take up the entire space of the parent (no padding applied by this component). */
|
|
429
413
|
variant?: 'full';
|
|
430
|
-
|
|
431
|
-
|
|
414
|
+
}
|
|
415
|
+
declare const ListItem: (props: ListItemProps) => JSX.Element;
|
|
432
416
|
|
|
433
417
|
interface ModalProps {
|
|
434
418
|
show: boolean;
|
|
@@ -670,6 +654,7 @@ interface PickerProps<T extends PickerValue> extends SelectProps {
|
|
|
670
654
|
type?: 'select';
|
|
671
655
|
/** @deprecated Use theme.controls.borderRadius (global) or style the components individually. */
|
|
672
656
|
rounded?: boolean;
|
|
657
|
+
round?: boolean;
|
|
673
658
|
}
|
|
674
659
|
declare const Picker: <T extends PickerValue>(props: PickerProps<T>) => JSX.Element;
|
|
675
660
|
|
|
@@ -994,4 +979,4 @@ declare const WaitingIndicator: (p: {
|
|
|
994
979
|
debug?: boolean;
|
|
995
980
|
}) => JSX.Element;
|
|
996
981
|
|
|
997
|
-
export { Alignment, Autocomplete, AutocompleteProps, AutocompleteValue, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DateInput, DateInputProps, DatePicker, DatePickerProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, GlobalStyles, Header, Highlight, ICONS, Icon, Image, InfoPanel, InfoTip, InfoTipProps, Input, InputProps, ItemPager, Label, LabelProps, List, ListItem, MackinTheme, Modal, Nav, NumberInput, NumberInputProps, OmniLink, OmniLinkProps, PagedResult, Pager, PagerProps, Picker, PickerProps, Popover, ProgressBar, ProgressBarProps, SearchBox, SearchBoxProps, Slider, TabHeader, TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, Th, ThSort, ThemeProvider, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, getCurrencyDisplay, mergeClassNames, useMediaQuery, useThemeSafely };
|
|
982
|
+
export { Alignment, Autocomplete, AutocompleteProps, AutocompleteValue, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DateInput, DateInputProps, DatePicker, DatePickerProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, GlobalStyles, Header, Highlight, ICONS, Icon, Image, InfoPanel, InfoTip, InfoTipProps, Input, InputProps, ItemPager, Label, LabelProps, List, ListItem, ListItemProps, ListProps, MackinTheme, Modal, Nav, NumberInput, NumberInputProps, OmniLink, OmniLinkProps, PagedResult, Pager, PagerProps, Picker, PickerProps, Popover, ProgressBar, ProgressBarProps, SearchBox, SearchBoxProps, Slider, TabHeader, TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, Th, ThSort, ThemeProvider, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, getCurrencyDisplay, mergeClassNames, useMediaQuery, useThemeSafely };
|
package/index.js
CHANGED
|
@@ -271,6 +271,33 @@ const Backdrop$1 = (props) => {
|
|
|
271
271
|
}, ref: backdrop, className: css.cx('backdrop', styles, props.className) }, props.children));
|
|
272
272
|
};
|
|
273
273
|
|
|
274
|
+
/*! *****************************************************************************
|
|
275
|
+
Copyright (c) Microsoft Corporation.
|
|
276
|
+
|
|
277
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
278
|
+
purpose with or without fee is hereby granted.
|
|
279
|
+
|
|
280
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
281
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
282
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
283
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
284
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
285
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
286
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
287
|
+
***************************************************************************** */
|
|
288
|
+
|
|
289
|
+
function __rest(s, e) {
|
|
290
|
+
var t = {};
|
|
291
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
292
|
+
t[p] = s[p];
|
|
293
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
294
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
295
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
296
|
+
t[p[i]] = s[p[i]];
|
|
297
|
+
}
|
|
298
|
+
return t;
|
|
299
|
+
}
|
|
300
|
+
|
|
274
301
|
const ICONS = {
|
|
275
302
|
add: proSolidSvgIcons.faPlus,
|
|
276
303
|
delete: proSolidSvgIcons.faTrashAlt,
|
|
@@ -313,7 +340,8 @@ const Icon = (props) => {
|
|
|
313
340
|
};
|
|
314
341
|
|
|
315
342
|
const Button = (props) => {
|
|
316
|
-
var _a;
|
|
343
|
+
var _a, _b;
|
|
344
|
+
const nativeProps = __rest(props, ["variant", "textAlign", "block", "round", "rounded", "rightIcon", "leftIcon", "iconBlock", "small", "readonly", "waiting", "enforceMinWidth"]);
|
|
317
345
|
const theme = useThemeSafely();
|
|
318
346
|
const buttonStyles = css.css `
|
|
319
347
|
padding-left: ${theme.controls.padding};
|
|
@@ -482,7 +510,7 @@ const Button = (props) => {
|
|
|
482
510
|
`}
|
|
483
511
|
`;
|
|
484
512
|
const disabled = props.disabled || props.waiting;
|
|
485
|
-
return (React__namespace.createElement("button", {
|
|
513
|
+
return (React__namespace.createElement("button", Object.assign({}, nativeProps, { disabled: disabled, className: css.cx('button', styles, props.className), type: (_b = props.type) !== null && _b !== void 0 ? _b : 'button' }),
|
|
486
514
|
props.leftIcon && React__namespace.createElement("span", { className: css.css({ marginRight: '0.5rem' }) }, props.leftIcon),
|
|
487
515
|
props.waiting ? React__namespace.createElement(Icon, { id: "waiting", spin: true }) : props.children,
|
|
488
516
|
props.rightIcon && React__namespace.createElement("span", { className: css.css({ marginLeft: '0.5rem' }) }, props.rightIcon)));
|
|
@@ -686,9 +714,10 @@ const Input = React__namespace.forwardRef((props, ref) => {
|
|
|
686
714
|
props.rightControl && props.type !== 'textarea' && React__namespace.createElement("div", { className: rightControlStyles }, props.rightControl)));
|
|
687
715
|
});
|
|
688
716
|
|
|
689
|
-
const List = (props) => {
|
|
717
|
+
const List = React__namespace.forwardRef((props, ref) => {
|
|
690
718
|
const children = props.items ? props.items.map((item, i) => React__namespace.createElement(ListItem, { key: i }, item)) : props.children;
|
|
691
719
|
const theme = useThemeSafely();
|
|
720
|
+
const listProps = __rest(props, ["altRowColor", "noLines", "items"]);
|
|
692
721
|
const listStyles = css.css `
|
|
693
722
|
margin: 0;
|
|
694
723
|
padding: 0;
|
|
@@ -704,9 +733,10 @@ const List = (props) => {
|
|
|
704
733
|
}
|
|
705
734
|
`}
|
|
706
735
|
`;
|
|
707
|
-
return (React__namespace.createElement("ul", { className: css.cx('list', listStyles, props.className) }, children));
|
|
708
|
-
};
|
|
736
|
+
return (React__namespace.createElement("ul", Object.assign({}, listProps, { ref: ref, className: css.cx('list', listStyles, props.className) }), children));
|
|
737
|
+
});
|
|
709
738
|
const ListItem = (props) => {
|
|
739
|
+
const liProps = __rest(props, ["variant"]);
|
|
710
740
|
const theme = useThemeSafely();
|
|
711
741
|
const itemStyles = css.css `
|
|
712
742
|
border-bottom: ${theme.controls.border};
|
|
@@ -738,7 +768,7 @@ const ListItem = (props) => {
|
|
|
738
768
|
}
|
|
739
769
|
`}
|
|
740
770
|
`;
|
|
741
|
-
return (React__namespace.createElement("li", { className: css.cx('listItem', itemStyles, props.className) },
|
|
771
|
+
return (React__namespace.createElement("li", Object.assign({}, liProps, { className: css.cx('listItem', itemStyles, props.className) }),
|
|
742
772
|
React__namespace.createElement("div", { className: css.css(contentStyle) }, props.children)));
|
|
743
773
|
};
|
|
744
774
|
|
|
@@ -849,6 +879,7 @@ const getAutocompleteValueId = (v) => {
|
|
|
849
879
|
const Autocomplete = (p) => {
|
|
850
880
|
const element = React__namespace.useRef(null);
|
|
851
881
|
const input = React__namespace.useRef(null);
|
|
882
|
+
const list = React__namespace.useRef(null);
|
|
852
883
|
const [values, setValues] = React__namespace.useState([]);
|
|
853
884
|
const showValues = React__namespace.useMemo(() => values.length > 0, [values]);
|
|
854
885
|
const shownValues = React__namespace.useMemo(() => {
|
|
@@ -861,22 +892,26 @@ const Autocomplete = (p) => {
|
|
|
861
892
|
position: relative;
|
|
862
893
|
width: 100%;
|
|
863
894
|
`;
|
|
895
|
+
let listBorderRadius = '';
|
|
896
|
+
if (p.round || p.rounded || theme.controls.borderRadius) {
|
|
897
|
+
listBorderRadius = theme.controls.borderRadius || '0.5rem';
|
|
898
|
+
}
|
|
864
899
|
const listClass = css.css({
|
|
865
900
|
position: 'absolute',
|
|
866
901
|
width: '100%',
|
|
867
902
|
border: theme.controls.border,
|
|
868
|
-
borderRadius:
|
|
903
|
+
borderRadius: listBorderRadius,
|
|
869
904
|
boxShadow: theme.controls.boxShadow,
|
|
870
905
|
backgroundColor: theme.colors.bg,
|
|
871
906
|
marginTop: `-4px !important`,
|
|
872
907
|
zIndex: theme.zIndexes.backdrop,
|
|
873
908
|
'li:first-child button': {
|
|
874
|
-
borderTopRightRadius:
|
|
875
|
-
borderTopLeftRadius:
|
|
909
|
+
borderTopRightRadius: listBorderRadius,
|
|
910
|
+
borderTopLeftRadius: listBorderRadius,
|
|
876
911
|
},
|
|
877
912
|
'li:last-child button': {
|
|
878
|
-
borderBottomRightRadius:
|
|
879
|
-
borderBottomLeftRadius:
|
|
913
|
+
borderBottomRightRadius: listBorderRadius,
|
|
914
|
+
borderBottomLeftRadius: listBorderRadius,
|
|
880
915
|
}
|
|
881
916
|
});
|
|
882
917
|
const inputClass = css.css `
|
|
@@ -888,6 +923,26 @@ const Autocomplete = (p) => {
|
|
|
888
923
|
const buttonStyles = css.css({
|
|
889
924
|
borderRadius: 0,
|
|
890
925
|
});
|
|
926
|
+
const buttonMarkerClass = 'ListItem__button';
|
|
927
|
+
const getNextTabElement = (fromIndex, direction) => {
|
|
928
|
+
var _a, _b, _c;
|
|
929
|
+
if (fromIndex === -1) {
|
|
930
|
+
let buttonIndex = 0;
|
|
931
|
+
if (direction === -1) {
|
|
932
|
+
buttonIndex = shownValues.length - 1;
|
|
933
|
+
}
|
|
934
|
+
return (_a = list.current) === null || _a === void 0 ? void 0 : _a.querySelector(`.${buttonMarkerClass}${buttonIndex}`);
|
|
935
|
+
}
|
|
936
|
+
else {
|
|
937
|
+
const nextIndex = fromIndex + direction;
|
|
938
|
+
if (nextIndex >= shownValues.length || nextIndex < 0) {
|
|
939
|
+
return (_b = input.current) !== null && _b !== void 0 ? _b : undefined;
|
|
940
|
+
}
|
|
941
|
+
else {
|
|
942
|
+
return (_c = list.current) === null || _c === void 0 ? void 0 : _c.querySelector(`.${buttonMarkerClass}${nextIndex}`);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
};
|
|
891
946
|
return (React__namespace.createElement("div", { ref: element, className: css.cx(baseClass, 'autocomplete') },
|
|
892
947
|
React__namespace.createElement(Backdrop$1, { onClick: () => setValues([]), show: showValues, allowScroll: true, transparent: true }),
|
|
893
948
|
React__namespace.createElement(TabLocker, { disabled: !showValues, style: { position: 'relative' } },
|
|
@@ -905,11 +960,37 @@ const Autocomplete = (p) => {
|
|
|
905
960
|
else {
|
|
906
961
|
setValues([]);
|
|
907
962
|
}
|
|
963
|
+
}, onKeyDown: e => {
|
|
964
|
+
var _a, _b;
|
|
965
|
+
if (showValues) {
|
|
966
|
+
if (e.key === 'ArrowDown') {
|
|
967
|
+
e.preventDefault();
|
|
968
|
+
e.stopPropagation();
|
|
969
|
+
(_a = getNextTabElement(-1, 1)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
970
|
+
}
|
|
971
|
+
else if (e.key === 'ArrowUp') {
|
|
972
|
+
e.preventDefault();
|
|
973
|
+
e.stopPropagation();
|
|
974
|
+
(_b = getNextTabElement(-1, -1)) === null || _b === void 0 ? void 0 : _b.focus();
|
|
975
|
+
}
|
|
976
|
+
}
|
|
908
977
|
}, onKeyPress: e => { var _a; return (_a = p.onKeyPress) === null || _a === void 0 ? void 0 : _a.call(p, e); } }),
|
|
909
|
-
showValues && (React__namespace.createElement(List, { className: listClass },
|
|
910
|
-
shownValues.map(value => {
|
|
978
|
+
showValues && (React__namespace.createElement(List, { ref: list, className: listClass },
|
|
979
|
+
shownValues.map((value, listItemIndex) => {
|
|
911
980
|
return (React__namespace.createElement(ListItem, { key: getAutocompleteValueId(value), variant: "full" },
|
|
912
|
-
React__namespace.createElement(Button, {
|
|
981
|
+
React__namespace.createElement(Button, { onKeyDown: e => {
|
|
982
|
+
var _a, _b;
|
|
983
|
+
if (e.key === 'ArrowDown') {
|
|
984
|
+
e.stopPropagation();
|
|
985
|
+
e.preventDefault();
|
|
986
|
+
(_a = getNextTabElement(listItemIndex, 1)) === null || _a === void 0 ? void 0 : _a.focus();
|
|
987
|
+
}
|
|
988
|
+
else if (e.key === 'ArrowUp') {
|
|
989
|
+
e.stopPropagation();
|
|
990
|
+
e.preventDefault();
|
|
991
|
+
(_b = getNextTabElement(listItemIndex, -1)) === null || _b === void 0 ? void 0 : _b.focus();
|
|
992
|
+
}
|
|
993
|
+
}, className: css.cx(buttonMarkerClass + listItemIndex, buttonStyles), onClick: () => {
|
|
913
994
|
p.onPick(value);
|
|
914
995
|
setValues([]);
|
|
915
996
|
setTimeout(() => {
|
|
@@ -1138,33 +1219,6 @@ const Calendar = (p) => {
|
|
|
1138
1219
|
cells)));
|
|
1139
1220
|
};
|
|
1140
1221
|
|
|
1141
|
-
/*! *****************************************************************************
|
|
1142
|
-
Copyright (c) Microsoft Corporation.
|
|
1143
|
-
|
|
1144
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
1145
|
-
purpose with or without fee is hereby granted.
|
|
1146
|
-
|
|
1147
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1148
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1149
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1150
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1151
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1152
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1153
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
1154
|
-
***************************************************************************** */
|
|
1155
|
-
|
|
1156
|
-
function __rest(s, e) {
|
|
1157
|
-
var t = {};
|
|
1158
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1159
|
-
t[p] = s[p];
|
|
1160
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1161
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1162
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1163
|
-
t[p[i]] = s[p[i]];
|
|
1164
|
-
}
|
|
1165
|
-
return t;
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
1222
|
const Checkbox = (props) => {
|
|
1169
1223
|
const inputProps = __rest(props, ["checked", "onChange", "label", "checkedIcon", "uncheckedIcon", "checkedThemeColor", "checkedColor", "readonly"]);
|
|
1170
1224
|
const selected = props.checkedIcon || 'selected';
|
|
@@ -2678,7 +2732,7 @@ const OmniLink = (props) => {
|
|
|
2678
2732
|
const Picker = (props) => {
|
|
2679
2733
|
const selectProps = __rest(props
|
|
2680
2734
|
// if we put numbers in, we expect them out
|
|
2681
|
-
, ["value", "options", "onChange", "type", "rounded", "readonly"]);
|
|
2735
|
+
, ["value", "options", "onChange", "type", "rounded", "round", "readonly"]);
|
|
2682
2736
|
// if we put numbers in, we expect them out
|
|
2683
2737
|
let isNumber = false;
|
|
2684
2738
|
if (props.options && props.options.length) {
|
|
@@ -2714,6 +2768,9 @@ const Picker = (props) => {
|
|
|
2714
2768
|
${props.rounded && `
|
|
2715
2769
|
border-radius: ${theme.controls.roundedRadius};
|
|
2716
2770
|
`}
|
|
2771
|
+
${props.round && `
|
|
2772
|
+
border-radius: ${theme.controls.roundRadius};
|
|
2773
|
+
`}
|
|
2717
2774
|
${props.readonly && `
|
|
2718
2775
|
background-color: transparent !important;
|
|
2719
2776
|
border: none;
|