@redneckz/wildless-cms-uni-blocks 0.14.197 → 0.14.199
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.14.189.js +22 -0
- package/bundle/bundle.umd.js +77 -79
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/hooks/useForm.d.ts +8 -7
- package/bundle/hooks/useJSONRef/resolveBlockProps.d.ts +1 -0
- package/bundle/ui-kit/BaseFiltration/filterBlocks.d.ts +1 -1
- package/bundle/ui-kit/BaseFiltration/useFiltrationForm.d.ts +10 -0
- package/dist/components/DepositFiltration/DepositFiltration.js +20 -11
- package/dist/components/DepositFiltration/DepositFiltration.js.map +1 -1
- package/dist/components/MortgageFiltration/MortgageFiltration.js +6 -7
- package/dist/components/MortgageFiltration/MortgageFiltration.js.map +1 -1
- package/dist/content-page-repository/replaceHeadingTags.js +1 -1
- package/dist/content-page-repository/replaceHeadingTags.js.map +1 -1
- package/dist/hooks/useForm.d.ts +8 -7
- package/dist/hooks/useForm.js.map +1 -1
- package/dist/hooks/useJSONRef/resolveBlockProps.d.ts +1 -0
- package/dist/hooks/useJSONRef/resolveBlockProps.js +6 -0
- package/dist/hooks/useJSONRef/resolveBlockProps.js.map +1 -0
- package/dist/hooks/useJSONRef/useJSONRef.js +2 -3
- package/dist/hooks/useJSONRef/useJSONRef.js.map +1 -1
- package/dist/ui-kit/BaseFiltration/filterBlocks.d.ts +1 -1
- package/dist/ui-kit/BaseFiltration/filterBlocks.js +3 -1
- package/dist/ui-kit/BaseFiltration/filterBlocks.js.map +1 -1
- package/dist/ui-kit/BaseFiltration/useFiltrationForm.d.ts +10 -0
- package/dist/ui-kit/BaseFiltration/useFiltrationForm.js +23 -0
- package/dist/ui-kit/BaseFiltration/useFiltrationForm.js.map +1 -0
- package/lib/components/DepositFiltration/DepositFiltration.js +20 -11
- package/lib/components/DepositFiltration/DepositFiltration.js.map +1 -1
- package/lib/components/MortgageFiltration/MortgageFiltration.js +6 -7
- package/lib/components/MortgageFiltration/MortgageFiltration.js.map +1 -1
- package/lib/content-page-repository/replaceHeadingTags.js +1 -1
- package/lib/content-page-repository/replaceHeadingTags.js.map +1 -1
- package/lib/hooks/useForm.d.ts +8 -7
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/hooks/useJSONRef/resolveBlockProps.d.ts +1 -0
- package/lib/hooks/useJSONRef/resolveBlockProps.js +3 -0
- package/lib/hooks/useJSONRef/resolveBlockProps.js.map +1 -0
- package/lib/hooks/useJSONRef/useJSONRef.js +3 -4
- package/lib/hooks/useJSONRef/useJSONRef.js.map +1 -1
- package/lib/ui-kit/BaseFiltration/filterBlocks.d.ts +1 -1
- package/lib/ui-kit/BaseFiltration/filterBlocks.js +3 -1
- package/lib/ui-kit/BaseFiltration/filterBlocks.js.map +1 -1
- package/lib/ui-kit/BaseFiltration/useFiltrationForm.d.ts +10 -0
- package/lib/ui-kit/BaseFiltration/useFiltrationForm.js +20 -0
- package/lib/ui-kit/BaseFiltration/useFiltrationForm.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +77 -79
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/hooks/useForm.d.ts +8 -7
- package/mobile/bundle/hooks/useJSONRef/resolveBlockProps.d.ts +1 -0
- package/mobile/bundle/ui-kit/BaseFiltration/filterBlocks.d.ts +1 -1
- package/mobile/bundle/ui-kit/BaseFiltration/useFiltrationForm.d.ts +10 -0
- package/mobile/dist/components/DepositFiltration/DepositFiltration.js +20 -11
- package/mobile/dist/components/DepositFiltration/DepositFiltration.js.map +1 -1
- package/mobile/dist/components/MortgageFiltration/MortgageFiltration.js +6 -7
- package/mobile/dist/components/MortgageFiltration/MortgageFiltration.js.map +1 -1
- package/mobile/dist/content-page-repository/replaceHeadingTags.js +1 -1
- package/mobile/dist/content-page-repository/replaceHeadingTags.js.map +1 -1
- package/mobile/dist/hooks/useForm.d.ts +8 -7
- package/mobile/dist/hooks/useForm.js.map +1 -1
- package/mobile/dist/hooks/useJSONRef/resolveBlockProps.d.ts +1 -0
- package/mobile/dist/hooks/useJSONRef/resolveBlockProps.js +6 -0
- package/mobile/dist/hooks/useJSONRef/resolveBlockProps.js.map +1 -0
- package/mobile/dist/hooks/useJSONRef/useJSONRef.js +2 -3
- package/mobile/dist/hooks/useJSONRef/useJSONRef.js.map +1 -1
- package/mobile/dist/ui-kit/BaseFiltration/filterBlocks.d.ts +1 -1
- package/mobile/dist/ui-kit/BaseFiltration/filterBlocks.js +3 -1
- package/mobile/dist/ui-kit/BaseFiltration/filterBlocks.js.map +1 -1
- package/mobile/dist/ui-kit/BaseFiltration/useFiltrationForm.d.ts +10 -0
- package/mobile/dist/ui-kit/BaseFiltration/useFiltrationForm.js +23 -0
- package/mobile/dist/ui-kit/BaseFiltration/useFiltrationForm.js.map +1 -0
- package/mobile/lib/components/DepositFiltration/DepositFiltration.js +20 -11
- package/mobile/lib/components/DepositFiltration/DepositFiltration.js.map +1 -1
- package/mobile/lib/components/MortgageFiltration/MortgageFiltration.js +6 -7
- package/mobile/lib/components/MortgageFiltration/MortgageFiltration.js.map +1 -1
- package/mobile/lib/content-page-repository/replaceHeadingTags.js +1 -1
- package/mobile/lib/content-page-repository/replaceHeadingTags.js.map +1 -1
- package/mobile/lib/hooks/useForm.d.ts +8 -7
- package/mobile/lib/hooks/useForm.js.map +1 -1
- package/mobile/lib/hooks/useJSONRef/resolveBlockProps.d.ts +1 -0
- package/mobile/lib/hooks/useJSONRef/resolveBlockProps.js +3 -0
- package/mobile/lib/hooks/useJSONRef/resolveBlockProps.js.map +1 -0
- package/mobile/lib/hooks/useJSONRef/useJSONRef.js +3 -4
- package/mobile/lib/hooks/useJSONRef/useJSONRef.js.map +1 -1
- package/mobile/lib/ui-kit/BaseFiltration/filterBlocks.d.ts +1 -1
- package/mobile/lib/ui-kit/BaseFiltration/filterBlocks.js +3 -1
- package/mobile/lib/ui-kit/BaseFiltration/filterBlocks.js.map +1 -1
- package/mobile/lib/ui-kit/BaseFiltration/useFiltrationForm.d.ts +10 -0
- package/mobile/lib/ui-kit/BaseFiltration/useFiltrationForm.js +20 -0
- package/mobile/lib/ui-kit/BaseFiltration/useFiltrationForm.js.map +1 -0
- package/mobile/src/components/DepositFiltration/DepositFiltration.tsx +32 -16
- package/mobile/src/components/MortgageFiltration/MortgageFiltration.tsx +9 -13
- package/mobile/src/content-page-repository/replaceHeadingTags.ts +1 -1
- package/mobile/src/hooks/useForm.ts +9 -10
- package/mobile/src/hooks/useJSONRef/resolveBlockProps.ts +4 -0
- package/mobile/src/hooks/useJSONRef/useJSONRef.ts +3 -4
- package/mobile/src/ui-kit/BaseFiltration/filterBlocks.ts +8 -3
- package/mobile/src/ui-kit/BaseFiltration/useFiltrationForm.ts +52 -0
- package/package.json +1 -1
- package/src/components/DepositFiltration/DepositFiltration.fixture.mobile.tsx +3 -3
- package/src/components/DepositFiltration/DepositFiltration.fixture.tsx +10 -3
- package/src/components/DepositFiltration/DepositFiltration.tsx +32 -16
- package/src/components/MortgageFiltration/MortgageFiltration.tsx +9 -13
- package/src/content-page-repository/replaceHeadingTags.ts +1 -1
- package/src/hooks/useForm.ts +9 -10
- package/src/hooks/useJSONRef/resolveBlockProps.ts +4 -0
- package/src/hooks/useJSONRef/useJSONRef.ts +3 -4
- package/src/ui-kit/BaseFiltration/filterBlocks.ts +8 -3
- package/src/ui-kit/BaseFiltration/useFiltrationForm.ts +52 -0
- package/bundle/components/DepositFiltration/SourceItem.d.ts +0 -4
- package/bundle/components/DepositFiltration/getChildSourceBook.d.ts +0 -2
- package/bundle/components/DepositFiltration/getPeriod.d.ts +0 -4
- package/bundle/components/DepositFiltration/useDepositsPeriods.d.ts +0 -8
- package/dist/components/DepositFiltration/SourceItem.d.ts +0 -4
- package/dist/components/DepositFiltration/SourceItem.js +0 -2
- package/dist/components/DepositFiltration/SourceItem.js.map +0 -1
- package/dist/components/DepositFiltration/getChildSourceBook.d.ts +0 -2
- package/dist/components/DepositFiltration/getChildSourceBook.js +0 -6
- package/dist/components/DepositFiltration/getChildSourceBook.js.map +0 -1
- package/dist/components/DepositFiltration/getPeriod.d.ts +0 -4
- package/dist/components/DepositFiltration/getPeriod.js +0 -10
- package/dist/components/DepositFiltration/getPeriod.js.map +0 -1
- package/dist/components/DepositFiltration/useDepositsPeriods.d.ts +0 -8
- package/dist/components/DepositFiltration/useDepositsPeriods.js +0 -26
- package/dist/components/DepositFiltration/useDepositsPeriods.js.map +0 -1
- package/lib/components/DepositFiltration/SourceItem.d.ts +0 -4
- package/lib/components/DepositFiltration/SourceItem.js +0 -2
- package/lib/components/DepositFiltration/SourceItem.js.map +0 -1
- package/lib/components/DepositFiltration/getChildSourceBook.d.ts +0 -2
- package/lib/components/DepositFiltration/getChildSourceBook.js +0 -3
- package/lib/components/DepositFiltration/getChildSourceBook.js.map +0 -1
- package/lib/components/DepositFiltration/getPeriod.d.ts +0 -4
- package/lib/components/DepositFiltration/getPeriod.js +0 -7
- package/lib/components/DepositFiltration/getPeriod.js.map +0 -1
- package/lib/components/DepositFiltration/useDepositsPeriods.d.ts +0 -8
- package/lib/components/DepositFiltration/useDepositsPeriods.js +0 -23
- package/lib/components/DepositFiltration/useDepositsPeriods.js.map +0 -1
- package/mobile/bundle/components/DepositFiltration/SourceItem.d.ts +0 -4
- package/mobile/bundle/components/DepositFiltration/getChildSourceBook.d.ts +0 -2
- package/mobile/bundle/components/DepositFiltration/getPeriod.d.ts +0 -4
- package/mobile/bundle/components/DepositFiltration/useDepositsPeriods.d.ts +0 -8
- package/mobile/dist/components/DepositFiltration/SourceItem.d.ts +0 -4
- package/mobile/dist/components/DepositFiltration/SourceItem.js +0 -2
- package/mobile/dist/components/DepositFiltration/SourceItem.js.map +0 -1
- package/mobile/dist/components/DepositFiltration/getChildSourceBook.d.ts +0 -2
- package/mobile/dist/components/DepositFiltration/getChildSourceBook.js +0 -6
- package/mobile/dist/components/DepositFiltration/getChildSourceBook.js.map +0 -1
- package/mobile/dist/components/DepositFiltration/getPeriod.d.ts +0 -4
- package/mobile/dist/components/DepositFiltration/getPeriod.js +0 -10
- package/mobile/dist/components/DepositFiltration/getPeriod.js.map +0 -1
- package/mobile/dist/components/DepositFiltration/useDepositsPeriods.d.ts +0 -8
- package/mobile/dist/components/DepositFiltration/useDepositsPeriods.js +0 -26
- package/mobile/dist/components/DepositFiltration/useDepositsPeriods.js.map +0 -1
- package/mobile/lib/components/DepositFiltration/SourceItem.d.ts +0 -4
- package/mobile/lib/components/DepositFiltration/SourceItem.js +0 -2
- package/mobile/lib/components/DepositFiltration/SourceItem.js.map +0 -1
- package/mobile/lib/components/DepositFiltration/getChildSourceBook.d.ts +0 -2
- package/mobile/lib/components/DepositFiltration/getChildSourceBook.js +0 -3
- package/mobile/lib/components/DepositFiltration/getChildSourceBook.js.map +0 -1
- package/mobile/lib/components/DepositFiltration/getPeriod.d.ts +0 -4
- package/mobile/lib/components/DepositFiltration/getPeriod.js +0 -7
- package/mobile/lib/components/DepositFiltration/getPeriod.js.map +0 -1
- package/mobile/lib/components/DepositFiltration/useDepositsPeriods.d.ts +0 -8
- package/mobile/lib/components/DepositFiltration/useDepositsPeriods.js +0 -23
- package/mobile/lib/components/DepositFiltration/useDepositsPeriods.js.map +0 -1
- package/mobile/src/components/DepositFiltration/SourceItem.ts +0 -5
- package/mobile/src/components/DepositFiltration/getChildSourceBook.ts +0 -7
- package/mobile/src/components/DepositFiltration/getPeriod.ts +0 -13
- package/mobile/src/components/DepositFiltration/useDepositsPeriods.ts +0 -34
- package/src/components/DepositFiltration/SourceItem.ts +0 -5
- package/src/components/DepositFiltration/getChildSourceBook.ts +0 -7
- package/src/components/DepositFiltration/getPeriod.ts +0 -13
- package/src/components/DepositFiltration/useDepositsPeriods.ts +0 -34
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFiltrationForm.js","sourceRoot":"","sources":["../../../src/ui-kit/BaseFiltration/useFiltrationForm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,OAAO,EAA0B,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,gBAA2B,EAC3B,EACE,KAAK,EACL,IAAI,EACJ,SAAS,GAAG,QAAQ,GAKrB,EAQD,EAAE;IACF,MAAM,MAAM,GAAG,KAAK,EAAE,MAAM,IAAI,EAAE,CAAC;IAEnC,MAAM,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC,GACvE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE5B,MAAM,eAAe,GAAG,OAAO,CAC7B,GAAG,EAAE,CACH,GAAG,CACD,MAAM,EACN,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAChE,EACH,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CACzB,CAAC;IAEF,MAAM,cAAc,GAClB,eAAe,KAAK,gBAAgB;QAClC,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,YAAY,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC;IAEhE,OAAO;QACL,eAAe;QACf,EAAE,cAAc,EAAE,eAAe,EAAE;QACnC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,sBAAsB,EAAE;KACjD,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { type JSONSchema7Definition } from 'json-schema';
|
|
2
|
-
import {
|
|
2
|
+
import { type BlockDef } from '../../model/ContentPageDef';
|
|
3
3
|
import { BaseFiltrationInner } from '../../ui-kit/BaseFiltration/BaseFiltrationInner';
|
|
4
|
-
import { filterBlocks } from '../../ui-kit/BaseFiltration/filterBlocks';
|
|
5
4
|
import { renderFiltrationForm } from '../../ui-kit/BaseFiltration/renderFiltrationForm';
|
|
5
|
+
import { useFiltrationForm } from '../../ui-kit/BaseFiltration/useFiltrationForm';
|
|
6
6
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
7
7
|
import { CurrencyInput } from '../../ui-kit/CurrencyInput/CurrencyInput';
|
|
8
8
|
import { InputRange } from '../../ui-kit/InputRange/InputRange';
|
|
9
9
|
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
10
10
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
11
11
|
import { style } from '../../utils/style';
|
|
12
|
+
import { unique } from '../../utils/unique';
|
|
12
13
|
import { type DepositFiltrationContent } from './DepositFiltrationContent';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
14
|
+
import { isRateRow, type RateRow } from './isRateRow';
|
|
15
|
+
import { numberRange } from './numberRange';
|
|
15
16
|
|
|
16
17
|
interface DepositFiltrationProps extends DepositFiltrationContent, UniBlockProps {}
|
|
17
18
|
|
|
@@ -28,16 +29,16 @@ const initialFiltrationState = {
|
|
|
28
29
|
|
|
29
30
|
export const DepositFiltration = UniBlock<DepositFiltrationProps>(
|
|
30
31
|
({ className, filtrationSchema = {}, resetButton, sumInput, periodInput, ...rest }) => {
|
|
31
|
-
const {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
const [, { blocksToRender, blocksWithProps }, { field, reset }] = useFiltrationForm(
|
|
33
|
+
initialFiltrationState,
|
|
34
|
+
{
|
|
35
|
+
block: rest.block,
|
|
36
|
+
page: rest.options?.page,
|
|
37
|
+
normalize: (content) => ({ ...content, period: getPeriod(content) }),
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
const rateRows = blocksWithProps.map(([, _]) => _?.paramsSource?.rateRows);
|
|
41
|
+
const months = getMonths(rateRows as Partial<RateRow>[]);
|
|
41
42
|
|
|
42
43
|
const Inputs = (
|
|
43
44
|
<div>
|
|
@@ -75,10 +76,25 @@ export const DepositFiltration = UniBlock<DepositFiltrationProps>(
|
|
|
75
76
|
childrenTypes: ['ProductBlock'],
|
|
76
77
|
childSchema: (content?: DepositFiltrationContent) => ({
|
|
77
78
|
...(content?.filtrationSchema || {}),
|
|
78
|
-
|
|
79
|
-
type: '
|
|
79
|
+
paramsSource: {
|
|
80
|
+
type: 'object',
|
|
80
81
|
title: 'Адрес справочника',
|
|
81
82
|
} as JSONSchema7Definition,
|
|
82
83
|
}),
|
|
83
84
|
},
|
|
84
85
|
);
|
|
86
|
+
|
|
87
|
+
const getPeriod = (content: BlockDef['content']): number[] =>
|
|
88
|
+
unique(
|
|
89
|
+
((content?.paramsSource?.rateRows as RateRow[] | undefined) || [])
|
|
90
|
+
.filter(isRateRow)
|
|
91
|
+
.flatMap((_) => numberRange(_.minMonths, _.maxMonths)),
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
const getMonths = (rateRows: Partial<RateRow>[]): number[] =>
|
|
95
|
+
unique(
|
|
96
|
+
rateRows
|
|
97
|
+
.flatMap((item) => item || [])
|
|
98
|
+
.filter(isRateRow)
|
|
99
|
+
.flatMap((_) => numberRange(_.minMonths, _.maxMonths)),
|
|
100
|
+
).sort((a, b) => a - b) || [];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
import { useForm } from '../../hooks/useForm';
|
|
3
2
|
import { BaseFiltrationInner } from '../../ui-kit/BaseFiltration/BaseFiltrationInner';
|
|
4
|
-
import { filterBlocks } from '../../ui-kit/BaseFiltration/filterBlocks';
|
|
5
3
|
import { renderFiltrationForm } from '../../ui-kit/BaseFiltration/renderFiltrationForm';
|
|
4
|
+
import { useFiltrationForm } from '../../ui-kit/BaseFiltration/useFiltrationForm';
|
|
6
5
|
import { useHotFilters } from '../../ui-kit/BaseFiltration/useHotFilters';
|
|
7
6
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
8
7
|
import { TabsControl } from '../../ui-kit/TabsControl/TabsControl';
|
|
@@ -27,19 +26,16 @@ interface MortgageFiltrationProps extends MortgageFiltrationContent, UniBlockPro
|
|
|
27
26
|
|
|
28
27
|
export const MortgageFiltration = UniBlock<MortgageFiltrationProps>(
|
|
29
28
|
({ className, hotFilters, filtrationSchema = {}, resetButton, ...rest }) => {
|
|
30
|
-
const [filtrationState, { field, reset, update
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
: filterBlocks(rest.block?.blocks, filtrationState)();
|
|
37
|
-
|
|
38
|
-
const handleFiltrationStateChange = useCallback(
|
|
39
|
-
(_: MortgageFiltrationState = initialFiltrationState) => replaceFiltrationState(_),
|
|
40
|
-
[],
|
|
29
|
+
const [filtrationState, { blocksToRender }, { field, reset, update }] = useFiltrationForm(
|
|
30
|
+
initialFiltrationState,
|
|
31
|
+
{
|
|
32
|
+
block: rest.block,
|
|
33
|
+
page: rest.options?.page,
|
|
34
|
+
},
|
|
41
35
|
);
|
|
42
36
|
|
|
37
|
+
const handleFiltrationStateChange = useCallback((_ = initialFiltrationState) => update(_), []);
|
|
38
|
+
|
|
43
39
|
const tabsControlProps = useHotFilters({
|
|
44
40
|
hotFilters,
|
|
45
41
|
filtrationState,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const replaceHeadingTags = (html: string) =>
|
|
2
|
-
html.replaceAll(/<h(\d)>(
|
|
2
|
+
html.replaceAll(/<h(\d)>(.*)<\/h\d>/g, '<p class="h$1">$2</p>');
|
|
@@ -17,19 +17,18 @@ export type FormFieldRegisterer<FormState> = <N extends keyof FormState, V = For
|
|
|
17
17
|
options?: Options<V, FormState[N]>,
|
|
18
18
|
) => FieldProps<V extends undefined ? FormState[N] : V>;
|
|
19
19
|
|
|
20
|
+
export interface FormOperatorProps<FormState extends Record<string, any>> {
|
|
21
|
+
isDirty?: boolean;
|
|
22
|
+
field: FormFieldRegisterer<FormState>;
|
|
23
|
+
update: (_: FormState) => void;
|
|
24
|
+
reset: () => void;
|
|
25
|
+
onSubmit?: (e: PreventableEvent) => void;
|
|
26
|
+
}
|
|
27
|
+
|
|
20
28
|
export const useForm = <FormState extends Record<string, any>>(
|
|
21
29
|
initialState: FormState,
|
|
22
30
|
{ resetOnSubmit, onSubmit }: { resetOnSubmit?: boolean; onSubmit?: (_: FormState) => void } = {},
|
|
23
|
-
): [
|
|
24
|
-
FormState,
|
|
25
|
-
{
|
|
26
|
-
isDirty: boolean;
|
|
27
|
-
field: FormFieldRegisterer<FormState>;
|
|
28
|
-
update: (_: FormState) => void;
|
|
29
|
-
reset: () => void;
|
|
30
|
-
onSubmit: (e: PreventableEvent) => void;
|
|
31
|
-
},
|
|
32
|
-
] => {
|
|
31
|
+
): [FormState, FormOperatorProps<FormState>] => {
|
|
33
32
|
const [formState, setFormState] = useState<FormState>(initialState);
|
|
34
33
|
|
|
35
34
|
const [isDirtyForm, setDirtyForm] = useState(false);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { collectRef,
|
|
1
|
+
import { collectRef, type JSONNode } from '@redneckz/json-ref';
|
|
2
2
|
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { fetchRefs } from './fetchRefs';
|
|
4
|
+
import { resolveBlockProps } from './resolveBlockProps';
|
|
4
5
|
|
|
5
6
|
export const useJSONRef = <C>(content: C, fallback?: Record<string, unknown>): C => {
|
|
6
7
|
const refs = collectRef(content as JSONNode);
|
|
@@ -12,7 +13,5 @@ export const useJSONRef = <C>(content: C, fallback?: Record<string, unknown>): C
|
|
|
12
13
|
}
|
|
13
14
|
}, [refs.join()]);
|
|
14
15
|
|
|
15
|
-
return refs.length
|
|
16
|
-
? (resolveRefSync(content as JSONNode, (_) => refsMap[_] || (fallback?.[_] as JSONNode)) as C)
|
|
17
|
-
: content;
|
|
16
|
+
return refs.length ? resolveBlockProps(content, { ...fallback, ...refsMap }) : content;
|
|
18
17
|
};
|
|
@@ -3,6 +3,11 @@ import { identity } from '../../utils/identity';
|
|
|
3
3
|
import { targetMatchPattern } from './targetMatchPattern';
|
|
4
4
|
|
|
5
5
|
export const filterBlocks =
|
|
6
|
-
(
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
(
|
|
7
|
+
blocksWithProps: [BlockDef, Record<string, any> | undefined][],
|
|
8
|
+
filtrationState: Record<string, any>,
|
|
9
|
+
) =>
|
|
10
|
+
(normalize: (content: BlockDef['content']) => BlockDef['content'] = identity) =>
|
|
11
|
+
blocksWithProps
|
|
12
|
+
?.filter(([, content]) => targetMatchPattern(filtrationState, normalize(content) || {}))
|
|
13
|
+
.map(([block]) => block);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useForm, type FormOperatorProps } from '../../hooks/useForm';
|
|
3
|
+
import { resolveBlockProps } from '../../hooks/useJSONRef/resolveBlockProps';
|
|
4
|
+
import { type BlockDef, type ContentPageDef } from '../../model/ContentPageDef';
|
|
5
|
+
import { identity } from '../../utils/identity';
|
|
6
|
+
import { zip } from '../../utils/zip';
|
|
7
|
+
import { filterBlocks } from './filterBlocks';
|
|
8
|
+
|
|
9
|
+
export const useFiltrationForm = <FormState extends Record<string, any>>(
|
|
10
|
+
initialFormState: FormState,
|
|
11
|
+
{
|
|
12
|
+
block,
|
|
13
|
+
page,
|
|
14
|
+
normalize = identity,
|
|
15
|
+
}: {
|
|
16
|
+
block?: BlockDef;
|
|
17
|
+
page?: ContentPageDef;
|
|
18
|
+
normalize?: (content: BlockDef['content']) => BlockDef['content'];
|
|
19
|
+
},
|
|
20
|
+
): [
|
|
21
|
+
FormState,
|
|
22
|
+
{
|
|
23
|
+
blocksToRender: BlockDef[] | undefined;
|
|
24
|
+
blocksWithProps: [BlockDef, Record<string, any> | undefined][];
|
|
25
|
+
},
|
|
26
|
+
FormOperatorProps<FormState>,
|
|
27
|
+
] => {
|
|
28
|
+
const blocks = block?.blocks || [];
|
|
29
|
+
|
|
30
|
+
const [filtrationState, { field, reset, update: replaceFiltrationState }] =
|
|
31
|
+
useForm(initialFormState);
|
|
32
|
+
|
|
33
|
+
const blocksWithProps = useMemo(
|
|
34
|
+
() =>
|
|
35
|
+
zip(
|
|
36
|
+
blocks,
|
|
37
|
+
blocks.map((b) => resolveBlockProps(b.content, page?.fallback)),
|
|
38
|
+
),
|
|
39
|
+
[blocks, page?.fallback],
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const blocksToRender =
|
|
43
|
+
filtrationState === initialFormState
|
|
44
|
+
? blocks
|
|
45
|
+
: filterBlocks(blocksWithProps, filtrationState)(normalize);
|
|
46
|
+
|
|
47
|
+
return [
|
|
48
|
+
filtrationState,
|
|
49
|
+
{ blocksToRender, blocksWithProps },
|
|
50
|
+
{ field, reset, update: replaceFiltrationState },
|
|
51
|
+
];
|
|
52
|
+
};
|
package/package.json
CHANGED
|
@@ -124,7 +124,7 @@ export default {
|
|
|
124
124
|
sum: { min: 500, max: 500000 },
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
|
-
|
|
127
|
+
paramsSource: { $ref: '/wcms-resources/product-block-3-data.json' },
|
|
128
128
|
},
|
|
129
129
|
),
|
|
130
130
|
generateBlock(
|
|
@@ -137,7 +137,7 @@ export default {
|
|
|
137
137
|
sum: { min: 500, max: 10000 },
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
|
-
|
|
140
|
+
paramsSource: { $ref: '/wcms-resources/product-block-2-data.json' },
|
|
141
141
|
},
|
|
142
142
|
),
|
|
143
143
|
generateBlock(
|
|
@@ -150,7 +150,7 @@ export default {
|
|
|
150
150
|
sum: { min: 1000, max: 100000 },
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
|
-
|
|
153
|
+
paramsSource: { $ref: '/wcms-resources/product-block-data.json' },
|
|
154
154
|
},
|
|
155
155
|
),
|
|
156
156
|
],
|
|
@@ -91,6 +91,13 @@ const SCHEMA: DepositFiltrationContent['filtrationSchema'] = {
|
|
|
91
91
|
|
|
92
92
|
const options = {
|
|
93
93
|
blocksRegistry: Blocks,
|
|
94
|
+
page: {
|
|
95
|
+
fallback: {
|
|
96
|
+
['/wcms-resources/product-block-data.json']: require('../../../cosmos-static/wcms-resources/product-block-data.json'),
|
|
97
|
+
['/wcms-resources/product-block-2-data.json']: require('../../../cosmos-static/wcms-resources/product-block-2-data.json'),
|
|
98
|
+
['/wcms-resources/product-block-3-data.json']: require('../../../cosmos-static/wcms-resources/product-block-3-data.json'),
|
|
99
|
+
},
|
|
100
|
+
},
|
|
94
101
|
} as BlockRendererOptions;
|
|
95
102
|
|
|
96
103
|
export default {
|
|
@@ -120,7 +127,7 @@ export default {
|
|
|
120
127
|
sum: { min: 100, max: 500 },
|
|
121
128
|
},
|
|
122
129
|
{
|
|
123
|
-
|
|
130
|
+
paramsSource: { $ref: '/wcms-resources/product-block-data.json' },
|
|
124
131
|
},
|
|
125
132
|
),
|
|
126
133
|
generateBlock(
|
|
@@ -132,7 +139,7 @@ export default {
|
|
|
132
139
|
sum: { min: 500, max: 10000 },
|
|
133
140
|
},
|
|
134
141
|
{
|
|
135
|
-
|
|
142
|
+
paramsSource: { $ref: '/wcms-resources/product-block-2-data.json' },
|
|
136
143
|
},
|
|
137
144
|
),
|
|
138
145
|
generateBlock(
|
|
@@ -144,7 +151,7 @@ export default {
|
|
|
144
151
|
sum: { min: 1000, max: 100000 },
|
|
145
152
|
},
|
|
146
153
|
{
|
|
147
|
-
|
|
154
|
+
paramsSource: { $ref: '/wcms-resources/product-block-3-data.json' },
|
|
148
155
|
},
|
|
149
156
|
),
|
|
150
157
|
],
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { type JSONSchema7Definition } from 'json-schema';
|
|
2
|
-
import {
|
|
2
|
+
import { type BlockDef } from '../../model/ContentPageDef';
|
|
3
3
|
import { BaseFiltrationInner } from '../../ui-kit/BaseFiltration/BaseFiltrationInner';
|
|
4
|
-
import { filterBlocks } from '../../ui-kit/BaseFiltration/filterBlocks';
|
|
5
4
|
import { renderFiltrationForm } from '../../ui-kit/BaseFiltration/renderFiltrationForm';
|
|
5
|
+
import { useFiltrationForm } from '../../ui-kit/BaseFiltration/useFiltrationForm';
|
|
6
6
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
7
7
|
import { CurrencyInput } from '../../ui-kit/CurrencyInput/CurrencyInput';
|
|
8
8
|
import { InputRange } from '../../ui-kit/InputRange/InputRange';
|
|
9
9
|
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
10
10
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
11
11
|
import { style } from '../../utils/style';
|
|
12
|
+
import { unique } from '../../utils/unique';
|
|
12
13
|
import { type DepositFiltrationContent } from './DepositFiltrationContent';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
14
|
+
import { isRateRow, type RateRow } from './isRateRow';
|
|
15
|
+
import { numberRange } from './numberRange';
|
|
15
16
|
|
|
16
17
|
interface DepositFiltrationProps extends DepositFiltrationContent, UniBlockProps {}
|
|
17
18
|
|
|
@@ -28,16 +29,16 @@ const initialFiltrationState = {
|
|
|
28
29
|
|
|
29
30
|
export const DepositFiltration = UniBlock<DepositFiltrationProps>(
|
|
30
31
|
({ className, filtrationSchema = {}, resetButton, sumInput, periodInput, ...rest }) => {
|
|
31
|
-
const {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
const [, { blocksToRender, blocksWithProps }, { field, reset }] = useFiltrationForm(
|
|
33
|
+
initialFiltrationState,
|
|
34
|
+
{
|
|
35
|
+
block: rest.block,
|
|
36
|
+
page: rest.options?.page,
|
|
37
|
+
normalize: (content) => ({ ...content, period: getPeriod(content) }),
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
const rateRows = blocksWithProps.map(([, _]) => _?.paramsSource?.rateRows);
|
|
41
|
+
const months = getMonths(rateRows as Partial<RateRow>[]);
|
|
41
42
|
|
|
42
43
|
const Inputs = (
|
|
43
44
|
<div>
|
|
@@ -75,10 +76,25 @@ export const DepositFiltration = UniBlock<DepositFiltrationProps>(
|
|
|
75
76
|
childrenTypes: ['ProductBlock'],
|
|
76
77
|
childSchema: (content?: DepositFiltrationContent) => ({
|
|
77
78
|
...(content?.filtrationSchema || {}),
|
|
78
|
-
|
|
79
|
-
type: '
|
|
79
|
+
paramsSource: {
|
|
80
|
+
type: 'object',
|
|
80
81
|
title: 'Адрес справочника',
|
|
81
82
|
} as JSONSchema7Definition,
|
|
82
83
|
}),
|
|
83
84
|
},
|
|
84
85
|
);
|
|
86
|
+
|
|
87
|
+
const getPeriod = (content: BlockDef['content']): number[] =>
|
|
88
|
+
unique(
|
|
89
|
+
((content?.paramsSource?.rateRows as RateRow[] | undefined) || [])
|
|
90
|
+
.filter(isRateRow)
|
|
91
|
+
.flatMap((_) => numberRange(_.minMonths, _.maxMonths)),
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
const getMonths = (rateRows: Partial<RateRow>[]): number[] =>
|
|
95
|
+
unique(
|
|
96
|
+
rateRows
|
|
97
|
+
.flatMap((item) => item || [])
|
|
98
|
+
.filter(isRateRow)
|
|
99
|
+
.flatMap((_) => numberRange(_.minMonths, _.maxMonths)),
|
|
100
|
+
).sort((a, b) => a - b) || [];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
import { useForm } from '../../hooks/useForm';
|
|
3
2
|
import { BaseFiltrationInner } from '../../ui-kit/BaseFiltration/BaseFiltrationInner';
|
|
4
|
-
import { filterBlocks } from '../../ui-kit/BaseFiltration/filterBlocks';
|
|
5
3
|
import { renderFiltrationForm } from '../../ui-kit/BaseFiltration/renderFiltrationForm';
|
|
4
|
+
import { useFiltrationForm } from '../../ui-kit/BaseFiltration/useFiltrationForm';
|
|
6
5
|
import { useHotFilters } from '../../ui-kit/BaseFiltration/useHotFilters';
|
|
7
6
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
8
7
|
import { TabsControl } from '../../ui-kit/TabsControl/TabsControl';
|
|
@@ -27,19 +26,16 @@ interface MortgageFiltrationProps extends MortgageFiltrationContent, UniBlockPro
|
|
|
27
26
|
|
|
28
27
|
export const MortgageFiltration = UniBlock<MortgageFiltrationProps>(
|
|
29
28
|
({ className, hotFilters, filtrationSchema = {}, resetButton, ...rest }) => {
|
|
30
|
-
const [filtrationState, { field, reset, update
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
: filterBlocks(rest.block?.blocks, filtrationState)();
|
|
37
|
-
|
|
38
|
-
const handleFiltrationStateChange = useCallback(
|
|
39
|
-
(_: MortgageFiltrationState = initialFiltrationState) => replaceFiltrationState(_),
|
|
40
|
-
[],
|
|
29
|
+
const [filtrationState, { blocksToRender }, { field, reset, update }] = useFiltrationForm(
|
|
30
|
+
initialFiltrationState,
|
|
31
|
+
{
|
|
32
|
+
block: rest.block,
|
|
33
|
+
page: rest.options?.page,
|
|
34
|
+
},
|
|
41
35
|
);
|
|
42
36
|
|
|
37
|
+
const handleFiltrationStateChange = useCallback((_ = initialFiltrationState) => update(_), []);
|
|
38
|
+
|
|
43
39
|
const tabsControlProps = useHotFilters({
|
|
44
40
|
hotFilters,
|
|
45
41
|
filtrationState,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const replaceHeadingTags = (html: string) =>
|
|
2
|
-
html.replaceAll(/<h(\d)>(
|
|
2
|
+
html.replaceAll(/<h(\d)>(.*)<\/h\d>/g, '<p class="h$1">$2</p>');
|
package/src/hooks/useForm.ts
CHANGED
|
@@ -17,19 +17,18 @@ export type FormFieldRegisterer<FormState> = <N extends keyof FormState, V = For
|
|
|
17
17
|
options?: Options<V, FormState[N]>,
|
|
18
18
|
) => FieldProps<V extends undefined ? FormState[N] : V>;
|
|
19
19
|
|
|
20
|
+
export interface FormOperatorProps<FormState extends Record<string, any>> {
|
|
21
|
+
isDirty?: boolean;
|
|
22
|
+
field: FormFieldRegisterer<FormState>;
|
|
23
|
+
update: (_: FormState) => void;
|
|
24
|
+
reset: () => void;
|
|
25
|
+
onSubmit?: (e: PreventableEvent) => void;
|
|
26
|
+
}
|
|
27
|
+
|
|
20
28
|
export const useForm = <FormState extends Record<string, any>>(
|
|
21
29
|
initialState: FormState,
|
|
22
30
|
{ resetOnSubmit, onSubmit }: { resetOnSubmit?: boolean; onSubmit?: (_: FormState) => void } = {},
|
|
23
|
-
): [
|
|
24
|
-
FormState,
|
|
25
|
-
{
|
|
26
|
-
isDirty: boolean;
|
|
27
|
-
field: FormFieldRegisterer<FormState>;
|
|
28
|
-
update: (_: FormState) => void;
|
|
29
|
-
reset: () => void;
|
|
30
|
-
onSubmit: (e: PreventableEvent) => void;
|
|
31
|
-
},
|
|
32
|
-
] => {
|
|
31
|
+
): [FormState, FormOperatorProps<FormState>] => {
|
|
33
32
|
const [formState, setFormState] = useState<FormState>(initialState);
|
|
34
33
|
|
|
35
34
|
const [isDirtyForm, setDirtyForm] = useState(false);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { collectRef,
|
|
1
|
+
import { collectRef, type JSONNode } from '@redneckz/json-ref';
|
|
2
2
|
import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { fetchRefs } from './fetchRefs';
|
|
4
|
+
import { resolveBlockProps } from './resolveBlockProps';
|
|
4
5
|
|
|
5
6
|
export const useJSONRef = <C>(content: C, fallback?: Record<string, unknown>): C => {
|
|
6
7
|
const refs = collectRef(content as JSONNode);
|
|
@@ -12,7 +13,5 @@ export const useJSONRef = <C>(content: C, fallback?: Record<string, unknown>): C
|
|
|
12
13
|
}
|
|
13
14
|
}, [refs.join()]);
|
|
14
15
|
|
|
15
|
-
return refs.length
|
|
16
|
-
? (resolveRefSync(content as JSONNode, (_) => refsMap[_] || (fallback?.[_] as JSONNode)) as C)
|
|
17
|
-
: content;
|
|
16
|
+
return refs.length ? resolveBlockProps(content, { ...fallback, ...refsMap }) : content;
|
|
18
17
|
};
|
|
@@ -3,6 +3,11 @@ import { identity } from '../../utils/identity';
|
|
|
3
3
|
import { targetMatchPattern } from './targetMatchPattern';
|
|
4
4
|
|
|
5
5
|
export const filterBlocks =
|
|
6
|
-
(
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
(
|
|
7
|
+
blocksWithProps: [BlockDef, Record<string, any> | undefined][],
|
|
8
|
+
filtrationState: Record<string, any>,
|
|
9
|
+
) =>
|
|
10
|
+
(normalize: (content: BlockDef['content']) => BlockDef['content'] = identity) =>
|
|
11
|
+
blocksWithProps
|
|
12
|
+
?.filter(([, content]) => targetMatchPattern(filtrationState, normalize(content) || {}))
|
|
13
|
+
.map(([block]) => block);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useForm, type FormOperatorProps } from '../../hooks/useForm';
|
|
3
|
+
import { resolveBlockProps } from '../../hooks/useJSONRef/resolveBlockProps';
|
|
4
|
+
import { type BlockDef, type ContentPageDef } from '../../model/ContentPageDef';
|
|
5
|
+
import { identity } from '../../utils/identity';
|
|
6
|
+
import { zip } from '../../utils/zip';
|
|
7
|
+
import { filterBlocks } from './filterBlocks';
|
|
8
|
+
|
|
9
|
+
export const useFiltrationForm = <FormState extends Record<string, any>>(
|
|
10
|
+
initialFormState: FormState,
|
|
11
|
+
{
|
|
12
|
+
block,
|
|
13
|
+
page,
|
|
14
|
+
normalize = identity,
|
|
15
|
+
}: {
|
|
16
|
+
block?: BlockDef;
|
|
17
|
+
page?: ContentPageDef;
|
|
18
|
+
normalize?: (content: BlockDef['content']) => BlockDef['content'];
|
|
19
|
+
},
|
|
20
|
+
): [
|
|
21
|
+
FormState,
|
|
22
|
+
{
|
|
23
|
+
blocksToRender: BlockDef[] | undefined;
|
|
24
|
+
blocksWithProps: [BlockDef, Record<string, any> | undefined][];
|
|
25
|
+
},
|
|
26
|
+
FormOperatorProps<FormState>,
|
|
27
|
+
] => {
|
|
28
|
+
const blocks = block?.blocks || [];
|
|
29
|
+
|
|
30
|
+
const [filtrationState, { field, reset, update: replaceFiltrationState }] =
|
|
31
|
+
useForm(initialFormState);
|
|
32
|
+
|
|
33
|
+
const blocksWithProps = useMemo(
|
|
34
|
+
() =>
|
|
35
|
+
zip(
|
|
36
|
+
blocks,
|
|
37
|
+
blocks.map((b) => resolveBlockProps(b.content, page?.fallback)),
|
|
38
|
+
),
|
|
39
|
+
[blocks, page?.fallback],
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const blocksToRender =
|
|
43
|
+
filtrationState === initialFormState
|
|
44
|
+
? blocks
|
|
45
|
+
: filterBlocks(blocksWithProps, filtrationState)(normalize);
|
|
46
|
+
|
|
47
|
+
return [
|
|
48
|
+
filtrationState,
|
|
49
|
+
{ blocksToRender, blocksWithProps },
|
|
50
|
+
{ field, reset, update: replaceFiltrationState },
|
|
51
|
+
];
|
|
52
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SourceItem.js","sourceRoot":"","sources":["../../../src/components/DepositFiltration/SourceItem.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
-
exports.getChildSourceBook = void 0;
|
|
3
|
-
const getChildSourceBook = (blocks) => blocks?.filter(hasSourceBook).map(({ content: { sourceBook } }) => sourceBook);
|
|
4
|
-
exports.getChildSourceBook = getChildSourceBook;
|
|
5
|
-
const hasSourceBook = (block) => Boolean(block && block.content && typeof block.content.sourceBook === 'string');
|
|
6
|
-
//# sourceMappingURL=getChildSourceBook.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getChildSourceBook.js","sourceRoot":"","sources":["../../../src/components/DepositFiltration/getChildSourceBook.ts"],"names":[],"mappings":";;AAEO,MAAM,kBAAkB,GAAG,CAAC,MAA8B,EAAE,EAAE,CACnE,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC;AADpE,QAAA,kBAAkB,sBACkD;AAEjF,MAAM,aAAa,GAAG,CAAC,KAAe,EAA2D,EAAE,CACjG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,IAAI,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC"}
|