diff --git a/src/components/DownloadLink.tsx b/src/components/DownloadLink.tsx index 66d47cc..a88d4f6 100755 --- a/src/components/DownloadLink.tsx +++ b/src/components/DownloadLink.tsx @@ -7,7 +7,7 @@ import { downloadFile } from './factory' import { getLinkToFile } from '@pages/FileDownload' -import '@styles/index.css' +import '@styles/components/download_link.less' export type DownloadLinkProps = LinkProps & { file?: FileInfoDto diff --git a/src/components/Grid.tsx b/src/components/Grid.tsx index ff38f20..ed85c78 100755 --- a/src/components/Grid.tsx +++ b/src/components/Grid.tsx @@ -1,4 +1,6 @@ -import React, { HTMLAttributes, memo } from 'react' +import { HTMLAttributes, memo } from 'react' + +import '@styles/components/grid.less' export type ComponentProps = HTMLAttributes @@ -36,7 +38,7 @@ export const GridItem = memo(({ children, row, col, rowSpan, colS } return ( -
+
{children}
) diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx index e1b7f8c..70fe1d6 100755 --- a/src/components/Table/Table.tsx +++ b/src/components/Table/Table.tsx @@ -8,7 +8,7 @@ import TableSettingsChanger from './TableSettingsChanger' import type { OmitExtends } from '@utils/types' import { applyTableSettings, getTableSettings, setTableSettings, TableColumnSettings, TableSettings } from '@utils' -import '@styles/index.css' +import '@styles/components/table.less' export type BaseTableColumn = ColumnGroupType | ColumnType export type TableColumn = OmitExtends, TableColumnSettings> diff --git a/src/index.tsx b/src/index.tsx index 8bc4c23..e348115 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -8,9 +8,7 @@ import { OpenAPI } from '@api' import App from './App' -import '@styles/include/antd_theme.less' -import '@styles/fonts.less' -import '@styles/index.css' +import '@styles/index.less' // OpenAPI.BASE = 'http://localhost:3000' // TODO: Удалить взятие из 'token' в следующем релизе, вставлено для совместимости diff --git a/src/pages/Well/Analytics/Statistics.jsx b/src/pages/Well/Analytics/Statistics.jsx index 5633bd2..27f4af2 100644 --- a/src/pages/Well/Analytics/Statistics.jsx +++ b/src/pages/Well/Analytics/Statistics.jsx @@ -9,7 +9,6 @@ import { makeGroupColumn, makeNumericColumn, makeNumericRender, makeTextColumn, import { OperationStatService, WellOperationService } from '@api' import { arrayOrDefault, withPermissions } from '@utils' -import '@styles/index.css' import '@styles/pages/statistics.less' const { Text } = Typography diff --git a/src/pages/Well/Measure/MeasureTable.jsx b/src/pages/Well/Measure/MeasureTable.jsx index 308c888..8506121 100644 --- a/src/pages/Well/Measure/MeasureTable.jsx +++ b/src/pages/Well/Measure/MeasureTable.jsx @@ -17,7 +17,6 @@ import { MeasureService } from '@api' import { View } from './View' -import '@styles/index.css' import '@styles/pages/measure.css' const createEditingColumns = (cols, renderDelegate) => diff --git a/src/pages/Well/Measure/View.jsx b/src/pages/Well/Measure/View.jsx index 6f61143..81b664b 100644 --- a/src/pages/Well/Measure/View.jsx +++ b/src/pages/Well/Measure/View.jsx @@ -3,7 +3,6 @@ import { Empty, Form } from 'antd' import { Grid, GridItem } from '@components/Grid' -import '@styles/index.css' import '@styles/pages/measure.css' export const View = memo(({ columns, item }) => !item || !columns?.length ? ( diff --git a/src/pages/Well/Telemetry/index.jsx b/src/pages/Well/Telemetry/index.jsx index a917396..57da347 100644 --- a/src/pages/Well/Telemetry/index.jsx +++ b/src/pages/Well/Telemetry/index.jsx @@ -4,8 +4,6 @@ import { memo, useMemo } from 'react' import { RootPathContext, useRootPath } from '@asb/context' import { withPermissions } from '@utils' -import '@styles/index.css' - const Telemetry = memo(() => { const root = useRootPath() const rootPath = useMemo(() => `${root}/telemetry`, [root]) diff --git a/src/pages/Well/WellOperations/Tvd/index.jsx b/src/pages/Well/WellOperations/Tvd/index.jsx index ba0a19b..2ff777c 100644 --- a/src/pages/Well/WellOperations/Tvd/index.jsx +++ b/src/pages/Well/WellOperations/Tvd/index.jsx @@ -17,7 +17,6 @@ import StatExport from './StatExport' import NetGraphExport from './NetGraphExport' import AdditionalTables from './AdditionalTables' -import '@styles/index.css' import '@styles/pages/tvd.less' const operationsColors = [ diff --git a/src/pages/Well/index.jsx b/src/pages/Well/index.jsx index 3b65aea..4181ee1 100644 --- a/src/pages/Well/index.jsx +++ b/src/pages/Well/index.jsx @@ -10,8 +10,6 @@ import { WellService } from '@api' import { WellNavigationMenu, menuItems } from './WellNavigationMenu' -import '@styles/index.css' - const Measure = lazy(() => import('./Measure')) const Reports = lazy(() => import('./Reports')) const WellCase = lazy(() => import('./WellCase')) diff --git a/src/styles/components/download_link.less b/src/styles/components/download_link.less new file mode 100644 index 0000000..c6d681a --- /dev/null +++ b/src/styles/components/download_link.less @@ -0,0 +1,4 @@ +.download-link { + height: 32px; + padding: 4px 15px; +} diff --git a/src/styles/components/grid.less b/src/styles/components/grid.less new file mode 100644 index 0000000..677dde4 --- /dev/null +++ b/src/styles/components/grid.less @@ -0,0 +1,3 @@ +.dd-grid-item { + padding: 4px; +} diff --git a/src/styles/components/table.less b/src/styles/components/table.less new file mode 100644 index 0000000..c9610db --- /dev/null +++ b/src/styles/components/table.less @@ -0,0 +1,13 @@ +.first-column-title { + display: flex; + flex-direction: column; + align-items: stretch; + justify-content: space-between; + position: relative; + padding: 16px 0; +} + +.text-align-r-container { + width: 100%; + text-align: right; +} diff --git a/src/styles/index.css b/src/styles/index.css deleted file mode 100755 index 7fc3ae3..0000000 --- a/src/styles/index.css +++ /dev/null @@ -1,165 +0,0 @@ -body { - margin: 0; - font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - background: #232323; -} - -.d-flex { - display: flex; -} - -.flex-direction-column { - flex-direction: column; -} - -.d-inline { - display: inline; -} - -.d-none { - display: none; -} - -.flex-1 { - flex: 1; -} - -.w-15 { - width: 15% -} - -.w-33 { - width: 33% -} - -.w-50 { - width: 50% -} - -.w-100 { - width: 100% -} - -.m-0 { - margin: 0; -} - -.mt-8px { - margin-top: 8px; -} - -.mt-20px { - margin-top: 20px; -} - -.mb-20px { - margin-bottom: 20px; -} - -.ml-5px { - margin-left: 5px; -} - -.ml-10px { - margin-left: 10px; -} - -.ml-30px { - margin-left: 30px; -} - -.h-100vh { - height: 100vh; -} - -.p-10 { - padding: 10px; -} - -.vertical-align-center { - vertical-align: center; -} - -.text-align-center { - text-align: center; -} - -.text-align-r-container { - width: 100%; - text-align: right; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} - -.linkDocuments { - color: #000; -} - -.linkDocuments:hover { - color: #c32828; -} - -.container{ - width: 100%; -} - -.login-button { - width: 20%; - margin: auto; -} - -.register-button { - width: 50%; - margin: auto; -} - -.first-column-title { - display: flex; - flex-direction: column; - align-items: stretch; - justify-content: space-between; - position: relative; - padding: 16px 0; -} - -.noselect { - -webkit-touch-callout: none; /* iOS Safari */ - -webkit-user-select: none; /* Safari */ - -khtml-user-select: none; /* Konqueror HTML */ - -moz-user-select: none; /* Old versions of Firefox */ - -ms-user-select: none; /* Internet Explorer/Edge */ - user-select: none; /* Non-prefixed version, currently - supported by Chrome, Edge, Opera and Firefox */ -} - -.download-link { - height: 32px; - padding: 4px 15px; -} - -.ant-table-cell:has(.color-pale-green) { - background-color: #98fb98; -} - -.ant-table-tbody > tr > td.ant-table-cell-row-hover:has( > div.color-pale-green) { - background: #98fb98; -} - -.color-pale-green { - background-color: #98fb98; -} - -.asb-grid-item { - padding: 4px; -} - -.pointer { - cursor: pointer; -} diff --git a/src/styles/index.less b/src/styles/index.less new file mode 100644 index 0000000..efe2883 --- /dev/null +++ b/src/styles/index.less @@ -0,0 +1,56 @@ +@import 'include/antd_theme.less'; +@import 'fonts.less'; + +body { + margin: 0; + font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', + 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + background: #232323; +} + +.d-none { display: none } +.d-flex { display: flex } +.d-inline { display: inline } + +.flex-direction-column { flex-direction: column } + +.flex-1 { flex: 1 } + +.w-15 { width: 15% } +.w-33 { width: 33% } +.w-50 { width: 50% } +.w-100 { width: 100% } +.h-100vh { height: 100vh } + +.m-0 { margin: 0 } +.mt-8px { margin-top: 8px } +.mt-20px { margin-top: 20px } +.mb-20px { margin-bottom: 20px } +.ml-5px { margin-left: 5px } +.ml-10px { margin-left: 10px } +.ml-30px { margin-left: 30px } + +.p-10 { padding: 10px } + +.text-align-center { + text-align: center; +} + +.container { + width: 100%; +} + +.noselect { + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Old versions of Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; /* Non-prefixed version, currently + supported by Chrome, Edge, Opera and Firefox */ +} + +.pointer { cursor: pointer }