@mackin.com/styleguide 8.0.0-beta.21 → 8.0.0-beta.24
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 +22 -6
- package/index.js +50 -40
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -282,13 +282,20 @@ interface InfoTipProps {
|
|
|
282
282
|
onClose?: () => void;
|
|
283
283
|
/** Defaults to 'info'. */
|
|
284
284
|
variant?: 'info' | 'modal';
|
|
285
|
-
modalHeader?: string;
|
|
286
285
|
/** Defaults to nav color. */
|
|
287
286
|
bgColor?: string;
|
|
288
287
|
/** Defaults to nav font color. */
|
|
289
288
|
fontColor?: string;
|
|
289
|
+
/** For variant=modal only. */
|
|
290
|
+
modalHeader?: string;
|
|
291
|
+
/** For variant=modal only. */
|
|
290
292
|
modalId?: string;
|
|
291
|
-
|
|
293
|
+
/** For variant=modal only. */
|
|
294
|
+
__modalDebug?: boolean;
|
|
295
|
+
/** Whether to move the popover on collision with the parent's bounds. Default is false. For variant=info only. */
|
|
296
|
+
reposition?: boolean;
|
|
297
|
+
/** Order of positions as the Popover colides with the window edge. The default order is ['right', 'top', 'left', 'bottom']. For variant=info only. */
|
|
298
|
+
positions?: ("bottom" | "left" | "right" | "top")[] | undefined;
|
|
292
299
|
}
|
|
293
300
|
declare const InfoTip: (props: InfoTipProps) => JSX.Element;
|
|
294
301
|
|
|
@@ -686,7 +693,7 @@ interface PopoverProps {
|
|
|
686
693
|
border?: string;
|
|
687
694
|
/** Popover background. Defaults to theme.colors.bg. */
|
|
688
695
|
backgroundColor?: string;
|
|
689
|
-
/** Order of positions as the Popover colides with the window edge. */
|
|
696
|
+
/** Order of positions as the Popover colides with the window edge. The default order is ['right', 'top', 'left', 'bottom']. */
|
|
690
697
|
positions?: ("bottom" | "left" | "right" | "top")[] | undefined;
|
|
691
698
|
}
|
|
692
699
|
declare const Popover: (p: PopoverProps) => JSX.Element;
|
|
@@ -721,7 +728,14 @@ declare type Alignment = 'left' | 'right' | 'center';
|
|
|
721
728
|
|
|
722
729
|
declare const GlobalStyles: () => null;
|
|
723
730
|
|
|
724
|
-
declare const getCurrencyDisplay: (value: number, isCents?: boolean | undefined, denomination?: string) => string;
|
|
731
|
+
declare const getCurrencyDisplay: (value: number, isCents?: boolean | undefined, denomination?: string) => string;
|
|
732
|
+
/** Converts an enum to an array of entities with id and name. The enum can be an integer or string enum.*/
|
|
733
|
+
declare const enumToEntities: <T extends {
|
|
734
|
+
[key: string]: string | number;
|
|
735
|
+
}>(enumObj: T) => {
|
|
736
|
+
id: string | number;
|
|
737
|
+
name: string;
|
|
738
|
+
}[];
|
|
725
739
|
|
|
726
740
|
interface MackinTheme {
|
|
727
741
|
colors: {
|
|
@@ -945,9 +959,11 @@ interface TextAreaProps extends Omit<React.DetailedHTMLProps<React.TextareaHTMLA
|
|
|
945
959
|
value?: string;
|
|
946
960
|
/** By default all leading and trailing whitespace will be cleared on blur. */
|
|
947
961
|
noTrim?: boolean;
|
|
962
|
+
/** Will mark the input as invalid and show this as the validation failed message. */
|
|
963
|
+
customError?: string;
|
|
948
964
|
onValueChange: (value: string | undefined) => void;
|
|
949
965
|
}
|
|
950
|
-
declare const TextArea: React.ForwardRefExoticComponent<Pick<TextAreaProps, "value" | "key" | "autoComplete" | "autoFocus" | "cols" | "dirName" | "disabled" | "form" | "maxLength" | "minLength" | "name" | "placeholder" | "readOnly" | "required" | "rows" | "wrap" | "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" | "noTrim" | "onValueChange"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
966
|
+
declare const TextArea: React.ForwardRefExoticComponent<Pick<TextAreaProps, "value" | "key" | "autoComplete" | "autoFocus" | "cols" | "dirName" | "disabled" | "form" | "maxLength" | "minLength" | "name" | "placeholder" | "readOnly" | "required" | "rows" | "wrap" | "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" | "noTrim" | "customError" | "onValueChange"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
951
967
|
|
|
952
968
|
declare type ToggleButtonVariant = 'primary' | 'secondary' | 'omg' | 'primary2' | 'positive' | 'negative';
|
|
953
969
|
interface ToggleButtonProps {
|
|
@@ -1008,4 +1024,4 @@ declare const useWaiting: <TArgs extends any[], TReturn>(func: (...args: TArgs)
|
|
|
1008
1024
|
*/
|
|
1009
1025
|
declare const useBooleanChanged: (effect: (current: boolean, previous: boolean) => void, dep: boolean | undefined) => void;
|
|
1010
1026
|
|
|
1011
|
-
export { Accordian, AccordianProps, Alignment, Autocomplete, AutocompleteProps, AutocompleteValue, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DateInput, DateInputProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, FormProps, 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, PickerOption, PickerProps, PickerValue, 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, getFileSizeDisplay, useAccordianState, useBooleanChanged, useIgnoreMount, useMediaQuery, useScrollbarSize, useThemeSafely, useWaiting };
|
|
1027
|
+
export { Accordian, AccordianProps, Alignment, Autocomplete, AutocompleteProps, AutocompleteValue, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DateInput, DateInputProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, FormProps, 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, PickerOption, PickerProps, PickerValue, 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, enumToEntities, getCurrencyDisplay, getFileSizeDisplay, useAccordianState, useBooleanChanged, useIgnoreMount, useMediaQuery, useScrollbarSize, useThemeSafely, useWaiting };
|
package/index.js
CHANGED
|
@@ -1148,9 +1148,6 @@ const BackdropContextProvider = (p) => {
|
|
|
1148
1148
|
log('un-mounted');
|
|
1149
1149
|
};
|
|
1150
1150
|
}, []);
|
|
1151
|
-
React.useEffect(() => {
|
|
1152
|
-
log('re-rendered');
|
|
1153
|
-
});
|
|
1154
1151
|
useIgnoreMount(() => {
|
|
1155
1152
|
log('showCount changed', showCount);
|
|
1156
1153
|
}, [showCount]);
|
|
@@ -1202,9 +1199,6 @@ const BackdropOverlay = (p) => {
|
|
|
1202
1199
|
log('unmounted');
|
|
1203
1200
|
};
|
|
1204
1201
|
}, []);
|
|
1205
|
-
React.useEffect(() => {
|
|
1206
|
-
log('re-rendered');
|
|
1207
|
-
});
|
|
1208
1202
|
useIgnoreMount(() => {
|
|
1209
1203
|
log('context.showing changed', context.showing);
|
|
1210
1204
|
}, [context.showing]);
|
|
@@ -1455,7 +1449,6 @@ const useScrollbarSize = (recalc) => {
|
|
|
1455
1449
|
return size;
|
|
1456
1450
|
};
|
|
1457
1451
|
|
|
1458
|
-
let htmlBodyStyles;
|
|
1459
1452
|
const Modal = (p) => {
|
|
1460
1453
|
var _a, _b, _c, _d;
|
|
1461
1454
|
const backdrop = React.useContext(BackdropContext);
|
|
@@ -1464,42 +1457,50 @@ const Modal = (p) => {
|
|
|
1464
1457
|
const hasHeader = p.closeButton || p.heading;
|
|
1465
1458
|
const contentRef = React__default['default'].useRef(null);
|
|
1466
1459
|
const log = useLogger((_a = p.id) !== null && _a !== void 0 ? _a : 'Modal', (_b = p.__debug) !== null && _b !== void 0 ? _b : false);
|
|
1460
|
+
const showing = React.useRef(p.show);
|
|
1461
|
+
const bodyStyles = React.useRef('');
|
|
1467
1462
|
const tryRemoveBodyStyles = () => {
|
|
1468
|
-
if (
|
|
1469
|
-
log('
|
|
1470
|
-
document.body.classList.remove(
|
|
1463
|
+
if (bodyStyles.current) {
|
|
1464
|
+
log('removing singleton', bodyStyles.current);
|
|
1465
|
+
document.body.classList.remove(bodyStyles.current);
|
|
1471
1466
|
}
|
|
1472
1467
|
};
|
|
1473
1468
|
React.useEffect(() => {
|
|
1474
1469
|
log('mounted');
|
|
1475
1470
|
return () => {
|
|
1476
1471
|
var _a;
|
|
1477
|
-
|
|
1478
|
-
|
|
1472
|
+
if (showing.current) {
|
|
1473
|
+
log(`un-mount in progress and this modal is showing. decrement the backdrop and try to remove singleton body styles.`);
|
|
1479
1474
|
backdrop.setShow(false, (_a = p.id) !== null && _a !== void 0 ? _a : 'Modal');
|
|
1480
1475
|
log('backdrop.setShow', false);
|
|
1481
1476
|
tryRemoveBodyStyles();
|
|
1482
1477
|
}
|
|
1478
|
+
else {
|
|
1479
|
+
log(`un-mount in progress but this modal is not showing. do nothing with the backdrop.`);
|
|
1480
|
+
}
|
|
1483
1481
|
log('un-mounted');
|
|
1484
1482
|
};
|
|
1485
1483
|
}, []);
|
|
1486
1484
|
useBooleanChanged((show, previousShow) => {
|
|
1487
|
-
var _a;
|
|
1485
|
+
var _a, _b, _c;
|
|
1488
1486
|
log('show changed', `${previousShow !== null && previousShow !== void 0 ? previousShow : 'undefined'} > ${show}`);
|
|
1489
1487
|
backdrop.setShow(show, (_a = p.id) !== null && _a !== void 0 ? _a : 'Modal');
|
|
1488
|
+
showing.current = show;
|
|
1490
1489
|
log('backdrop.setShow', show);
|
|
1491
|
-
if (!
|
|
1492
|
-
|
|
1493
|
-
|
|
1490
|
+
if (!bodyStyles.current) {
|
|
1491
|
+
bodyStyles.current = css.css({
|
|
1492
|
+
label: 'ModalBodyOverrides_' + ((_c = (_b = p.id) === null || _b === void 0 ? void 0 : _b.replace(/\s+/, '')) !== null && _c !== void 0 ? _c : nanoid.nanoid()),
|
|
1494
1493
|
overflow: 'hidden',
|
|
1495
1494
|
paddingRight: `${useScrollbarSize()}px`
|
|
1496
1495
|
});
|
|
1496
|
+
log('creating singleton bodyStyles', bodyStyles.current);
|
|
1497
1497
|
}
|
|
1498
1498
|
if (show) {
|
|
1499
|
-
log('adding singleton
|
|
1500
|
-
document.body.classList.add(
|
|
1499
|
+
log('this modal is showing. adding singleton bodyStyles', bodyStyles.current);
|
|
1500
|
+
document.body.classList.add(bodyStyles.current);
|
|
1501
1501
|
}
|
|
1502
1502
|
else {
|
|
1503
|
+
log('this modal is hiding. try removing singleton bodyStyles');
|
|
1503
1504
|
tryRemoveBodyStyles();
|
|
1504
1505
|
}
|
|
1505
1506
|
}, p.show);
|
|
@@ -1966,18 +1967,8 @@ const getFileSizeDisplay = (size) => {
|
|
|
1966
1967
|
return value.toLocaleString(undefined, { minimumFractionDigits: 1, maximumFractionDigits: 1 }) + ` ${suffix}`;
|
|
1967
1968
|
};
|
|
1968
1969
|
|
|
1969
|
-
const getCurrencyDisplay = (value, isCents, denomination = '$') => {
|
|
1970
|
-
let actualValue = value || 0;
|
|
1971
|
-
if (isCents) {
|
|
1972
|
-
actualValue /= 100;
|
|
1973
|
-
}
|
|
1974
|
-
return `${denomination}${actualValue.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
1975
|
-
};
|
|
1976
|
-
const noop = () => {
|
|
1977
|
-
// lil' noop would be a great rap name. (thanks linter)
|
|
1978
|
-
};
|
|
1979
|
-
|
|
1980
1970
|
const Header = (props) => {
|
|
1971
|
+
var _a;
|
|
1981
1972
|
const theme = useThemeSafely();
|
|
1982
1973
|
const bodyStyles = css.css `
|
|
1983
1974
|
padding-top: calc(${theme.layout.headerHeight} + ${theme.layout.headerBodyOffset});
|
|
@@ -1989,7 +1980,9 @@ const Header = (props) => {
|
|
|
1989
1980
|
document.body.classList.remove(bodyStyles);
|
|
1990
1981
|
};
|
|
1991
1982
|
});
|
|
1992
|
-
const toggleMenu = props.toggleMenu
|
|
1983
|
+
const toggleMenu = (_a = props.toggleMenu) !== null && _a !== void 0 ? _a : (() => {
|
|
1984
|
+
/* noop */
|
|
1985
|
+
});
|
|
1993
1986
|
const headerStyles = css.css `
|
|
1994
1987
|
display: flex;
|
|
1995
1988
|
gap: ${theme.controls.gap};
|
|
@@ -2119,7 +2112,7 @@ const Popover = (p) => {
|
|
|
2119
2112
|
};
|
|
2120
2113
|
|
|
2121
2114
|
const InfoTip = (props) => {
|
|
2122
|
-
var _a, _b;
|
|
2115
|
+
var _a, _b, _c;
|
|
2123
2116
|
const [showTip, setShowTip] = React__namespace.useState(false);
|
|
2124
2117
|
const theme = useThemeSafely();
|
|
2125
2118
|
const bgColor = (_a = props.bgColor) !== null && _a !== void 0 ? _a : theme.colors.nav;
|
|
@@ -2181,13 +2174,13 @@ const InfoTip = (props) => {
|
|
|
2181
2174
|
if (props.variant === 'modal') {
|
|
2182
2175
|
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
2183
2176
|
button,
|
|
2184
|
-
React__namespace.createElement(Modal, { id: props.modalId, __debug: props.
|
|
2177
|
+
React__namespace.createElement(Modal, { id: props.modalId, __debug: props.__modalDebug, show: showTip, heading: props.modalHeader, onClick: closeTip, className: css.css({
|
|
2185
2178
|
whiteSpace: 'normal'
|
|
2186
2179
|
}), closeButton: true },
|
|
2187
2180
|
React__namespace.createElement("div", { className: css.css({ padding: '1rem' }) }, props.content))));
|
|
2188
2181
|
}
|
|
2189
2182
|
else {
|
|
2190
|
-
return (React__namespace.createElement(Popover, { reposition: false, isOpen: showTip, onClickOutside: closeTip, arrorColor: bgColor, border: '', backgroundColor: bgColor, parent: button, content: (React__namespace.createElement("div", { className: css.css({
|
|
2183
|
+
return (React__namespace.createElement(Popover, { positions: props.positions, reposition: (_c = props.reposition) !== null && _c !== void 0 ? _c : false, isOpen: showTip, onClickOutside: closeTip, arrorColor: bgColor, border: '', backgroundColor: bgColor, parent: button, content: (React__namespace.createElement("div", { className: css.css({
|
|
2191
2184
|
padding: '0.5rem',
|
|
2192
2185
|
fontSize: '0.75rem',
|
|
2193
2186
|
maxWidth: '22rem'
|
|
@@ -3709,6 +3702,28 @@ const GlobalStyles = () => {
|
|
|
3709
3702
|
return null;
|
|
3710
3703
|
};
|
|
3711
3704
|
|
|
3705
|
+
const getCurrencyDisplay = (value, isCents, denomination = '$') => {
|
|
3706
|
+
let actualValue = value || 0;
|
|
3707
|
+
if (isCents) {
|
|
3708
|
+
actualValue /= 100;
|
|
3709
|
+
}
|
|
3710
|
+
return `${denomination}${actualValue.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
3711
|
+
};
|
|
3712
|
+
/** Converts an enum to an array of entities with id and name. The enum can be an integer or string enum.*/
|
|
3713
|
+
const enumToEntities = (enumObj) => {
|
|
3714
|
+
const entities = [];
|
|
3715
|
+
for (const key in enumObj) {
|
|
3716
|
+
if (isNaN(parseInt(key, 10))) {
|
|
3717
|
+
entities.push({
|
|
3718
|
+
id: enumObj[key],
|
|
3719
|
+
name: key
|
|
3720
|
+
});
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
return entities;
|
|
3724
|
+
};
|
|
3725
|
+
//TB: FUTURE Expose in UI.
|
|
3726
|
+
|
|
3712
3727
|
const Slider = (p) => {
|
|
3713
3728
|
const theme = useThemeSafely();
|
|
3714
3729
|
const currentValue = React.useRef(p.value);
|
|
@@ -3991,11 +4006,8 @@ const defaultRows = 10;
|
|
|
3991
4006
|
const TextArea = React__namespace.forwardRef((props, ref) => {
|
|
3992
4007
|
var _a, _b;
|
|
3993
4008
|
const [localValue, setLocalValue] = React__namespace.useState(props.value);
|
|
3994
|
-
const [validationError, setValidationError] = React__namespace.useState('');
|
|
3995
|
-
const updateErrorMessage = React__namespace.useCallback(() => {
|
|
3996
|
-
setValidationError(getValidationMessage(inputRef.current));
|
|
3997
|
-
}, []);
|
|
3998
4009
|
const inputRef = (ref !== null && ref !== void 0 ? ref : React__namespace.useRef(null));
|
|
4010
|
+
const [validationError, updateErrorMessage] = useInputValidationMessage(inputRef, props);
|
|
3999
4011
|
const nativeProps = __rest(props, ["onValueChange"]);
|
|
4000
4012
|
const theme = useThemeSafely();
|
|
4001
4013
|
React__namespace.useEffect(() => {
|
|
@@ -4166,9 +4178,6 @@ const WaitingIndicator = (p) => {
|
|
|
4166
4178
|
log('unmounted');
|
|
4167
4179
|
};
|
|
4168
4180
|
}, []);
|
|
4169
|
-
React.useEffect(() => {
|
|
4170
|
-
log('re-rendered');
|
|
4171
|
-
});
|
|
4172
4181
|
}
|
|
4173
4182
|
React.useEffect(() => {
|
|
4174
4183
|
log('show changed', p.show);
|
|
@@ -4278,6 +4287,7 @@ exports.Tr = Tr;
|
|
|
4278
4287
|
exports.WaitingIndicator = WaitingIndicator;
|
|
4279
4288
|
exports.calcDynamicThemeProps = calcDynamicThemeProps;
|
|
4280
4289
|
exports.defaultTheme = defaultTheme;
|
|
4290
|
+
exports.enumToEntities = enumToEntities;
|
|
4281
4291
|
exports.getCurrencyDisplay = getCurrencyDisplay;
|
|
4282
4292
|
exports.getFileSizeDisplay = getFileSizeDisplay;
|
|
4283
4293
|
exports.useAccordianState = useAccordianState;
|