@redneckz/wildless-cms-uni-blocks 0.13.8 → 0.13.9
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/bin/migration-scripts/0.13.9.js +59 -0
- package/bundle/bundle.umd.js +15 -9
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
- package/dist/components/DepositFiltration/DepositFiltration.js +14 -8
- package/dist/components/DepositFiltration/DepositFiltration.js.map +1 -1
- package/dist/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
- package/lib/components/DepositFiltration/DepositFiltration.js +14 -8
- package/lib/components/DepositFiltration/DepositFiltration.js.map +1 -1
- package/lib/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
- package/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
- package/mobile/dist/components/DepositFiltration/DepositFiltration.js +14 -8
- package/mobile/dist/components/DepositFiltration/DepositFiltration.js.map +1 -1
- package/mobile/dist/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
- package/mobile/lib/components/DepositFiltration/DepositFiltration.js +14 -8
- package/mobile/lib/components/DepositFiltration/DepositFiltration.js.map +1 -1
- package/mobile/lib/components/DepositFiltration/DepositFiltrationContent.d.ts +2 -2
- package/mobile/src/components/DepositFiltration/DepositFiltration.example.json +11 -1
- package/mobile/src/components/DepositFiltration/DepositFiltration.tsx +18 -12
- package/mobile/src/components/DepositFiltration/DepositFiltrationContent.ts +1 -2
- package/package.json +1 -1
- package/src/components/DepositFiltration/DepositFiltration.example.json +11 -1
- package/src/components/DepositFiltration/DepositFiltration.fixture.tsx +21 -8
- package/src/components/DepositFiltration/DepositFiltration.tsx +18 -12
- package/src/components/DepositFiltration/DepositFiltrationContent.ts +1 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseFiltrationInnerContent, NumberRange,
|
|
1
|
+
import type { BaseFiltrationInnerContent, NumberRange, StringArray } from '../../ui-kit/BaseFiltration/BaseFiltrationContent';
|
|
2
2
|
export declare type DepositFiltrationSchema = {
|
|
3
3
|
/** @title Валюта */
|
|
4
4
|
currency?: StringArray;
|
|
@@ -7,7 +7,7 @@ export declare type DepositFiltrationSchema = {
|
|
|
7
7
|
/** @title Выплата процентов */
|
|
8
8
|
percents?: StringArray;
|
|
9
9
|
/** @hidden */
|
|
10
|
-
sum?:
|
|
10
|
+
sum?: NumberRange;
|
|
11
11
|
/** @hidden */
|
|
12
12
|
period?: NumberRange;
|
|
13
13
|
};
|
|
@@ -9,22 +9,28 @@ const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
|
|
|
9
9
|
const CurrencyInput_1 = require("../../ui-kit/CurrencyInput/CurrencyInput");
|
|
10
10
|
const InputRange_1 = require("../../ui-kit/InputRange/InputRange");
|
|
11
11
|
const style_1 = require("../../utils/style");
|
|
12
|
+
const DEFAULT_MIN_MONTHS = 3;
|
|
13
|
+
const DEFAULT_MAX_MONTHS = 60;
|
|
14
|
+
const DEFAULT_MIN_SUM = 500;
|
|
15
|
+
const DEFAULT_MAX_SUM = 1000000000;
|
|
12
16
|
const initialFiltrationState = {
|
|
13
|
-
sum:
|
|
17
|
+
sum: {
|
|
18
|
+
min: 10000,
|
|
19
|
+
max: DEFAULT_MAX_SUM,
|
|
20
|
+
},
|
|
14
21
|
period: {
|
|
15
22
|
min: 3,
|
|
16
23
|
max: 36,
|
|
17
24
|
},
|
|
18
25
|
};
|
|
19
|
-
const DEFAULT_MIN_MONTHS = 3;
|
|
20
|
-
const DEFAULT_MAX_MONTHS = 36;
|
|
21
|
-
const DEFAULT_MIN_SUM = 500;
|
|
22
|
-
const DEFAULT_MAX_SUM = 1000000000;
|
|
23
26
|
exports.DepositFiltration = (0, uni_jsx_1.JSX)(({ className, filtrationSchema = {}, resetButton, sumInput, periodInput, ...rest }) => {
|
|
24
27
|
const [filtrationState, { field, reset }] = (0, useForm_1.useForm)(initialFiltrationState);
|
|
25
|
-
const
|
|
26
|
-
const Inputs = ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(CurrencyInput_1.CurrencyInput, { label: sumInput?.title, min: DEFAULT_MIN_SUM, max: DEFAULT_MAX_SUM, ...field('sum', {
|
|
27
|
-
parse: (min) => ({ min, max:
|
|
28
|
+
const maxPeriodValue = periodInput?.max || DEFAULT_MAX_MONTHS;
|
|
29
|
+
const Inputs = ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(CurrencyInput_1.CurrencyInput, { label: sumInput?.title, min: DEFAULT_MIN_SUM, max: DEFAULT_MAX_SUM, ...field('sum', {
|
|
30
|
+
parse: (min) => ({ min: Number(min), max: DEFAULT_MAX_SUM }),
|
|
31
|
+
format: ({ min }) => String(min),
|
|
32
|
+
}) }), (0, jsx_runtime_1.jsx)(InputRange_1.InputRange, { title: periodInput?.title, items: ['От 3 мес', 'До 5 лет'], min: periodInput?.min || DEFAULT_MIN_MONTHS, max: maxPeriodValue, ...field('period', {
|
|
33
|
+
parse: (min) => ({ min, max: maxPeriodValue }),
|
|
28
34
|
format: ({ min }) => min,
|
|
29
35
|
}) })] }));
|
|
30
36
|
return ((0, jsx_runtime_1.jsxs)(BlockWrapper_1.BlockWrapper, { className: (0, style_1.style)('space-y-2xs', className), defaultPadding: "p-0", version: "transparent", ...rest, children: [(0, renderFiltrationForm_1.renderFiltrationForm)({ field, reset, filtrationSchema, resetButton, children: Inputs }), (0, jsx_runtime_1.jsx)(BaseFiltrationInner_1.BaseFiltrationInner, { filtrationState: filtrationState, ...rest })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DepositFiltration.js","sourceRoot":"","sources":["../../../src/components/DepositFiltration/DepositFiltration.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,iDAA8C;AAE9C,yFAAsF;AACtF,2FAAwF;AACxF,4DAAyD;AACzD,4EAAyE;AACzE,mEAAgE;AAChE,6CAA0C;AAK1C,MAAM,
|
|
1
|
+
{"version":3,"file":"DepositFiltration.js","sourceRoot":"","sources":["../../../src/components/DepositFiltration/DepositFiltration.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,iDAA8C;AAE9C,yFAAsF;AACtF,2FAAwF;AACxF,4DAAyD;AACzD,4EAAyE;AACzE,mEAAgE;AAChE,6CAA0C;AAK1C,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,eAAe,GAAG,UAAU,CAAC;AAEnC,MAAM,sBAAsB,GAAG;IAC7B,GAAG,EAAE;QACH,GAAG,EAAE,KAAK;QACV,GAAG,EAAE,eAAe;KACrB;IACD,MAAM,EAAE;QACN,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,EAAE;KACR;CACF,CAAC;AAEW,QAAA,iBAAiB,GAAqC,IAAA,aAAG,EACpE,CAAC,EAAE,SAAS,EAAE,gBAAgB,GAAG,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACpF,MAAM,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,IAAA,iBAAO,EAAC,sBAAsB,CAAC,CAAC;IAE5E,MAAM,cAAc,GAAG,WAAW,EAAE,GAAG,IAAI,kBAAkB,CAAC;IAE9D,MAAM,MAAM,GAAG,CACb,4CACE,uBAAC,6BAAa,IACZ,KAAK,EAAE,QAAQ,EAAE,KAAK,EACtB,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,eAAe,KAChB,KAAK,CAAC,KAAK,EAAE;oBACf,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC;oBAC5D,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC;iBACjC,CAAC,GACF,EACF,uBAAC,uBAAU,IACT,KAAK,EAAE,WAAW,EAAE,KAAK,EACzB,KAAK,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,EAC/B,GAAG,EAAE,WAAW,EAAE,GAAG,IAAI,kBAAkB,EAC3C,GAAG,EAAE,cAAc,KACf,KAAK,CAAC,QAAQ,EAAE;oBAClB,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC;oBAC9C,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG;iBACzB,CAAC,GACF,IACE,CACP,CAAC;IAEF,OAAO,CACL,wBAAC,2BAAY,IACX,SAAS,EAAE,IAAA,aAAK,EAAC,aAAa,EAAE,SAAS,CAAC,EAC1C,cAAc,EAAC,KAAK,EACpB,OAAO,EAAC,aAAa,KACjB,IAAI,aAEP,IAAA,2CAAoB,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EACxF,uBAAC,yCAAmB,IAAC,eAAe,EAAE,eAAe,KAAM,IAAI,GAAI,IACtD,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,yBAAiB,CAAC,aAAa,GAAG,CAAC,aAAa,CAAC,CAAC;AAClD,yBAAiB,CAAC,WAAW,GAAG,CAAC,OAAkC,EAAE,EAAE,CACrE,OAAO,EAAE,gBAAgB,IAAI,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseFiltrationInnerContent, NumberRange,
|
|
1
|
+
import type { BaseFiltrationInnerContent, NumberRange, StringArray } from '../../ui-kit/BaseFiltration/BaseFiltrationContent';
|
|
2
2
|
export declare type DepositFiltrationSchema = {
|
|
3
3
|
/** @title Валюта */
|
|
4
4
|
currency?: StringArray;
|
|
@@ -7,7 +7,7 @@ export declare type DepositFiltrationSchema = {
|
|
|
7
7
|
/** @title Выплата процентов */
|
|
8
8
|
percents?: StringArray;
|
|
9
9
|
/** @hidden */
|
|
10
|
-
sum?:
|
|
10
|
+
sum?: NumberRange;
|
|
11
11
|
/** @hidden */
|
|
12
12
|
period?: NumberRange;
|
|
13
13
|
};
|
|
@@ -7,22 +7,28 @@ import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
|
7
7
|
import { CurrencyInput } from '../../ui-kit/CurrencyInput/CurrencyInput.js';
|
|
8
8
|
import { InputRange } from '../../ui-kit/InputRange/InputRange.js';
|
|
9
9
|
import { style } from '../../utils/style.js';
|
|
10
|
+
const DEFAULT_MIN_MONTHS = 3;
|
|
11
|
+
const DEFAULT_MAX_MONTHS = 60;
|
|
12
|
+
const DEFAULT_MIN_SUM = 500;
|
|
13
|
+
const DEFAULT_MAX_SUM = 1000000000;
|
|
10
14
|
const initialFiltrationState = {
|
|
11
|
-
sum:
|
|
15
|
+
sum: {
|
|
16
|
+
min: 10000,
|
|
17
|
+
max: DEFAULT_MAX_SUM,
|
|
18
|
+
},
|
|
12
19
|
period: {
|
|
13
20
|
min: 3,
|
|
14
21
|
max: 36,
|
|
15
22
|
},
|
|
16
23
|
};
|
|
17
|
-
const DEFAULT_MIN_MONTHS = 3;
|
|
18
|
-
const DEFAULT_MAX_MONTHS = 36;
|
|
19
|
-
const DEFAULT_MIN_SUM = 500;
|
|
20
|
-
const DEFAULT_MAX_SUM = 1000000000;
|
|
21
24
|
export const DepositFiltration = JSX(({ className, filtrationSchema = {}, resetButton, sumInput, periodInput, ...rest }) => {
|
|
22
25
|
const [filtrationState, { field, reset }] = useForm(initialFiltrationState);
|
|
23
|
-
const
|
|
24
|
-
const Inputs = (_jsxs("div", { children: [_jsx(CurrencyInput, { label: sumInput?.title, min: DEFAULT_MIN_SUM, max: DEFAULT_MAX_SUM, ...field('sum', {
|
|
25
|
-
parse: (min) => ({ min, max:
|
|
26
|
+
const maxPeriodValue = periodInput?.max || DEFAULT_MAX_MONTHS;
|
|
27
|
+
const Inputs = (_jsxs("div", { children: [_jsx(CurrencyInput, { label: sumInput?.title, min: DEFAULT_MIN_SUM, max: DEFAULT_MAX_SUM, ...field('sum', {
|
|
28
|
+
parse: (min) => ({ min: Number(min), max: DEFAULT_MAX_SUM }),
|
|
29
|
+
format: ({ min }) => String(min),
|
|
30
|
+
}) }), _jsx(InputRange, { title: periodInput?.title, items: ['От 3 мес', 'До 5 лет'], min: periodInput?.min || DEFAULT_MIN_MONTHS, max: maxPeriodValue, ...field('period', {
|
|
31
|
+
parse: (min) => ({ min, max: maxPeriodValue }),
|
|
26
32
|
format: ({ min }) => min,
|
|
27
33
|
}) })] }));
|
|
28
34
|
return (_jsxs(BlockWrapper, { className: style('space-y-2xs', className), defaultPadding: "p-0", version: "transparent", ...rest, children: [renderFiltrationForm({ field, reset, filtrationSchema, resetButton, children: Inputs }), _jsx(BaseFiltrationInner, { filtrationState: filtrationState, ...rest })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DepositFiltration.js","sourceRoot":"","sources":["../../../src/components/DepositFiltration/DepositFiltration.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK1C,MAAM,
|
|
1
|
+
{"version":3,"file":"DepositFiltration.js","sourceRoot":"","sources":["../../../src/components/DepositFiltration/DepositFiltration.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK1C,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,eAAe,GAAG,UAAU,CAAC;AAEnC,MAAM,sBAAsB,GAAG;IAC7B,GAAG,EAAE;QACH,GAAG,EAAE,KAAK;QACV,GAAG,EAAE,eAAe;KACrB;IACD,MAAM,EAAE;QACN,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,EAAE;KACR;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAqC,GAAG,CACpE,CAAC,EAAE,SAAS,EAAE,gBAAgB,GAAG,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACpF,MAAM,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAE5E,MAAM,cAAc,GAAG,WAAW,EAAE,GAAG,IAAI,kBAAkB,CAAC;IAE9D,MAAM,MAAM,GAAG,CACb,0BACE,KAAC,aAAa,IACZ,KAAK,EAAE,QAAQ,EAAE,KAAK,EACtB,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,eAAe,KAChB,KAAK,CAAC,KAAK,EAAE;oBACf,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC;oBAC5D,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC;iBACjC,CAAC,GACF,EACF,KAAC,UAAU,IACT,KAAK,EAAE,WAAW,EAAE,KAAK,EACzB,KAAK,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,EAC/B,GAAG,EAAE,WAAW,EAAE,GAAG,IAAI,kBAAkB,EAC3C,GAAG,EAAE,cAAc,KACf,KAAK,CAAC,QAAQ,EAAE;oBAClB,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC;oBAC9C,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG;iBACzB,CAAC,GACF,IACE,CACP,CAAC;IAEF,OAAO,CACL,MAAC,YAAY,IACX,SAAS,EAAE,KAAK,CAAC,aAAa,EAAE,SAAS,CAAC,EAC1C,cAAc,EAAC,KAAK,EACpB,OAAO,EAAC,aAAa,KACjB,IAAI,aAEP,oBAAoB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EACxF,KAAC,mBAAmB,IAAC,eAAe,EAAE,eAAe,KAAM,IAAI,GAAI,IACtD,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,iBAAiB,CAAC,aAAa,GAAG,CAAC,aAAa,CAAC,CAAC;AAClD,iBAAiB,CAAC,WAAW,GAAG,CAAC,OAAkC,EAAE,EAAE,CACrE,OAAO,EAAE,gBAAgB,IAAI,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseFiltrationInnerContent, NumberRange,
|
|
1
|
+
import type { BaseFiltrationInnerContent, NumberRange, StringArray } from '../../ui-kit/BaseFiltration/BaseFiltrationContent';
|
|
2
2
|
export declare type DepositFiltrationSchema = {
|
|
3
3
|
/** @title Валюта */
|
|
4
4
|
currency?: StringArray;
|
|
@@ -7,7 +7,7 @@ export declare type DepositFiltrationSchema = {
|
|
|
7
7
|
/** @title Выплата процентов */
|
|
8
8
|
percents?: StringArray;
|
|
9
9
|
/** @hidden */
|
|
10
|
-
sum?:
|
|
10
|
+
sum?: NumberRange;
|
|
11
11
|
/** @hidden */
|
|
12
12
|
period?: NumberRange;
|
|
13
13
|
};
|
|
@@ -30,7 +30,17 @@
|
|
|
30
30
|
},
|
|
31
31
|
"sum": {
|
|
32
32
|
"title": "Сумма",
|
|
33
|
-
"type": "
|
|
33
|
+
"type": "object",
|
|
34
|
+
"properties": {
|
|
35
|
+
"min": {
|
|
36
|
+
"title": "Минимум",
|
|
37
|
+
"type": "number"
|
|
38
|
+
},
|
|
39
|
+
"max": {
|
|
40
|
+
"title": "Максимум",
|
|
41
|
+
"type": "number"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
34
44
|
},
|
|
35
45
|
"period": {
|
|
36
46
|
"title": "Срок",
|
|
@@ -11,25 +11,28 @@ import type { DepositFiltrationContent } from './DepositFiltrationContent';
|
|
|
11
11
|
|
|
12
12
|
interface DepositFiltrationProps extends DepositFiltrationContent, UniBlockProps {}
|
|
13
13
|
|
|
14
|
+
const DEFAULT_MIN_MONTHS = 3;
|
|
15
|
+
const DEFAULT_MAX_MONTHS = 60;
|
|
16
|
+
|
|
17
|
+
const DEFAULT_MIN_SUM = 500;
|
|
18
|
+
const DEFAULT_MAX_SUM = 1000000000;
|
|
19
|
+
|
|
14
20
|
const initialFiltrationState = {
|
|
15
|
-
sum:
|
|
21
|
+
sum: {
|
|
22
|
+
min: 10000,
|
|
23
|
+
max: DEFAULT_MAX_SUM,
|
|
24
|
+
},
|
|
16
25
|
period: {
|
|
17
26
|
min: 3,
|
|
18
27
|
max: 36,
|
|
19
28
|
},
|
|
20
29
|
};
|
|
21
30
|
|
|
22
|
-
const DEFAULT_MIN_MONTHS = 3;
|
|
23
|
-
const DEFAULT_MAX_MONTHS = 36;
|
|
24
|
-
|
|
25
|
-
const DEFAULT_MIN_SUM = 500;
|
|
26
|
-
const DEFAULT_MAX_SUM = 1000000000;
|
|
27
|
-
|
|
28
31
|
export const DepositFiltration: JSXBlock<DepositFiltrationProps> = JSX<DepositFiltrationProps>(
|
|
29
32
|
({ className, filtrationSchema = {}, resetButton, sumInput, periodInput, ...rest }) => {
|
|
30
33
|
const [filtrationState, { field, reset }] = useForm(initialFiltrationState);
|
|
31
34
|
|
|
32
|
-
const
|
|
35
|
+
const maxPeriodValue = periodInput?.max || DEFAULT_MAX_MONTHS;
|
|
33
36
|
|
|
34
37
|
const Inputs = (
|
|
35
38
|
<div>
|
|
@@ -37,15 +40,18 @@ export const DepositFiltration: JSXBlock<DepositFiltrationProps> = JSX<DepositFi
|
|
|
37
40
|
label={sumInput?.title}
|
|
38
41
|
min={DEFAULT_MIN_SUM}
|
|
39
42
|
max={DEFAULT_MAX_SUM}
|
|
40
|
-
{...field('sum', {
|
|
43
|
+
{...field('sum', {
|
|
44
|
+
parse: (min) => ({ min: Number(min), max: DEFAULT_MAX_SUM }),
|
|
45
|
+
format: ({ min }) => String(min),
|
|
46
|
+
})}
|
|
41
47
|
/>
|
|
42
48
|
<InputRange
|
|
43
49
|
title={periodInput?.title}
|
|
44
|
-
items={['От 3 мес', 'До
|
|
50
|
+
items={['От 3 мес', 'До 5 лет']}
|
|
45
51
|
min={periodInput?.min || DEFAULT_MIN_MONTHS}
|
|
46
|
-
max={
|
|
52
|
+
max={maxPeriodValue}
|
|
47
53
|
{...field('period', {
|
|
48
|
-
parse: (min) => ({ min, max:
|
|
54
|
+
parse: (min) => ({ min, max: maxPeriodValue }),
|
|
49
55
|
format: ({ min }) => min,
|
|
50
56
|
})}
|
|
51
57
|
/>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
BaseFiltrationInnerContent,
|
|
3
3
|
NumberRange,
|
|
4
|
-
NumberValue,
|
|
5
4
|
StringArray,
|
|
6
5
|
} from '../../ui-kit/BaseFiltration/BaseFiltrationContent';
|
|
7
6
|
|
|
@@ -13,7 +12,7 @@ export type DepositFiltrationSchema = {
|
|
|
13
12
|
/** @title Выплата процентов */
|
|
14
13
|
percents?: StringArray;
|
|
15
14
|
/** @hidden */
|
|
16
|
-
sum?:
|
|
15
|
+
sum?: NumberRange;
|
|
17
16
|
/** @hidden */
|
|
18
17
|
period?: NumberRange;
|
|
19
18
|
};
|
package/package.json
CHANGED
|
@@ -30,7 +30,17 @@
|
|
|
30
30
|
},
|
|
31
31
|
"sum": {
|
|
32
32
|
"title": "Сумма",
|
|
33
|
-
"type": "
|
|
33
|
+
"type": "object",
|
|
34
|
+
"properties": {
|
|
35
|
+
"min": {
|
|
36
|
+
"title": "Минимум",
|
|
37
|
+
"type": "number"
|
|
38
|
+
},
|
|
39
|
+
"max": {
|
|
40
|
+
"title": "Максимум",
|
|
41
|
+
"type": "number"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
34
44
|
},
|
|
35
45
|
"period": {
|
|
36
46
|
"title": "Срок",
|
|
@@ -78,7 +78,17 @@ const SCHEMA: DepositFiltrationContent['filtrationSchema'] = {
|
|
|
78
78
|
},
|
|
79
79
|
sum: {
|
|
80
80
|
title: 'Сумма',
|
|
81
|
-
type: '
|
|
81
|
+
type: 'object',
|
|
82
|
+
properties: {
|
|
83
|
+
min: {
|
|
84
|
+
title: 'Минимум',
|
|
85
|
+
type: 'number',
|
|
86
|
+
},
|
|
87
|
+
max: {
|
|
88
|
+
title: 'Максимум',
|
|
89
|
+
type: 'number',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
82
92
|
},
|
|
83
93
|
period: {
|
|
84
94
|
title: 'Срок',
|
|
@@ -109,7 +119,7 @@ export default {
|
|
|
109
119
|
filtrationSchema={SCHEMA}
|
|
110
120
|
topItemsCount={2}
|
|
111
121
|
sumInput={{ title: 'Сумма' }}
|
|
112
|
-
periodInput={{ title: 'Срок, месяцев', min: 3, max:
|
|
122
|
+
periodInput={{ title: 'Срок, месяцев', min: 3, max: 60 }}
|
|
113
123
|
resetButton={{ text: 'Очистить фильтры', version: 'secondary' }}
|
|
114
124
|
notFound={{
|
|
115
125
|
title: 'Нет подходящей программы',
|
|
@@ -125,7 +135,7 @@ export default {
|
|
|
125
135
|
OPTIONS_PENSIONER,
|
|
126
136
|
PERCENTS_IN_THE_END,
|
|
127
137
|
{
|
|
128
|
-
sum: 5000,
|
|
138
|
+
sum: { min: 500, max: 5000 },
|
|
129
139
|
period: { min: 9, max: 38 },
|
|
130
140
|
},
|
|
131
141
|
),
|
|
@@ -135,7 +145,10 @@ export default {
|
|
|
135
145
|
OPTIONS_ADD,
|
|
136
146
|
OPTIONS_ONLINE,
|
|
137
147
|
PERCENTS_EACH_MONTH,
|
|
138
|
-
{
|
|
148
|
+
{
|
|
149
|
+
sum: { min: 500, max: 1000 },
|
|
150
|
+
period: { min: 9, max: 38 },
|
|
151
|
+
},
|
|
139
152
|
),
|
|
140
153
|
generateBlock(
|
|
141
154
|
PRODUCT_TILE,
|
|
@@ -144,7 +157,7 @@ export default {
|
|
|
144
157
|
OPTIONS_PENSIONER,
|
|
145
158
|
PERCENTS_EACH_MONTH,
|
|
146
159
|
{
|
|
147
|
-
sum: 500,
|
|
160
|
+
sum: { min: 500, max: 1500 },
|
|
148
161
|
period: { min: 9, max: 38 },
|
|
149
162
|
},
|
|
150
163
|
),
|
|
@@ -155,7 +168,7 @@ export default {
|
|
|
155
168
|
OPTIONS_PENSIONER,
|
|
156
169
|
PERCENTS_EACH_MONTH,
|
|
157
170
|
{
|
|
158
|
-
sum: 1000,
|
|
171
|
+
sum: { min: 500, max: 1000 },
|
|
159
172
|
period: { min: 9, max: 38 },
|
|
160
173
|
},
|
|
161
174
|
),
|
|
@@ -166,7 +179,7 @@ export default {
|
|
|
166
179
|
OPTIONS_ONLINE,
|
|
167
180
|
PERCENTS_IN_THE_END,
|
|
168
181
|
{
|
|
169
|
-
sum: 1000,
|
|
182
|
+
sum: { min: 500, max: 1000 },
|
|
170
183
|
period: { min: 9, max: 38 },
|
|
171
184
|
},
|
|
172
185
|
),
|
|
@@ -177,7 +190,7 @@ export default {
|
|
|
177
190
|
OPTIONS_PENSIONER,
|
|
178
191
|
PERCENTS_EACH_MONTH,
|
|
179
192
|
{
|
|
180
|
-
sum: 1000,
|
|
193
|
+
sum: { min: 500, max: 1000 },
|
|
181
194
|
period: { min: 9, max: 38 },
|
|
182
195
|
},
|
|
183
196
|
),
|
|
@@ -11,25 +11,28 @@ import type { DepositFiltrationContent } from './DepositFiltrationContent';
|
|
|
11
11
|
|
|
12
12
|
interface DepositFiltrationProps extends DepositFiltrationContent, UniBlockProps {}
|
|
13
13
|
|
|
14
|
+
const DEFAULT_MIN_MONTHS = 3;
|
|
15
|
+
const DEFAULT_MAX_MONTHS = 60;
|
|
16
|
+
|
|
17
|
+
const DEFAULT_MIN_SUM = 500;
|
|
18
|
+
const DEFAULT_MAX_SUM = 1000000000;
|
|
19
|
+
|
|
14
20
|
const initialFiltrationState = {
|
|
15
|
-
sum:
|
|
21
|
+
sum: {
|
|
22
|
+
min: 10000,
|
|
23
|
+
max: DEFAULT_MAX_SUM,
|
|
24
|
+
},
|
|
16
25
|
period: {
|
|
17
26
|
min: 3,
|
|
18
27
|
max: 36,
|
|
19
28
|
},
|
|
20
29
|
};
|
|
21
30
|
|
|
22
|
-
const DEFAULT_MIN_MONTHS = 3;
|
|
23
|
-
const DEFAULT_MAX_MONTHS = 36;
|
|
24
|
-
|
|
25
|
-
const DEFAULT_MIN_SUM = 500;
|
|
26
|
-
const DEFAULT_MAX_SUM = 1000000000;
|
|
27
|
-
|
|
28
31
|
export const DepositFiltration: JSXBlock<DepositFiltrationProps> = JSX<DepositFiltrationProps>(
|
|
29
32
|
({ className, filtrationSchema = {}, resetButton, sumInput, periodInput, ...rest }) => {
|
|
30
33
|
const [filtrationState, { field, reset }] = useForm(initialFiltrationState);
|
|
31
34
|
|
|
32
|
-
const
|
|
35
|
+
const maxPeriodValue = periodInput?.max || DEFAULT_MAX_MONTHS;
|
|
33
36
|
|
|
34
37
|
const Inputs = (
|
|
35
38
|
<div>
|
|
@@ -37,15 +40,18 @@ export const DepositFiltration: JSXBlock<DepositFiltrationProps> = JSX<DepositFi
|
|
|
37
40
|
label={sumInput?.title}
|
|
38
41
|
min={DEFAULT_MIN_SUM}
|
|
39
42
|
max={DEFAULT_MAX_SUM}
|
|
40
|
-
{...field('sum', {
|
|
43
|
+
{...field('sum', {
|
|
44
|
+
parse: (min) => ({ min: Number(min), max: DEFAULT_MAX_SUM }),
|
|
45
|
+
format: ({ min }) => String(min),
|
|
46
|
+
})}
|
|
41
47
|
/>
|
|
42
48
|
<InputRange
|
|
43
49
|
title={periodInput?.title}
|
|
44
|
-
items={['От 3 мес', 'До
|
|
50
|
+
items={['От 3 мес', 'До 5 лет']}
|
|
45
51
|
min={periodInput?.min || DEFAULT_MIN_MONTHS}
|
|
46
|
-
max={
|
|
52
|
+
max={maxPeriodValue}
|
|
47
53
|
{...field('period', {
|
|
48
|
-
parse: (min) => ({ min, max:
|
|
54
|
+
parse: (min) => ({ min, max: maxPeriodValue }),
|
|
49
55
|
format: ({ min }) => min,
|
|
50
56
|
})}
|
|
51
57
|
/>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
BaseFiltrationInnerContent,
|
|
3
3
|
NumberRange,
|
|
4
|
-
NumberValue,
|
|
5
4
|
StringArray,
|
|
6
5
|
} from '../../ui-kit/BaseFiltration/BaseFiltrationContent';
|
|
7
6
|
|
|
@@ -13,7 +12,7 @@ export type DepositFiltrationSchema = {
|
|
|
13
12
|
/** @title Выплата процентов */
|
|
14
13
|
percents?: StringArray;
|
|
15
14
|
/** @hidden */
|
|
16
|
-
sum?:
|
|
15
|
+
sum?: NumberRange;
|
|
17
16
|
/** @hidden */
|
|
18
17
|
period?: NumberRange;
|
|
19
18
|
};
|