@linzjs/step-ag-grid 8.0.0 → 8.1.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.
@@ -0,0 +1,55 @@
1
+ import "@linzjs/lui/dist/scss/base.scss";
2
+ import "@linzjs/lui/dist/fonts";
3
+
4
+ import { ComponentMeta, ComponentStory } from "@storybook/react/dist/ts3.9/client/preview/types-6-3";
5
+ import { useRef } from "react";
6
+ import {
7
+ GridFormPopoverMenu,
8
+ GridFormPopoverMenuProps,
9
+ PopoutMenuSeparator,
10
+ } from "../../../components/gridForm/GridFormPopoverMenu";
11
+ import { GridContextProvider } from "../../../contexts/GridContextProvider";
12
+ import { GridPopoverContext, GridPopoverContextType } from "contexts/GridPopoverContext";
13
+ import { GridBaseRow } from "../../../components/Grid";
14
+
15
+ export default {
16
+ title: "GridForm / Testing",
17
+ component: GridFormPopoverMenu,
18
+ args: {},
19
+ } as ComponentMeta<typeof GridFormPopoverMenu>;
20
+
21
+ const Template: ComponentStory<typeof GridFormPopoverMenu> = (props) => {
22
+ const configs: [string, GridFormPopoverMenuProps<GridBaseRow>][] = [
23
+ ["No options", { options: async () => [] }],
24
+ [
25
+ "Enabled/disabled/hidden and divider",
26
+ {
27
+ options: async () => [
28
+ { label: "Enabled", value: 1 },
29
+ PopoutMenuSeparator,
30
+ { label: "Disabled", value: 0, disabled: true },
31
+ { label: "ERROR! this should be hidden", value: 3, hidden: true },
32
+ ],
33
+ },
34
+ ],
35
+ ];
36
+ // eslint-disable-next-line react-hooks/rules-of-hooks
37
+ const anchorRefs = configs.map(() => useRef<HTMLHeadingElement>(null));
38
+
39
+ return (
40
+ <div className={"react-menu-inline-test"}>
41
+ <GridContextProvider>
42
+ {configs.map((config, index) => (
43
+ <>
44
+ <h6 ref={anchorRefs[index]}>{config[0]}</h6>
45
+ <GridPopoverContext.Provider value={{ anchorRef: anchorRefs[index] } as any as GridPopoverContextType<any>}>
46
+ <GridFormPopoverMenu {...props} {...config[1]} />
47
+ </GridPopoverContext.Provider>
48
+ </>
49
+ ))}
50
+ </GridContextProvider>
51
+ </div>
52
+ );
53
+ };
54
+
55
+ export const GridFormPopoverMenu_ = Template.bind({});
@@ -1,3 +0,0 @@
1
- .react-menu-inline-test .szh-menu-container, .react-menu-inline-test .szh-menu {
2
- position: static !important;
3
- }