cozy-ui 127.14.0 → 127.15.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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/react/ActionsMenu/Actions/locales/en.json +1 -0
- package/react/ActionsMenu/Actions/locales/fr.json +1 -0
- package/react/ActionsMenu/ActionsMenuButton.jsx +45 -0
- package/react/ContactsList/ContactCell.jsx +3 -39
- package/react/ContactsList/locales/en.json +1 -2
- package/react/ContactsList/locales/fr.json +1 -2
- package/transpiled/react/ActionsMenu/Actions/locales/withActionsLocales.js +2 -0
- package/transpiled/react/ActionsMenu/ActionsMenuButton.d.ts +5 -0
- package/transpiled/react/ActionsMenu/ActionsMenuButton.js +49 -0
- package/transpiled/react/ContactsList/ContactCell.js +5 -41
- package/transpiled/react/ContactsList/locales/withContactsListLocales.js +2 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [127.15.0](https://github.com/cozy/cozy-ui/compare/v127.14.0...v127.15.0) (2025-08-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **ActionsMenuButton:** Add component ([cd65a6c](https://github.com/cozy/cozy-ui/commit/cd65a6c))
|
|
7
|
+
|
|
1
8
|
# [127.14.0](https://github.com/cozy/cozy-ui/compare/v127.13.1...v127.14.0) (2025-08-21)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { useState, useRef } from 'react'
|
|
2
|
+
|
|
3
|
+
import ActionsMenu from '.'
|
|
4
|
+
import { locales } from './Actions/locales/withActionsLocales'
|
|
5
|
+
import Icon from '../Icon'
|
|
6
|
+
import IconButton from '../IconButton'
|
|
7
|
+
import DotsIcon from '../Icons/Dots'
|
|
8
|
+
import ListItemIcon from '../ListItemIcon'
|
|
9
|
+
import { useI18n, useExtendI18n } from '../providers/I18n'
|
|
10
|
+
|
|
11
|
+
const ActionsMenuButton = ({ docs, actions }) => {
|
|
12
|
+
const [showActions, setShowActions] = useState(false)
|
|
13
|
+
const actionsRef = useRef()
|
|
14
|
+
useExtendI18n(locales)
|
|
15
|
+
const { t } = useI18n()
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<ListItemIcon>
|
|
20
|
+
<IconButton
|
|
21
|
+
ref={actionsRef}
|
|
22
|
+
arial-label={t('menu')}
|
|
23
|
+
onClick={() => setShowActions(true)}
|
|
24
|
+
>
|
|
25
|
+
<Icon icon={DotsIcon} />
|
|
26
|
+
</IconButton>
|
|
27
|
+
</ListItemIcon>
|
|
28
|
+
{showActions && (
|
|
29
|
+
<ActionsMenu
|
|
30
|
+
open
|
|
31
|
+
ref={actionsRef}
|
|
32
|
+
docs={docs}
|
|
33
|
+
actions={actions}
|
|
34
|
+
anchorOrigin={{
|
|
35
|
+
vertical: 'bottom',
|
|
36
|
+
horizontal: 'right'
|
|
37
|
+
}}
|
|
38
|
+
onClose={() => setShowActions(false)}
|
|
39
|
+
/>
|
|
40
|
+
)}
|
|
41
|
+
</>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default ActionsMenuButton
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import ContactIdentity from './Contacts/ContactIdentity'
|
|
4
|
-
import
|
|
5
|
-
import ActionsMenu from '../ActionsMenu'
|
|
6
|
-
import Icon from '../Icon'
|
|
7
|
-
import IconButton from '../IconButton'
|
|
8
|
-
import DotsIcon from '../Icons/Dots'
|
|
9
|
-
import ListItemIcon from '../ListItemIcon'
|
|
10
|
-
import { useI18n, useExtendI18n } from '../providers/I18n'
|
|
4
|
+
import ActionsMenuButton from '../ActionsMenu/ActionsMenuButton'
|
|
11
5
|
|
|
12
6
|
const Cell = ({ row, column, cell, actions }) => {
|
|
13
|
-
const [showActions, setShowActions] = useState(false)
|
|
14
|
-
useExtendI18n(locales)
|
|
15
|
-
const { t } = useI18n()
|
|
16
|
-
const actionsRef = useRef()
|
|
17
|
-
|
|
18
7
|
if (column.id === 'fullname') {
|
|
19
8
|
return <ContactIdentity contact={row} noWrapper />
|
|
20
9
|
}
|
|
@@ -24,32 +13,7 @@ const Cell = ({ row, column, cell, actions }) => {
|
|
|
24
13
|
return null
|
|
25
14
|
}
|
|
26
15
|
|
|
27
|
-
return
|
|
28
|
-
<>
|
|
29
|
-
<ListItemIcon>
|
|
30
|
-
<IconButton
|
|
31
|
-
ref={actionsRef}
|
|
32
|
-
arial-label={t('menu')}
|
|
33
|
-
onClick={() => setShowActions(true)}
|
|
34
|
-
>
|
|
35
|
-
<Icon icon={DotsIcon} />
|
|
36
|
-
</IconButton>
|
|
37
|
-
</ListItemIcon>
|
|
38
|
-
{showActions && (
|
|
39
|
-
<ActionsMenu
|
|
40
|
-
open
|
|
41
|
-
ref={actionsRef}
|
|
42
|
-
docs={[row]}
|
|
43
|
-
actions={actions}
|
|
44
|
-
anchorOrigin={{
|
|
45
|
-
vertical: 'bottom',
|
|
46
|
-
horizontal: 'right'
|
|
47
|
-
}}
|
|
48
|
-
onClose={() => setShowActions(false)}
|
|
49
|
-
/>
|
|
50
|
-
)}
|
|
51
|
-
</>
|
|
52
|
-
)
|
|
16
|
+
return <ActionsMenuButton docs={[row]} actions={actions} />
|
|
53
17
|
}
|
|
54
18
|
|
|
55
19
|
return cell
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var en = {
|
|
2
|
+
menu: "Menu",
|
|
2
3
|
viewInContacts: "View in Cozy Contacts",
|
|
3
4
|
viewInDrive: "Open",
|
|
4
5
|
modify: "Modify",
|
|
@@ -27,6 +28,7 @@ var en = {
|
|
|
27
28
|
call: "Call"
|
|
28
29
|
};
|
|
29
30
|
var fr = {
|
|
31
|
+
menu: "Menu",
|
|
30
32
|
viewInContacts: "Voir dans Cozy Contacts",
|
|
31
33
|
viewInDrive: "Ouvrir",
|
|
32
34
|
modify: "Modifier",
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { useState, useRef } from 'react';
|
|
3
|
+
import ActionsMenu from "cozy-ui/transpiled/react/ActionsMenu";
|
|
4
|
+
import { locales } from "cozy-ui/transpiled/react/ActionsMenu/Actions/locales/withActionsLocales";
|
|
5
|
+
import Icon from "cozy-ui/transpiled/react/Icon";
|
|
6
|
+
import IconButton from "cozy-ui/transpiled/react/IconButton";
|
|
7
|
+
import DotsIcon from "cozy-ui/transpiled/react/Icons/Dots";
|
|
8
|
+
import ListItemIcon from "cozy-ui/transpiled/react/ListItemIcon";
|
|
9
|
+
import { useI18n, useExtendI18n } from "cozy-ui/transpiled/react/providers/I18n";
|
|
10
|
+
|
|
11
|
+
var ActionsMenuButton = function ActionsMenuButton(_ref) {
|
|
12
|
+
var docs = _ref.docs,
|
|
13
|
+
actions = _ref.actions;
|
|
14
|
+
|
|
15
|
+
var _useState = useState(false),
|
|
16
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
+
showActions = _useState2[0],
|
|
18
|
+
setShowActions = _useState2[1];
|
|
19
|
+
|
|
20
|
+
var actionsRef = useRef();
|
|
21
|
+
useExtendI18n(locales);
|
|
22
|
+
|
|
23
|
+
var _useI18n = useI18n(),
|
|
24
|
+
t = _useI18n.t;
|
|
25
|
+
|
|
26
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ListItemIcon, null, /*#__PURE__*/React.createElement(IconButton, {
|
|
27
|
+
ref: actionsRef,
|
|
28
|
+
"arial-label": t('menu'),
|
|
29
|
+
onClick: function onClick() {
|
|
30
|
+
return setShowActions(true);
|
|
31
|
+
}
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
33
|
+
icon: DotsIcon
|
|
34
|
+
}))), showActions && /*#__PURE__*/React.createElement(ActionsMenu, {
|
|
35
|
+
open: true,
|
|
36
|
+
ref: actionsRef,
|
|
37
|
+
docs: docs,
|
|
38
|
+
actions: actions,
|
|
39
|
+
anchorOrigin: {
|
|
40
|
+
vertical: 'bottom',
|
|
41
|
+
horizontal: 'right'
|
|
42
|
+
},
|
|
43
|
+
onClose: function onClose() {
|
|
44
|
+
return setShowActions(false);
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default ActionsMenuButton;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { useRef, useState } from 'react';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import ContactIdentity from "cozy-ui/transpiled/react/ContactsList/Contacts/ContactIdentity";
|
|
4
|
-
import
|
|
5
|
-
import ActionsMenu from "cozy-ui/transpiled/react/ActionsMenu";
|
|
6
|
-
import Icon from "cozy-ui/transpiled/react/Icon";
|
|
7
|
-
import IconButton from "cozy-ui/transpiled/react/IconButton";
|
|
8
|
-
import DotsIcon from "cozy-ui/transpiled/react/Icons/Dots";
|
|
9
|
-
import ListItemIcon from "cozy-ui/transpiled/react/ListItemIcon";
|
|
10
|
-
import { useI18n, useExtendI18n } from "cozy-ui/transpiled/react/providers/I18n";
|
|
3
|
+
import ActionsMenuButton from "cozy-ui/transpiled/react/ActionsMenu/ActionsMenuButton";
|
|
11
4
|
|
|
12
5
|
var Cell = function Cell(_ref) {
|
|
13
6
|
var row = _ref.row,
|
|
@@ -15,18 +8,6 @@ var Cell = function Cell(_ref) {
|
|
|
15
8
|
cell = _ref.cell,
|
|
16
9
|
actions = _ref.actions;
|
|
17
10
|
|
|
18
|
-
var _useState = useState(false),
|
|
19
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
-
showActions = _useState2[0],
|
|
21
|
-
setShowActions = _useState2[1];
|
|
22
|
-
|
|
23
|
-
useExtendI18n(locales);
|
|
24
|
-
|
|
25
|
-
var _useI18n = useI18n(),
|
|
26
|
-
t = _useI18n.t;
|
|
27
|
-
|
|
28
|
-
var actionsRef = useRef();
|
|
29
|
-
|
|
30
11
|
if (column.id === 'fullname') {
|
|
31
12
|
return /*#__PURE__*/React.createElement(ContactIdentity, {
|
|
32
13
|
contact: row,
|
|
@@ -39,27 +20,10 @@ var Cell = function Cell(_ref) {
|
|
|
39
20
|
return null;
|
|
40
21
|
}
|
|
41
22
|
|
|
42
|
-
return /*#__PURE__*/React.createElement(
|
|
43
|
-
ref: actionsRef,
|
|
44
|
-
"arial-label": t('menu'),
|
|
45
|
-
onClick: function onClick() {
|
|
46
|
-
return setShowActions(true);
|
|
47
|
-
}
|
|
48
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
49
|
-
icon: DotsIcon
|
|
50
|
-
}))), showActions && /*#__PURE__*/React.createElement(ActionsMenu, {
|
|
51
|
-
open: true,
|
|
52
|
-
ref: actionsRef,
|
|
23
|
+
return /*#__PURE__*/React.createElement(ActionsMenuButton, {
|
|
53
24
|
docs: [row],
|
|
54
|
-
actions: actions
|
|
55
|
-
|
|
56
|
-
vertical: 'bottom',
|
|
57
|
-
horizontal: 'right'
|
|
58
|
-
},
|
|
59
|
-
onClose: function onClose() {
|
|
60
|
-
return setShowActions(false);
|
|
61
|
-
}
|
|
62
|
-
}));
|
|
25
|
+
actions: actions
|
|
26
|
+
});
|
|
63
27
|
}
|
|
64
28
|
|
|
65
29
|
return cell;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
var en = {
|
|
2
2
|
empty: "EMPTY",
|
|
3
3
|
me: "me",
|
|
4
|
-
favorite: "favorites"
|
|
5
|
-
menu: "Menu"
|
|
4
|
+
favorite: "favorites"
|
|
6
5
|
};
|
|
7
6
|
var fr = {
|
|
8
7
|
empty: "VIDE",
|
|
9
8
|
me: "moi",
|
|
10
|
-
favorite: "favoris"
|
|
11
|
-
menu: "Menu"
|
|
9
|
+
favorite: "favoris"
|
|
12
10
|
};
|
|
13
11
|
import withOnlyLocales from "cozy-ui/transpiled/react/providers/I18n/withOnlyLocales";
|
|
14
12
|
export var locales = {
|