@linzjs/step-ag-grid 2.1.3 → 2.2.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/dist/index.js +123 -20
- package/dist/index.js.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/lui/ActionButton.d.ts +15 -0
- package/dist/src/lui/reactUtils.d.ts +6 -0
- package/dist/src/lui/reactUtils.test.d.ts +1 -0
- package/dist/src/lui/stateDeferredHook.d.ts +4 -0
- package/dist/src/lui/timeoutHook.d.ts +8 -0
- package/dist/src/lui/timeoutHook.test.d.ts +1 -0
- package/dist/src/react-menu3/components/ControlledMenu.d.ts +2 -2
- package/dist/src/react-menu3/types.d.ts +4 -0
- package/dist/step-ag-grid.esm.js +116 -22
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +4 -3
- package/src/components/GridPopoverHook.tsx +1 -0
- package/src/index.ts +5 -0
- package/src/lui/ActionButton.scss +32 -0
- package/src/lui/ActionButton.tsx +76 -0
- package/src/lui/reactUtils.test.tsx +47 -0
- package/src/lui/reactUtils.tsx +14 -0
- package/src/lui/stateDeferredHook.tsx +29 -0
- package/src/lui/timeoutHook.test.tsx +38 -0
- package/src/lui/timeoutHook.tsx +40 -0
- package/src/react-menu3/components/ControlledMenu.tsx +7 -4
- package/src/react-menu3/types.ts +5 -0
- package/src/stories/components/ActionButton.stories.tsx +33 -0
- package/src/stories/{components → grid}/FormTest.scss +0 -0
- package/src/stories/{components → grid}/FormTest.tsx +0 -0
- package/src/stories/{components → grid}/GridPopoutBearing.stories.tsx +7 -10
- package/src/stories/{components → grid}/GridPopoutEditDropDown.stories.tsx +20 -23
- package/src/stories/{components → grid}/GridPopoutEditGeneric.stories.tsx +6 -9
- package/src/stories/{components → grid}/GridPopoutEditGenericTextArea.stories.tsx +57 -18
- package/src/stories/{components → grid}/GridPopoutEditMultiSelect.stories.tsx +6 -9
- package/src/stories/{components → grid}/GridReadOnly.stories.tsx +6 -8
- /package/src/stories/{components → react-menu}/ReactMenu.stories.tsx +0 -0
package/dist/src/index.d.ts
CHANGED
|
@@ -23,9 +23,13 @@ export { GridPopoverEditDropDown } from "./components/gridPopoverEdit/GridPopove
|
|
|
23
23
|
export { GridPopoverMessage } from "./components/gridPopoverEdit/GridPopoverMessage";
|
|
24
24
|
export { GridPopoverTextArea } from "./components/gridPopoverEdit/GridPopoverTextArea";
|
|
25
25
|
export { GridPopoverTextInput } from "./components/gridPopoverEdit/GridPopoverTextInput";
|
|
26
|
+
export * from "./components/gridForm/GridFormDropDown";
|
|
27
|
+
export * from "./components/gridForm/GridFormMultiSelect";
|
|
28
|
+
export * from "./components/gridForm/GridFormPopoutMenu";
|
|
26
29
|
export { GridHeaderSelect } from "./components/gridHeader/GridHeaderSelect";
|
|
27
30
|
export { TextAreaInput } from "./lui/TextAreaInput";
|
|
28
31
|
export { TextInputFormatted } from "./lui/TextInputFormatted";
|
|
29
32
|
export { GridSubComponentTextArea } from "./components/GridSubComponentTextArea";
|
|
33
|
+
export * from "./lui/ActionButton";
|
|
30
34
|
export * from "./utils/bearing";
|
|
31
35
|
export * from "./utils/util";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./ActionButton.scss";
|
|
3
|
+
import { IconName } from "@linzjs/lui/dist/components/LuiIcon/LuiIcon";
|
|
4
|
+
export interface ActionButtonProps {
|
|
5
|
+
icon: IconName;
|
|
6
|
+
name: string;
|
|
7
|
+
inProgressName?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
dataTestId?: string;
|
|
10
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "ns";
|
|
11
|
+
className?: string;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
inProgress?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const ActionButton: ({ icon, name, inProgressName, dataTestId, inProgress, className, title, onClick, size, }: ActionButtonProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cancels timeouts on scope being destroyed.
|
|
3
|
+
*
|
|
4
|
+
* This could almost be a debounce, but debounce tracks by function reference, this tracks by hook reference.
|
|
5
|
+
* This could have been implemented using debounce if the callers function was wrapped in useCallback,
|
|
6
|
+
* but there's no way to enforce that, so it would lead to bugs.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useTimeoutHook: () => (fn: () => void, waitTimeMs: number) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MutableRefObject, ForwardedRef } from "react";
|
|
2
2
|
import { ControlledMenuProps } from "../types";
|
|
3
|
-
export declare const ControlledMenuFr: ({ "aria-label": ariaLabel, className, containerProps, initialMounted, unmountOnClose, transition, transitionTimeout, boundingBoxRef, boundingBoxPadding, reposition, submenuOpenDelay, submenuCloseDelay, skipOpen, viewScroll, portal, theming, onItemClick, onClose, saveButtonRef, ...restProps }: ControlledMenuProps & {
|
|
3
|
+
export declare const ControlledMenuFr: ({ "aria-label": ariaLabel, className, containerProps, initialMounted, unmountOnClose, transition, transitionTimeout, boundingBoxRef, boundingBoxPadding, reposition, submenuOpenDelay, submenuCloseDelay, skipOpen, viewScroll, portal, theming, onItemClick, onClose, saveButtonRef, closeMenuExclusionClassName, ...restProps }: ControlledMenuProps & {
|
|
4
4
|
saveButtonRef?: MutableRefObject<HTMLButtonElement | null> | undefined;
|
|
5
5
|
}, externalRef: ForwardedRef<HTMLUListElement>) => JSX.Element | null;
|
|
6
6
|
export declare const ControlledMenu: import("react").ForwardRefExoticComponent<Pick<ControlledMenuProps & {
|
|
7
7
|
saveButtonRef?: MutableRefObject<HTMLButtonElement | null> | undefined;
|
|
8
|
-
}, "aria-label" | "className" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "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-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "containerProps" | "initialMounted" | "unmountOnClose" | "transition" | "transitionTimeout" | "boundingBoxRef" | "boundingBoxPadding" | "reposition" | "submenuOpenDelay" | "submenuCloseDelay" | "skipOpen" | "viewScroll" | "portal" | "theming" | "onItemClick" | "onClose" | "saveButtonRef" | "anchorPoint" | "anchorRef" | "captureFocus" | "state" | "menuItemFocus" | "endTransition" | "repositionFlag" | "dontShrinkIfDirectionIsTop" | "menuClassName" | "menuStyle" | "arrowClassName" | "arrowStyle" | "arrow" | "offsetX" | "offsetY" | "align" | "direction" | "position" | "overflow" | "setDownOverflow" | "isDisabled" | "ariaLabel" | "containerRef" | "externalRef" | "parentScrollingRef"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
8
|
+
}, "aria-label" | "className" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "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-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "containerProps" | "initialMounted" | "unmountOnClose" | "transition" | "transitionTimeout" | "boundingBoxRef" | "boundingBoxPadding" | "reposition" | "submenuOpenDelay" | "submenuCloseDelay" | "skipOpen" | "viewScroll" | "portal" | "theming" | "onItemClick" | "onClose" | "saveButtonRef" | "closeMenuExclusionClassName" | "anchorPoint" | "anchorRef" | "captureFocus" | "state" | "menuItemFocus" | "endTransition" | "repositionFlag" | "dontShrinkIfDirectionIsTop" | "menuClassName" | "menuStyle" | "arrowClassName" | "arrowStyle" | "arrow" | "offsetX" | "offsetY" | "align" | "direction" | "position" | "overflow" | "setDownOverflow" | "isDisabled" | "ariaLabel" | "containerRef" | "externalRef" | "parentScrollingRef"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
@@ -396,5 +396,9 @@ export interface ControlledMenuProps extends RootMenuProps, ExtraMenuProps {
|
|
|
396
396
|
* Event fired when menu is about to close.
|
|
397
397
|
*/
|
|
398
398
|
onClose?: EventHandler<MenuCloseEvent>;
|
|
399
|
+
/**
|
|
400
|
+
* When clicking outside the menu to close, anything with this class will not cause a close.
|
|
401
|
+
*/
|
|
402
|
+
closeMenuExclusionClassName?: string;
|
|
399
403
|
}
|
|
400
404
|
export {};
|
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import { unstable_batchedUpdates, flushSync, createPortal } from 'react-dom';
|
|
|
3
3
|
import { findIndex, isEmpty, castArray, remove, flatten, delay, sortBy, last, difference, xorBy, fromPairs } from 'lodash-es';
|
|
4
4
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
5
5
|
import { AgGridReact } from 'ag-grid-react';
|
|
6
|
-
import { LuiMiniSpinner, LuiIcon, LuiCheckboxInput } from '@linzjs/lui';
|
|
6
|
+
import { LuiMiniSpinner, LuiIcon, LuiCheckboxInput, LuiButton } from '@linzjs/lui';
|
|
7
7
|
|
|
8
8
|
// Generate className following BEM methodology: http://getbem.com/naming/
|
|
9
9
|
// Modifier value can be one of the following types: boolean, string, undefined
|
|
@@ -1276,7 +1276,7 @@ var EventHandlersContext = createContext({
|
|
|
1276
1276
|
});
|
|
1277
1277
|
|
|
1278
1278
|
var ControlledMenuFr = function (_a, externalRef) {
|
|
1279
|
-
var ariaLabel = _a["aria-label"], className = _a.className, containerProps = _a.containerProps, initialMounted = _a.initialMounted, unmountOnClose = _a.unmountOnClose, transition = _a.transition, transitionTimeout = _a.transitionTimeout, boundingBoxRef = _a.boundingBoxRef, boundingBoxPadding = _a.boundingBoxPadding, _b = _a.reposition, reposition = _b === void 0 ? "auto" : _b, _c = _a.submenuOpenDelay, submenuOpenDelay = _c === void 0 ? 300 : _c, _d = _a.submenuCloseDelay, submenuCloseDelay = _d === void 0 ? 150 : _d, skipOpen = _a.skipOpen, _e = _a.viewScroll, viewScroll = _e === void 0 ? "initial" : _e, portal = _a.portal, theming = _a.theming, onItemClick = _a.onItemClick, onClose = _a.onClose, saveButtonRef = _a.saveButtonRef, restProps = __rest(_a, ["aria-label", "className", "containerProps", "initialMounted", "unmountOnClose", "transition", "transitionTimeout", "boundingBoxRef", "boundingBoxPadding", "reposition", "submenuOpenDelay", "submenuCloseDelay", "skipOpen", "viewScroll", "portal", "theming", "onItemClick", "onClose", "saveButtonRef"]);
|
|
1279
|
+
var ariaLabel = _a["aria-label"], className = _a.className, containerProps = _a.containerProps, initialMounted = _a.initialMounted, unmountOnClose = _a.unmountOnClose, transition = _a.transition, transitionTimeout = _a.transitionTimeout, boundingBoxRef = _a.boundingBoxRef, boundingBoxPadding = _a.boundingBoxPadding, _b = _a.reposition, reposition = _b === void 0 ? "auto" : _b, _c = _a.submenuOpenDelay, submenuOpenDelay = _c === void 0 ? 300 : _c, _d = _a.submenuCloseDelay, submenuCloseDelay = _d === void 0 ? 150 : _d, skipOpen = _a.skipOpen, _e = _a.viewScroll, viewScroll = _e === void 0 ? "initial" : _e, portal = _a.portal, theming = _a.theming, onItemClick = _a.onItemClick, onClose = _a.onClose, saveButtonRef = _a.saveButtonRef, closeMenuExclusionClassName = _a.closeMenuExclusionClassName, restProps = __rest(_a, ["aria-label", "className", "containerProps", "initialMounted", "unmountOnClose", "transition", "transitionTimeout", "boundingBoxRef", "boundingBoxPadding", "reposition", "submenuOpenDelay", "submenuCloseDelay", "skipOpen", "viewScroll", "portal", "theming", "onItemClick", "onClose", "saveButtonRef", "closeMenuExclusionClassName"]);
|
|
1280
1280
|
var containerRef = useRef();
|
|
1281
1281
|
var scrollNodesRef = useRef({});
|
|
1282
1282
|
var anchorRef = restProps.anchorRef, state = restProps.state;
|
|
@@ -1304,11 +1304,11 @@ var ControlledMenuFr = function (_a, externalRef) {
|
|
|
1304
1304
|
viewScroll,
|
|
1305
1305
|
]);
|
|
1306
1306
|
var clickIsWithinMenu = useCallback(function (ev) {
|
|
1307
|
-
return hasParentClass("szh-menu--state-open", ev.target)
|
|
1308
|
-
|
|
1307
|
+
return hasParentClass("szh-menu--state-open", ev.target) ||
|
|
1308
|
+
(closeMenuExclusionClassName && hasParentClass(closeMenuExclusionClassName, ev.target));
|
|
1309
|
+
}, [closeMenuExclusionClassName]);
|
|
1309
1310
|
var handleScreenEventForSave = useCallback(function (ev) {
|
|
1310
1311
|
if (!clickIsWithinMenu(ev)) {
|
|
1311
|
-
//!ev.currentTarget.contains(ev.relatedTarget || document.activeElement)) {
|
|
1312
1312
|
ev.preventDefault();
|
|
1313
1313
|
ev.stopPropagation();
|
|
1314
1314
|
// FIXME There's an issue in React17
|
|
@@ -2518,11 +2518,11 @@ function styleInject(css, ref) {
|
|
|
2518
2518
|
}
|
|
2519
2519
|
}
|
|
2520
2520
|
|
|
2521
|
-
var css_248z$
|
|
2522
|
-
styleInject(css_248z$
|
|
2521
|
+
var css_248z$7 = ".AgGridGenericCellRenderer-icon{margin-right:4px}.AgGridGenericCellRenderer-ic_infoIcon{fill:#3a7cdf;margin-right:4px}.AgGridGenericCellRenderer-ic_warningIcon{fill:#ea6a2e;margin-right:4px}";
|
|
2522
|
+
styleInject(css_248z$7);
|
|
2523
2523
|
|
|
2524
|
-
var css_248z$
|
|
2525
|
-
styleInject(css_248z$
|
|
2524
|
+
var css_248z$6 = ".GridLoadableCell-container{align-items:center;display:flex}";
|
|
2525
|
+
styleInject(css_248z$6);
|
|
2526
2526
|
|
|
2527
2527
|
var GridLoadableCell = function (props) {
|
|
2528
2528
|
if (props.isLoading) {
|
|
@@ -2708,7 +2708,7 @@ var useGridPopoverHook = function (props) {
|
|
|
2708
2708
|
});
|
|
2709
2709
|
}); }, [props, stopEditing, propsRef]);
|
|
2710
2710
|
var popoverWrapper = useCallback(function (children) {
|
|
2711
|
-
return (jsx(Fragment$1, { children: anchorRef.current && (jsxs(ControlledMenu, __assign({ state: isOpen ? "open" : "closed", portal: true, unmountOnClose: true, anchorRef: anchorRef, saveButtonRef: saveButtonRef, menuClassName: "step-ag-grid-react-menu", onClose: function (event) { return triggerSave(event.reason).then(); }, viewScroll: "auto", dontShrinkIfDirectionIsTop: true, className: props.className }, { children: [saving && ( // This is the overlay that prevents editing when the editor is saving
|
|
2711
|
+
return (jsx(Fragment$1, { children: anchorRef.current && (jsxs(ControlledMenu, __assign({ state: isOpen ? "open" : "closed", portal: true, unmountOnClose: true, anchorRef: anchorRef, saveButtonRef: saveButtonRef, menuClassName: "step-ag-grid-react-menu", onClose: function (event) { return triggerSave(event.reason).then(); }, viewScroll: "auto", dontShrinkIfDirectionIsTop: true, className: props.className, closeMenuExclusionClassName: "ReactModal__Content" }, { children: [saving && ( // This is the overlay that prevents editing when the editor is saving
|
|
2712
2712
|
jsx("div", { style: {
|
|
2713
2713
|
position: "absolute",
|
|
2714
2714
|
left: 0,
|
|
@@ -2744,11 +2744,11 @@ var GridRenderPopoutMenuCell = function (props) {
|
|
|
2744
2744
|
return (jsx(GridLoadableCell, __assign({ isLoading: isLoading, className: disabled ? "GridPopoutMenu-burgerDisabled" : "GridPopoutMenu-burger" }, { children: jsx(LuiIcon, { name: "ic_more_vert", alt: "More actions", size: "md" }) })));
|
|
2745
2745
|
};
|
|
2746
2746
|
|
|
2747
|
-
var css_248z$
|
|
2748
|
-
styleInject(css_248z$
|
|
2747
|
+
var css_248z$5 = ".GridMultiSelect-containerSmall .GridFormMultiSelect-options{max-height:130px;overflow-y:auto}.GridMultiSelect-containerMedium .GridFormMultiSelect-options{max-height:190px;overflow-y:auto}.GridMultiSelect-containerLarge .GridFormMultiSelect-options{max-height:320px;overflow-y:auto}.GridMultiSelect-containerUnlimited .GridFormMultiSelect-options{overflow-y:auto}";
|
|
2748
|
+
styleInject(css_248z$5);
|
|
2749
2749
|
|
|
2750
|
-
var css_248z$
|
|
2751
|
-
styleInject(css_248z$
|
|
2750
|
+
var css_248z$4 = ".GridPopoverEditDropDown-containerSmall .GridFormDropDown-options{max-height:120px;overflow-y:auto}.GridPopoverEditDropDown-containerMedium .GridFormDropDown-options{max-height:200px;overflow-y:auto}.GridPopoverEditDropDown-containerLarge .GridFormDropDown-options{max-height:400px;overflow-y:auto}.GridPopoverEditDropDown-containerUnlimited .GridFormDropDown-options{overflow-y:auto}";
|
|
2751
|
+
styleInject(css_248z$4);
|
|
2752
2752
|
|
|
2753
2753
|
/* global setTimeout, clearTimeout */
|
|
2754
2754
|
|
|
@@ -2822,8 +2822,11 @@ function defer() {
|
|
|
2822
2822
|
}
|
|
2823
2823
|
|
|
2824
2824
|
var MenuSeparatorString = "_____MENU_SEPARATOR_____";
|
|
2825
|
-
Object.freeze({ value: MenuSeparatorString });
|
|
2825
|
+
var MenuSeparator = Object.freeze({ value: MenuSeparatorString });
|
|
2826
2826
|
var MenuHeaderString = "_____MENU_HEADER_____";
|
|
2827
|
+
var MenuHeaderItem = function (title) {
|
|
2828
|
+
return { label: title, value: MenuHeaderString };
|
|
2829
|
+
};
|
|
2827
2830
|
var GridFormDropDown = function (_props) {
|
|
2828
2831
|
var props = _props;
|
|
2829
2832
|
var _a = useContext(GridContext), updatingCells = _a.updatingCells, stopEditing = _a.stopEditing;
|
|
@@ -3120,8 +3123,8 @@ var GridPopoutEditMultiSelect = function (colDef, props) {
|
|
|
3120
3123
|
return GridCell(__assign({ initialWidth: 65, maxWidth: 150 }, colDef), __assign(__assign({ editor: GridFormMultiSelect }, props), { editorParams: __assign({ className: "GridMultiSelect-containerMedium" }, props.editorParams) }));
|
|
3121
3124
|
};
|
|
3122
3125
|
|
|
3123
|
-
var css_248z$
|
|
3124
|
-
styleInject(css_248z$
|
|
3126
|
+
var css_248z$3 = ".GridPopoutMenu-burger{cursor:pointer}.GridPopoutMenu-burger svg{fill:#007198}.GridPopoutMenu-burgerDisabled svg{fill:#989189}";
|
|
3127
|
+
styleInject(css_248z$3);
|
|
3125
3128
|
|
|
3126
3129
|
/** Menu configuration types **/
|
|
3127
3130
|
var PopoutMenuSeparator = Object.freeze({ __isMenuSeparator__: true });
|
|
@@ -3284,11 +3287,11 @@ var convertDDToDMS = function (dd, showPositiveSymbol, addTrailingZeros) {
|
|
|
3284
3287
|
return dmsString;
|
|
3285
3288
|
};
|
|
3286
3289
|
|
|
3287
|
-
var css_248z$
|
|
3288
|
-
styleInject(css_248z$
|
|
3290
|
+
var css_248z$2 = ".GridFormEditBearing-input{width:320px}";
|
|
3291
|
+
styleInject(css_248z$2);
|
|
3289
3292
|
|
|
3290
|
-
var css_248z = ".LuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#beb9b4;line-height:48px;position:absolute;right:14px;top:0}";
|
|
3291
|
-
styleInject(css_248z);
|
|
3293
|
+
var css_248z$1 = ".LuiTextInput{margin-bottom:0}.LuiTextInput-formatted{color:#beb9b4;line-height:48px;position:absolute;right:14px;top:0}";
|
|
3294
|
+
styleInject(css_248z$1);
|
|
3292
3295
|
|
|
3293
3296
|
var TextInputFormatted = function (props) {
|
|
3294
3297
|
return (jsxs("div", __assign({ className: clsx("LuiTextInput Grid-popoverContainer", props.error && "hasError", props.warning && "hasWarning", props.className) }, { children: [jsxs("span", __assign({ className: "LuiTextInput-inputWrapper" }, { children: [jsx("input", __assign({ type: "text", className: "LuiTextInput-input", min: "0", value: props.value, onChange: props.onChange }, props.inputProps)), jsx("span", __assign({ className: "LuiTextInput-formatted" }, { children: props.formatted }))] })), props.error && (jsxs("span", __assign({ className: "LuiTextInput-error" }, { children: [jsx(LuiIcon, { alt: "error", name: "ic_error", className: "LuiTextInput-error-icon", size: "sm", status: "error" }), props.error] }))), props.warning && (jsxs("span", __assign({ className: "LuiTextInput-warning" }, { children: [jsx(LuiIcon, { alt: "warning", name: "ic_warning", className: "LuiTextInput-warning-icon", size: "sm", status: "warning" }), props.warning] })))] })));
|
|
@@ -3590,5 +3593,96 @@ var GridSubComponentTextArea = function (props) {
|
|
|
3590
3593
|
return (jsx("div", __assign({ className: "FreeTextInput LuiDeprecatedForms" }, { children: jsx("textarea", { autoFocus: true, maxLength: 10000, spellCheck: true, className: "free-text-input", onChange: function (e) { return setValue(e.target.value); }, defaultValue: value }) })));
|
|
3591
3594
|
};
|
|
3592
3595
|
|
|
3593
|
-
|
|
3596
|
+
var css_248z = ".ActionButton{align-items:center;display:flex}.ActionButton .LuiIcon{margin:0 4px!important}.ActionButton-minimalArea{position:relative}.ActionButton-minimalAreaDisplay{position:absolute}.ActionButton-minimalAreaExpand{visibility:hidden}.ActionButton-inProgress{background-color:#e2f3f7!important;color:#007198!important;cursor:progress}.ActionButton-inProgress svg *{fill:#0000!important}";
|
|
3597
|
+
styleInject(css_248z);
|
|
3598
|
+
|
|
3599
|
+
/**
|
|
3600
|
+
* Track previous values of states.
|
|
3601
|
+
*
|
|
3602
|
+
* @param value Value to track.
|
|
3603
|
+
*/
|
|
3604
|
+
var usePrevious = function (value) {
|
|
3605
|
+
var ref = useRef();
|
|
3606
|
+
useEffect(function () {
|
|
3607
|
+
ref.current = value;
|
|
3608
|
+
}, [value]);
|
|
3609
|
+
return ref.current;
|
|
3610
|
+
};
|
|
3611
|
+
|
|
3612
|
+
/**
|
|
3613
|
+
* Cancels timeouts on scope being destroyed.
|
|
3614
|
+
*
|
|
3615
|
+
* This could almost be a debounce, but debounce tracks by function reference, this tracks by hook reference.
|
|
3616
|
+
* This could have been implemented using debounce if the callers function was wrapped in useCallback,
|
|
3617
|
+
* but there's no way to enforce that, so it would lead to bugs.
|
|
3618
|
+
*/
|
|
3619
|
+
var useTimeoutHook = function () {
|
|
3620
|
+
var timeout = useRef();
|
|
3621
|
+
/**
|
|
3622
|
+
* Clear any pending timeouts.
|
|
3623
|
+
*/
|
|
3624
|
+
var clearTimeouts = function () {
|
|
3625
|
+
if (timeout.current) {
|
|
3626
|
+
var tc = timeout.current;
|
|
3627
|
+
timeout.current = undefined;
|
|
3628
|
+
clearTimeout(tc);
|
|
3629
|
+
}
|
|
3630
|
+
};
|
|
3631
|
+
/**
|
|
3632
|
+
* Call this when your action has completed.
|
|
3633
|
+
*/
|
|
3634
|
+
var invoke = useCallback(function (fn, waitTimeMs) {
|
|
3635
|
+
clearTimeouts();
|
|
3636
|
+
timeout.current = setTimeout(fn, waitTimeMs);
|
|
3637
|
+
}, []);
|
|
3638
|
+
/**
|
|
3639
|
+
* Clear timeout on loss of scope.
|
|
3640
|
+
*/
|
|
3641
|
+
useEffect(function () {
|
|
3642
|
+
return function () { return clearTimeouts(); };
|
|
3643
|
+
}, []);
|
|
3644
|
+
return invoke;
|
|
3645
|
+
};
|
|
3646
|
+
|
|
3647
|
+
/**
|
|
3648
|
+
* Defers state change up to a minimum time since last state change.
|
|
3649
|
+
*/
|
|
3650
|
+
var useStateDeferred = function (initialValue) {
|
|
3651
|
+
var startTime = useRef(0);
|
|
3652
|
+
var timeoutHook = useTimeoutHook();
|
|
3653
|
+
var _a = useState(initialValue), value = _a[0], _setValue = _a[1];
|
|
3654
|
+
var setValue = useCallback(function (newValue) {
|
|
3655
|
+
startTime.current = Date.now();
|
|
3656
|
+
_setValue(newValue);
|
|
3657
|
+
}, []);
|
|
3658
|
+
var setValueDeferred = useCallback(function (newValue, minimumWaitTimeMs) {
|
|
3659
|
+
var waitTimeMs = Math.max(minimumWaitTimeMs - (Date.now() - startTime.current), 0);
|
|
3660
|
+
timeoutHook(function () { return _setValue(newValue); }, waitTimeMs);
|
|
3661
|
+
}, [timeoutHook]);
|
|
3662
|
+
return [value, setValue, setValueDeferred];
|
|
3663
|
+
};
|
|
3664
|
+
|
|
3665
|
+
// Kept this less than one second, so I don't have issues with waitFor as it defaults to 1s
|
|
3666
|
+
var minimumInProgressTimeMs = 950;
|
|
3667
|
+
var ActionButton = function (_a) {
|
|
3668
|
+
var _b;
|
|
3669
|
+
var _c;
|
|
3670
|
+
var icon = _a.icon, name = _a.name, inProgressName = _a.inProgressName, dataTestId = _a.dataTestId, inProgress = _a.inProgress, className = _a.className, title = _a.title, onClick = _a.onClick, _d = _a.size, size = _d === void 0 ? "sm" : _d;
|
|
3671
|
+
var lastInProgress = usePrevious(inProgress !== null && inProgress !== void 0 ? inProgress : false);
|
|
3672
|
+
var _e = useStateDeferred(!!inProgress), localInProgress = _e[0], setLocalInProgress = _e[1], setLocalInProgressDeferred = _e[2];
|
|
3673
|
+
useEffect(function () {
|
|
3674
|
+
if (inProgress == lastInProgress)
|
|
3675
|
+
return;
|
|
3676
|
+
inProgress ? setLocalInProgress(true) : setLocalInProgressDeferred(false, minimumInProgressTimeMs);
|
|
3677
|
+
}, [inProgress, lastInProgress, setLocalInProgress, setLocalInProgressDeferred]);
|
|
3678
|
+
return (jsxs(LuiButton, __assign({ "data-testid": dataTestId, type: "button", level: "tertiary", title: title !== null && title !== void 0 ? title : name, "aria-label": name, className: clsx("lui-button-icon", "ActionButton", className, localInProgress && "ActionButton-inProgress"), size: "lg", onClick: onClick, disabled: localInProgress }, { children: [localInProgress ? (jsx(LuiMiniSpinner, { size: 16, divProps: (_b = {
|
|
3679
|
+
"data-testid": "loading-spinner",
|
|
3680
|
+
style: { padding: 0, margin: 0, paddingRight: 8 },
|
|
3681
|
+
role: "status"
|
|
3682
|
+
},
|
|
3683
|
+
_b["aria-label"] = "Loading",
|
|
3684
|
+
_b) })) : (jsx(LuiIcon, { name: icon, alt: name, size: size })), jsxs("span", __assign({ className: "ActionButton-minimalArea" }, { children: [jsx("span", __assign({ className: "ActionButton-minimalAreaDisplay" }, { children: (_c = (localInProgress ? inProgressName : name)) !== null && _c !== void 0 ? _c : name })), jsx("span", __assign({ className: "ActionButton-minimalAreaExpand" }, { children: name }))] }))] })));
|
|
3685
|
+
};
|
|
3686
|
+
|
|
3687
|
+
export { ActionButton, ComponentLoadingWrapper, ControlledMenu, FocusableItem, GenericCellEditorComponent, GenericMultiEditCellClass, Grid, GridCell, GridCellRenderer, GridContext, GridContextProvider, GridFormDropDown, GridFormMultiSelect, GridFormPopoutMenu, GridHeaderSelect, GridIcon, GridLoadableCell, GridPopoutEditMultiSelect, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridRendererGenericCell, GridSubComponentTextArea, GridUpdatingContext, GridUpdatingContextProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, bearingCorrectionValueFormatter, bearingNumberParser, bearingStringValidator, bearingValueFormatter, convertDDToDMS, hasParentClass, isFloat, isNotEmpty, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait };
|
|
3594
3688
|
//# sourceMappingURL=step-ag-grid.esm.js.map
|