@dartcom/ui-kit 10.5.23 → 10.5.24
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/dist/components/buttons/delete/delete.d.ts.map +1 -1
- package/dist/components/buttons/delete/delete.esm.js +1 -1
- package/dist/components/buttons/icon/constants.d.ts +6 -0
- package/dist/components/buttons/icon/constants.d.ts.map +1 -1
- package/dist/components/buttons/icon/constants.esm.js +1 -1
- package/dist/components/buttons/icon/icon.d.ts.map +1 -1
- package/dist/components/buttons/icon/icon.esm.js +1 -1
- package/dist/components/buttons/icon/types.d.ts +2 -4
- package/dist/components/buttons/icon/types.d.ts.map +1 -1
- package/dist/components/list/list.d.ts.map +1 -1
- package/dist/components/list/list.esm.js +1 -1
- package/dist/index.cjs +10 -13
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/delete/delete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/delete/delete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAW5C,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAyF7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as i}from"react/jsx-runtime";import*as
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import*as o from"react";import{Slide as n,Tooltip as r,Dialog as t,DialogTitle as l,DialogContent as c,DialogContentText as d,DialogActions as a,Button as s}from"@mui/material";import m from"../icon/icon.esm.js";const f=o.forwardRef(function(i,o){return e(n,{direction:"up",ref:o,...i})}),u=({notification:n,onDelete:u,disabled:h=!1,...p})=>{const x=o.useId(),[C,b]=o.useState(!1),k=()=>{b(!1)},g=o.useMemo(()=>h?"disabled":"error",[h]);return i(o.Fragment,{children:[n?e(r,{title:n.title,children:e(m,{...p,iconName:"delete",iconColor:g,onClick:()=>{b(!0)},disabled:h})}):e(m,{...p,iconName:"delete",iconColor:g,onClick:u,disabled:h}),n?i(t,{slots:{transition:f},open:C,onClose:k,children:[e(l,{id:`${x}-dialog-title`,children:n.title}),e(c,{children:e(d,{id:`${x}-dialog-text`,children:n.description})}),i(a,{children:[e(s,{variant:"contained",color:"error",sx:{textTransform:"none"},onClick:k,children:"Отмена"}),e(s,{variant:"contained",sx:{textTransform:"none"},onClick:()=>{u(),k()},children:"Подтвердить"})]})]}):null]})};export{u as default};
|
|
@@ -17,5 +17,11 @@ export declare const icons: {
|
|
|
17
17
|
clear: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
18
18
|
muiName: string;
|
|
19
19
|
};
|
|
20
|
+
show: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
21
|
+
muiName: string;
|
|
22
|
+
};
|
|
23
|
+
close: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
24
|
+
muiName: string;
|
|
25
|
+
};
|
|
20
26
|
};
|
|
21
27
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/icon/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/icon/constants.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;CASjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import i from"@mui/icons-material/Clear";import m from"@mui/icons-material/Delete";import r from"@mui/icons-material/Edit";import
|
|
1
|
+
import i from"@mui/icons-material/Clear";import m from"@mui/icons-material/CloseOutlined";import o from"@mui/icons-material/Delete";import r from"@mui/icons-material/Edit";import t from"@mui/icons-material/Moving";import e from"@mui/icons-material/RestartAlt";import a from"@mui/icons-material/Save";import l from"@mui/icons-material/Visibility";const s={reset:e,edit:r,move:t,save:a,delete:o,clear:i,show:l,close:m};export{s as icons};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ1C,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ1C,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAuCzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import*as i from"react";import{styled as t,IconButton as r,Tooltip as n}from"@mui/material";import{icons as e}from"./constants.esm.js";const m=t(r)(()=>({padding:0})),c=({title:t,
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import*as i from"react";import{styled as t,IconButton as r,Tooltip as n}from"@mui/material";import{icons as e}from"./constants.esm.js";const m=t(r)(()=>({padding:0})),c=({title:t,iconName:r,iconColor:c="primary",...a})=>{const l=i.useId(),s=e[r];return t?o(n,{title:t,children:o(m,{id:l,...a,onClick:o=>{o.stopPropagation(),a.onClick?.(o)},children:o(s,{fontSize:"medium",color:c})})}):o(m,{id:l,...a,onClick:o=>{o.stopPropagation(),a.onClick?.(o)},children:o(s,{fontSize:"medium",color:c})})};export{c as default};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { IconButton, IconProps } from '@mui/material';
|
|
2
2
|
import { icons } from './constants';
|
|
3
3
|
export type IconButtonProps = React.ComponentProps<typeof IconButton> & {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
color?: IconProps['color'];
|
|
7
|
-
};
|
|
4
|
+
iconName: keyof typeof icons;
|
|
5
|
+
iconColor?: IconProps['color'];
|
|
8
6
|
title?: React.ReactNode;
|
|
9
7
|
};
|
|
10
8
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/icon/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,GAAG;IACtE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/icon/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,GAAG;IACtE,QAAQ,EAAE,MAAM,OAAO,KAAK,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/components/list/list.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,iBAAS,UAAU,CAAC,CAAC,EAAE,EACrB,KAAK,EACL,YAAgB,EAChB,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,EAAE,EAEF,YAAmB,GACpB,EAAE,SAAS,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/components/list/list.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,iBAAS,UAAU,CAAC,CAAC,EAAE,EACrB,KAAK,EACL,YAAgB,EAChB,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,EAAE,EAEF,YAAmB,GACpB,EAAE,SAAS,CAAC,CAAC,CAAC,2CAwGd;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import*as n from"react";import{Box as i,Typography as o,List as a,ListItem as
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import*as n from"react";import{Box as i,Typography as o,List as a,ListItem as l}from"@mui/material";import"@mui/material/IconButton";import"../buttons/delete/delete.esm.js";import r from"../buttons/icon/icon.esm.js";import"@mui/icons-material/CloudUpload";import"../buttons/upload/styles.esm.js";import s from"../no-data/no-data.esm.js";function m({items:m,columnsCount:p=1,getContent:d,title:c,getKey:u,onClick:g,onClear:f,sx:h,isShowNoData:C=!0}){const x=n.useMemo(()=>m.length>0,[m.length]),b=n.useMemo(()=>Boolean(f)&&x,[f,x]);return t(i,{sx:({spacing:t,breakpoints:e})=>({display:"grid",gridTemplateColumns:"1fr",gap:t(2),...h?.root,[e.down("sm")]:{gap:t(1)}}),children:[c||f?t(i,{sx:({spacing:t})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:t(1)}),children:[c?e(o,{variant:"h6",noWrap:!0,sx:{textAlign:"center",fontWeight:700,...h?.title},children:c}):null,b?e(r,{iconName:"clear",iconColor:"warning",onClick:f}):null]}):null,x?e(a,{sx:({spacing:t,breakpoints:e})=>({display:"grid",gridTemplateColumns:`repeat(${p}, 1fr)`,gap:t(2),...h?.list,[e.down("sm")]:{gap:t(1)}}),disablePadding:!0,children:m.map((t,n)=>e(l,{onClick:()=>g?.(t,n),sx:()=>({...h?.item}),disablePadding:!0,children:d(t,n)},u(t,n)))}):e(n.Fragment,{children:C?e(s,{}):null})]})}export{m as default};
|
package/dist/index.cjs
CHANGED
|
@@ -8,11 +8,13 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
8
8
|
var ArrowDownwardIcon = require('@mui/icons-material/ArrowDownward');
|
|
9
9
|
var IconButton$1 = require('@mui/material/IconButton');
|
|
10
10
|
var ClearIcon = require('@mui/icons-material/Clear');
|
|
11
|
+
var CloseIcon = require('@mui/icons-material/CloseOutlined');
|
|
11
12
|
var DeleteIcon = require('@mui/icons-material/Delete');
|
|
12
13
|
var EditIcon = require('@mui/icons-material/Edit');
|
|
13
14
|
var MovingIcon = require('@mui/icons-material/Moving');
|
|
14
15
|
var RestartAltIcon = require('@mui/icons-material/RestartAlt');
|
|
15
16
|
var SaveIcon = require('@mui/icons-material/Save');
|
|
17
|
+
var VisibilityIcon = require('@mui/icons-material/Visibility');
|
|
16
18
|
var CloudUploadIcon = require('@mui/icons-material/CloudUpload');
|
|
17
19
|
var Checkbox = require('@mui/material/Checkbox');
|
|
18
20
|
var FormControlLabel = require('@mui/material/FormControlLabel');
|
|
@@ -17410,6 +17412,8 @@ const icons = {
|
|
|
17410
17412
|
save: SaveIcon,
|
|
17411
17413
|
delete: DeleteIcon,
|
|
17412
17414
|
clear: ClearIcon,
|
|
17415
|
+
show: VisibilityIcon,
|
|
17416
|
+
close: CloseIcon,
|
|
17413
17417
|
};
|
|
17414
17418
|
|
|
17415
17419
|
const StyledIconButton = material.styled(material.IconButton)(() => {
|
|
@@ -17417,10 +17421,9 @@ const StyledIconButton = material.styled(material.IconButton)(() => {
|
|
|
17417
17421
|
padding: 0,
|
|
17418
17422
|
};
|
|
17419
17423
|
});
|
|
17420
|
-
const IconButton = ({ title,
|
|
17424
|
+
const IconButton = ({ title, iconName, iconColor = 'primary', ...props }) => {
|
|
17421
17425
|
const buttonId = React__namespace.useId();
|
|
17422
|
-
const Icon = icons[
|
|
17423
|
-
const iconColor = iconProps.color ?? 'primary';
|
|
17426
|
+
const Icon = icons[iconName];
|
|
17424
17427
|
if (title) {
|
|
17425
17428
|
return (jsxRuntime.jsx(material.Tooltip, { title: title, children: jsxRuntime.jsx(StyledIconButton, { id: buttonId, ...props, onClick: (event) => {
|
|
17426
17429
|
event.stopPropagation();
|
|
@@ -17445,13 +17448,10 @@ const DeleteButton = ({ notification, onDelete, disabled = false, ...props }) =>
|
|
|
17445
17448
|
const handleCloseNotification = () => {
|
|
17446
17449
|
setOpenNotification(false);
|
|
17447
17450
|
};
|
|
17448
|
-
const
|
|
17449
|
-
return
|
|
17450
|
-
name: 'delete',
|
|
17451
|
-
color: disabled ? 'disabled' : 'error',
|
|
17452
|
-
};
|
|
17451
|
+
const iconColor = React__namespace.useMemo(() => {
|
|
17452
|
+
return disabled ? 'disabled' : 'error';
|
|
17453
17453
|
}, [disabled]);
|
|
17454
|
-
return (jsxRuntime.jsxs(React__namespace.Fragment, { children: [notification ? (jsxRuntime.jsx(material.Tooltip, { title: notification.title, children: jsxRuntime.jsx(IconButton, { ...props,
|
|
17454
|
+
return (jsxRuntime.jsxs(React__namespace.Fragment, { children: [notification ? (jsxRuntime.jsx(material.Tooltip, { title: notification.title, children: jsxRuntime.jsx(IconButton, { ...props, iconName: "delete", iconColor: iconColor, onClick: handleOpenNotification, disabled: disabled }) })) : (jsxRuntime.jsx(IconButton, { ...props, iconName: "delete", iconColor: iconColor, onClick: onDelete, disabled: disabled })), notification ? (jsxRuntime.jsxs(material.Dialog, { slots: {
|
|
17455
17455
|
transition: Transition,
|
|
17456
17456
|
}, open: openNotification, onClose: handleCloseNotification, children: [jsxRuntime.jsx(material.DialogTitle, { id: `${id}-dialog-title`, children: notification.title }), jsxRuntime.jsx(material.DialogContent, { children: jsxRuntime.jsx(material.DialogContentText, { id: `${id}-dialog-text`, children: notification.description }) }), jsxRuntime.jsxs(material.DialogActions, { children: [jsxRuntime.jsx(material.Button, { variant: "contained", color: "error", sx: {
|
|
17457
17457
|
textTransform: 'none',
|
|
@@ -20315,10 +20315,7 @@ function CustomList({ items, columnsCount = 1, getContent, title, getKey, onClic
|
|
|
20315
20315
|
textAlign: 'center',
|
|
20316
20316
|
fontWeight: 700,
|
|
20317
20317
|
...sx?.title,
|
|
20318
|
-
}, children: title })) : null, isShowClear ? (jsxRuntime.jsx(IconButton, {
|
|
20319
|
-
name: 'clear',
|
|
20320
|
-
color: 'warning',
|
|
20321
|
-
}, onClick: onClear })) : null] })) : null, isData ? (jsxRuntime.jsx(material.List, { sx: ({ spacing, breakpoints }) => {
|
|
20318
|
+
}, children: title })) : null, isShowClear ? (jsxRuntime.jsx(IconButton, { iconName: "clear", iconColor: "warning", onClick: onClear })) : null] })) : null, isData ? (jsxRuntime.jsx(material.List, { sx: ({ spacing, breakpoints }) => {
|
|
20322
20319
|
return {
|
|
20323
20320
|
display: 'grid',
|
|
20324
20321
|
gridTemplateColumns: `repeat(${columnsCount}, 1fr)`,
|