From 97be09ca6bc46c344a2a418ef883a7e8223e6e50 Mon Sep 17 00:00:00 2001 From: ssortia Date: Tue, 4 Jun 2024 14:08:45 +0300 Subject: [PATCH] added archive --- package.json | 6 +- src/components/icons/ArchiveIcon.js | 15 +++++ src/components/icons/RestoreIcon.js | 15 +++++ src/components/other/IsArchiveToggle.mjs | 41 ++++++++++++ src/components/tables/SimpleEditableTable.js | 67 ++++++++++++++++---- src/styles/style.less | 46 ++++++++++++++ 6 files changed, 173 insertions(+), 17 deletions(-) create mode 100644 src/components/icons/ArchiveIcon.js create mode 100644 src/components/icons/RestoreIcon.js create mode 100644 src/components/other/IsArchiveToggle.mjs create mode 100644 src/styles/style.less diff --git a/package.json b/package.json index 4e6c95f..dbf09d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ilb/antd-tables", - "version": "1.0.1", + "version": "1.1.0", "description": "", "main": "index.js", "type": "module", @@ -10,11 +10,11 @@ "author": "ssortia", "license": "MIT", "dependencies": { - "@ant-design/icons": "^4.7.0", + "@ant-design/icons": "^4.8.3", "@ilb/ajvinstance": "^3.0.0", "@ilb/antd-toasts": "^1.0.0", "@ilb/uniformscomponentsantd": "^1.2.24", - "react": "18.2.0", + "react": "18.3.1", "antd": "^4.21.5", "moment": "^2.29.4", "uniforms": "^3.10.0-rc.1", diff --git a/src/components/icons/ArchiveIcon.js b/src/components/icons/ArchiveIcon.js new file mode 100644 index 0000000..9e049d5 --- /dev/null +++ b/src/components/icons/ArchiveIcon.js @@ -0,0 +1,15 @@ +import React from 'react'; +import Icon from '@ant-design/icons'; + +const ArchiveSvg = () => ( + + + + +); +const ArchiveIcon = (props) => ; + +export default ArchiveIcon; diff --git a/src/components/icons/RestoreIcon.js b/src/components/icons/RestoreIcon.js new file mode 100644 index 0000000..e50dc44 --- /dev/null +++ b/src/components/icons/RestoreIcon.js @@ -0,0 +1,15 @@ +import React from 'react'; +import Icon from '@ant-design/icons'; + +const RestoreSvg = () => ( + + + + +); +const RestoreIcon = (props) => ; + +export default RestoreIcon; diff --git a/src/components/other/IsArchiveToggle.mjs b/src/components/other/IsArchiveToggle.mjs new file mode 100644 index 0000000..e658ad9 --- /dev/null +++ b/src/components/other/IsArchiveToggle.mjs @@ -0,0 +1,41 @@ +import { Button } from "antd"; +import RestoreIcon from "../icons/RestoreIcon.js"; +import ArchiveIcon from "../icons/ArchiveIcon.js"; + +/** + * @param record + * @param onRestore + * @param onArchive + * @param props + * @constructor + */ +export default function IsArchiveToggle({ isArchive, onRestore, onArchive, ...props }) { + const IconComponent = ({ type, handler }) => { + let icon = "Тут могла быть ваша реклама."; + + if (type === "restore") { + icon = ; + } + + if (type === "archive") { + icon = ; + } + + return ( +