@astral/ui 1.31.0 → 1.34.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/ActionCell/ActionCell.d.ts +6 -1
- package/ActionCell/ActionCell.js +3 -3
- package/esm/ActionCell/ActionCell.d.ts +6 -1
- package/esm/ActionCell/ActionCell.js +3 -3
- package/esm/hooks/index.d.ts +1 -0
- package/esm/hooks/index.js +1 -0
- package/esm/hooks/useRadioGroup/index.d.ts +1 -0
- package/esm/hooks/useRadioGroup/index.js +1 -0
- package/esm/hooks/useRadioGroup/useRadioGroup.d.ts +1 -0
- package/esm/hooks/useRadioGroup/useRadioGroup.js +1 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +1 -0
- package/hooks/useRadioGroup/index.d.ts +1 -0
- package/hooks/useRadioGroup/index.js +17 -0
- package/hooks/useRadioGroup/useRadioGroup.d.ts +1 -0
- package/hooks/useRadioGroup/useRadioGroup.js +5 -0
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { TooltipProps } from '../Tooltip';
|
|
2
3
|
export declare type NestedAction<T> = {
|
|
3
4
|
/**
|
|
4
5
|
* Обработчик действия
|
|
@@ -65,5 +66,9 @@ export declare type ActionsCellProps<T> = {
|
|
|
65
66
|
* Данные строки из DataGrid
|
|
66
67
|
*/
|
|
67
68
|
row: T;
|
|
69
|
+
/**
|
|
70
|
+
* Позиция тултипа
|
|
71
|
+
*/
|
|
72
|
+
tooltipPlacement?: TooltipProps['placement'];
|
|
68
73
|
};
|
|
69
|
-
export declare function ActionCell<T>({ actions: { main, secondary }, row, }: ActionsCellProps<T>): JSX.Element;
|
|
74
|
+
export declare function ActionCell<T>({ actions: { main, secondary }, row, tooltipPlacement, }: ActionsCellProps<T>): JSX.Element;
|
package/ActionCell/ActionCell.js
CHANGED
|
@@ -9,17 +9,17 @@ const IconDropdownButton_1 = require("../IconDropdownButton");
|
|
|
9
9
|
const MenuItem_1 = require("../MenuItem");
|
|
10
10
|
const Tooltip_1 = require("../Tooltip");
|
|
11
11
|
const styles_1 = require("./styles");
|
|
12
|
-
function ActionCell({ actions: { main = [], secondary = [] }, row, }) {
|
|
12
|
+
function ActionCell({ actions: { main = [], secondary = [] }, row, tooltipPlacement, }) {
|
|
13
13
|
const handleActionClick = (onClick) => () => {
|
|
14
14
|
onClick(row);
|
|
15
15
|
};
|
|
16
16
|
const renderMainAction = (0, react_1.useCallback)((action) => {
|
|
17
17
|
if (action.nested) {
|
|
18
18
|
const { name, actions, icon } = action;
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, Object.assign({ title: name }, { children: (0, jsx_runtime_1.jsx)(IconDropdownButton_1.IconDropdownButton, Object.assign({ icon: icon, variant: "text" }, { children: actions.map(({ name: nestedActionName, onClick }) => ((0, jsx_runtime_1.jsx)(MenuItem_1.MenuItem, Object.assign({ onClick: handleActionClick(onClick) }, { children: nestedActionName }), nestedActionName))) })) }), name));
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, Object.assign({ title: name, placement: tooltipPlacement }, { children: (0, jsx_runtime_1.jsx)(IconDropdownButton_1.IconDropdownButton, Object.assign({ icon: icon, variant: "text" }, { children: actions.map(({ name: nestedActionName, onClick }) => ((0, jsx_runtime_1.jsx)(MenuItem_1.MenuItem, Object.assign({ onClick: handleActionClick(onClick) }, { children: nestedActionName }), nestedActionName))) })) }), name));
|
|
20
20
|
}
|
|
21
21
|
const { onClick, name, icon } = action;
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, Object.assign({ title: name }, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, Object.assign({ variant: "text", onClick: handleActionClick(onClick) }, { children: icon })) }), name));
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, Object.assign({ title: name, placement: tooltipPlacement }, { children: (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, Object.assign({ variant: "text", onClick: handleActionClick(onClick) }, { children: icon })) }), name));
|
|
23
23
|
}, [handleActionClick]);
|
|
24
24
|
const renderSecondaryActions = (0, react_1.useMemo)(() => {
|
|
25
25
|
if (!Boolean(secondary.length)) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { TooltipProps } from '../Tooltip';
|
|
2
3
|
export declare type NestedAction<T> = {
|
|
3
4
|
/**
|
|
4
5
|
* Обработчик действия
|
|
@@ -65,5 +66,9 @@ export declare type ActionsCellProps<T> = {
|
|
|
65
66
|
* Данные строки из DataGrid
|
|
66
67
|
*/
|
|
67
68
|
row: T;
|
|
69
|
+
/**
|
|
70
|
+
* Позиция тултипа
|
|
71
|
+
*/
|
|
72
|
+
tooltipPlacement?: TooltipProps['placement'];
|
|
68
73
|
};
|
|
69
|
-
export declare function ActionCell<T>({ actions: { main, secondary }, row, }: ActionsCellProps<T>): JSX.Element;
|
|
74
|
+
export declare function ActionCell<T>({ actions: { main, secondary }, row, tooltipPlacement, }: ActionsCellProps<T>): JSX.Element;
|
|
@@ -6,17 +6,17 @@ import { IconDropdownButton } from '../IconDropdownButton';
|
|
|
6
6
|
import { MenuItem } from '../MenuItem';
|
|
7
7
|
import { Tooltip } from '../Tooltip';
|
|
8
8
|
import { ActionCellWrapper } from './styles';
|
|
9
|
-
export function ActionCell({ actions: { main = [], secondary = [] }, row, }) {
|
|
9
|
+
export function ActionCell({ actions: { main = [], secondary = [] }, row, tooltipPlacement, }) {
|
|
10
10
|
const handleActionClick = (onClick) => () => {
|
|
11
11
|
onClick(row);
|
|
12
12
|
};
|
|
13
13
|
const renderMainAction = useCallback((action) => {
|
|
14
14
|
if (action.nested) {
|
|
15
15
|
const { name, actions, icon } = action;
|
|
16
|
-
return (_jsx(Tooltip, Object.assign({ title: name }, { children: _jsx(IconDropdownButton, Object.assign({ icon: icon, variant: "text" }, { children: actions.map(({ name: nestedActionName, onClick }) => (_jsx(MenuItem, Object.assign({ onClick: handleActionClick(onClick) }, { children: nestedActionName }), nestedActionName))) })) }), name));
|
|
16
|
+
return (_jsx(Tooltip, Object.assign({ title: name, placement: tooltipPlacement }, { children: _jsx(IconDropdownButton, Object.assign({ icon: icon, variant: "text" }, { children: actions.map(({ name: nestedActionName, onClick }) => (_jsx(MenuItem, Object.assign({ onClick: handleActionClick(onClick) }, { children: nestedActionName }), nestedActionName))) })) }), name));
|
|
17
17
|
}
|
|
18
18
|
const { onClick, name, icon } = action;
|
|
19
|
-
return (_jsx(Tooltip, Object.assign({ title: name }, { children: _jsx(IconButton, Object.assign({ variant: "text", onClick: handleActionClick(onClick) }, { children: icon })) }), name));
|
|
19
|
+
return (_jsx(Tooltip, Object.assign({ title: name, placement: tooltipPlacement }, { children: _jsx(IconButton, Object.assign({ variant: "text", onClick: handleActionClick(onClick) }, { children: icon })) }), name));
|
|
20
20
|
}, [handleActionClick]);
|
|
21
21
|
const renderSecondaryActions = useMemo(() => {
|
|
22
22
|
if (!Boolean(secondary.length)) {
|
package/esm/hooks/index.d.ts
CHANGED
package/esm/hooks/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useRadioGroup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useRadioGroup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useRadioGroup } from '@mui/material/RadioGroup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useRadioGroup } from '@mui/material/RadioGroup';
|
package/hooks/index.d.ts
CHANGED
package/hooks/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useRadioGroup';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useRadioGroup"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useRadioGroup } from '@mui/material/RadioGroup';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useRadioGroup = void 0;
|
|
4
|
+
var RadioGroup_1 = require("@mui/material/RadioGroup");
|
|
5
|
+
Object.defineProperty(exports, "useRadioGroup", { enumerable: true, get: function () { return RadioGroup_1.useRadioGroup; } });
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astral/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.34.0",
|
|
4
4
|
"browser": "./esm/index.js",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@astral/icons": "^1.
|
|
7
|
+
"@astral/icons": "^1.34.0",
|
|
8
8
|
"@emotion/cache": "11.7.1",
|
|
9
9
|
"@emotion/react": "11.9.0",
|
|
10
10
|
"@emotion/server": "11.4.0",
|