Compare commits
14 Commits
dev
...
release/mo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a9ba6bb84 | ||
|
|
2c9117d08c | ||
|
|
efdad41493 | ||
|
|
8e48a48fee | ||
|
|
ec7f7ea941 | ||
|
|
95bd5d1010 | ||
|
|
09ba9499a3 | ||
|
|
0f425109a6 | ||
|
|
74af4fb492 | ||
|
|
f451af545a | ||
|
|
e748a560ed | ||
|
|
b4b6192f1c | ||
|
|
eff67858dc | ||
|
|
7b9dbdaeb5 |
13
.gitignore
vendored
13
.gitignore
vendored
@ -1,19 +1,19 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
node_modules
|
||||
.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
.next/
|
||||
out/
|
||||
|
||||
# production
|
||||
/build
|
||||
build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
@ -42,3 +42,6 @@ yarn-error.log*
|
||||
!.yarn/releases
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
|
||||
# turbo
|
||||
.turbo
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
import type { BaseOption } from 'Elements/types';
|
||||
import { isEmpty } from 'radash';
|
||||
import type { BaseOption } from 'ui/elements/types';
|
||||
|
||||
export function normalizeOptions(options: any[] | null | undefined) {
|
||||
return (isEmpty(options) ? [] : options) as BaseOption[];
|
||||
12
@packages/tools/package.json
Normal file
12
@packages/tools/package.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "tools",
|
||||
"version": "0.0.0",
|
||||
"main": "./index.tsx",
|
||||
"types": "./index.tsx",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mobx": "^6.7.0",
|
||||
"radash": "^10.3.0",
|
||||
"ui": "*"
|
||||
}
|
||||
}
|
||||
4
@packages/ui/elements/config.js
Normal file
4
@packages/ui/elements/config.js
Normal file
@ -0,0 +1,4 @@
|
||||
/* eslint-disable unicorn/filename-case */
|
||||
|
||||
export { ConfigProvider } from 'antd';
|
||||
export { default as ru_RU } from 'antd/lib/locale/ru_RU';
|
||||
15
@packages/ui/elements/index.ts
Normal file
15
@packages/ui/elements/index.ts
Normal file
@ -0,0 +1,15 @@
|
||||
export { default as Button } from './Button';
|
||||
export { default as Checkbox } from './Checkbox';
|
||||
export { default as Input } from './Input';
|
||||
export { default as InputNumber } from './InputNumber';
|
||||
export { default as Link } from './Link';
|
||||
export { default as message } from './message';
|
||||
export { default as notification } from './notification';
|
||||
export { default as Radio } from './Radio';
|
||||
export { default as Result } from './Result';
|
||||
export { default as Segmented } from './Segmented';
|
||||
export { default as Select } from './Select';
|
||||
export { default as Switch } from './Switch';
|
||||
export { default as Table } from './Table';
|
||||
export { default as Text } from './Text';
|
||||
export { default as Tooltip } from './Tooltip';
|
||||
@ -1,6 +1,6 @@
|
||||
import styled from 'styled-components';
|
||||
import { Box } from 'UIKit/grid';
|
||||
import { min } from 'UIKit/mq';
|
||||
import { Box } from 'ui/grid';
|
||||
import { min } from 'ui/mq';
|
||||
|
||||
const Background = styled(Box)`
|
||||
background: #fff;
|
||||
1
@packages/ui/elements/styles/antd.less
Normal file
1
@packages/ui/elements/styles/antd.less
Normal file
@ -0,0 +1 @@
|
||||
@import 'antd/dist/antd.less';
|
||||
@ -15,6 +15,4 @@ export function max(breakpoint: keyof typeof screens) {
|
||||
return `@media (max-width: calc(${screens[breakpoint]}px))`;
|
||||
}
|
||||
|
||||
export const mediaQuery = {
|
||||
breakpoints: Object.values(screens).map((value) => `${value + threshold}px`),
|
||||
};
|
||||
export const breakpoints = Object.values(screens).map((value) => `${value + threshold}px`);
|
||||
20
@packages/ui/package.json
Normal file
20
@packages/ui/package.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "ui",
|
||||
"version": "0.0.0",
|
||||
"main": "./index.tsx",
|
||||
"types": "./index.tsx",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/react": "18.0.20",
|
||||
"@types/rebass": "^4.0.10",
|
||||
"@types/styled-components": "^5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "^4.8.0",
|
||||
"antd": "4.24.5",
|
||||
"react": "^18.2.0",
|
||||
"rebass": "^4.0.7",
|
||||
"styled-components": "^5.3.6",
|
||||
"use-debounce": "^9.0.2"
|
||||
}
|
||||
}
|
||||
7
@packages/ui/theme.js
Normal file
7
@packages/ui/theme.js
Normal file
@ -0,0 +1,7 @@
|
||||
import { breakpoints } from './mq';
|
||||
|
||||
const theme = {
|
||||
breakpoints,
|
||||
};
|
||||
|
||||
export default theme;
|
||||
@ -1,10 +1,10 @@
|
||||
import Alert from 'Elements/Alert';
|
||||
import Table from 'Elements/Table';
|
||||
import { toJS } from 'mobx';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { useStore } from 'stores/hooks';
|
||||
import styled from 'styled-components';
|
||||
import { Flex } from 'UIKit/grid';
|
||||
import Alert from 'ui/elements/Alert';
|
||||
import Table from 'ui/elements/Table';
|
||||
import { Flex } from 'ui/grid';
|
||||
import { columns } from './config';
|
||||
|
||||
const Grid = styled(Flex)`
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
import type { ColumnsType } from 'antd/lib/table';
|
||||
import { MAX_INSURANCE } from 'constants/values';
|
||||
import InputNumber from 'Elements/InputNumber';
|
||||
import Select from 'Elements/Select';
|
||||
import { formatter, parser } from 'tools/number';
|
||||
import InputNumber from 'ui/elements/InputNumber';
|
||||
import Select from 'ui/elements/Select';
|
||||
import { buildOptionComponent, buildValueComponent } from './builders';
|
||||
import type * as Insurance from './types';
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import Alert from 'Elements/Alert';
|
||||
import Table from 'Elements/Table';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { useStore } from 'stores/hooks';
|
||||
import styled from 'styled-components';
|
||||
import { Flex } from 'UIKit/grid';
|
||||
import Alert from 'ui/elements/Alert';
|
||||
import Table from 'ui/elements/Table';
|
||||
import { Flex } from 'ui/grid';
|
||||
import { columns } from './config';
|
||||
|
||||
const Grid = styled(Flex)`
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { KeysSchema, RowSchema } from 'config/schema/insurance';
|
||||
import type { BaseOption, Status } from 'Elements/types';
|
||||
import type { BaseOption, Status } from 'ui/elements/types';
|
||||
import type { z } from 'zod';
|
||||
|
||||
export type Keys = z.infer<typeof KeysSchema>;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Flex } from 'UIKit/grid';
|
||||
import { Flex } from 'ui/grid';
|
||||
import renderFormRows from '../../lib/render-rows';
|
||||
import { id, rows, title } from './config';
|
||||
import FinGAPTable from './FinGAPTable';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { useStore } from 'stores/hooks';
|
||||
import { Flex } from 'UIKit/grid';
|
||||
import { Flex } from 'ui/grid';
|
||||
import elementsRender from '../../config/elements-render';
|
||||
import { elements } from './config';
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
import type { ColumnsType } from 'antd/lib/table';
|
||||
import InputNumber from 'Elements/InputNumber';
|
||||
import InputNumber from 'ui/elements/InputNumber';
|
||||
|
||||
import { buildValueComponent } from './builders';
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import Alert from 'Elements/Alert';
|
||||
import Table from 'Elements/Table';
|
||||
import { computed } from 'mobx';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { useStore } from 'stores/hooks';
|
||||
import styled from 'styled-components';
|
||||
import { Box, Flex } from 'UIKit/grid';
|
||||
import { min } from 'UIKit/mq';
|
||||
import Alert from 'ui/elements/Alert';
|
||||
import Table from 'ui/elements/Table';
|
||||
import { Box, Flex } from 'ui/grid';
|
||||
import { min } from 'ui/mq';
|
||||
import { columns } from './config';
|
||||
|
||||
const Grid = styled(Flex)`
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Box, Flex } from 'UIKit/grid';
|
||||
import { Box, Flex } from 'ui/grid';
|
||||
import elementsRender from '../../config/elements-render';
|
||||
import { id, title } from './config';
|
||||
import PaymentsParams from './PaymentsParams';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import Background from 'Elements/layout/Background';
|
||||
import Tabs from 'Elements/layout/Tabs';
|
||||
import styled from 'styled-components';
|
||||
import { min } from 'UIKit/mq';
|
||||
import Background from 'ui/elements/layout/Background';
|
||||
import Tabs from 'ui/elements/layout/Tabs';
|
||||
import { min } from 'ui/mq';
|
||||
import AddProduct from './AddProduct';
|
||||
import CreateKP from './CreateKP';
|
||||
import Insurance from './Insurance';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import Background from 'Elements/layout/Background';
|
||||
import styled from 'styled-components';
|
||||
import { min } from 'UIKit/mq';
|
||||
import Background from 'ui/elements/layout/Background';
|
||||
import { min } from 'ui/mq';
|
||||
import renderFormRows from '../lib/render-rows';
|
||||
import { rows } from './config';
|
||||
|
||||
|
||||
@ -1,14 +1,5 @@
|
||||
import Button from 'Elements/Button';
|
||||
import Checkbox from 'Elements/Checkbox';
|
||||
import Input from 'Elements/Input';
|
||||
import InputNumber from 'Elements/InputNumber';
|
||||
import Link from 'Elements/Link';
|
||||
import Radio from 'Elements/Radio';
|
||||
import Segmented from 'Elements/Segmented';
|
||||
import Select from 'Elements/Select';
|
||||
import Switch from 'Elements/Switch';
|
||||
import Text from 'Elements/Text';
|
||||
import type { ComponentProps } from 'react';
|
||||
import * as elements from 'ui/elements';
|
||||
import type { Elements as ActionElements } from './map/actions';
|
||||
import type { Elements as ValuesElements } from './map/values';
|
||||
|
||||
@ -17,146 +8,146 @@ function wrapComponentsMap<C, T extends Record<ValuesElements | ActionElements,
|
||||
}
|
||||
|
||||
const components = wrapComponentsMap({
|
||||
selectProduct: Select,
|
||||
selectClientRisk: Select,
|
||||
selectClientType: Select,
|
||||
selectSupplierCurrency: Select,
|
||||
tbxLeaseObjectPrice: InputNumber,
|
||||
tbxLeaseObjectPriceWthtVAT: InputNumber,
|
||||
tbxVATInLeaseObjectPrice: InputNumber,
|
||||
tbxSupplierDiscountRub: InputNumber,
|
||||
tbxSupplierDiscountPerc: InputNumber,
|
||||
radioBalanceHolder: Radio,
|
||||
tbxSaleBonus: InputNumber,
|
||||
tbxFirstPaymentPerc: InputNumber,
|
||||
tbxFirstPaymentRub: InputNumber,
|
||||
radioLastPaymentRule: Segmented,
|
||||
tbxLastPaymentPerc: InputNumber,
|
||||
tbxLastPaymentRub: InputNumber,
|
||||
selectImportProgram: Select,
|
||||
tbxImportProgramSum: InputNumber,
|
||||
tbxAddEquipmentPrice: InputNumber,
|
||||
tbxRedemptionPaymentSum: InputNumber,
|
||||
tbxLeasingPeriod: InputNumber,
|
||||
radioGraphType: Radio,
|
||||
tbxParmentsDecreasePercent: InputNumber,
|
||||
selectSeasonType: Select,
|
||||
selectHighSeasonStart: Select,
|
||||
tbxComissionPerc: InputNumber,
|
||||
tbxComissionRub: InputNumber,
|
||||
selectLeaseObjectType: Select,
|
||||
selectBrand: Select,
|
||||
selectModel: Select,
|
||||
selectConfiguration: Select,
|
||||
cbxLeaseObjectUsed: Checkbox,
|
||||
radioDeliveryTime: Segmented,
|
||||
tbxLeaseObjectCount: InputNumber,
|
||||
selectLeaseObjectUseFor: Select,
|
||||
tbxLeaseObjectYear: InputNumber,
|
||||
selectLeaseObjectCategory: Select,
|
||||
selectEngineType: Select,
|
||||
tbxLeaseObjectMotorPower: InputNumber,
|
||||
tbxEngineVolume: InputNumber,
|
||||
tbxMaxMass: InputNumber,
|
||||
tbxCountSeats: InputNumber,
|
||||
tbxMaxSpeed: InputNumber,
|
||||
cbxWithTrailer: Checkbox,
|
||||
selectDealer: Select,
|
||||
selectDealerPerson: Select,
|
||||
selectDealerRewardCondition: Select,
|
||||
tbxDealerRewardSumm: InputNumber,
|
||||
selectDealerBroker: Select,
|
||||
selectDealerBrokerRewardCondition: Select,
|
||||
tbxDealerBrokerRewardSumm: InputNumber,
|
||||
selectIndAgent: Select,
|
||||
selectIndAgentRewardCondition: Select,
|
||||
tbxIndAgentRewardSumm: InputNumber,
|
||||
selectCalcDoubleAgent: Select,
|
||||
selectCalcDoubleAgentRewardCondition: Select,
|
||||
tbxCalcDoubleAgentRewardSumm: InputNumber,
|
||||
selectCalcBroker: Select,
|
||||
selectCalcBrokerRewardCondition: Select,
|
||||
tbxCalcBrokerRewardSum: InputNumber,
|
||||
selectCalcFinDepartment: Select,
|
||||
selectFinDepartmentRewardCondtion: Select,
|
||||
tbxFinDepartmentRewardSumm: InputNumber,
|
||||
cbxInsDecentral: Switch,
|
||||
radioInsKaskoType: Radio,
|
||||
tbxInsFranchise: InputNumber,
|
||||
cbxInsUnlimitDrivers: Switch,
|
||||
tbxInsAgeDrivers: InputNumber,
|
||||
tbxInsExpDrivers: InputNumber,
|
||||
tbxINNForCalc: InputNumber,
|
||||
selectGPSBrand: Select,
|
||||
selectGPSModel: Select,
|
||||
selectRegionRegistration: Select,
|
||||
selectTownRegistration: Select,
|
||||
radioInfuranceOPF: Radio,
|
||||
selectRegistration: Select,
|
||||
selectInsNSIB: Select,
|
||||
selectRequirementTelematic: Select,
|
||||
selectTracker: Select,
|
||||
selectTelematic: Select,
|
||||
selectTechnicalCard: Select,
|
||||
cbxLastPaymentRedemption: Switch,
|
||||
cbxPriceWithDiscount: Switch,
|
||||
cbxFullPriceWithDiscount: Switch,
|
||||
cbxCostIncrease: Switch,
|
||||
cbxInsurance: Switch,
|
||||
cbxRegistrationQuote: Switch,
|
||||
cbxTechnicalCardQuote: Switch,
|
||||
cbxNSIB: Switch,
|
||||
cbxQuoteRedemptionGraph: Switch,
|
||||
cbxShowFinGAP: Switch,
|
||||
tbxQuoteName: Input,
|
||||
radioQuoteContactGender: Radio,
|
||||
cbxDisableChecks: Switch,
|
||||
selectTarif: Select,
|
||||
tbxCreditRate: InputNumber,
|
||||
selectRate: Select,
|
||||
tbxMaxPriceChange: InputNumber,
|
||||
tbxImporterRewardPerc: InputNumber,
|
||||
tbxImporterRewardRub: InputNumber,
|
||||
selectLead: Select,
|
||||
selectOpportunity: Select,
|
||||
selectQuote: Select,
|
||||
cbxRecalcWithRevision: Checkbox,
|
||||
tbxIRR_Perc: InputNumber,
|
||||
tbxMileage: InputNumber,
|
||||
tbxEngineHours: InputNumber,
|
||||
radioCalcType: Segmented,
|
||||
tbxTotalPayments: InputNumber,
|
||||
radioObjectRegistration: Radio,
|
||||
selectObjectRegionRegistration: Select,
|
||||
tbxVehicleTaxInYear: InputNumber,
|
||||
tbxVehicleTaxInLeasingPeriod: InputNumber,
|
||||
selectObjectCategoryTax: Select,
|
||||
selectObjectTypeTax: Select,
|
||||
radioTypePTS: Radio,
|
||||
selectLegalClientRegion: Select,
|
||||
selectLegalClientTown: Select,
|
||||
selectSubsidy: Select,
|
||||
selectFuelCard: Select,
|
||||
tbxMinPriceChange: InputNumber,
|
||||
tbxBonusCoefficient: InputNumber,
|
||||
selectProduct: elements.Select,
|
||||
selectClientRisk: elements.Select,
|
||||
selectClientType: elements.Select,
|
||||
selectSupplierCurrency: elements.Select,
|
||||
tbxLeaseObjectPrice: elements.InputNumber,
|
||||
tbxLeaseObjectPriceWthtVAT: elements.InputNumber,
|
||||
tbxVATInLeaseObjectPrice: elements.InputNumber,
|
||||
tbxSupplierDiscountRub: elements.InputNumber,
|
||||
tbxSupplierDiscountPerc: elements.InputNumber,
|
||||
radioBalanceHolder: elements.Radio,
|
||||
tbxSaleBonus: elements.InputNumber,
|
||||
tbxFirstPaymentPerc: elements.InputNumber,
|
||||
tbxFirstPaymentRub: elements.InputNumber,
|
||||
radioLastPaymentRule: elements.Segmented,
|
||||
tbxLastPaymentPerc: elements.InputNumber,
|
||||
tbxLastPaymentRub: elements.InputNumber,
|
||||
selectImportProgram: elements.Select,
|
||||
tbxImportProgramSum: elements.InputNumber,
|
||||
tbxAddEquipmentPrice: elements.InputNumber,
|
||||
tbxRedemptionPaymentSum: elements.InputNumber,
|
||||
tbxLeasingPeriod: elements.InputNumber,
|
||||
radioGraphType: elements.Radio,
|
||||
tbxParmentsDecreasePercent: elements.InputNumber,
|
||||
selectSeasonType: elements.Select,
|
||||
selectHighSeasonStart: elements.Select,
|
||||
tbxComissionPerc: elements.InputNumber,
|
||||
tbxComissionRub: elements.InputNumber,
|
||||
selectLeaseObjectType: elements.Select,
|
||||
selectBrand: elements.Select,
|
||||
selectModel: elements.Select,
|
||||
selectConfiguration: elements.Select,
|
||||
cbxLeaseObjectUsed: elements.Checkbox,
|
||||
radioDeliveryTime: elements.Segmented,
|
||||
tbxLeaseObjectCount: elements.InputNumber,
|
||||
selectLeaseObjectUseFor: elements.Select,
|
||||
tbxLeaseObjectYear: elements.InputNumber,
|
||||
selectLeaseObjectCategory: elements.Select,
|
||||
selectEngineType: elements.Select,
|
||||
tbxLeaseObjectMotorPower: elements.InputNumber,
|
||||
tbxEngineVolume: elements.InputNumber,
|
||||
tbxMaxMass: elements.InputNumber,
|
||||
tbxCountSeats: elements.InputNumber,
|
||||
tbxMaxSpeed: elements.InputNumber,
|
||||
cbxWithTrailer: elements.Checkbox,
|
||||
selectDealer: elements.Select,
|
||||
selectDealerPerson: elements.Select,
|
||||
selectDealerRewardCondition: elements.Select,
|
||||
tbxDealerRewardSumm: elements.InputNumber,
|
||||
selectDealerBroker: elements.Select,
|
||||
selectDealerBrokerRewardCondition: elements.Select,
|
||||
tbxDealerBrokerRewardSumm: elements.InputNumber,
|
||||
selectIndAgent: elements.Select,
|
||||
selectIndAgentRewardCondition: elements.Select,
|
||||
tbxIndAgentRewardSumm: elements.InputNumber,
|
||||
selectCalcDoubleAgent: elements.Select,
|
||||
selectCalcDoubleAgentRewardCondition: elements.Select,
|
||||
tbxCalcDoubleAgentRewardSumm: elements.InputNumber,
|
||||
selectCalcBroker: elements.Select,
|
||||
selectCalcBrokerRewardCondition: elements.Select,
|
||||
tbxCalcBrokerRewardSum: elements.InputNumber,
|
||||
selectCalcFinDepartment: elements.Select,
|
||||
selectFinDepartmentRewardCondtion: elements.Select,
|
||||
tbxFinDepartmentRewardSumm: elements.InputNumber,
|
||||
cbxInsDecentral: elements.Switch,
|
||||
radioInsKaskoType: elements.Radio,
|
||||
tbxInsFranchise: elements.InputNumber,
|
||||
cbxInsUnlimitDrivers: elements.Switch,
|
||||
tbxInsAgeDrivers: elements.InputNumber,
|
||||
tbxInsExpDrivers: elements.InputNumber,
|
||||
tbxINNForCalc: elements.InputNumber,
|
||||
selectGPSBrand: elements.Select,
|
||||
selectGPSModel: elements.Select,
|
||||
selectRegionRegistration: elements.Select,
|
||||
selectTownRegistration: elements.Select,
|
||||
radioInfuranceOPF: elements.Radio,
|
||||
selectRegistration: elements.Select,
|
||||
selectInsNSIB: elements.Select,
|
||||
selectRequirementTelematic: elements.Select,
|
||||
selectTracker: elements.Select,
|
||||
selectTelematic: elements.Select,
|
||||
selectTechnicalCard: elements.Select,
|
||||
cbxLastPaymentRedemption: elements.Switch,
|
||||
cbxPriceWithDiscount: elements.Switch,
|
||||
cbxFullPriceWithDiscount: elements.Switch,
|
||||
cbxCostIncrease: elements.Switch,
|
||||
cbxInsurance: elements.Switch,
|
||||
cbxRegistrationQuote: elements.Switch,
|
||||
cbxTechnicalCardQuote: elements.Switch,
|
||||
cbxNSIB: elements.Switch,
|
||||
cbxQuoteRedemptionGraph: elements.Switch,
|
||||
cbxShowFinGAP: elements.Switch,
|
||||
tbxQuoteName: elements.Input,
|
||||
radioQuoteContactGender: elements.Radio,
|
||||
cbxDisableChecks: elements.Switch,
|
||||
selectTarif: elements.Select,
|
||||
tbxCreditRate: elements.InputNumber,
|
||||
selectRate: elements.Select,
|
||||
tbxMaxPriceChange: elements.InputNumber,
|
||||
tbxImporterRewardPerc: elements.InputNumber,
|
||||
tbxImporterRewardRub: elements.InputNumber,
|
||||
selectLead: elements.Select,
|
||||
selectOpportunity: elements.Select,
|
||||
selectQuote: elements.Select,
|
||||
cbxRecalcWithRevision: elements.Checkbox,
|
||||
tbxIRR_Perc: elements.InputNumber,
|
||||
tbxMileage: elements.InputNumber,
|
||||
tbxEngineHours: elements.InputNumber,
|
||||
radioCalcType: elements.Segmented,
|
||||
tbxTotalPayments: elements.InputNumber,
|
||||
radioObjectRegistration: elements.Radio,
|
||||
selectObjectRegionRegistration: elements.Select,
|
||||
tbxVehicleTaxInYear: elements.InputNumber,
|
||||
tbxVehicleTaxInLeasingPeriod: elements.InputNumber,
|
||||
selectObjectCategoryTax: elements.Select,
|
||||
selectObjectTypeTax: elements.Select,
|
||||
radioTypePTS: elements.Radio,
|
||||
selectLegalClientRegion: elements.Select,
|
||||
selectLegalClientTown: elements.Select,
|
||||
selectSubsidy: elements.Select,
|
||||
selectFuelCard: elements.Select,
|
||||
tbxMinPriceChange: elements.InputNumber,
|
||||
tbxBonusCoefficient: elements.InputNumber,
|
||||
|
||||
/** Readonly Elements */
|
||||
labelLeaseObjectRisk: Text,
|
||||
tbxInsKaskoPriceLeasePeriod: InputNumber,
|
||||
labelIrrInfo: Text,
|
||||
labelRegistrationDescription: Text,
|
||||
labelDepreciationGroup: Text,
|
||||
tbxSubsidySum: InputNumber,
|
||||
labelLeaseObjectRisk: elements.Text,
|
||||
tbxInsKaskoPriceLeasePeriod: elements.InputNumber,
|
||||
labelIrrInfo: elements.Text,
|
||||
labelRegistrationDescription: elements.Text,
|
||||
labelDepreciationGroup: elements.Text,
|
||||
tbxSubsidySum: elements.InputNumber,
|
||||
|
||||
/** Button Elements */
|
||||
btnCreateKP: Button,
|
||||
btnCalculate: Button,
|
||||
btnCreateKP: elements.Button,
|
||||
btnCalculate: elements.Button,
|
||||
|
||||
/** Link Elements */
|
||||
linkDownloadKp: Link,
|
||||
linkLeadUrl: Link,
|
||||
linkOpportunityUrl: Link,
|
||||
linkQuoteUrl: Link,
|
||||
linkDownloadKp: elements.Link,
|
||||
linkLeadUrl: elements.Link,
|
||||
linkOpportunityUrl: elements.Link,
|
||||
linkQuoteUrl: elements.Link,
|
||||
});
|
||||
|
||||
export default components;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { MAX_FRANCHISE, MAX_LEASING_PERIOD } from 'constants/values';
|
||||
import dayjs from 'dayjs';
|
||||
import DownloadOutlined from 'Elements/icons/DownloadOutlined';
|
||||
import { formatter, formatterExtra, parser } from 'tools/number';
|
||||
import DownloadOutlined from 'ui/elements/icons/DownloadOutlined';
|
||||
import CurrencyAddon from '../addons/currency-addon';
|
||||
import type { ElementsProps } from './elements-components';
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
/* eslint-disable object-curly-newline */
|
||||
import { Container, Head } from 'Components/Layout/Element';
|
||||
import Link from 'Elements/Link';
|
||||
import Tooltip from 'Elements/Tooltip';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import type { ComponentProps } from 'react';
|
||||
import { useStore } from 'stores/hooks';
|
||||
import Link from 'ui/elements/Link';
|
||||
import Tooltip from 'ui/elements/Tooltip';
|
||||
import buildReadonly from '../../builders/build-readonly';
|
||||
import builders from '../elements-builders';
|
||||
import components from '../elements-components';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* eslint-disable react/no-array-index-key */
|
||||
import Divider from 'Elements/layout/Divider';
|
||||
import type { BoxProps } from 'UIKit/grid';
|
||||
import { Box } from 'UIKit/grid';
|
||||
import Divider from 'ui/elements/layout/Divider';
|
||||
import type { BoxProps } from 'ui/grid';
|
||||
import { Box } from 'ui/grid';
|
||||
import elementsRender from '../config/elements-render';
|
||||
import type { Elements as ActionElements } from '../config/map/actions';
|
||||
import type { Elements as ValuesElements } from '../config/map/values';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
import Button from 'Elements/Button';
|
||||
import Result from 'Elements/Result';
|
||||
import Button from 'ui/elements/Button';
|
||||
import Result from 'ui/elements/Result';
|
||||
|
||||
function handleRetry() {
|
||||
window.location.reload();
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { getUser } from 'api/user/query';
|
||||
import styled from 'styled-components';
|
||||
import { Flex } from 'UIKit/grid';
|
||||
import { min } from 'UIKit/mq';
|
||||
import { Flex } from 'ui/grid';
|
||||
import { min } from 'ui/mq';
|
||||
|
||||
const UserText = styled.span`
|
||||
margin: 0;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { ReactNode } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { Flex } from 'UIKit/grid';
|
||||
import { min } from 'UIKit/mq';
|
||||
import { Flex } from 'ui/grid';
|
||||
import { min } from 'ui/mq';
|
||||
|
||||
const ElementTitle = styled.label`
|
||||
color: rgba(0, 0, 0, 0.75);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/* eslint-disable import/no-unresolved */
|
||||
import styled from 'styled-components';
|
||||
import { Flex } from 'UIKit/grid';
|
||||
import { min } from 'UIKit/mq';
|
||||
import { Flex } from 'ui/grid';
|
||||
import { min } from 'ui/mq';
|
||||
import Auth from './Auth';
|
||||
import Logo from './Logo';
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import Image from 'next/image';
|
||||
import logo from 'public/assets/images/logo-primary.svg';
|
||||
import styled from 'styled-components';
|
||||
import { Flex } from 'UIKit/grid';
|
||||
import { min } from 'UIKit/mq';
|
||||
import { Flex } from 'ui/grid';
|
||||
import { min } from 'ui/mq';
|
||||
|
||||
const ImageWrapper = styled.div`
|
||||
width: 100px;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* eslint-disable react/prop-types */
|
||||
/* eslint-disable import/no-unresolved */
|
||||
import { Flex } from 'UIKit/grid';
|
||||
import { Flex } from 'ui/grid';
|
||||
import Header from './Header';
|
||||
|
||||
export default function Layout({ children }) {
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { MAX_LEASING_PERIOD } from 'constants/values';
|
||||
import Table from 'Elements/Table';
|
||||
import { toJS } from 'mobx';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { useStore } from 'stores/hooks';
|
||||
import Table from 'ui/elements/Table';
|
||||
import { columns } from './config';
|
||||
|
||||
const PaymentsTable = observer(() => {
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import { Container, Head } from 'Components/Layout/Element';
|
||||
import Text from 'Elements/Text';
|
||||
import { toJS } from 'mobx';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { useStore } from 'stores/hooks';
|
||||
import styled from 'styled-components';
|
||||
import { Box } from 'UIKit/grid';
|
||||
import { min } from 'UIKit/mq';
|
||||
import Text from 'ui/elements/Text';
|
||||
import { Box } from 'ui/grid';
|
||||
import { min } from 'ui/mq';
|
||||
import { formatters, id, title, titles } from './config';
|
||||
|
||||
const Grid = styled(Box)`
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import Alert from 'Elements/Alert';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { useStore } from 'stores/hooks';
|
||||
import styled from 'styled-components';
|
||||
import { Box, Flex } from 'UIKit/grid';
|
||||
import Alert from 'ui/elements/Alert';
|
||||
import { Box, Flex } from 'ui/grid';
|
||||
|
||||
const Bold = styled.span`
|
||||
font-weight: bold;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import Background from 'Elements/layout/Background';
|
||||
import Tabs from 'Elements/layout/Tabs';
|
||||
import styled from 'styled-components';
|
||||
import { min } from 'UIKit/mq';
|
||||
import Background from 'ui/elements/layout/Background';
|
||||
import Tabs from 'ui/elements/layout/Tabs';
|
||||
import { min } from 'ui/mq';
|
||||
import PaymentsTable from './PaymentsTable';
|
||||
import Results from './Results';
|
||||
import Validation from './Validation';
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
import { mediaQuery } from './mq';
|
||||
|
||||
const theme = {
|
||||
...mediaQuery,
|
||||
};
|
||||
|
||||
export default theme;
|
||||
18
package.json
18
package.json
@ -1,7 +1,10 @@
|
||||
{
|
||||
"name": "evocalculator.client2",
|
||||
"version": "0.1.0",
|
||||
"name": "evocalculator.client",
|
||||
"version": "2.0.0",
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"@packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
@ -12,13 +15,13 @@
|
||||
"precommit": "yarn prettier && yarn lint:fix && yarn test",
|
||||
"graphql:codegen": "graphql-codegen --config .graphqlrc.yml",
|
||||
"graphql:download-schema": "dotenv -e .env.local apollo client:download-schema graphql/crm.schema.graphql",
|
||||
"graphql:update": "yarn graphql:codegen & yarn graphql:download-schema",
|
||||
"prepare": "husky install",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:ci": "jest --ci"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "^4.7.0",
|
||||
"@apollo/client": "^3.7.0",
|
||||
"@fontsource/montserrat": "^4.5.12",
|
||||
"@tanstack/react-query": "^4.14.1",
|
||||
@ -26,25 +29,25 @@
|
||||
"@trpc/next": "^10.0.0-rc.3",
|
||||
"@trpc/react-query": "^10.0.0-rc.3",
|
||||
"@trpc/server": "^10.0.0-rc.3",
|
||||
"antd": "^4.21.3",
|
||||
"axios": "^1.1.3",
|
||||
"dayjs": "^1.11.2",
|
||||
"less": "^4.1.3",
|
||||
"less-loader": "^11.0.0",
|
||||
"mobx": "^6.5.0",
|
||||
"mobx": "^6.7.0",
|
||||
"mobx-react-lite": "^3.4.0",
|
||||
"next": "^12.3.0",
|
||||
"next-compose-plugins": "^2.2.1",
|
||||
"next-plugin-graphql": "^0.0.2",
|
||||
"next-with-less": "^2.0.5",
|
||||
"normalize.css": "^8.0.1",
|
||||
"radash": "^8.0.0",
|
||||
"radash": "^10.3.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"rebass": "^4.0.7",
|
||||
"sharp": "^0.30.4",
|
||||
"styled-components": "^5.3.5",
|
||||
"superjson": "^1.11.0",
|
||||
"tools": "*",
|
||||
"ui": "*",
|
||||
"use-debounce": "^8.0.1",
|
||||
"zod": "^3.19.1"
|
||||
},
|
||||
@ -58,7 +61,6 @@
|
||||
"@types/node": "18.7.18",
|
||||
"@types/react": "18.0.20",
|
||||
"@types/react-dom": "18.0.6",
|
||||
"@types/rebass": "^4.0.10",
|
||||
"@types/styled-components": "^5.1.25",
|
||||
"@typescript-eslint/eslint-plugin": "^5.37.0",
|
||||
"@typescript-eslint/parser": "^5.37.0",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import Result from 'Elements/Result';
|
||||
import Result from 'ui/elements/Result';
|
||||
|
||||
export default function NotFound() {
|
||||
return <Result status="404" title="404" subTitle="Тут ничего нет" />;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import Result from 'Elements/Result';
|
||||
import Result from 'ui/elements/Result';
|
||||
|
||||
export default function ServerError() {
|
||||
return <Result status="500" title="Ой" subTitle=" Что-то сломалось" />;
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
/* eslint-disable global-require */
|
||||
import { ApolloProvider } from '@apollo/client';
|
||||
import { QueryClientProvider } from '@tanstack/react-query';
|
||||
import { ConfigProvider } from 'antd';
|
||||
import 'antd/dist/antd.less';
|
||||
import Layout from 'Components/Layout';
|
||||
import Head from 'next/head';
|
||||
import 'normalize.css';
|
||||
@ -10,12 +8,13 @@ import { useMemo } from 'react';
|
||||
import StoreProvider from 'stores/Provider';
|
||||
import { ThemeProvider } from 'styled-components';
|
||||
import { trpcClient } from 'trpc/client';
|
||||
import { GlobalStyle } from 'UIKit/colors';
|
||||
import theme from 'UIKit/theme';
|
||||
import { GlobalStyle } from 'ui/colors';
|
||||
import { ConfigProvider, ru_RU } from 'ui/elements/config';
|
||||
import 'ui/elements/styles/antd.less';
|
||||
import theme from 'ui/theme';
|
||||
import '../styles/fonts.css';
|
||||
import '../styles/globals.css';
|
||||
|
||||
import ruRU from 'antd/lib/locale/ru_RU';
|
||||
import initializeQueryClient from 'api/client';
|
||||
import initializeApollo from 'apollo/client';
|
||||
|
||||
@ -38,7 +37,7 @@ function App({ Component, pageProps }) {
|
||||
</Head>
|
||||
<GlobalStyle />
|
||||
<StoreProvider {...pageProps}>
|
||||
<ConfigProvider locale={ruRU}>
|
||||
<ConfigProvider locale={ru_RU}>
|
||||
<ApolloProvider client={apolloClient}>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<Layout>
|
||||
|
||||
@ -8,8 +8,8 @@ import Head from 'next/head';
|
||||
import { getOwnerData, useInsuranceData, useMainData } from 'process/init/get-data';
|
||||
import { useReactions } from 'process/init/inject-reactions/hooks';
|
||||
import styled from 'styled-components';
|
||||
import { Box } from 'UIKit/grid';
|
||||
import { min } from 'UIKit/mq';
|
||||
import { Box } from 'ui/grid';
|
||||
import { min } from 'ui/mq';
|
||||
|
||||
const Grid = styled(Box)`
|
||||
display: flex;
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import message from 'Elements/message';
|
||||
import { reaction } from 'mobx';
|
||||
import type { ReactionsContext } from 'process/types';
|
||||
import { pick } from 'radash';
|
||||
import extend from 'stores/tables/insurance/tools';
|
||||
import message from 'ui/elements/message';
|
||||
|
||||
const key = 'KP_LOADING_INFO';
|
||||
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
import titles from 'Components/Calculation/config/elements-titles';
|
||||
import type * as Values from 'Components/Calculation/config/map/values';
|
||||
import { getValueName } from 'Components/Calculation/config/map/values';
|
||||
import type { BaseOption } from 'Elements/types';
|
||||
import { observable } from 'mobx';
|
||||
import type RootStore from 'stores/root';
|
||||
import Validation from 'stores/validation';
|
||||
import type { BaseOption } from 'ui/elements/types';
|
||||
import type { RemoveError, ValidationParams } from '../validation/types';
|
||||
import OptionsStore from './options';
|
||||
import StatusStore from './statuses';
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
/* eslint-disable unicorn/prefer-set-has */
|
||||
import type { Elements, ElementsTypes } from 'Components/Calculation/config/map/values';
|
||||
import defaultOptions from 'config/default-options';
|
||||
import type { BaseOption } from 'Elements/types';
|
||||
import { makeAutoObservable } from 'mobx';
|
||||
import type RootStore from 'stores/root';
|
||||
import type { BaseOption } from 'ui/elements/types';
|
||||
import type { CalculationOptions } from './types';
|
||||
|
||||
export default class OptionsStore {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { Elements, ElementsTypes } from 'Components/Calculation/config/map/values';
|
||||
import type { BaseOption } from 'Elements/types';
|
||||
import type { BaseOption } from 'ui/elements/types';
|
||||
|
||||
export type CalculationOptions = {
|
||||
[ElementName in Elements]: BaseOption<ElementsTypes[ElementName]>[];
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
import type { Elements as ElementsActions } from 'Components/Calculation/config/map/actions';
|
||||
import type { Elements as ElementsValues } from 'Components/Calculation/config/map/values';
|
||||
import defaultStatuses from 'config/default-statuses';
|
||||
import type { Status } from 'Elements/types';
|
||||
import { makeAutoObservable } from 'mobx';
|
||||
import type RootStore from 'stores/root';
|
||||
import type { Status } from 'ui/elements/types';
|
||||
import type { CalculationStatuses } from './types';
|
||||
|
||||
export default class StatusStore {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { Elements as ElementsActions } from 'Components/Calculation/config/map/actions';
|
||||
import type { Elements as ElementsValues } from 'Components/Calculation/config/map/values';
|
||||
import type { Status } from 'Elements/types';
|
||||
import type { Status } from 'ui/elements/types';
|
||||
|
||||
export type CalculationStatuses = Record<ElementsValues | ElementsActions, Status>;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { Status } from 'Elements/types';
|
||||
import type { IObservableArray } from 'mobx';
|
||||
import { makeAutoObservable, observable, reaction } from 'mobx';
|
||||
import type { Status } from 'ui/elements/types';
|
||||
|
||||
import type RootStore from 'stores/root';
|
||||
import Validation from '../../validation';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import type { Status } from 'Elements/types';
|
||||
import type { Status } from 'ui/elements/types';
|
||||
|
||||
export type Row = {
|
||||
value: number;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import notification from 'Elements/notification';
|
||||
import { makeAutoObservable } from 'mobx';
|
||||
import notification from 'ui/elements/notification';
|
||||
import type { ValidationConfig } from './types';
|
||||
|
||||
export default class Validation {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user