@abyss-project/commons-front-core 8.3.0 → 9.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/catalog/pages/Menu.tsx
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import Button from '@mui/material/Button';
|
|
3
|
-
import ContentCopyOutlined from '@mui/icons-material/ContentCopyOutlined';
|
|
4
|
-
import DeleteOutlineOutlined from '@mui/icons-material/DeleteOutlineOutlined';
|
|
5
|
-
import DriveFileMoveOutlined from '@mui/icons-material/DriveFileMoveOutlined';
|
|
6
|
-
import EditOutlined from '@mui/icons-material/EditOutlined';
|
|
7
|
-
import IosShareOutlined from '@mui/icons-material/IosShareOutlined';
|
|
8
|
-
import LockOutlined from '@mui/icons-material/LockOutlined';
|
|
9
|
-
import MoreHorizRounded from '@mui/icons-material/MoreHorizRounded';
|
|
10
|
-
import {
|
|
11
|
-
Menu,
|
|
12
|
-
MenuItemTone,
|
|
13
|
-
MenuSeparator,
|
|
14
|
-
} from '../../src/components/layers/Menu/Menu';
|
|
15
|
-
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
16
|
-
|
|
17
|
-
export const MenuPage = () => {
|
|
18
|
-
const { log } = useEventLog();
|
|
19
|
-
const trigger = useRef<HTMLButtonElement>(null);
|
|
20
|
-
const [anchor, setAnchor] = useState<HTMLElement | null>(null);
|
|
21
|
-
|
|
22
|
-
// Opened on arrival, so the page shows the menu without a click.
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
setAnchor(trigger.current);
|
|
25
|
-
}, []);
|
|
26
|
-
|
|
27
|
-
const select = (action: string) => () => log(action);
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<Showcase
|
|
31
|
-
family="Couches"
|
|
32
|
-
name="Menu"
|
|
33
|
-
description="Menu d'actions : icône, description, raccourci, ton danger, entrées désactivées sautées par les flèches."
|
|
34
|
-
>
|
|
35
|
-
<Example title="Actions d'un fichier">
|
|
36
|
-
<Button
|
|
37
|
-
ref={trigger}
|
|
38
|
-
variant="outlined"
|
|
39
|
-
startIcon={<MoreHorizRounded />}
|
|
40
|
-
onClick={(event) => setAnchor(event.currentTarget)}
|
|
41
|
-
>
|
|
42
|
-
avis-imposition-2026.pdf
|
|
43
|
-
</Button>
|
|
44
|
-
</Example>
|
|
45
|
-
<LastEvent />
|
|
46
|
-
<Menu
|
|
47
|
-
anchorEl={anchor}
|
|
48
|
-
open={anchor !== null}
|
|
49
|
-
onClose={() => setAnchor(null)}
|
|
50
|
-
items={[
|
|
51
|
-
{
|
|
52
|
-
id: 'share',
|
|
53
|
-
label: 'Partager',
|
|
54
|
-
description: 'Lien ou invitation par courriel',
|
|
55
|
-
icon: <IosShareOutlined />,
|
|
56
|
-
shortcut: 'Ctrl+Maj+S',
|
|
57
|
-
onSelect: select('partager'),
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: 'rename',
|
|
61
|
-
label: 'Renommer',
|
|
62
|
-
icon: <EditOutlined />,
|
|
63
|
-
shortcut: 'F2',
|
|
64
|
-
onSelect: select('renommer'),
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
id: 'copy',
|
|
68
|
-
label: 'Copier le lien',
|
|
69
|
-
icon: <ContentCopyOutlined />,
|
|
70
|
-
shortcut: 'Ctrl+L',
|
|
71
|
-
onSelect: select('copier'),
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
id: 'move',
|
|
75
|
-
label: 'Déplacer',
|
|
76
|
-
icon: <DriveFileMoveOutlined />,
|
|
77
|
-
onSelect: select('déplacer'),
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
id: 'encrypt',
|
|
81
|
-
label: 'Déjà chiffré',
|
|
82
|
-
icon: <LockOutlined />,
|
|
83
|
-
disabled: true,
|
|
84
|
-
onSelect: select('chiffrer'),
|
|
85
|
-
},
|
|
86
|
-
MenuSeparator.Divider,
|
|
87
|
-
{
|
|
88
|
-
id: 'trash',
|
|
89
|
-
label: 'Mettre à la corbeille',
|
|
90
|
-
icon: <DeleteOutlineOutlined />,
|
|
91
|
-
tone: MenuItemTone.Danger,
|
|
92
|
-
shortcut: 'Suppr',
|
|
93
|
-
onSelect: select('corbeille'),
|
|
94
|
-
},
|
|
95
|
-
]}
|
|
96
|
-
/>
|
|
97
|
-
</Showcase>
|
|
98
|
-
);
|
|
99
|
-
};
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import Button from '@mui/material/Button';
|
|
3
|
+
import ContentCopyOutlined from '@mui/icons-material/ContentCopyOutlined';
|
|
4
|
+
import DeleteOutlineOutlined from '@mui/icons-material/DeleteOutlineOutlined';
|
|
5
|
+
import DriveFileMoveOutlined from '@mui/icons-material/DriveFileMoveOutlined';
|
|
6
|
+
import EditOutlined from '@mui/icons-material/EditOutlined';
|
|
7
|
+
import IosShareOutlined from '@mui/icons-material/IosShareOutlined';
|
|
8
|
+
import LockOutlined from '@mui/icons-material/LockOutlined';
|
|
9
|
+
import MoreHorizRounded from '@mui/icons-material/MoreHorizRounded';
|
|
10
|
+
import {
|
|
11
|
+
Menu,
|
|
12
|
+
MenuItemTone,
|
|
13
|
+
MenuSeparator,
|
|
14
|
+
} from '../../src/components/layers/Menu/Menu';
|
|
15
|
+
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
16
|
+
|
|
17
|
+
export const MenuPage = () => {
|
|
18
|
+
const { log } = useEventLog();
|
|
19
|
+
const trigger = useRef<HTMLButtonElement>(null);
|
|
20
|
+
const [anchor, setAnchor] = useState<HTMLElement | null>(null);
|
|
21
|
+
|
|
22
|
+
// Opened on arrival, so the page shows the menu without a click.
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
setAnchor(trigger.current);
|
|
25
|
+
}, []);
|
|
26
|
+
|
|
27
|
+
const select = (action: string) => () => log(action);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Showcase
|
|
31
|
+
family="Couches"
|
|
32
|
+
name="Menu"
|
|
33
|
+
description="Menu d'actions : icône, description, raccourci, ton danger, entrées désactivées sautées par les flèches."
|
|
34
|
+
>
|
|
35
|
+
<Example title="Actions d'un fichier">
|
|
36
|
+
<Button
|
|
37
|
+
ref={trigger}
|
|
38
|
+
variant="outlined"
|
|
39
|
+
startIcon={<MoreHorizRounded />}
|
|
40
|
+
onClick={(event) => setAnchor(event.currentTarget)}
|
|
41
|
+
>
|
|
42
|
+
avis-imposition-2026.pdf
|
|
43
|
+
</Button>
|
|
44
|
+
</Example>
|
|
45
|
+
<LastEvent />
|
|
46
|
+
<Menu
|
|
47
|
+
anchorEl={anchor}
|
|
48
|
+
open={anchor !== null}
|
|
49
|
+
onClose={() => setAnchor(null)}
|
|
50
|
+
items={[
|
|
51
|
+
{
|
|
52
|
+
id: 'share',
|
|
53
|
+
label: 'Partager',
|
|
54
|
+
description: 'Lien ou invitation par courriel',
|
|
55
|
+
icon: <IosShareOutlined />,
|
|
56
|
+
shortcut: 'Ctrl+Maj+S',
|
|
57
|
+
onSelect: select('partager'),
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'rename',
|
|
61
|
+
label: 'Renommer',
|
|
62
|
+
icon: <EditOutlined />,
|
|
63
|
+
shortcut: 'F2',
|
|
64
|
+
onSelect: select('renommer'),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'copy',
|
|
68
|
+
label: 'Copier le lien',
|
|
69
|
+
icon: <ContentCopyOutlined />,
|
|
70
|
+
shortcut: 'Ctrl+L',
|
|
71
|
+
onSelect: select('copier'),
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'move',
|
|
75
|
+
label: 'Déplacer',
|
|
76
|
+
icon: <DriveFileMoveOutlined />,
|
|
77
|
+
onSelect: select('déplacer'),
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'encrypt',
|
|
81
|
+
label: 'Déjà chiffré',
|
|
82
|
+
icon: <LockOutlined />,
|
|
83
|
+
disabled: true,
|
|
84
|
+
onSelect: select('chiffrer'),
|
|
85
|
+
},
|
|
86
|
+
MenuSeparator.Divider,
|
|
87
|
+
{
|
|
88
|
+
id: 'trash',
|
|
89
|
+
label: 'Mettre à la corbeille',
|
|
90
|
+
icon: <DeleteOutlineOutlined />,
|
|
91
|
+
tone: MenuItemTone.Danger,
|
|
92
|
+
shortcut: 'Suppr',
|
|
93
|
+
onSelect: select('corbeille'),
|
|
94
|
+
},
|
|
95
|
+
]}
|
|
96
|
+
/>
|
|
97
|
+
</Showcase>
|
|
98
|
+
);
|
|
99
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abyss-project/commons-front-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Front Core package of AbyssProject",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"react-is": "^18.0.0 || ^19.0.0",
|
|
81
81
|
"react-router-dom": "^6.15.0",
|
|
82
82
|
"zustand": "^5.0.0",
|
|
83
|
-
"@abyss-project/main": "
|
|
83
|
+
"@abyss-project/main": "16.0.0"
|
|
84
84
|
},
|
|
85
85
|
"peerDependenciesMeta": {
|
|
86
86
|
"@abyss-project/capacitor-auth": {
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"use-debounce": "^10.0.5",
|
|
131
131
|
"uuid": "^9.0.0",
|
|
132
132
|
"yup": "^0.32.11",
|
|
133
|
-
"@abyss-project/main": "
|
|
133
|
+
"@abyss-project/main": "16.0.0"
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
136
|
"@abyss-project/cloud": "^2.4.0",
|