@redneckz/wildless-cms-uni-blocks 0.14.94 → 0.14.96
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/bundle/bundle.umd.js +25 -30
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/CalculatorValueBlock.d.ts +4 -2
- package/bundle/components/Calculator/Rate.d.ts +2 -2
- package/bundle/components/Calculator/getDefaultValues.d.ts +0 -1
- package/bundle/components/Calculator/rangeHelpers.d.ts +0 -1
- package/bundle/components/Calculator/renderRate.d.ts +4 -9
- package/bundle/utils/toLocalNumberFormat.d.ts +3 -1
- package/dist/components/Calculator/CalculatorValueBlock.d.ts +4 -2
- package/dist/components/Calculator/CalculatorValueBlock.js +3 -1
- package/dist/components/Calculator/CalculatorValueBlock.js.map +1 -1
- package/dist/components/Calculator/Rate.d.ts +2 -2
- package/dist/components/Calculator/Rate.js +2 -1
- package/dist/components/Calculator/Rate.js.map +1 -1
- package/dist/components/Calculator/getDefaultValues.d.ts +0 -1
- package/dist/components/Calculator/getDefaultValues.js +1 -7
- package/dist/components/Calculator/getDefaultValues.js.map +1 -1
- package/dist/components/Calculator/rangeHelpers.d.ts +0 -1
- package/dist/components/Calculator/rangeHelpers.js +1 -4
- package/dist/components/Calculator/rangeHelpers.js.map +1 -1
- package/dist/components/Calculator/renderRate.d.ts +4 -9
- package/dist/components/Calculator/renderRate.js +1 -8
- package/dist/components/Calculator/renderRate.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenuItem.js +1 -4
- package/dist/components/StickyBottomMenu/StickyBottomMenuItem.js.map +1 -1
- package/dist/utils/toLocalNumberFormat.d.ts +3 -1
- package/dist/utils/toLocalNumberFormat.js +2 -2
- package/dist/utils/toLocalNumberFormat.js.map +1 -1
- package/lib/components/Calculator/CalculatorValueBlock.d.ts +4 -2
- package/lib/components/Calculator/CalculatorValueBlock.js +3 -1
- package/lib/components/Calculator/CalculatorValueBlock.js.map +1 -1
- package/lib/components/Calculator/Rate.d.ts +2 -2
- package/lib/components/Calculator/Rate.js +2 -1
- package/lib/components/Calculator/Rate.js.map +1 -1
- package/lib/components/Calculator/getDefaultValues.d.ts +0 -1
- package/lib/components/Calculator/getDefaultValues.js +1 -6
- package/lib/components/Calculator/getDefaultValues.js.map +1 -1
- package/lib/components/Calculator/rangeHelpers.d.ts +0 -1
- package/lib/components/Calculator/rangeHelpers.js +0 -2
- package/lib/components/Calculator/rangeHelpers.js.map +1 -1
- package/lib/components/Calculator/renderRate.d.ts +4 -9
- package/lib/components/Calculator/renderRate.js +1 -8
- package/lib/components/Calculator/renderRate.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenuItem.js +1 -4
- package/lib/components/StickyBottomMenu/StickyBottomMenuItem.js.map +1 -1
- package/lib/utils/toLocalNumberFormat.d.ts +3 -1
- package/lib/utils/toLocalNumberFormat.js +2 -2
- package/lib/utils/toLocalNumberFormat.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +26 -34
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/CalculatorValueBlock.d.ts +4 -2
- package/mobile/bundle/components/Calculator/Rate.d.ts +2 -2
- package/mobile/bundle/components/Calculator/getDefaultValues.d.ts +0 -1
- package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +0 -1
- package/mobile/bundle/components/Calculator/renderRate.d.ts +4 -9
- package/mobile/bundle/utils/toLocalNumberFormat.d.ts +3 -1
- package/mobile/dist/components/Calculator/CalculatorValueBlock.d.ts +4 -2
- package/mobile/dist/components/Calculator/CalculatorValueBlock.js +3 -1
- package/mobile/dist/components/Calculator/CalculatorValueBlock.js.map +1 -1
- package/mobile/dist/components/Calculator/Rate.d.ts +2 -2
- package/mobile/dist/components/Calculator/Rate.js +2 -1
- package/mobile/dist/components/Calculator/Rate.js.map +1 -1
- package/mobile/dist/components/Calculator/getDefaultValues.d.ts +0 -1
- package/mobile/dist/components/Calculator/getDefaultValues.js +1 -7
- package/mobile/dist/components/Calculator/getDefaultValues.js.map +1 -1
- package/mobile/dist/components/Calculator/rangeHelpers.d.ts +0 -1
- package/mobile/dist/components/Calculator/rangeHelpers.js +1 -4
- package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -1
- package/mobile/dist/components/Calculator/renderRate.d.ts +4 -9
- package/mobile/dist/components/Calculator/renderRate.js +1 -8
- package/mobile/dist/components/Calculator/renderRate.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuItem.js +1 -4
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuItem.js.map +1 -1
- package/mobile/dist/utils/toLocalNumberFormat.d.ts +3 -1
- package/mobile/dist/utils/toLocalNumberFormat.js +2 -2
- package/mobile/dist/utils/toLocalNumberFormat.js.map +1 -1
- package/mobile/lib/components/Calculator/CalculatorValueBlock.d.ts +4 -2
- package/mobile/lib/components/Calculator/CalculatorValueBlock.js +3 -1
- package/mobile/lib/components/Calculator/CalculatorValueBlock.js.map +1 -1
- package/mobile/lib/components/Calculator/Rate.d.ts +2 -2
- package/mobile/lib/components/Calculator/Rate.js +2 -1
- package/mobile/lib/components/Calculator/Rate.js.map +1 -1
- package/mobile/lib/components/Calculator/getDefaultValues.d.ts +0 -1
- package/mobile/lib/components/Calculator/getDefaultValues.js +1 -6
- package/mobile/lib/components/Calculator/getDefaultValues.js.map +1 -1
- package/mobile/lib/components/Calculator/rangeHelpers.d.ts +0 -1
- package/mobile/lib/components/Calculator/rangeHelpers.js +0 -2
- package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -1
- package/mobile/lib/components/Calculator/renderRate.d.ts +4 -9
- package/mobile/lib/components/Calculator/renderRate.js +1 -8
- package/mobile/lib/components/Calculator/renderRate.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuItem.js +1 -4
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuItem.js.map +1 -1
- package/mobile/lib/utils/toLocalNumberFormat.d.ts +3 -1
- package/mobile/lib/utils/toLocalNumberFormat.js +2 -2
- package/mobile/lib/utils/toLocalNumberFormat.js.map +1 -1
- package/mobile/src/components/Calculator/CalculatorValueBlock.tsx +8 -4
- package/mobile/src/components/Calculator/Rate.tsx +5 -4
- package/mobile/src/components/Calculator/getDefaultValues.ts +0 -9
- package/mobile/src/components/Calculator/rangeHelpers.ts +0 -10
- package/mobile/src/components/Calculator/renderRate.tsx +23 -44
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenuItem.tsx +1 -5
- package/mobile/src/utils/toLocalNumberFormat.ts +2 -2
- package/package.json +1 -1
- package/src/components/Calculator/CalculatorValueBlock.tsx +8 -4
- package/src/components/Calculator/Rate.tsx +5 -4
- package/src/components/Calculator/getDefaultValues.ts +0 -9
- package/src/components/Calculator/rangeHelpers.ts +0 -10
- package/src/components/Calculator/renderRate.tsx +23 -44
- package/src/components/StickyBottomMenu/StickyBottomMenuItem.tsx +1 -5
- package/src/utils/toLocalNumberFormat.ts +2 -2
- package/bundle/components/Calculator/getCreditRate.d.ts +0 -7
- package/bundle/components/Calculator/getDefaultMonths.d.ts +0 -1
- package/bundle/components/Calculator/renderInitialFeeInput.d.ts +0 -6
- package/bundle/components/Calculator/renderRealEstateValue.d.ts +0 -6
- package/dist/components/Calculator/getCreditRate.d.ts +0 -7
- package/dist/components/Calculator/getCreditRate.js +0 -14
- package/dist/components/Calculator/getCreditRate.js.map +0 -1
- package/dist/components/Calculator/getDefaultMonths.d.ts +0 -1
- package/dist/components/Calculator/getDefaultMonths.js +0 -5
- package/dist/components/Calculator/getDefaultMonths.js.map +0 -1
- package/dist/components/Calculator/renderInitialFeeInput.d.ts +0 -6
- package/dist/components/Calculator/renderInitialFeeInput.js +0 -19
- package/dist/components/Calculator/renderInitialFeeInput.js.map +0 -1
- package/dist/components/Calculator/renderRealEstateValue.d.ts +0 -6
- package/dist/components/Calculator/renderRealEstateValue.js +0 -16
- package/dist/components/Calculator/renderRealEstateValue.js.map +0 -1
- package/lib/components/Calculator/getCreditRate.d.ts +0 -7
- package/lib/components/Calculator/getCreditRate.js +0 -11
- package/lib/components/Calculator/getCreditRate.js.map +0 -1
- package/lib/components/Calculator/getDefaultMonths.d.ts +0 -1
- package/lib/components/Calculator/getDefaultMonths.js +0 -2
- package/lib/components/Calculator/getDefaultMonths.js.map +0 -1
- package/lib/components/Calculator/renderInitialFeeInput.d.ts +0 -6
- package/lib/components/Calculator/renderInitialFeeInput.js +0 -16
- package/lib/components/Calculator/renderInitialFeeInput.js.map +0 -1
- package/lib/components/Calculator/renderRealEstateValue.d.ts +0 -6
- package/lib/components/Calculator/renderRealEstateValue.js +0 -13
- package/lib/components/Calculator/renderRealEstateValue.js.map +0 -1
- package/mobile/bundle/components/Calculator/getCreditRate.d.ts +0 -7
- package/mobile/bundle/components/Calculator/getDefaultMonths.d.ts +0 -1
- package/mobile/bundle/components/Calculator/renderInitialFeeInput.d.ts +0 -6
- package/mobile/bundle/components/Calculator/renderRealEstateValue.d.ts +0 -6
- package/mobile/dist/components/Calculator/getCreditRate.d.ts +0 -7
- package/mobile/dist/components/Calculator/getCreditRate.js +0 -14
- package/mobile/dist/components/Calculator/getCreditRate.js.map +0 -1
- package/mobile/dist/components/Calculator/getDefaultMonths.d.ts +0 -1
- package/mobile/dist/components/Calculator/getDefaultMonths.js +0 -5
- package/mobile/dist/components/Calculator/getDefaultMonths.js.map +0 -1
- package/mobile/dist/components/Calculator/renderInitialFeeInput.d.ts +0 -6
- package/mobile/dist/components/Calculator/renderInitialFeeInput.js +0 -19
- package/mobile/dist/components/Calculator/renderInitialFeeInput.js.map +0 -1
- package/mobile/dist/components/Calculator/renderRealEstateValue.d.ts +0 -6
- package/mobile/dist/components/Calculator/renderRealEstateValue.js +0 -16
- package/mobile/dist/components/Calculator/renderRealEstateValue.js.map +0 -1
- package/mobile/lib/components/Calculator/getCreditRate.d.ts +0 -7
- package/mobile/lib/components/Calculator/getCreditRate.js +0 -11
- package/mobile/lib/components/Calculator/getCreditRate.js.map +0 -1
- package/mobile/lib/components/Calculator/getDefaultMonths.d.ts +0 -1
- package/mobile/lib/components/Calculator/getDefaultMonths.js +0 -2
- package/mobile/lib/components/Calculator/getDefaultMonths.js.map +0 -1
- package/mobile/lib/components/Calculator/renderInitialFeeInput.d.ts +0 -6
- package/mobile/lib/components/Calculator/renderInitialFeeInput.js +0 -16
- package/mobile/lib/components/Calculator/renderInitialFeeInput.js.map +0 -1
- package/mobile/lib/components/Calculator/renderRealEstateValue.d.ts +0 -6
- package/mobile/lib/components/Calculator/renderRealEstateValue.js +0 -13
- package/mobile/lib/components/Calculator/renderRealEstateValue.js.map +0 -1
- package/mobile/src/components/Calculator/getCreditRate.ts +0 -20
- package/mobile/src/components/Calculator/getDefaultMonths.ts +0 -2
- package/mobile/src/components/Calculator/renderInitialFeeInput.tsx +0 -36
- package/mobile/src/components/Calculator/renderRealEstateValue.tsx +0 -33
- package/src/components/Calculator/getCreditRate.ts +0 -20
- package/src/components/Calculator/getDefaultMonths.ts +0 -2
- package/src/components/Calculator/renderInitialFeeInput.tsx +0 -36
- package/src/components/Calculator/renderRealEstateValue.tsx +0 -33
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { Text } from '../../ui-kit/Text/Text';
|
|
3
|
+
import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
|
|
3
4
|
|
|
4
5
|
export interface RateProps {
|
|
5
|
-
rate: number;
|
|
6
|
+
rate: number | undefined;
|
|
6
7
|
title?: string;
|
|
7
8
|
unit?: string;
|
|
9
|
+
fractionDigits?: number;
|
|
8
10
|
depositeName?: string;
|
|
9
11
|
isShowDepositeName?: boolean;
|
|
10
|
-
fractionDigits?: number;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export const Rate = JSX<RateProps>(
|
|
14
|
-
({ rate, title = 'Ставка', unit,
|
|
15
|
+
({ rate = 0, title = 'Ставка', unit, fractionDigits = 2, depositeName, isShowDepositeName }) => (
|
|
15
16
|
<div>
|
|
16
17
|
<Text size="text-l" font="font-light" color="text-secondary-text">
|
|
17
18
|
{title}
|
|
@@ -19,7 +20,7 @@ export const Rate = JSX<RateProps>(
|
|
|
19
20
|
<div className="relative">
|
|
20
21
|
<div className="flex justify-start gradient-color-text">
|
|
21
22
|
<span className="font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]">
|
|
22
|
-
{
|
|
23
|
+
{toLocalNumberFormat(fractionDigits, { fixed: true })(rate)}
|
|
23
24
|
</span>
|
|
24
25
|
{unit ? <span className="text-7xl">{unit}</span> : null}
|
|
25
26
|
</div>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { CommonDefaultParams } from './CalculatorContent';
|
|
2
2
|
import {
|
|
3
|
-
BUSINESS_MAX_DAYS,
|
|
4
|
-
BUSINESS_MIN_DAYS,
|
|
5
3
|
DEFAULT_MAX_MONTHS,
|
|
6
4
|
DEFAULT_MAX_SUM,
|
|
7
5
|
DEFAULT_MIN_MONTHS,
|
|
@@ -19,10 +17,3 @@ export const getMonthsDefaultValue = (defaultParams?: CommonDefaultParams, defau
|
|
|
19
17
|
defaultParams.period <= DEFAULT_MAX_MONTHS
|
|
20
18
|
? defaultParams.period
|
|
21
19
|
: defaultMonth;
|
|
22
|
-
|
|
23
|
-
export const getDaysDefaultValue = (defaultParams?: CommonDefaultParams, defaultDays = 0) =>
|
|
24
|
-
defaultParams?.period &&
|
|
25
|
-
defaultParams.period >= BUSINESS_MIN_DAYS &&
|
|
26
|
-
defaultParams.period <= BUSINESS_MAX_DAYS
|
|
27
|
-
? defaultParams.period
|
|
28
|
-
: defaultDays;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { max } from '../../utils/maxBy';
|
|
2
|
-
import { mergeIntervals } from '../../utils/mergeIntervals';
|
|
3
2
|
import { min } from '../../utils/minBy';
|
|
4
3
|
|
|
5
4
|
export const getLimitRangeByKeys = <
|
|
@@ -34,15 +33,6 @@ export const getRangeByKeys = <
|
|
|
34
33
|
: 0,
|
|
35
34
|
});
|
|
36
35
|
|
|
37
|
-
export const getMergeRangesByKeys = <
|
|
38
|
-
MinKey extends string,
|
|
39
|
-
MaxKey extends string,
|
|
40
|
-
T extends Record<MinKey | MaxKey, number>,
|
|
41
|
-
>(
|
|
42
|
-
[minKey, maxKey]: [MinKey, MaxKey],
|
|
43
|
-
rows: T[] = [],
|
|
44
|
-
) => mergeIntervals(rows.map((row) => [row[minKey], row[maxKey]]));
|
|
45
|
-
|
|
46
36
|
export const checkRangeByKeys = <
|
|
47
37
|
MinKey extends string,
|
|
48
38
|
MaxKey extends string,
|
|
@@ -1,56 +1,35 @@
|
|
|
1
1
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
2
|
-
import { Rate } from './Rate';
|
|
3
|
-
import { UnknownRate } from './UnknownRate';
|
|
2
|
+
import { Rate, type RateProps } from './Rate';
|
|
3
|
+
import { UnknownRate, type UnknownRateProps } from './UnknownRate';
|
|
4
4
|
|
|
5
|
-
interface RenderRateProps {
|
|
6
|
-
rate: number;
|
|
7
|
-
depositeName?: string;
|
|
8
|
-
isUnavailableByTerm?: boolean;
|
|
9
|
-
isShowDepositeName?: boolean;
|
|
10
|
-
fractionDigits?: number;
|
|
5
|
+
interface RenderRateProps extends RateProps, UnknownRateProps {
|
|
11
6
|
isUnknownRateShown?: boolean;
|
|
12
|
-
title?: string;
|
|
13
|
-
unit?: string;
|
|
14
7
|
}
|
|
15
8
|
|
|
16
|
-
const renderDesktopRate = ({
|
|
17
|
-
rate,
|
|
18
|
-
depositeName,
|
|
19
|
-
fractionDigits,
|
|
20
|
-
isShowDepositeName,
|
|
21
|
-
title,
|
|
22
|
-
unit,
|
|
23
|
-
}: RenderRateProps) => (
|
|
24
|
-
<Rate
|
|
25
|
-
rate={rate}
|
|
26
|
-
depositeName={depositeName}
|
|
27
|
-
fractionDigits={fractionDigits}
|
|
28
|
-
isShowDepositeName={isShowDepositeName}
|
|
29
|
-
unit={unit}
|
|
30
|
-
title={title}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
const renderMobileRate = ({ rate, title, unit }: RenderRateProps) => (
|
|
35
|
-
<CalculatorValueBlock title={title} value={rate} postfix={unit} />
|
|
36
|
-
);
|
|
37
|
-
|
|
38
9
|
export const renderRate = ({
|
|
39
|
-
isUnknownRateShown = true,
|
|
40
|
-
isUnavailableByTerm = false,
|
|
41
10
|
title = 'Ставка',
|
|
42
|
-
unit = '%',
|
|
43
11
|
rate = 0,
|
|
12
|
+
unit = '%',
|
|
13
|
+
fractionDigits = 2,
|
|
14
|
+
isUnknownRateShown = true,
|
|
44
15
|
...rest
|
|
45
|
-
}: RenderRateProps) =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return (
|
|
16
|
+
}: RenderRateProps) =>
|
|
17
|
+
isUnknownRateShown && rate === 0 ? (
|
|
18
|
+
<UnknownRate title={title} {...rest} />
|
|
19
|
+
) : (
|
|
51
20
|
<div>
|
|
52
|
-
<div className="hidden @xl:block">
|
|
53
|
-
|
|
21
|
+
<div className="hidden @xl:block">
|
|
22
|
+
<Rate title={title} rate={rate} unit={unit} fractionDigits={fractionDigits} {...rest} />
|
|
23
|
+
</div>
|
|
24
|
+
<div className="@xl:hidden">
|
|
25
|
+
<CalculatorValueBlock
|
|
26
|
+
title={title}
|
|
27
|
+
value={rate}
|
|
28
|
+
postfix={unit}
|
|
29
|
+
fractionDigits={fractionDigits}
|
|
30
|
+
fixed={true}
|
|
31
|
+
{...rest}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
54
34
|
</div>
|
|
55
35
|
);
|
|
56
|
-
};
|
|
@@ -16,12 +16,8 @@ export const StickyBottomMenuItem = JSX<StickyBottomMenuItemProps>(
|
|
|
16
16
|
const isAnotherPortal =
|
|
17
17
|
!projectSettings?.BASE_PATH || !item?.href?.startsWith(projectSettings.BASE_PATH);
|
|
18
18
|
|
|
19
|
-
const _href = !projectSettings.BASE_PATH
|
|
20
|
-
? item?.href
|
|
21
|
-
: item?.href?.replace(projectSettings.BASE_PATH, '');
|
|
22
|
-
|
|
23
19
|
const link = useLink({ isRemote: isAnotherPortal });
|
|
24
|
-
const { href, onClick: handleClick } = link({ href:
|
|
20
|
+
const { href, onClick: handleClick } = link({ href: item?.href, onClick });
|
|
25
21
|
|
|
26
22
|
return (
|
|
27
23
|
<a
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const toLocalNumberFormat =
|
|
2
|
-
(fractionDigits = 0) =>
|
|
2
|
+
(fractionDigits = 0, { fixed }: { fixed?: boolean } = {}) =>
|
|
3
3
|
(_: string | number | undefined = 0): string =>
|
|
4
4
|
new Intl.NumberFormat('ru-RU', {
|
|
5
|
-
minimumFractionDigits: 0,
|
|
5
|
+
minimumFractionDigits: fixed ? fractionDigits : 0,
|
|
6
6
|
maximumFractionDigits: fractionDigits,
|
|
7
7
|
}).format(Number(_) || 0);
|
package/package.json
CHANGED
|
@@ -6,15 +6,17 @@ import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
|
|
|
6
6
|
const calculatorValueBlockStyle = 'flex justify-between @xl:flex-col';
|
|
7
7
|
|
|
8
8
|
export interface CalculatorValueBlockProps {
|
|
9
|
+
className?: string;
|
|
9
10
|
title?: string;
|
|
10
11
|
value?: number;
|
|
11
|
-
|
|
12
|
+
fractionDigits?: number;
|
|
13
|
+
fixed?: boolean;
|
|
12
14
|
prefix?: string;
|
|
13
|
-
|
|
15
|
+
postfix?: string;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export const CalculatorValueBlock = JSX<CalculatorValueBlockProps>(
|
|
17
|
-
({ title, value,
|
|
19
|
+
({ className, title, value, fractionDigits, fixed, prefix, postfix }) => (
|
|
18
20
|
<div className={style(calculatorValueBlockStyle, className)}>
|
|
19
21
|
{title ? (
|
|
20
22
|
<Text size="text-l" font="font-light" color="text-secondary-text">
|
|
@@ -24,7 +26,9 @@ export const CalculatorValueBlock = JSX<CalculatorValueBlockProps>(
|
|
|
24
26
|
{value ? (
|
|
25
27
|
<div>
|
|
26
28
|
<Text size="text-h3">
|
|
27
|
-
{prefix
|
|
29
|
+
{[prefix, toLocalNumberFormat(fractionDigits, { fixed })(value), postfix]
|
|
30
|
+
.filter(Boolean)
|
|
31
|
+
.join(' ')}
|
|
28
32
|
</Text>
|
|
29
33
|
</div>
|
|
30
34
|
) : (
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { Text } from '../../ui-kit/Text/Text';
|
|
3
|
+
import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat';
|
|
3
4
|
|
|
4
5
|
export interface RateProps {
|
|
5
|
-
rate: number;
|
|
6
|
+
rate: number | undefined;
|
|
6
7
|
title?: string;
|
|
7
8
|
unit?: string;
|
|
9
|
+
fractionDigits?: number;
|
|
8
10
|
depositeName?: string;
|
|
9
11
|
isShowDepositeName?: boolean;
|
|
10
|
-
fractionDigits?: number;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export const Rate = JSX<RateProps>(
|
|
14
|
-
({ rate, title = 'Ставка', unit,
|
|
15
|
+
({ rate = 0, title = 'Ставка', unit, fractionDigits = 2, depositeName, isShowDepositeName }) => (
|
|
15
16
|
<div>
|
|
16
17
|
<Text size="text-l" font="font-light" color="text-secondary-text">
|
|
17
18
|
{title}
|
|
@@ -19,7 +20,7 @@ export const Rate = JSX<RateProps>(
|
|
|
19
20
|
<div className="relative">
|
|
20
21
|
<div className="flex justify-start gradient-color-text">
|
|
21
22
|
<span className="font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]">
|
|
22
|
-
{
|
|
23
|
+
{toLocalNumberFormat(fractionDigits, { fixed: true })(rate)}
|
|
23
24
|
</span>
|
|
24
25
|
{unit ? <span className="text-7xl">{unit}</span> : null}
|
|
25
26
|
</div>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { CommonDefaultParams } from './CalculatorContent';
|
|
2
2
|
import {
|
|
3
|
-
BUSINESS_MAX_DAYS,
|
|
4
|
-
BUSINESS_MIN_DAYS,
|
|
5
3
|
DEFAULT_MAX_MONTHS,
|
|
6
4
|
DEFAULT_MAX_SUM,
|
|
7
5
|
DEFAULT_MIN_MONTHS,
|
|
@@ -19,10 +17,3 @@ export const getMonthsDefaultValue = (defaultParams?: CommonDefaultParams, defau
|
|
|
19
17
|
defaultParams.period <= DEFAULT_MAX_MONTHS
|
|
20
18
|
? defaultParams.period
|
|
21
19
|
: defaultMonth;
|
|
22
|
-
|
|
23
|
-
export const getDaysDefaultValue = (defaultParams?: CommonDefaultParams, defaultDays = 0) =>
|
|
24
|
-
defaultParams?.period &&
|
|
25
|
-
defaultParams.period >= BUSINESS_MIN_DAYS &&
|
|
26
|
-
defaultParams.period <= BUSINESS_MAX_DAYS
|
|
27
|
-
? defaultParams.period
|
|
28
|
-
: defaultDays;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { max } from '../../utils/maxBy';
|
|
2
|
-
import { mergeIntervals } from '../../utils/mergeIntervals';
|
|
3
2
|
import { min } from '../../utils/minBy';
|
|
4
3
|
|
|
5
4
|
export const getLimitRangeByKeys = <
|
|
@@ -34,15 +33,6 @@ export const getRangeByKeys = <
|
|
|
34
33
|
: 0,
|
|
35
34
|
});
|
|
36
35
|
|
|
37
|
-
export const getMergeRangesByKeys = <
|
|
38
|
-
MinKey extends string,
|
|
39
|
-
MaxKey extends string,
|
|
40
|
-
T extends Record<MinKey | MaxKey, number>,
|
|
41
|
-
>(
|
|
42
|
-
[minKey, maxKey]: [MinKey, MaxKey],
|
|
43
|
-
rows: T[] = [],
|
|
44
|
-
) => mergeIntervals(rows.map((row) => [row[minKey], row[maxKey]]));
|
|
45
|
-
|
|
46
36
|
export const checkRangeByKeys = <
|
|
47
37
|
MinKey extends string,
|
|
48
38
|
MaxKey extends string,
|
|
@@ -1,56 +1,35 @@
|
|
|
1
1
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
2
|
-
import { Rate } from './Rate';
|
|
3
|
-
import { UnknownRate } from './UnknownRate';
|
|
2
|
+
import { Rate, type RateProps } from './Rate';
|
|
3
|
+
import { UnknownRate, type UnknownRateProps } from './UnknownRate';
|
|
4
4
|
|
|
5
|
-
interface RenderRateProps {
|
|
6
|
-
rate: number;
|
|
7
|
-
depositeName?: string;
|
|
8
|
-
isUnavailableByTerm?: boolean;
|
|
9
|
-
isShowDepositeName?: boolean;
|
|
10
|
-
fractionDigits?: number;
|
|
5
|
+
interface RenderRateProps extends RateProps, UnknownRateProps {
|
|
11
6
|
isUnknownRateShown?: boolean;
|
|
12
|
-
title?: string;
|
|
13
|
-
unit?: string;
|
|
14
7
|
}
|
|
15
8
|
|
|
16
|
-
const renderDesktopRate = ({
|
|
17
|
-
rate,
|
|
18
|
-
depositeName,
|
|
19
|
-
fractionDigits,
|
|
20
|
-
isShowDepositeName,
|
|
21
|
-
title,
|
|
22
|
-
unit,
|
|
23
|
-
}: RenderRateProps) => (
|
|
24
|
-
<Rate
|
|
25
|
-
rate={rate}
|
|
26
|
-
depositeName={depositeName}
|
|
27
|
-
fractionDigits={fractionDigits}
|
|
28
|
-
isShowDepositeName={isShowDepositeName}
|
|
29
|
-
unit={unit}
|
|
30
|
-
title={title}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
const renderMobileRate = ({ rate, title, unit }: RenderRateProps) => (
|
|
35
|
-
<CalculatorValueBlock title={title} value={rate} postfix={unit} />
|
|
36
|
-
);
|
|
37
|
-
|
|
38
9
|
export const renderRate = ({
|
|
39
|
-
isUnknownRateShown = true,
|
|
40
|
-
isUnavailableByTerm = false,
|
|
41
10
|
title = 'Ставка',
|
|
42
|
-
unit = '%',
|
|
43
11
|
rate = 0,
|
|
12
|
+
unit = '%',
|
|
13
|
+
fractionDigits = 2,
|
|
14
|
+
isUnknownRateShown = true,
|
|
44
15
|
...rest
|
|
45
|
-
}: RenderRateProps) =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return (
|
|
16
|
+
}: RenderRateProps) =>
|
|
17
|
+
isUnknownRateShown && rate === 0 ? (
|
|
18
|
+
<UnknownRate title={title} {...rest} />
|
|
19
|
+
) : (
|
|
51
20
|
<div>
|
|
52
|
-
<div className="hidden @xl:block">
|
|
53
|
-
|
|
21
|
+
<div className="hidden @xl:block">
|
|
22
|
+
<Rate title={title} rate={rate} unit={unit} fractionDigits={fractionDigits} {...rest} />
|
|
23
|
+
</div>
|
|
24
|
+
<div className="@xl:hidden">
|
|
25
|
+
<CalculatorValueBlock
|
|
26
|
+
title={title}
|
|
27
|
+
value={rate}
|
|
28
|
+
postfix={unit}
|
|
29
|
+
fractionDigits={fractionDigits}
|
|
30
|
+
fixed={true}
|
|
31
|
+
{...rest}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
54
34
|
</div>
|
|
55
35
|
);
|
|
56
|
-
};
|
|
@@ -16,12 +16,8 @@ export const StickyBottomMenuItem = JSX<StickyBottomMenuItemProps>(
|
|
|
16
16
|
const isAnotherPortal =
|
|
17
17
|
!projectSettings?.BASE_PATH || !item?.href?.startsWith(projectSettings.BASE_PATH);
|
|
18
18
|
|
|
19
|
-
const _href = !projectSettings.BASE_PATH
|
|
20
|
-
? item?.href
|
|
21
|
-
: item?.href?.replace(projectSettings.BASE_PATH, '');
|
|
22
|
-
|
|
23
19
|
const link = useLink({ isRemote: isAnotherPortal });
|
|
24
|
-
const { href, onClick: handleClick } = link({ href:
|
|
20
|
+
const { href, onClick: handleClick } = link({ href: item?.href, onClick });
|
|
25
21
|
|
|
26
22
|
return (
|
|
27
23
|
<a
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const toLocalNumberFormat =
|
|
2
|
-
(fractionDigits = 0) =>
|
|
2
|
+
(fractionDigits = 0, { fixed }: { fixed?: boolean } = {}) =>
|
|
3
3
|
(_: string | number | undefined = 0): string =>
|
|
4
4
|
new Intl.NumberFormat('ru-RU', {
|
|
5
|
-
minimumFractionDigits: 0,
|
|
5
|
+
minimumFractionDigits: fixed ? fractionDigits : 0,
|
|
6
6
|
maximumFractionDigits: fractionDigits,
|
|
7
7
|
}).format(Number(_) || 0);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getDefaultMonths: (minMonths: number, maxMonths: number) => number;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface RenderRealEstateValueInputProps {
|
|
3
|
-
moneyValue: number;
|
|
4
|
-
}
|
|
5
|
-
export declare function renderRealEstateValue(props: RenderRealEstateValueInputProps, title?: string, callback?: (value: number) => void): JSX.Element;
|
|
6
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.getCreditRate = void 0;
|
|
3
|
-
const DEFAULT_RATE = 10.2;
|
|
4
|
-
const getCreditRate = (params) => {
|
|
5
|
-
const { calculatorParams, isInsurance } = params;
|
|
6
|
-
if (!calculatorParams) {
|
|
7
|
-
return DEFAULT_RATE;
|
|
8
|
-
}
|
|
9
|
-
return isInsurance
|
|
10
|
-
? calculatorParams?.rateWithInsurance || DEFAULT_RATE
|
|
11
|
-
: calculatorParams?.rateWithoutInsurance || DEFAULT_RATE;
|
|
12
|
-
};
|
|
13
|
-
exports.getCreditRate = getCreditRate;
|
|
14
|
-
//# sourceMappingURL=getCreditRate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getCreditRate.js","sourceRoot":"","sources":["../../../src/components/Calculator/getCreditRate.ts"],"names":[],"mappings":";;AAEA,MAAM,YAAY,GAAG,IAAI,CAAC;AAOnB,MAAM,aAAa,GAAG,CAAC,MAA2B,EAAE,EAAE;IAC3D,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;IAEjD,IAAI,CAAC,gBAAgB,EAAE;QACrB,OAAO,YAAY,CAAC;KACrB;IAED,OAAO,WAAW;QAChB,CAAC,CAAC,gBAAgB,EAAE,iBAAiB,IAAI,YAAY;QACrD,CAAC,CAAC,gBAAgB,EAAE,oBAAoB,IAAI,YAAY,CAAC;AAC7D,CAAC,CAAC;AAVW,QAAA,aAAa,iBAUxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getDefaultMonths: (minMonths: number, maxMonths: number) => number;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.getDefaultMonths = void 0;
|
|
3
|
-
const getDefaultMonths = (minMonths, maxMonths) => Math.round((maxMonths - minMonths) / 2);
|
|
4
|
-
exports.getDefaultMonths = getDefaultMonths;
|
|
5
|
-
//# sourceMappingURL=getDefaultMonths.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultMonths.js","sourceRoot":"","sources":["../../../src/components/Calculator/getDefaultMonths.ts"],"names":[],"mappings":";;AAAO,MAAM,gBAAgB,GAAG,CAAC,SAAiB,EAAE,SAAiB,EAAE,EAAE,CACvE,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAD7B,QAAA,gBAAgB,oBACa"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.renderInitialFeeInput = void 0;
|
|
3
|
-
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
-
// TEMP
|
|
5
|
-
const InputRange_1 = require("../../ui-kit/InputRange/InputRange");
|
|
6
|
-
const toLocalNumberFormat_1 = require("../../utils/toLocalNumberFormat");
|
|
7
|
-
const constants_1 = require("./constants");
|
|
8
|
-
const STEP_MONEY = 1000;
|
|
9
|
-
function renderInitialFeeInput(props, title, callback) {
|
|
10
|
-
const { moneyValue } = props;
|
|
11
|
-
const minSum = constants_1.DEFAULT_MIN_SUM;
|
|
12
|
-
const maxSum = constants_1.DEFAULT_MAX_SUM;
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)(InputRange_1.InputRange, { title: title, items: [
|
|
14
|
-
`От ${(0, toLocalNumberFormat_1.toLocalNumberFormat)(0)(minSum)} рублей`,
|
|
15
|
-
`До ${(0, toLocalNumberFormat_1.toLocalNumberFormat)(0)(maxSum)} рублей`,
|
|
16
|
-
], min: minSum, max: maxSum, step: STEP_MONEY, value: moneyValue, onChange: callback }));
|
|
17
|
-
}
|
|
18
|
-
exports.renderInitialFeeInput = renderInitialFeeInput;
|
|
19
|
-
//# sourceMappingURL=renderInitialFeeInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderInitialFeeInput.js","sourceRoot":"","sources":["../../../src/components/Calculator/renderInitialFeeInput.tsx"],"names":[],"mappings":";;;AAAA,OAAO;AACP,mEAAgE;AAChE,yEAAsE;AACtE,2CAA+D;AAE/D,MAAM,UAAU,GAAG,IAAI,CAAC;AAMxB,SAAgB,qBAAqB,CACnC,KAAiC,EACjC,KAAc,EACd,QAAkC;IAElC,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAE7B,MAAM,MAAM,GAAG,2BAAe,CAAC;IAC/B,MAAM,MAAM,GAAG,2BAAe,CAAC;IAE/B,OAAO,CACL,uBAAC,uBAAU,IACT,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE;YACL,MAAM,IAAA,yCAAmB,EAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS;YAC7C,MAAM,IAAA,yCAAmB,EAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS;SAC9C,EACD,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;AACJ,CAAC;AAxBD,sDAwBC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface RenderRealEstateValueInputProps {
|
|
3
|
-
moneyValue: number;
|
|
4
|
-
}
|
|
5
|
-
export declare function renderRealEstateValue(props: RenderRealEstateValueInputProps, title?: string, callback?: (value: number) => void): JSX.Element;
|
|
6
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.renderRealEstateValue = void 0;
|
|
3
|
-
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
-
// TEMP
|
|
5
|
-
const InputRange_1 = require("../../ui-kit/InputRange/InputRange");
|
|
6
|
-
const toLocalNumberFormat_1 = require("../../utils/toLocalNumberFormat");
|
|
7
|
-
const constants_1 = require("./constants");
|
|
8
|
-
const STEP_MONEY = 1000;
|
|
9
|
-
function renderRealEstateValue(props, title, callback) {
|
|
10
|
-
const { moneyValue } = props;
|
|
11
|
-
const minSum = constants_1.DEFAULT_MIN_SUM;
|
|
12
|
-
const maxSum = constants_1.DEFAULT_MAX_SUM;
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)(InputRange_1.InputRange, { title: title, items: [`От ${(0, toLocalNumberFormat_1.toLocalNumberFormat)(2)(minSum)} ₽`, `До ${(0, toLocalNumberFormat_1.toLocalNumberFormat)(2)(maxSum)} ₽`], min: minSum, max: maxSum, step: STEP_MONEY, value: moneyValue, onChange: callback }));
|
|
14
|
-
}
|
|
15
|
-
exports.renderRealEstateValue = renderRealEstateValue;
|
|
16
|
-
//# sourceMappingURL=renderRealEstateValue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderRealEstateValue.js","sourceRoot":"","sources":["../../../src/components/Calculator/renderRealEstateValue.tsx"],"names":[],"mappings":";;;AAAA,OAAO;AACP,mEAAgE;AAChE,yEAAsE;AACtE,2CAA+D;AAE/D,MAAM,UAAU,GAAG,IAAI,CAAC;AAMxB,SAAgB,qBAAqB,CACnC,KAAsC,EACtC,KAAc,EACd,QAAkC;IAElC,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAE7B,MAAM,MAAM,GAAG,2BAAe,CAAC;IAC/B,MAAM,MAAM,GAAG,2BAAe,CAAC;IAE/B,OAAO,CACL,uBAAC,uBAAU,IACT,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,CAAC,MAAM,IAAA,yCAAmB,EAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,IAAA,yCAAmB,EAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAC3F,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;AACJ,CAAC;AArBD,sDAqBC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const DEFAULT_RATE = 10.2;
|
|
2
|
-
export const getCreditRate = (params) => {
|
|
3
|
-
const { calculatorParams, isInsurance } = params;
|
|
4
|
-
if (!calculatorParams) {
|
|
5
|
-
return DEFAULT_RATE;
|
|
6
|
-
}
|
|
7
|
-
return isInsurance
|
|
8
|
-
? calculatorParams?.rateWithInsurance || DEFAULT_RATE
|
|
9
|
-
: calculatorParams?.rateWithoutInsurance || DEFAULT_RATE;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=getCreditRate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getCreditRate.js","sourceRoot":"","sources":["../../../src/components/Calculator/getCreditRate.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GAAG,IAAI,CAAC;AAO1B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAA2B,EAAE,EAAE;IAC3D,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;IAEjD,IAAI,CAAC,gBAAgB,EAAE;QACrB,OAAO,YAAY,CAAC;KACrB;IAED,OAAO,WAAW;QAChB,CAAC,CAAC,gBAAgB,EAAE,iBAAiB,IAAI,YAAY;QACrD,CAAC,CAAC,gBAAgB,EAAE,oBAAoB,IAAI,YAAY,CAAC;AAC7D,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getDefaultMonths: (minMonths: number, maxMonths: number) => number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultMonths.js","sourceRoot":"","sources":["../../../src/components/Calculator/getDefaultMonths.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAiB,EAAE,SAAiB,EAAE,EAAE,CACvE,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
-
// TEMP
|
|
3
|
-
import { InputRange } from '../../ui-kit/InputRange/InputRange.js';
|
|
4
|
-
import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat.js';
|
|
5
|
-
import { DEFAULT_MAX_SUM, DEFAULT_MIN_SUM } from './constants.js';
|
|
6
|
-
const STEP_MONEY = 1000;
|
|
7
|
-
export function renderInitialFeeInput(props, title, callback) {
|
|
8
|
-
const { moneyValue } = props;
|
|
9
|
-
const minSum = DEFAULT_MIN_SUM;
|
|
10
|
-
const maxSum = DEFAULT_MAX_SUM;
|
|
11
|
-
return (_jsx(InputRange, { title: title, items: [
|
|
12
|
-
`От ${toLocalNumberFormat(0)(minSum)} рублей`,
|
|
13
|
-
`До ${toLocalNumberFormat(0)(maxSum)} рублей`,
|
|
14
|
-
], min: minSum, max: maxSum, step: STEP_MONEY, value: moneyValue, onChange: callback }));
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=renderInitialFeeInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderInitialFeeInput.js","sourceRoot":"","sources":["../../../src/components/Calculator/renderInitialFeeInput.tsx"],"names":[],"mappings":";AAAA,OAAO;AACP,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE/D,MAAM,UAAU,GAAG,IAAI,CAAC;AAMxB,MAAM,UAAU,qBAAqB,CACnC,KAAiC,EACjC,KAAc,EACd,QAAkC;IAElC,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAE7B,MAAM,MAAM,GAAG,eAAe,CAAC;IAC/B,MAAM,MAAM,GAAG,eAAe,CAAC;IAE/B,OAAO,CACL,KAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE;YACL,MAAM,mBAAmB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS;YAC7C,MAAM,mBAAmB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS;SAC9C,EACD,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface RenderRealEstateValueInputProps {
|
|
3
|
-
moneyValue: number;
|
|
4
|
-
}
|
|
5
|
-
export declare function renderRealEstateValue(props: RenderRealEstateValueInputProps, title?: string, callback?: (value: number) => void): JSX.Element;
|
|
6
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
-
// TEMP
|
|
3
|
-
import { InputRange } from '../../ui-kit/InputRange/InputRange.js';
|
|
4
|
-
import { toLocalNumberFormat } from '../../utils/toLocalNumberFormat.js';
|
|
5
|
-
import { DEFAULT_MAX_SUM, DEFAULT_MIN_SUM } from './constants.js';
|
|
6
|
-
const STEP_MONEY = 1000;
|
|
7
|
-
export function renderRealEstateValue(props, title, callback) {
|
|
8
|
-
const { moneyValue } = props;
|
|
9
|
-
const minSum = DEFAULT_MIN_SUM;
|
|
10
|
-
const maxSum = DEFAULT_MAX_SUM;
|
|
11
|
-
return (_jsx(InputRange, { title: title, items: [`От ${toLocalNumberFormat(2)(minSum)} ₽`, `До ${toLocalNumberFormat(2)(maxSum)} ₽`], min: minSum, max: maxSum, step: STEP_MONEY, value: moneyValue, onChange: callback }));
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=renderRealEstateValue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderRealEstateValue.js","sourceRoot":"","sources":["../../../src/components/Calculator/renderRealEstateValue.tsx"],"names":[],"mappings":";AAAA,OAAO;AACP,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE/D,MAAM,UAAU,GAAG,IAAI,CAAC;AAMxB,MAAM,UAAU,qBAAqB,CACnC,KAAsC,EACtC,KAAc,EACd,QAAkC;IAElC,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAE7B,MAAM,MAAM,GAAG,eAAe,CAAC;IAC/B,MAAM,MAAM,GAAG,eAAe,CAAC;IAE/B,OAAO,CACL,KAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,CAAC,MAAM,mBAAmB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,mBAAmB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAC3F,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;AACJ,CAAC"}
|