@linzjs/step-ag-grid 23.0.1 → 25.0.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/dist/GridTheme.scss +1 -1
- package/dist/index.css +0 -13
- package/dist/src/components/ComponentLoadingWrapper.d.ts +1 -1
- package/dist/src/components/Grid.d.ts +17 -17
- package/dist/src/components/GridCell.d.ts +9 -9
- package/dist/src/components/GridCellFiller.d.ts +2 -2
- package/dist/src/components/GridCellMultiEditor.d.ts +6 -6
- package/dist/src/components/GridCellMultiSelectClassRules.d.ts +1 -1
- package/dist/src/components/GridIcon.d.ts +2 -2
- package/dist/src/components/GridNoRowsOverlay.d.ts +1 -1
- package/dist/src/components/GridPopoverHook.d.ts +2 -2
- package/dist/src/components/GridWrapper.d.ts +1 -1
- package/dist/src/components/PostSortRowsHook.d.ts +1 -1
- package/dist/src/components/clickInputWhenContainingCellClicked.d.ts +1 -1
- package/dist/src/components/gridFilter/GridFilterButtons.d.ts +5 -5
- package/dist/src/components/gridFilter/GridFilterColumnsToggle.d.ts +1 -1
- package/dist/src/components/gridFilter/GridFilterDownloadCsvButton.d.ts +1 -1
- package/dist/src/components/gridFilter/GridFilterHeaderIconButton.d.ts +2 -2
- package/dist/src/components/gridFilter/GridFilters.d.ts +1 -1
- package/dist/src/components/gridFilter/index.d.ts +7 -7
- package/dist/src/components/gridFilter/useGridFilter.d.ts +2 -2
- package/dist/src/components/gridForm/GridFormDropDown.d.ts +8 -8
- package/dist/src/components/gridForm/GridFormEditBearing.d.ts +2 -2
- package/dist/src/components/gridForm/GridFormMessage.d.ts +3 -3
- package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormMultiSelectGrid.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +5 -5
- package/dist/src/components/gridForm/GridFormSubComponentTextArea.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormTextArea.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormTextInput.d.ts +3 -3
- package/dist/src/components/gridForm/index.d.ts +10 -10
- package/dist/src/components/gridHeader/GridHeaderSelect.d.ts +1 -1
- package/dist/src/components/gridHeader/index.d.ts +1 -1
- package/dist/src/components/gridHook/index.d.ts +1 -1
- package/dist/src/components/gridHook/useGridContextMenu.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridButton.d.ts +5 -5
- package/dist/src/components/gridPopoverEdit/GridEditBoolean.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelectGrid.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverEditBearing.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverEditDropDown.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverMenu.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverMessage.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverTextArea.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverTextInput.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/index.d.ts +11 -11
- package/dist/src/components/gridRender/GridRenderGenericCell.d.ts +5 -5
- package/dist/src/components/gridRender/GridRenderPopoutMenuCell.d.ts +1 -1
- package/dist/src/components/gridRender/index.d.ts +2 -2
- package/dist/src/components/gridUtil.d.ts +1 -1
- package/dist/src/components/index.d.ts +19 -19
- package/dist/src/contexts/GridContext.d.ts +4 -4
- package/dist/src/contexts/GridContextProvider.d.ts +3 -3
- package/dist/src/contexts/GridPopoverContext.d.ts +3 -3
- package/dist/src/contexts/GridPopoverContextProvider.d.ts +4 -4
- package/dist/src/contexts/GridUpdatingContextProvider.d.ts +1 -1
- package/dist/src/index.d.ts +19 -17
- package/dist/src/lui/ActionButton.d.ts +9 -9
- package/dist/src/lui/FormError.d.ts +2 -2
- package/dist/src/lui/TextAreaInput.d.ts +1 -1
- package/dist/src/lui/TextInputFormatted.d.ts +2 -2
- package/dist/src/lui/reactUtils.d.ts +1 -1
- package/dist/src/lui/stateDeferredHook.d.ts +1 -1
- package/dist/src/react-menu3/components/ControlledMenu.d.ts +2 -2
- package/dist/src/react-menu3/components/FocusableItem.d.ts +3 -3
- package/dist/src/react-menu3/components/Menu.d.ts +3 -3
- package/dist/src/react-menu3/components/MenuButton.d.ts +2 -2
- package/dist/src/react-menu3/components/MenuDivider.d.ts +1 -1
- package/dist/src/react-menu3/components/MenuGroup.d.ts +2 -2
- package/dist/src/react-menu3/components/MenuHeader.d.ts +2 -2
- package/dist/src/react-menu3/components/MenuItem.d.ts +3 -3
- package/dist/src/react-menu3/components/MenuList.d.ts +1 -1
- package/dist/src/react-menu3/components/MenuRadioGroup.d.ts +2 -2
- package/dist/src/react-menu3/components/SubMenu.d.ts +5 -5
- package/dist/src/react-menu3/contexts/EventHandlersContext.d.ts +1 -1
- package/dist/src/react-menu3/contexts/MenuListContext.d.ts +2 -2
- package/dist/src/react-menu3/contexts/MenuListItemContext.d.ts +1 -1
- package/dist/src/react-menu3/contexts/RadioGroupContext.d.ts +1 -1
- package/dist/src/react-menu3/contexts/SettingsContext.d.ts +2 -2
- package/dist/src/react-menu3/hooks/index.d.ts +9 -9
- package/dist/src/react-menu3/hooks/useBEM.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useCombinedRef.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useIsomorphicLayoutEffect.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useItemEffect.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useItemState.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useItems.d.ts +2 -2
- package/dist/src/react-menu3/hooks/useMenuChange.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useMenuState.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useMenuStateAndFocus.d.ts +1 -1
- package/dist/src/react-menu3/index.d.ts +11 -11
- package/dist/src/react-menu3/positionUtils/getPositionHelpers.d.ts +1 -1
- package/dist/src/react-menu3/positionUtils/index.d.ts +3 -3
- package/dist/src/react-menu3/positionUtils/placeArrowHorizontal.d.ts +1 -1
- package/dist/src/react-menu3/positionUtils/placeArrowVertical.d.ts +1 -1
- package/dist/src/react-menu3/positionUtils/placeLeftorRight.d.ts +4 -4
- package/dist/src/react-menu3/positionUtils/placeToporBottom.d.ts +5 -5
- package/dist/src/react-menu3/positionUtils/positionContextMenu.d.ts +2 -2
- package/dist/src/react-menu3/positionUtils/positionMenu.d.ts +5 -5
- package/dist/src/react-menu3/style-utils/index.d.ts +1 -1
- package/dist/src/react-menu3/types.d.ts +15 -15
- package/dist/src/react-menu3/utils/constants.d.ts +1 -1
- package/dist/src/react-menu3/utils/index.d.ts +3 -3
- package/dist/src/react-menu3/utils/utils.d.ts +5 -5
- package/dist/src/react-menu3/utils/withHovering.d.ts +1 -1
- package/{src/utils → dist/src/utils/__tests__}/storybookTestUtil.ts +2 -2
- package/{src/utils → dist/src/utils/__tests__}/testQuick.ts +15 -14
- package/{src/utils → dist/src/utils/__tests__}/testUtil.ts +31 -36
- package/dist/src/utils/__tests__/vitestUtil.ts +295 -0
- package/dist/src/utils/textValidator.d.ts +2 -2
- package/dist/{step-ag-grid.cjs.js → step-ag-grid.cjs} +969 -955
- package/dist/step-ag-grid.cjs.map +1 -0
- package/dist/step-ag-grid.esm.js +970 -958
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/dist/vite.config.d.ts +1 -1
- package/package.json +38 -57
- package/src/components/ComponentLoadingWrapper.tsx +5 -6
- package/src/components/Grid.tsx +85 -83
- package/src/components/GridCell.test.tsx +17 -15
- package/src/components/GridCell.tsx +46 -44
- package/src/components/GridCellFiller.tsx +5 -4
- package/src/components/GridCellMultiEditor.tsx +7 -7
- package/src/components/GridCellMultiSelectClassRules.tsx +3 -3
- package/src/components/GridIcon.tsx +6 -7
- package/src/components/GridLoadableCell.tsx +2 -2
- package/src/components/GridNoRowsOverlay.tsx +8 -8
- package/src/components/GridPopoverHook.tsx +16 -16
- package/src/components/GridWrapper.tsx +2 -2
- package/src/components/PostSortRowsHook.ts +11 -11
- package/src/components/clickInputWhenContainingCellClicked.tsx +5 -5
- package/src/components/gridFilter/GridFilterButtons.tsx +8 -9
- package/src/components/gridFilter/GridFilterColumnsToggle.tsx +25 -26
- package/src/components/gridFilter/GridFilterDownloadCsvButton.tsx +12 -13
- package/src/components/gridFilter/GridFilterHeaderIconButton.tsx +9 -10
- package/src/components/gridFilter/GridFilterQuick.tsx +6 -6
- package/src/components/gridFilter/GridFilters.tsx +1 -1
- package/src/components/gridFilter/index.ts +7 -7
- package/src/components/gridFilter/useGridFilter.ts +3 -3
- package/src/components/gridForm/GridFormDropDown.tsx +56 -52
- package/src/components/gridForm/GridFormEditBearing.tsx +12 -12
- package/src/components/gridForm/GridFormMessage.tsx +10 -10
- package/src/components/gridForm/GridFormMultiSelect.tsx +53 -51
- package/src/components/gridForm/GridFormMultiSelectGrid.tsx +25 -26
- package/src/components/gridForm/GridFormPopoverMenu.tsx +32 -29
- package/src/components/gridForm/GridFormSubComponentTextArea.tsx +10 -10
- package/src/components/gridForm/GridFormSubComponentTextInput.tsx +8 -8
- package/src/components/gridForm/GridFormTextArea.tsx +11 -11
- package/src/components/gridForm/GridFormTextInput.tsx +11 -11
- package/src/components/gridForm/index.ts +10 -10
- package/src/components/gridHeader/GridHeaderSelect.tsx +9 -9
- package/src/components/gridHeader/index.ts +1 -1
- package/src/components/gridHook/index.ts +1 -1
- package/src/components/gridHook/useGridContextMenu.tsx +7 -7
- package/src/components/gridPopoverEdit/GridButton.tsx +13 -12
- package/src/components/gridPopoverEdit/GridEditBoolean.tsx +19 -18
- package/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.ts +7 -6
- package/src/components/gridPopoverEdit/GridPopoutEditMultiSelectGrid.ts +7 -6
- package/src/components/gridPopoverEdit/GridPopoverEditBearing.ts +9 -9
- package/src/components/gridPopoverEdit/GridPopoverEditDropDown.ts +8 -7
- package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +6 -6
- package/src/components/gridPopoverEdit/GridPopoverMessage.ts +4 -4
- package/src/components/gridPopoverEdit/GridPopoverTextArea.ts +4 -4
- package/src/components/gridPopoverEdit/GridPopoverTextInput.ts +4 -4
- package/src/components/gridPopoverEdit/index.ts +11 -11
- package/src/components/gridRender/GridRenderGenericCell.tsx +5 -5
- package/src/components/gridRender/GridRenderPopoutMenuCell.tsx +8 -9
- package/src/components/gridRender/index.ts +2 -2
- package/src/components/gridUtil.ts +3 -3
- package/src/components/index.ts +19 -19
- package/src/contexts/GridContext.tsx +52 -46
- package/src/contexts/GridContextProvider.test.tsx +15 -14
- package/src/contexts/GridContextProvider.tsx +42 -42
- package/src/contexts/GridPopoverContext.tsx +10 -7
- package/src/contexts/GridPopoverContextProvider.tsx +12 -10
- package/src/contexts/GridSubComponentContext.ts +6 -5
- package/src/contexts/GridUpdatingContext.tsx +5 -4
- package/src/contexts/GridUpdatingContextProvider.tsx +3 -3
- package/src/index.ts +19 -21
- package/src/lui/ActionButton.scss +2 -2
- package/src/lui/ActionButton.tsx +42 -41
- package/src/lui/FormError.scss +3 -4
- package/src/lui/FormError.tsx +4 -4
- package/src/lui/TextAreaInput.tsx +9 -9
- package/src/lui/TextInputFormatted.scss +1 -1
- package/src/lui/TextInputFormatted.tsx +11 -11
- package/src/lui/reactUtils.test.tsx +9 -8
- package/src/lui/reactUtils.tsx +2 -2
- package/src/lui/stateDeferredHook.tsx +3 -5
- package/src/lui/timeoutHook.test.tsx +12 -11
- package/src/lui/timeoutHook.tsx +1 -1
- package/src/react-app-env.d.ts +1 -1
- package/src/react-menu3/components/ControlledMenu.tsx +48 -48
- package/src/react-menu3/components/FocusableItem.tsx +7 -7
- package/src/react-menu3/components/Menu.tsx +11 -11
- package/src/react-menu3/components/MenuButton.tsx +4 -4
- package/src/react-menu3/components/MenuDivider.tsx +4 -4
- package/src/react-menu3/components/MenuGroup.tsx +5 -5
- package/src/react-menu3/components/MenuHeader.tsx +4 -4
- package/src/react-menu3/components/MenuItem.tsx +14 -14
- package/src/react-menu3/components/MenuList.tsx +55 -55
- package/src/react-menu3/components/MenuRadioGroup.tsx +7 -7
- package/src/react-menu3/components/SubMenu.tsx +24 -24
- package/src/react-menu3/contexts/EventHandlersContext.ts +2 -2
- package/src/react-menu3/contexts/HoverItemContext.ts +1 -1
- package/src/react-menu3/contexts/ItemSettingsContext.ts +1 -1
- package/src/react-menu3/contexts/MenuListContext.ts +2 -2
- package/src/react-menu3/contexts/MenuListItemContext.ts +2 -2
- package/src/react-menu3/contexts/RadioGroupContext.ts +2 -2
- package/src/react-menu3/contexts/SettingsContext.ts +2 -2
- package/src/react-menu3/hooks/index.ts +9 -9
- package/src/react-menu3/hooks/useBEM.ts +4 -4
- package/src/react-menu3/hooks/useCombinedRef.ts +2 -2
- package/src/react-menu3/hooks/useIsomorphicLayoutEffect.ts +4 -4
- package/src/react-menu3/hooks/useItemEffect.ts +3 -3
- package/src/react-menu3/hooks/useItemState.ts +5 -5
- package/src/react-menu3/hooks/useItems.ts +8 -8
- package/src/react-menu3/hooks/useMenuChange.ts +3 -3
- package/src/react-menu3/hooks/useMenuState.ts +5 -5
- package/src/react-menu3/hooks/useMenuStateAndFocus.ts +4 -4
- package/src/react-menu3/index.ts +11 -11
- package/src/react-menu3/positionUtils/getPositionHelpers.ts +2 -2
- package/src/react-menu3/positionUtils/index.ts +3 -3
- package/src/react-menu3/positionUtils/placeArrowHorizontal.ts +1 -1
- package/src/react-menu3/positionUtils/placeArrowVertical.ts +1 -1
- package/src/react-menu3/positionUtils/placeLeftorRight.ts +13 -13
- package/src/react-menu3/positionUtils/placeToporBottom.ts +15 -15
- package/src/react-menu3/positionUtils/positionContextMenu.ts +4 -4
- package/src/react-menu3/positionUtils/positionMenu.ts +14 -14
- package/src/react-menu3/style-utils/index.ts +24 -24
- package/src/react-menu3/types.ts +15 -15
- package/src/react-menu3/utils/constants.ts +33 -33
- package/src/react-menu3/utils/index.ts +3 -4
- package/src/react-menu3/utils/propTypes2.ts +10 -10
- package/src/react-menu3/utils/utils.ts +14 -14
- package/src/react-menu3/utils/withHovering.tsx +3 -3
- package/src/stories/components/ActionButton.stories.tsx +23 -24
- package/src/stories/grid/FormTest.tsx +15 -16
- package/src/stories/grid/GridDragRow.stories.tsx +33 -34
- package/src/stories/grid/GridFilterButtons.stories.tsx +32 -33
- package/src/stories/grid/GridNoRowsOverlay.stories.tsx +9 -10
- package/src/stories/grid/GridNonEditableRow.stories.tsx +40 -41
- package/src/stories/grid/GridPinnedRow.stories.tsx +25 -26
- package/src/stories/grid/GridPopoutContextMenu.stories.tsx +33 -32
- package/src/stories/grid/GridPopoutEditBoolean.stories.tsx +21 -22
- package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +18 -19
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +50 -49
- package/src/stories/grid/GridPopoverEditBearing.stories.tsx +25 -26
- package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +93 -94
- package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +62 -63
- package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +28 -28
- package/src/stories/grid/GridReadOnly.stories.tsx +66 -67
- package/src/stories/grid/GridViewList.stories.tsx +37 -38
- package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +37 -38
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +25 -26
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +25 -26
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +31 -31
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +47 -48
- package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +44 -45
- package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +19 -20
- package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +21 -22
- package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +40 -41
- package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +14 -15
- package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +14 -15
- package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +10 -11
- package/src/stories/grid/gridFormStatic/GridFormMultiSelect.stories.tsx +20 -21
- package/src/stories/grid/gridFormStatic/GridFormPopoverMenu.stories.tsx +16 -17
- package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +13 -14
- package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +13 -14
- package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +68 -71
- package/src/stories/react-menu/ReactMenu.stories.tsx +26 -26
- package/src/styles/Grid.scss +9 -9
- package/src/styles/GridIcon.scss +6 -6
- package/src/styles/GridPopoverMenu.scss +3 -3
- package/src/styles/GridTheme.scss +1 -1
- package/src/styles/react-menu-customisations.scss +26 -41
- package/src/utils/__tests__/storybookTestUtil.ts +4 -0
- package/src/utils/__tests__/testQuick.ts +157 -0
- package/src/utils/__tests__/testUtil.ts +294 -0
- package/src/utils/__tests__/vitestUtil.ts +295 -0
- package/src/utils/bearing.test.ts +47 -45
- package/src/utils/bearing.ts +20 -20
- package/src/utils/deferredPromise.ts +1 -1
- package/src/utils/textMatcher.test.ts +10 -9
- package/src/utils/textMatcher.ts +8 -8
- package/src/utils/textValidator.test.ts +61 -62
- package/src/utils/textValidator.ts +11 -11
- package/src/utils/util.test.ts +21 -20
- package/src/utils/util.ts +7 -7
- package/dist/src/utils/storybookTestUtil.d.ts +0 -3
- package/dist/src/utils/testQuick.d.ts +0 -62
- package/dist/src/utils/testUtil.d.ts +0 -46
- package/dist/step-ag-grid.cjs.js.map +0 -1
package/src/index.ts
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
|
|
19
|
-
export * from
|
|
20
|
-
export * from "./utils/util";
|
|
21
|
-
export * from "./utils/deferredPromise";
|
|
1
|
+
export * from './components';
|
|
2
|
+
export * from './contexts/GridContext';
|
|
3
|
+
export * from './contexts/GridContextProvider';
|
|
4
|
+
export * from './contexts/GridPopoverContext';
|
|
5
|
+
export * from './contexts/GridPopoverContextProvider';
|
|
6
|
+
export * from './contexts/GridSubComponentContext';
|
|
7
|
+
export * from './contexts/GridUpdatingContext';
|
|
8
|
+
export * from './contexts/GridUpdatingContextProvider';
|
|
9
|
+
export * from './lui/ActionButton';
|
|
10
|
+
export * from './lui/FormError';
|
|
11
|
+
export * from './lui/TextAreaInput';
|
|
12
|
+
export * from './lui/TextInputFormatted';
|
|
13
|
+
export * from './react-menu3/index';
|
|
14
|
+
export * from './react-menu3/types';
|
|
15
|
+
export * from './utils/bearing';
|
|
16
|
+
export * from './utils/deferredPromise';
|
|
17
|
+
export * from './utils/textMatcher';
|
|
18
|
+
export * from './utils/textValidator';
|
|
19
|
+
export * from './utils/util';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use "../../node_modules/@linzjs/lui/dist/scss/
|
|
1
|
+
@use "../../node_modules/@linzjs/lui/dist/scss/Core" as lui;
|
|
2
2
|
|
|
3
3
|
.ActionButton {
|
|
4
4
|
display: flex;
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
.ActionButton-inProgress.lui-button-lg.lui-button-icon-right {
|
|
45
45
|
cursor: progress;
|
|
46
46
|
color: #007198;
|
|
47
|
-
background-color:
|
|
47
|
+
background-color: lui.$polar;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.ActionButton-fill {
|
package/src/lui/ActionButton.tsx
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import
|
|
1
|
+
import './ActionButton.scss';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import { LuiButton, LuiIcon, LuiMiniSpinner } from '@linzjs/lui';
|
|
4
|
+
import { LuiButtonProps } from '@linzjs/lui/dist/components/LuiButton/LuiButton';
|
|
5
|
+
import { IconName } from '@linzjs/lui/dist/components/LuiIcon/LuiIcon';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { CSSProperties, ReactElement, useEffect, useState } from 'react';
|
|
5
8
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { IconName } from "@linzjs/lui/dist/components/LuiIcon/LuiIcon";
|
|
9
|
-
|
|
10
|
-
import { usePrevious } from "./reactUtils";
|
|
11
|
-
import { useStateDeferred } from "./stateDeferredHook";
|
|
9
|
+
import { usePrevious } from './reactUtils';
|
|
10
|
+
import { useStateDeferred } from './stateDeferredHook';
|
|
12
11
|
|
|
13
12
|
export interface ActionButtonProps {
|
|
14
13
|
icon: IconName;
|
|
15
14
|
name?: string;
|
|
16
|
-
|
|
15
|
+
'aria-label'?: string;
|
|
17
16
|
inProgressName?: string;
|
|
18
17
|
title?: string;
|
|
19
18
|
dataTestId?: string;
|
|
20
|
-
size?:
|
|
21
|
-
iconPosition?:
|
|
22
|
-
|
|
19
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'ns';
|
|
20
|
+
iconPosition?: 'left' | 'right';
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
|
22
|
+
className?: 'ActionButton-fill' | 'ActionButton-tight' | string;
|
|
23
23
|
onClick: () => Promise<void> | void;
|
|
24
|
-
level?: LuiButtonProps[
|
|
24
|
+
level?: LuiButtonProps['level'];
|
|
25
25
|
style?: CSSProperties;
|
|
26
26
|
disabled?: boolean;
|
|
27
27
|
}
|
|
@@ -39,10 +39,10 @@ export const ActionButton = ({
|
|
|
39
39
|
className,
|
|
40
40
|
title,
|
|
41
41
|
onClick,
|
|
42
|
-
size =
|
|
43
|
-
iconPosition =
|
|
44
|
-
level =
|
|
45
|
-
|
|
42
|
+
size = 'sm',
|
|
43
|
+
iconPosition = 'left',
|
|
44
|
+
level = 'tertiary',
|
|
45
|
+
'aria-label': ariaLabel,
|
|
46
46
|
}: ActionButtonProps): ReactElement => {
|
|
47
47
|
const [inProgress, setInProgress] = useState(false);
|
|
48
48
|
const lastInProgress = usePrevious(inProgress ?? false);
|
|
@@ -54,63 +54,64 @@ export const ActionButton = ({
|
|
|
54
54
|
}, [inProgress, lastInProgress, setLocalInProgress, setLocalInProgressDeferred]);
|
|
55
55
|
|
|
56
56
|
const buttonText = (
|
|
57
|
-
<span className={
|
|
58
|
-
<span className={
|
|
57
|
+
<span className={'ActionButton-minimalArea'}>
|
|
58
|
+
<span className={'ActionButton-minimalAreaDisplay'}>{(localInProgress ? inProgressName : name) ?? name}</span>
|
|
59
59
|
{/* This makes sure the button expands to fill maximum length text at all times */}
|
|
60
|
-
<span className={
|
|
60
|
+
<span className={'ActionButton-minimalAreaExpand'}>{name}</span>
|
|
61
61
|
</span>
|
|
62
62
|
);
|
|
63
63
|
|
|
64
64
|
return (
|
|
65
65
|
<LuiButton
|
|
66
66
|
data-testid={dataTestId}
|
|
67
|
-
type={
|
|
67
|
+
type={'button'}
|
|
68
68
|
level={level}
|
|
69
69
|
title={title ?? ariaLabel ?? name}
|
|
70
|
-
buttonProps={{
|
|
70
|
+
buttonProps={{ 'aria-label': ariaLabel ?? name }}
|
|
71
71
|
className={clsx(
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
'lui-button-icon-right',
|
|
73
|
+
'ActionButton',
|
|
74
74
|
className,
|
|
75
|
-
localInProgress &&
|
|
76
|
-
name != null && !className?.includes(
|
|
77
|
-
name == null &&
|
|
75
|
+
localInProgress && 'ActionButton-inProgress',
|
|
76
|
+
name != null && !className?.includes('ActionButton-fill') && 'ActionButton-minimal',
|
|
77
|
+
name == null && 'ActionButton-iconOnly',
|
|
78
78
|
)}
|
|
79
|
-
size={
|
|
79
|
+
size={'lg'}
|
|
80
80
|
style={style}
|
|
81
|
-
onClick={
|
|
81
|
+
onClick={() => {
|
|
82
82
|
const promise = onClick();
|
|
83
|
-
const isPromise = typeof promise !==
|
|
83
|
+
const isPromise = typeof promise !== 'undefined';
|
|
84
84
|
if (isPromise) {
|
|
85
85
|
setInProgress(true);
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
void promise.finally(() => {
|
|
87
|
+
setInProgress(false);
|
|
88
|
+
});
|
|
88
89
|
}
|
|
89
90
|
}}
|
|
90
91
|
disabled={localInProgress || disabled}
|
|
91
92
|
>
|
|
92
|
-
{iconPosition ===
|
|
93
|
+
{iconPosition === 'right' && buttonText}
|
|
93
94
|
{localInProgress && (
|
|
94
|
-
<div style={{ position:
|
|
95
|
+
<div style={{ position: 'relative' }}>
|
|
95
96
|
<LuiMiniSpinner
|
|
96
97
|
size={14}
|
|
97
98
|
divProps={{
|
|
98
|
-
|
|
99
|
+
'data-testid': 'loading-spinner',
|
|
99
100
|
style: {
|
|
100
|
-
position:
|
|
101
|
+
position: 'absolute',
|
|
101
102
|
left: 4,
|
|
102
103
|
top: -10,
|
|
103
104
|
bottom: 10,
|
|
104
105
|
right: -4,
|
|
105
106
|
},
|
|
106
|
-
role:
|
|
107
|
-
|
|
107
|
+
role: 'status',
|
|
108
|
+
'aria-label': 'Loading',
|
|
108
109
|
}}
|
|
109
110
|
/>
|
|
110
111
|
</div>
|
|
111
112
|
)}
|
|
112
|
-
<LuiIcon name={icon} alt={ariaLabel ?? name ??
|
|
113
|
-
{iconPosition ===
|
|
113
|
+
<LuiIcon name={icon} alt={ariaLabel ?? name ?? ''} size={size} />
|
|
114
|
+
{iconPosition === 'left' && buttonText}
|
|
114
115
|
</LuiButton>
|
|
115
116
|
);
|
|
116
117
|
};
|
package/src/lui/FormError.scss
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
@use "../../node_modules/@linzjs/lui/dist/scss/
|
|
2
|
-
|
|
1
|
+
@use "../../node_modules/@linzjs/lui/dist/scss/Core" as lui;
|
|
3
2
|
|
|
4
3
|
.FormError {
|
|
5
4
|
display: flex;
|
|
6
5
|
|
|
7
6
|
&-helpText {
|
|
8
7
|
font-size: 0.75rem;
|
|
9
|
-
color:
|
|
8
|
+
color: lui.$fuscous;
|
|
10
9
|
font-weight: 400;
|
|
11
10
|
}
|
|
12
11
|
|
|
@@ -19,7 +18,7 @@
|
|
|
19
18
|
padding-left: 0;
|
|
20
19
|
font-size: 14px;
|
|
21
20
|
font-weight: 600;
|
|
22
|
-
color:
|
|
21
|
+
color: lui.$charcoal;
|
|
23
22
|
align-items: center;
|
|
24
23
|
}
|
|
25
24
|
}
|
package/src/lui/FormError.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import './FormError.scss';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { LuiIcon } from '@linzjs/lui';
|
|
4
|
+
import { ReactElement } from 'react';
|
|
5
5
|
|
|
6
6
|
export interface FormErrorProps {
|
|
7
7
|
helpText?: string;
|
|
@@ -18,7 +18,7 @@ export const FormError = (props: FormErrorProps) => {
|
|
|
18
18
|
</div>
|
|
19
19
|
)}
|
|
20
20
|
|
|
21
|
-
{props.helpText && !props.error && <span className={
|
|
21
|
+
{props.helpText && !props.error && <span className={'FormError-helpText'}>{props.helpText}</span>}
|
|
22
22
|
</>
|
|
23
23
|
);
|
|
24
24
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import clsx from
|
|
2
|
-
import { omit } from
|
|
3
|
-
import { InputHTMLAttributes, ReactElement, useId } from
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { omit } from 'lodash-es';
|
|
3
|
+
import { InputHTMLAttributes, ReactElement, useId } from 'react';
|
|
4
4
|
|
|
5
|
-
import { FormError } from
|
|
5
|
+
import { FormError } from './FormError';
|
|
6
6
|
|
|
7
7
|
export interface LuiTextAreaInputProps extends InputHTMLAttributes<HTMLTextAreaElement> {
|
|
8
8
|
// overrides value in base class to be string type only
|
|
@@ -23,9 +23,9 @@ export const TextAreaInput = (props: LuiTextAreaInputProps) => {
|
|
|
23
23
|
return (
|
|
24
24
|
<div
|
|
25
25
|
className={clsx(
|
|
26
|
-
|
|
27
|
-
props.disabled ?
|
|
28
|
-
props.error ?
|
|
26
|
+
'LuiTextAreaInput Grid-popoverContainer',
|
|
27
|
+
props.disabled ? 'isDisabled' : '',
|
|
28
|
+
props.error ? 'hasError' : '',
|
|
29
29
|
props.className,
|
|
30
30
|
)}
|
|
31
31
|
>
|
|
@@ -36,9 +36,9 @@ export const TextAreaInput = (props: LuiTextAreaInputProps) => {
|
|
|
36
36
|
{/* wrapper div used for error styling */}
|
|
37
37
|
<textarea
|
|
38
38
|
rows={5}
|
|
39
|
-
{...omit(props, [
|
|
39
|
+
{...omit(props, ['error', 'value', 'helpText', 'formatted', 'className', 'allowTabToSave'])}
|
|
40
40
|
id={id}
|
|
41
|
-
value={props.value ??
|
|
41
|
+
value={props.value ?? ''}
|
|
42
42
|
spellCheck={true}
|
|
43
43
|
onMouseEnter={(e) => {
|
|
44
44
|
if (document.activeElement != e.currentTarget) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import './TextInputFormatted.scss';
|
|
2
2
|
|
|
3
|
-
import clsx from
|
|
4
|
-
import { omit } from
|
|
5
|
-
import { DetailedHTMLProps, InputHTMLAttributes, ReactElement } from
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { omit } from 'lodash-es';
|
|
5
|
+
import { DetailedHTMLProps, InputHTMLAttributes, ReactElement } from 'react';
|
|
6
6
|
|
|
7
|
-
import { FormError } from
|
|
7
|
+
import { FormError } from './FormError';
|
|
8
8
|
|
|
9
9
|
export interface LuiTextInputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
10
10
|
// overrides value in base class to be string type only
|
|
@@ -21,26 +21,26 @@ export const TextInputFormatted = (props: LuiTextInputProps): ReactElement => {
|
|
|
21
21
|
return (
|
|
22
22
|
<div
|
|
23
23
|
className={clsx(
|
|
24
|
-
|
|
25
|
-
props.error &&
|
|
24
|
+
'LuiTextInput GridLuiTextInput Grid-popoverContainer',
|
|
25
|
+
props.error && 'hasError',
|
|
26
26
|
props.className,
|
|
27
27
|
)}
|
|
28
28
|
>
|
|
29
29
|
<span className="LuiTextInput-inputWrapper">
|
|
30
30
|
{/* wrapper div used for error styling */}
|
|
31
31
|
<input
|
|
32
|
-
type={
|
|
32
|
+
type={'text'}
|
|
33
33
|
spellCheck={true}
|
|
34
34
|
defaultValue={props.value}
|
|
35
|
-
{...omit(props, [
|
|
36
|
-
className={
|
|
35
|
+
{...omit(props, ['error', 'value', 'helpText', 'formatted', 'className', 'allowTabToSave'])}
|
|
36
|
+
className={'LuiTextInput-input'}
|
|
37
37
|
onMouseEnter={(e) => {
|
|
38
38
|
e.currentTarget.focus();
|
|
39
39
|
props.onMouseEnter && props.onMouseEnter(e);
|
|
40
40
|
}}
|
|
41
41
|
data-allowtabtosave={props.allowTabToSave}
|
|
42
42
|
/>
|
|
43
|
-
<span className={
|
|
43
|
+
<span className={'LuiTextInput-formatted'}>{props.formatted}</span>
|
|
44
44
|
</span>
|
|
45
45
|
|
|
46
46
|
<FormError error={props.error} helpText={props.helpText} />
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { screen } from
|
|
2
|
-
import { render } from
|
|
3
|
-
import userEvent from
|
|
4
|
-
import { ReactElement, useEffect, useState } from
|
|
1
|
+
import { screen } from '@testing-library/dom';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import userEvent from '@testing-library/user-event';
|
|
4
|
+
import { ReactElement, useEffect, useState } from 'react';
|
|
5
|
+
import { describe, expect, test } from 'vitest';
|
|
5
6
|
|
|
6
|
-
import { usePrevious } from
|
|
7
|
+
import { usePrevious } from './reactUtils';
|
|
7
8
|
|
|
8
9
|
interface WrapperProps {
|
|
9
10
|
value: boolean;
|
|
@@ -33,10 +34,10 @@ const TestComponent = (): ReactElement => {
|
|
|
33
34
|
);
|
|
34
35
|
};
|
|
35
36
|
|
|
36
|
-
describe(
|
|
37
|
-
test(
|
|
37
|
+
describe('usePrevious', () => {
|
|
38
|
+
test('usePrevious', async () => {
|
|
38
39
|
render(<TestComponent />);
|
|
39
|
-
const button = await screen.findByText(
|
|
40
|
+
const button = await screen.findByText('Change value');
|
|
40
41
|
|
|
41
42
|
expect(extPrevious).toBeUndefined();
|
|
42
43
|
|
package/src/lui/reactUtils.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useEffect, useRef } from
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Track previous values of states.
|
|
5
5
|
*
|
|
6
6
|
* @param value Value to track.
|
|
7
7
|
*/
|
|
8
|
-
export const usePrevious = <T
|
|
8
|
+
export const usePrevious = <T,>(value: T): T | undefined => {
|
|
9
9
|
const ref = useRef<T>();
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
ref.current = value;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { useCallback, useRef, useState } from
|
|
1
|
+
import { useCallback, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useTimeoutHook } from
|
|
3
|
+
import { useTimeoutHook } from './timeoutHook';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Defers state change up to a minimum time since last state change.
|
|
7
7
|
*/
|
|
8
|
-
export const useStateDeferred = <T
|
|
9
|
-
initialValue: T,
|
|
10
|
-
): [T, (v: T) => void, (v: T, w: number) => void] => {
|
|
8
|
+
export const useStateDeferred = <T,>(initialValue: T): [T, (v: T) => void, (v: T, w: number) => void] => {
|
|
11
9
|
const startTime = useRef<number>(0);
|
|
12
10
|
const timeoutHook = useTimeoutHook();
|
|
13
11
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { render } from
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
|
|
2
3
|
|
|
3
|
-
import { useTimeoutHook } from
|
|
4
|
+
import { useTimeoutHook } from './timeoutHook';
|
|
4
5
|
|
|
5
|
-
describe(
|
|
6
|
+
describe('useTimeoutHook', () => {
|
|
6
7
|
beforeEach(() => {
|
|
7
|
-
|
|
8
|
+
vi.useFakeTimers();
|
|
8
9
|
});
|
|
9
10
|
|
|
10
11
|
afterEach(() => {
|
|
11
|
-
|
|
12
|
+
vi.useRealTimers();
|
|
12
13
|
});
|
|
13
14
|
|
|
14
15
|
const TestComponent = (props: { callback: () => void; repeat?: number }) => {
|
|
@@ -19,21 +20,21 @@ describe("useTimeoutHook", () => {
|
|
|
19
20
|
return <div />;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
test(
|
|
23
|
-
const callback =
|
|
23
|
+
test('invokes on timeout', () => {
|
|
24
|
+
const callback = vi.fn();
|
|
24
25
|
|
|
25
26
|
render(<TestComponent callback={callback} />);
|
|
26
27
|
expect(callback).toHaveBeenCalledTimes(0);
|
|
27
|
-
|
|
28
|
+
vi.runAllTimers();
|
|
28
29
|
expect(callback).toHaveBeenCalledTimes(1);
|
|
29
30
|
});
|
|
30
31
|
|
|
31
|
-
test(
|
|
32
|
-
const callback =
|
|
32
|
+
test('invokes once on double invocation', () => {
|
|
33
|
+
const callback = vi.fn();
|
|
33
34
|
|
|
34
35
|
render(<TestComponent callback={callback} repeat={2} />);
|
|
35
36
|
expect(callback).toHaveBeenCalledTimes(0);
|
|
36
|
-
|
|
37
|
+
vi.runAllTimers();
|
|
37
38
|
expect(callback).toHaveBeenCalledTimes(1);
|
|
38
39
|
});
|
|
39
40
|
});
|
package/src/lui/timeoutHook.tsx
CHANGED
package/src/react-app-env.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/// <reference types="react-scripts" />
|
|
1
|
+
/// <reference types="react-scripts" />
|