@equinor/fusion-framework-react-components-bookmark 0.1.15 → 0.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/CHANGELOG.md +53 -0
- package/LICENSE +21 -0
- package/dist/esm/components/Bookmark.js +5 -5
- package/dist/esm/components/Bookmark.js.map +1 -1
- package/dist/esm/components/create-bookmark/CreateBookmark.js +1 -1
- package/dist/esm/components/create-bookmark/CreateBookmark.js.map +1 -1
- package/dist/esm/components/edit-bookmark/EditBookmark.js +17 -18
- package/dist/esm/components/edit-bookmark/EditBookmark.js.map +1 -1
- package/dist/esm/components/filter/Filter.js +7 -4
- package/dist/esm/components/filter/Filter.js.map +1 -1
- package/dist/esm/components/import-bookmark/ImportBookmark.js +4 -4
- package/dist/esm/components/import-bookmark/ImportBookmark.js.map +1 -1
- package/dist/esm/components/row/Row.js +6 -6
- package/dist/esm/components/row/Row.js.map +1 -1
- package/dist/esm/components/section/Section.js +20 -21
- package/dist/esm/components/section/Section.js.map +1 -1
- package/dist/esm/components/shared/SharedIcon.js +16 -14
- package/dist/esm/components/shared/SharedIcon.js.map +1 -1
- package/dist/esm/hooks/useBookmarkGrouping.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/components/Bookmark.d.ts +1 -1
- package/dist/types/components/BookmarkProvider.d.ts +1 -1
- package/dist/types/components/create-bookmark/CreateBookmark.d.ts +3 -3
- package/dist/types/components/edit-bookmark/EditBookmark.d.ts +4 -4
- package/dist/types/components/filter/Filter.d.ts +6 -6
- package/dist/types/components/import-bookmark/ImportBookmark.d.ts +1 -1
- package/dist/types/components/loading/Loading.d.ts +1 -1
- package/dist/types/components/row/MoreMenu.d.ts +5 -5
- package/dist/types/components/row/Row.d.ts +7 -7
- package/dist/types/components/section/Section.d.ts +3 -3
- package/dist/types/components/sectionList/SectionList.d.ts +2 -2
- package/dist/types/components/shared/SharedIcon.d.ts +3 -3
- package/dist/types/hooks/useBookmarkGrouping.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +53 -57
- package/src/components/Bookmark.tsx +9 -8
- package/src/components/create-bookmark/CreateBookmark.tsx +4 -3
- package/src/components/edit-bookmark/EditBookmark.tsx +26 -26
- package/src/components/filter/Filter.tsx +20 -10
- package/src/components/import-bookmark/ImportBookmark.tsx +6 -5
- package/src/components/row/MoreMenu.tsx +4 -4
- package/src/components/row/Row.tsx +17 -15
- package/src/components/section/Section.tsx +24 -26
- package/src/components/sectionList/SectionList.tsx +6 -6
- package/src/components/shared/SharedIcon.tsx +22 -20
- package/src/hooks/useBookmarkGrouping.ts +2 -2
- package/src/version.ts +1 -1
- package/tsconfig.json +1 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const Bookmark: () => JSX.Element;
|
|
1
|
+
export declare const Bookmark: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default Bookmark;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FrameworkEvent, FrameworkEventInit } from '@equinor/fusion-framework-module-event';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
export declare const BookmarkProvider: ({ children }: PropsWithChildren<unknown>) => JSX.Element;
|
|
3
|
+
export declare const BookmarkProvider: ({ children }: PropsWithChildren<unknown>) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare module '@equinor/fusion-framework-module-event' {
|
|
5
5
|
interface FrameworkEventMap {
|
|
6
6
|
onBookmarkOpen: FrameworkEvent<FrameworkEventInit<boolean, unknown>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const CreateBookmarkModal: ({ isOpen, onClose, }: {
|
|
2
|
-
isOpen: boolean;
|
|
3
|
-
onClose: (b: boolean) => void;
|
|
4
|
-
}) => JSX.Element;
|
|
2
|
+
readonly isOpen: boolean;
|
|
3
|
+
readonly onClose: (b: boolean) => void;
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const EditBookmarkModal: ({ isOpen, onClose, bookmarkId, }: {
|
|
2
|
-
isOpen: boolean;
|
|
3
|
-
onClose: (b: boolean) => void;
|
|
4
|
-
bookmarkId?: string | undefined;
|
|
5
|
-
}) => JSX.Element;
|
|
2
|
+
readonly isOpen: boolean;
|
|
3
|
+
readonly onClose: (b: boolean) => void;
|
|
4
|
+
readonly bookmarkId?: string | undefined;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { GroupingKeys } from '../../hooks/useBookmarkGrouping';
|
|
2
2
|
type BookmarkFilterProps = {
|
|
3
|
-
searchText: string;
|
|
4
|
-
setSearchText: (newVal: string | null) => void;
|
|
5
|
-
setGroupBy: (groupBy: GroupingKeys) => void;
|
|
6
|
-
groupingModes: string[];
|
|
7
|
-
groupBy: string;
|
|
3
|
+
readonly searchText: string;
|
|
4
|
+
readonly setSearchText: (newVal: string | null) => void;
|
|
5
|
+
readonly setGroupBy: (groupBy: GroupingKeys) => void;
|
|
6
|
+
readonly groupingModes: string[];
|
|
7
|
+
readonly groupBy: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const BookmarkFilter: ({ searchText, setGroupBy, setSearchText, groupingModes, groupBy, }: BookmarkFilterProps) => JSX.Element;
|
|
9
|
+
export declare const BookmarkFilter: ({ searchText, setGroupBy, setSearchText, groupingModes, groupBy, }: BookmarkFilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ImportBookmarkModal: () => JSX.Element;
|
|
1
|
+
export declare const ImportBookmarkModal: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const Loading: () => JSX.Element;
|
|
1
|
+
export declare const Loading: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
2
|
import { MenuOption } from './Row';
|
|
3
3
|
type MenuProps = {
|
|
4
|
-
pRef: MutableRefObject<HTMLElement | null>;
|
|
5
|
-
onClose: VoidFunction;
|
|
6
|
-
open: boolean;
|
|
7
|
-
options: MenuOption[];
|
|
4
|
+
readonly pRef: MutableRefObject<HTMLElement | null>;
|
|
5
|
+
readonly onClose: VoidFunction;
|
|
6
|
+
readonly open: boolean;
|
|
7
|
+
readonly options: MenuOption[];
|
|
8
8
|
};
|
|
9
|
-
export declare const MoreMenu: ({ pRef, onClose, open, options }: MenuProps) => JSX.Element;
|
|
9
|
+
export declare const MoreMenu: ({ pRef, onClose, open, options }: MenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -6,12 +6,12 @@ export type MenuOption = {
|
|
|
6
6
|
Icon?: ReactNode;
|
|
7
7
|
};
|
|
8
8
|
type RowProps = {
|
|
9
|
-
name: string;
|
|
10
|
-
id: string;
|
|
11
|
-
menuOpen: boolean;
|
|
12
|
-
onMenuOpen: (id: string) => void;
|
|
13
|
-
menuOptions: MenuOption[];
|
|
14
|
-
children?: ReactNode;
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly menuOpen: boolean;
|
|
12
|
+
readonly onMenuOpen: (id: string) => void;
|
|
13
|
+
readonly menuOptions: MenuOption[];
|
|
14
|
+
readonly children?: ReactNode;
|
|
15
15
|
};
|
|
16
|
-
export declare const Row: ({ name, menuOptions, children, id, menuOpen, onMenuOpen }: RowProps) => JSX.Element;
|
|
16
|
+
export declare const Row: ({ name, menuOptions, children, id, menuOpen, onMenuOpen }: RowProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
type SectionProps = {
|
|
3
|
-
name: string;
|
|
4
|
-
children: ReactNode;
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly children: ReactNode;
|
|
5
5
|
};
|
|
6
|
-
export declare const Section: ({ children, name }: SectionProps) => JSX.Element;
|
|
6
|
+
export declare const Section: ({ children, name }: SectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useBookmarkGrouping } from '../../hooks';
|
|
2
2
|
type SectionListProps = {
|
|
3
|
-
bookmarkGroups: ReturnType<typeof useBookmarkGrouping>['bookmarkGroups'];
|
|
3
|
+
readonly bookmarkGroups: ReturnType<typeof useBookmarkGrouping>['bookmarkGroups'];
|
|
4
4
|
};
|
|
5
|
-
export declare const SectionList: ({ bookmarkGroups }: SectionListProps) => JSX.Element;
|
|
5
|
+
export declare const SectionList: ({ bookmarkGroups }: SectionListProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type SharedIconProps = {
|
|
2
|
-
createdBy: string;
|
|
3
|
-
createdById: string;
|
|
2
|
+
readonly createdBy: string;
|
|
3
|
+
readonly createdById: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const SharedIcon: ({ createdBy, createdById }: SharedIconProps) => JSX.Element;
|
|
5
|
+
export declare const SharedIcon: ({ createdBy, createdById }: SharedIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -9,6 +9,6 @@ export declare const useBookmarkGrouping: (bookmarks?: Bookmark[]) => {
|
|
|
9
9
|
groupingProperty: string;
|
|
10
10
|
values: Bookmark<unknown>[];
|
|
11
11
|
}[];
|
|
12
|
-
groupingModes: Record<GroupingKeys, (
|
|
12
|
+
groupingModes: Record<GroupingKeys, (_item: Bookmark) => string>;
|
|
13
13
|
groupByKey: GroupingKeys;
|
|
14
14
|
};
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.1
|
|
1
|
+
export declare const version = "0.2.1";
|
package/package.json
CHANGED
|
@@ -1,59 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"@types/react": "^17.0.0 || ^18.0.0",
|
|
51
|
-
"react": "^17.0.0 || ^18.0.0",
|
|
52
|
-
"styled-components": "^5.3.9"
|
|
53
|
-
},
|
|
54
|
-
"peerDependenciesMeta": {
|
|
55
|
-
"@types/react": {
|
|
56
|
-
"optional": true
|
|
57
|
-
}
|
|
2
|
+
"name": "@equinor/fusion-framework-react-components-bookmark",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/esm/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist/esm/index.js"
|
|
8
|
+
},
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"author": "",
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/equinor/fusion-framework.git",
|
|
19
|
+
"directory": "packages/react/components/bookmark"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@equinor/fusion-framework-react": "^5.2.5",
|
|
23
|
+
"@equinor/fusion-framework-react-module-bookmark": "^2.0.15"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@equinor/eds-core-react": "^0.32.4",
|
|
27
|
+
"@equinor/eds-icons": "^0.19.3",
|
|
28
|
+
"@equinor/eds-tokens": "^0.9.2",
|
|
29
|
+
"@equinor/eds-utils": "^0.8.1",
|
|
30
|
+
"@types/react": "^18.2.20",
|
|
31
|
+
"react": "^18.2.0",
|
|
32
|
+
"styled-components": "^6.0.7",
|
|
33
|
+
"typescript": "^5.1.3",
|
|
34
|
+
"@equinor/fusion-framework-module-app": "^5.2.3",
|
|
35
|
+
"@equinor/fusion-framework-module-bookmark": "^1.0.9",
|
|
36
|
+
"@equinor/fusion-framework-module-event": "^4.0.4"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@equinor/eds-core-react": "^0.30.0",
|
|
40
|
+
"@equinor/eds-icons": "^0.19.3",
|
|
41
|
+
"@equinor/eds-tokens": "^0.9.2",
|
|
42
|
+
"@equinor/eds-utils": "^0.8.1",
|
|
43
|
+
"@types/react": "^17.0.0 || ^18.0.0",
|
|
44
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
45
|
+
"styled-components": "^6.0.7"
|
|
46
|
+
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"@types/react": {
|
|
49
|
+
"optional": true
|
|
58
50
|
}
|
|
59
|
-
}
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc -b"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -2,12 +2,13 @@ import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
|
|
|
2
2
|
import { useBookmarkGrouping } from '../hooks';
|
|
3
3
|
import { BookmarkFilter } from './filter/Filter';
|
|
4
4
|
import { SectionList } from './sectionList/SectionList';
|
|
5
|
-
import { css } from '@emotion/css';
|
|
6
5
|
import { useEffect } from 'react';
|
|
7
6
|
|
|
8
7
|
import { Icon } from '@equinor/eds-core-react';
|
|
9
8
|
import { chevron_down, chevron_right, share, more_vertical, add } from '@equinor/eds-icons';
|
|
10
9
|
|
|
10
|
+
import styled from 'styled-components';
|
|
11
|
+
|
|
11
12
|
Icon.add({
|
|
12
13
|
chevron_down,
|
|
13
14
|
chevron_right,
|
|
@@ -16,14 +17,14 @@ Icon.add({
|
|
|
16
17
|
add,
|
|
17
18
|
});
|
|
18
19
|
|
|
19
|
-
const
|
|
20
|
-
|
|
20
|
+
const Styled = {
|
|
21
|
+
Wrapper: styled.div`
|
|
21
22
|
padding-right: 1rem;
|
|
22
23
|
display: flex;
|
|
23
24
|
flex-direction: column;
|
|
24
25
|
gap: 1rem;
|
|
25
26
|
`,
|
|
26
|
-
|
|
27
|
+
List: styled.div`
|
|
27
28
|
overflow-y: auto;
|
|
28
29
|
overflow-x: hidden;
|
|
29
30
|
height: calc((100vh - 85px) - 3rem);
|
|
@@ -41,7 +42,7 @@ export const Bookmark = () => {
|
|
|
41
42
|
useBookmarkGrouping(bookmarks);
|
|
42
43
|
|
|
43
44
|
return (
|
|
44
|
-
<
|
|
45
|
+
<Styled.Wrapper>
|
|
45
46
|
<BookmarkFilter
|
|
46
47
|
groupBy={groupByKey}
|
|
47
48
|
groupingModes={Object.keys(groupingModes)}
|
|
@@ -49,10 +50,10 @@ export const Bookmark = () => {
|
|
|
49
50
|
setGroupBy={setGroupBy}
|
|
50
51
|
setSearchText={setSearchText}
|
|
51
52
|
/>
|
|
52
|
-
<
|
|
53
|
+
<Styled.List>
|
|
53
54
|
<SectionList bookmarkGroups={bookmarkGroups} />
|
|
54
|
-
</
|
|
55
|
-
</
|
|
55
|
+
</Styled.List>
|
|
56
|
+
</Styled.Wrapper>
|
|
56
57
|
);
|
|
57
58
|
};
|
|
58
59
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
1
|
import { Button, Checkbox, Dialog, Input, Label, TextField } from '@equinor/eds-core-react';
|
|
3
2
|
import type { AppModule } from '@equinor/fusion-framework-module-app';
|
|
4
3
|
import { useFramework } from '@equinor/fusion-framework-react';
|
|
5
4
|
import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
|
|
6
5
|
import { ChangeEvent, useState } from 'react';
|
|
7
6
|
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
// TODO
|
|
8
9
|
const StyledContent = styled(Dialog.Content)`
|
|
9
10
|
display: flex;
|
|
10
11
|
flex-direction: column;
|
|
@@ -15,8 +16,8 @@ export const CreateBookmarkModal = ({
|
|
|
15
16
|
isOpen,
|
|
16
17
|
onClose,
|
|
17
18
|
}: {
|
|
18
|
-
isOpen: boolean;
|
|
19
|
-
onClose: (b: boolean) => void;
|
|
19
|
+
readonly isOpen: boolean;
|
|
20
|
+
readonly onClose: (b: boolean) => void;
|
|
20
21
|
}) => {
|
|
21
22
|
const [state, setState] = useState<{ name: string; description: string; isShared: boolean }>({
|
|
22
23
|
name: '',
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ChangeEvent, useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
3
|
import { Button, Checkbox, Dialog, Input, Label, TextField } from '@equinor/eds-core-react';
|
|
4
4
|
import type { AppModule } from '@equinor/fusion-framework-module-app';
|
|
5
5
|
// TODO - export from `@equinor/fusion-framework-react-module-bookmark`
|
|
6
6
|
import type { PatchBookmark } from '@equinor/fusion-framework-module-bookmark';
|
|
7
7
|
import { useFramework } from '@equinor/fusion-framework-react';
|
|
8
8
|
import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
|
|
9
|
-
import { ChangeEvent, useEffect, useState } from 'react';
|
|
10
9
|
import { appendBookmarkIdToUrl } from '../../utils/append-bookmark-to-uri';
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
gap: 1rem;
|
|
16
|
-
`;
|
|
17
|
-
const StyledDialog = styled(Dialog)`
|
|
18
|
-
width: 500px;
|
|
19
|
-
`;
|
|
11
|
+
import styled from 'styled-components';
|
|
20
12
|
|
|
21
|
-
const
|
|
22
|
-
|
|
13
|
+
const Styled = {
|
|
14
|
+
Dialog: styled(Dialog)`
|
|
15
|
+
width: 500px;
|
|
16
|
+
`,
|
|
17
|
+
DialogContent: styled(Dialog.Content)`
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: 1rem;
|
|
21
|
+
`,
|
|
22
|
+
CheckboxWrapper: styled.div`
|
|
23
23
|
display: flex;
|
|
24
24
|
gap: 1rem;
|
|
25
25
|
`,
|
|
26
|
-
|
|
27
|
-
display:
|
|
26
|
+
Actions: styled.div`
|
|
27
|
+
display: flex;
|
|
28
28
|
gap: 0.2em;
|
|
29
29
|
`,
|
|
30
30
|
};
|
|
@@ -34,9 +34,9 @@ export const EditBookmarkModal = ({
|
|
|
34
34
|
onClose,
|
|
35
35
|
bookmarkId,
|
|
36
36
|
}: {
|
|
37
|
-
isOpen: boolean;
|
|
38
|
-
onClose: (b: boolean) => void;
|
|
39
|
-
bookmarkId?: string;
|
|
37
|
+
readonly isOpen: boolean;
|
|
38
|
+
readonly onClose: (b: boolean) => void;
|
|
39
|
+
readonly bookmarkId?: string;
|
|
40
40
|
}) => {
|
|
41
41
|
const [state, setState] = useState<PatchBookmark>({
|
|
42
42
|
id: '',
|
|
@@ -61,9 +61,9 @@ export const EditBookmarkModal = ({
|
|
|
61
61
|
}, [bookmarkId, bookmarks]);
|
|
62
62
|
|
|
63
63
|
return (
|
|
64
|
-
<
|
|
64
|
+
<Styled.Dialog open={isOpen}>
|
|
65
65
|
<Dialog.Header>Edit bookmark</Dialog.Header>
|
|
66
|
-
<
|
|
66
|
+
<Styled.DialogContent>
|
|
67
67
|
<div>
|
|
68
68
|
<Label htmlFor="name" label="Name" />
|
|
69
69
|
<Input
|
|
@@ -93,7 +93,7 @@ export const EditBookmarkModal = ({
|
|
|
93
93
|
<Input readOnly={true} value={current?.manifest?.name || ''} />
|
|
94
94
|
</div>
|
|
95
95
|
|
|
96
|
-
<
|
|
96
|
+
<Styled.CheckboxWrapper>
|
|
97
97
|
<Checkbox
|
|
98
98
|
label="Is Shared"
|
|
99
99
|
checked={state.isShared}
|
|
@@ -113,10 +113,10 @@ export const EditBookmarkModal = ({
|
|
|
113
113
|
setUpdatePayload((s) => !s);
|
|
114
114
|
}}
|
|
115
115
|
/>
|
|
116
|
-
</
|
|
117
|
-
</
|
|
116
|
+
</Styled.CheckboxWrapper>
|
|
117
|
+
</Styled.DialogContent>
|
|
118
118
|
<Dialog.Actions>
|
|
119
|
-
<
|
|
119
|
+
<Styled.Actions>
|
|
120
120
|
<Button onClick={() => onClose(false)} variant="ghost">
|
|
121
121
|
Cancel
|
|
122
122
|
</Button>
|
|
@@ -130,8 +130,8 @@ export const EditBookmarkModal = ({
|
|
|
130
130
|
>
|
|
131
131
|
Save
|
|
132
132
|
</Button>
|
|
133
|
-
</
|
|
133
|
+
</Styled.Actions>
|
|
134
134
|
</Dialog.Actions>
|
|
135
|
-
</
|
|
135
|
+
</Styled.Dialog>
|
|
136
136
|
);
|
|
137
137
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { css } from '@emotion/css';
|
|
2
1
|
import { Search, Autocomplete } from '@equinor/eds-core-react';
|
|
3
2
|
import { GroupingKeys } from '../../hooks/useBookmarkGrouping';
|
|
4
3
|
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
|
|
5
6
|
type BookmarkFilterProps = {
|
|
6
|
-
searchText: string;
|
|
7
|
-
setSearchText: (newVal: string | null) => void;
|
|
8
|
-
setGroupBy: (groupBy: GroupingKeys) => void;
|
|
9
|
-
groupingModes: string[];
|
|
10
|
-
groupBy: string;
|
|
7
|
+
readonly searchText: string;
|
|
8
|
+
readonly setSearchText: (newVal: string | null) => void;
|
|
9
|
+
readonly setGroupBy: (groupBy: GroupingKeys) => void;
|
|
10
|
+
readonly groupingModes: string[];
|
|
11
|
+
readonly groupBy: string;
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
const
|
|
14
|
-
|
|
14
|
+
const Styled = {
|
|
15
|
+
Root: styled.div`
|
|
15
16
|
display: flex;
|
|
16
17
|
align-items: center;
|
|
17
18
|
justify-content: space-between;
|
|
@@ -26,7 +27,16 @@ export const BookmarkFilter = ({
|
|
|
26
27
|
groupBy,
|
|
27
28
|
}: BookmarkFilterProps) => {
|
|
28
29
|
return (
|
|
29
|
-
<
|
|
30
|
+
<Search
|
|
31
|
+
placeholder="Search in my bookmarks"
|
|
32
|
+
value={searchText ?? ''}
|
|
33
|
+
onChange={(e) => {
|
|
34
|
+
setSearchText(e.currentTarget.value.length ? e.currentTarget.value : null);
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
return (
|
|
39
|
+
<Styled.Root>
|
|
30
40
|
<Search
|
|
31
41
|
placeholder="Search in my bookmarks"
|
|
32
42
|
value={searchText ?? ''}
|
|
@@ -43,6 +53,6 @@ export const BookmarkFilter = ({
|
|
|
43
53
|
onOptionsChange={(changes) => setGroupBy(changes.selectedItems[0] as GroupingKeys)}
|
|
44
54
|
label={''}
|
|
45
55
|
/>
|
|
46
|
-
</
|
|
56
|
+
</Styled.Root>
|
|
47
57
|
);
|
|
48
58
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { css } from '@emotion/css';
|
|
2
1
|
import { Button, Dialog } from '@equinor/eds-core-react';
|
|
3
2
|
import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
|
|
4
3
|
import { useEffect, useState } from 'react';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
|
|
7
|
+
const Styled = {
|
|
8
|
+
Actions: styled.div`
|
|
8
9
|
display: flex;
|
|
9
10
|
gap: 1rem;
|
|
10
11
|
`,
|
|
@@ -31,7 +32,7 @@ export const ImportBookmarkModal = () => {
|
|
|
31
32
|
<p>Would you like to import it?</p>
|
|
32
33
|
</Dialog.Content>
|
|
33
34
|
<Dialog.Actions>
|
|
34
|
-
<
|
|
35
|
+
<Styled.Actions>
|
|
35
36
|
<Button
|
|
36
37
|
onClick={() => setIsOpen(false)}
|
|
37
38
|
variant={'ghost'}
|
|
@@ -49,7 +50,7 @@ export const ImportBookmarkModal = () => {
|
|
|
49
50
|
>
|
|
50
51
|
Import
|
|
51
52
|
</Button>
|
|
52
|
-
</
|
|
53
|
+
</Styled.Actions>
|
|
53
54
|
</Dialog.Actions>
|
|
54
55
|
</Dialog>
|
|
55
56
|
);
|
|
@@ -3,10 +3,10 @@ import { MutableRefObject } from 'react';
|
|
|
3
3
|
import { MenuOption } from './Row';
|
|
4
4
|
|
|
5
5
|
type MenuProps = {
|
|
6
|
-
pRef: MutableRefObject<HTMLElement | null>;
|
|
7
|
-
onClose: VoidFunction;
|
|
8
|
-
open: boolean;
|
|
9
|
-
options: MenuOption[];
|
|
6
|
+
readonly pRef: MutableRefObject<HTMLElement | null>;
|
|
7
|
+
readonly onClose: VoidFunction;
|
|
8
|
+
readonly open: boolean;
|
|
9
|
+
readonly options: MenuOption[];
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export const MoreMenu = ({ pRef, onClose, open, options }: MenuProps) => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { css } from '@emotion/css';
|
|
2
1
|
import { Icon, Typography } from '@equinor/eds-core-react';
|
|
3
2
|
import { tokens } from '@equinor/eds-tokens';
|
|
4
3
|
import { useOutsideClick } from '@equinor/eds-utils';
|
|
@@ -6,6 +5,8 @@ import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
|
|
|
6
5
|
import { MutableRefObject, ReactNode, useRef } from 'react';
|
|
7
6
|
import { MoreMenu } from './MoreMenu';
|
|
8
7
|
|
|
8
|
+
import styled from 'styled-components';
|
|
9
|
+
|
|
9
10
|
export type MenuOption = {
|
|
10
11
|
name: string;
|
|
11
12
|
disabled: boolean;
|
|
@@ -14,22 +15,22 @@ export type MenuOption = {
|
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
type RowProps = {
|
|
17
|
-
name: string;
|
|
18
|
-
id: string;
|
|
19
|
-
menuOpen: boolean;
|
|
20
|
-
onMenuOpen: (id: string) => void;
|
|
21
|
-
menuOptions: MenuOption[];
|
|
22
|
-
children?: ReactNode;
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly menuOpen: boolean;
|
|
21
|
+
readonly onMenuOpen: (id: string) => void;
|
|
22
|
+
readonly menuOptions: MenuOption[];
|
|
23
|
+
readonly children?: ReactNode;
|
|
23
24
|
};
|
|
24
25
|
|
|
25
|
-
const
|
|
26
|
-
|
|
26
|
+
const Styled = {
|
|
27
|
+
Icons: styled.div`
|
|
27
28
|
display: flex;
|
|
28
29
|
flex-direction: row;
|
|
29
30
|
gap: 0.2em;
|
|
30
31
|
align-items: center;
|
|
31
32
|
`,
|
|
32
|
-
|
|
33
|
+
ListItem: styled.div`
|
|
33
34
|
cursor: pointer;
|
|
34
35
|
&:hover {
|
|
35
36
|
background-color: ${tokens.colors.ui.background__light.hex};
|
|
@@ -51,9 +52,10 @@ export const Row = ({ name, menuOptions, children, id, menuOpen, onMenuOpen }: R
|
|
|
51
52
|
|
|
52
53
|
useOutsideClick(pRef.current, () => onMenuOpen(''));
|
|
53
54
|
|
|
55
|
+
// TODO: @noggling fix this
|
|
54
56
|
return (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
/* eslint-disable-next-line styled-components-a11y/click-events-have-key-events, styled-components-a11y/no-static-element-interactions*/
|
|
58
|
+
<Styled.ListItem
|
|
57
59
|
onClick={(e) => {
|
|
58
60
|
e.preventDefault();
|
|
59
61
|
e.stopPropagation();
|
|
@@ -61,7 +63,7 @@ export const Row = ({ name, menuOptions, children, id, menuOpen, onMenuOpen }: R
|
|
|
61
63
|
}}
|
|
62
64
|
>
|
|
63
65
|
<Typography>{name}</Typography>
|
|
64
|
-
<
|
|
66
|
+
<Styled.Icons>
|
|
65
67
|
{children}
|
|
66
68
|
{!!menuOptions?.length && (
|
|
67
69
|
<Icon
|
|
@@ -84,7 +86,7 @@ export const Row = ({ name, menuOptions, children, id, menuOpen, onMenuOpen }: R
|
|
|
84
86
|
}}
|
|
85
87
|
pRef={pRef}
|
|
86
88
|
/>
|
|
87
|
-
</
|
|
88
|
-
</
|
|
89
|
+
</Styled.Icons>
|
|
90
|
+
</Styled.ListItem>
|
|
89
91
|
);
|
|
90
92
|
};
|