@redneckz/wildless-cms-uni-blocks 0.8.23 → 0.8.24
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.8.17.js +27 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +59 -28
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +6 -2
- package/bundle/components/Tabs/LinkTab.d.ts +1 -0
- package/bundle/hooks/useBranches.d.ts +20 -0
- package/bundle/ui-kit/TopItem/TopItem.d.ts +2 -1
- package/dist/components/ApplicationForm/ApplicationFormAcquiring.js +1 -1
- package/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
- package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormCredit.js +5 -5
- package/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/dist/components/ApplicationForm/renderBankOffices.js.map +1 -1
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/dist/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +6 -2
- package/dist/components/Calculator/getMonthlyPayment.js +4 -1
- package/dist/components/Calculator/getMonthlyPayment.js.map +1 -1
- package/dist/components/Header/HeaderSecondaryMenu.js +7 -2
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/Tabs/LinkTab.d.ts +1 -0
- package/dist/components/Tabs/LinkTab.js +6 -2
- package/dist/components/Tabs/LinkTab.js.map +1 -1
- package/dist/components/Tabs/Tabs.js +15 -3
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/renderTab.js +1 -1
- package/dist/components/Tabs/renderTab.js.map +1 -1
- package/dist/hooks/useBranches.d.ts +20 -0
- package/dist/hooks/useBranches.js +16 -0
- package/dist/hooks/useBranches.js.map +1 -0
- package/dist/ui-kit/BlockWrapper.js +1 -4
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/dist/ui-kit/TopItem/TopItem.d.ts +2 -1
- package/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormAcquiring.js +1 -1
- package/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
- package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormCredit.js +5 -5
- package/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/lib/components/ApplicationForm/renderBankOffices.js.map +1 -1
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/lib/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +6 -2
- package/lib/components/Calculator/getMonthlyPayment.js +4 -1
- package/lib/components/Calculator/getMonthlyPayment.js.map +1 -1
- package/lib/components/Header/HeaderSecondaryMenu.js +7 -2
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/Tabs/LinkTab.d.ts +1 -0
- package/lib/components/Tabs/LinkTab.js +6 -2
- package/lib/components/Tabs/LinkTab.js.map +1 -1
- package/lib/components/Tabs/Tabs.js +15 -3
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/renderTab.js +1 -1
- package/lib/components/Tabs/renderTab.js.map +1 -1
- package/lib/hooks/useBranches.d.ts +20 -0
- package/lib/hooks/useBranches.js +13 -0
- package/lib/hooks/useBranches.js.map +1 -0
- package/lib/ui-kit/BlockWrapper.js +1 -4
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/ui-kit/TopItem/TopItem.d.ts +2 -1
- package/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +2 -5
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +6 -2
- package/mobile/bundle/components/Tabs/LinkTab.d.ts +1 -0
- package/mobile/bundle/hooks/useBranches.d.ts +20 -0
- package/mobile/bundle/ui-kit/TopItem/TopItem.d.ts +2 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
- package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js +5 -5
- package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderBankOffices.js.map +1 -1
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/mobile/dist/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +6 -2
- package/mobile/dist/components/Calculator/getMonthlyPayment.js +4 -1
- package/mobile/dist/components/Calculator/getMonthlyPayment.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js +7 -2
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/dist/components/Tabs/LinkTab.d.ts +1 -0
- package/mobile/dist/components/Tabs/LinkTab.js +6 -2
- package/mobile/dist/components/Tabs/LinkTab.js.map +1 -1
- package/mobile/dist/components/Tabs/Tabs.js +15 -3
- package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
- package/mobile/dist/components/Tabs/renderTab.js +1 -1
- package/mobile/dist/components/Tabs/renderTab.js.map +1 -1
- package/mobile/dist/hooks/useBranches.d.ts +20 -0
- package/mobile/dist/hooks/useBranches.js +16 -0
- package/mobile/dist/hooks/useBranches.js.map +1 -0
- package/mobile/dist/ui-kit/BlockWrapper.js +1 -4
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/dist/ui-kit/TopItem/TopItem.d.ts +2 -1
- package/mobile/dist/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
- package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js +5 -5
- package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderBankOffices.js.map +1 -1
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js +2 -2
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlock.js.map +1 -1
- package/mobile/lib/components/BonusBenefitsBlock/BonusBenefitsBlockContent.d.ts +6 -2
- package/mobile/lib/components/Calculator/getMonthlyPayment.js +4 -1
- package/mobile/lib/components/Calculator/getMonthlyPayment.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js +7 -2
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/lib/components/Tabs/LinkTab.d.ts +1 -0
- package/mobile/lib/components/Tabs/LinkTab.js +6 -2
- package/mobile/lib/components/Tabs/LinkTab.js.map +1 -1
- package/mobile/lib/components/Tabs/Tabs.js +15 -3
- package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/components/Tabs/renderTab.js +1 -1
- package/mobile/lib/components/Tabs/renderTab.js.map +1 -1
- package/mobile/lib/hooks/useBranches.d.ts +20 -0
- package/mobile/lib/hooks/useBranches.js +13 -0
- package/mobile/lib/hooks/useBranches.js.map +1 -0
- package/mobile/lib/ui-kit/BlockWrapper.js +1 -4
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/ui-kit/TopItem/TopItem.d.ts +2 -1
- package/mobile/lib/ui-kit/TopItem/TopItem.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +2 -2
- package/mobile/src/components/ApplicationForm/ApplicationFormCredit.tsx +5 -5
- package/mobile/src/components/ApplicationForm/renderBankOffices.tsx +1 -1
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.example.json +16 -8
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +3 -3
- package/mobile/src/components/BonusBenefitsBlock/BonusBenefitsBlockContent.ts +6 -2
- package/mobile/src/components/Calculator/getMonthlyPayment.ts +3 -1
- package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +9 -2
- package/mobile/src/components/Tabs/LinkTab.tsx +8 -2
- package/mobile/src/components/Tabs/Tabs.tsx +18 -3
- package/mobile/src/components/Tabs/renderTab.tsx +7 -1
- package/mobile/src/hooks/useBranches.ts +43 -0
- package/mobile/src/ui-kit/BlockWrapper.tsx +1 -6
- package/mobile/src/ui-kit/TopItem/TopItem.tsx +2 -1
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +1 -1
- package/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +2 -2
- package/src/components/ApplicationForm/ApplicationFormCredit.tsx +5 -5
- package/src/components/ApplicationForm/renderBankOffices.tsx +1 -1
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.example.json +16 -8
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.fixture.tsx +8 -8
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlock.tsx +3 -3
- package/src/components/BonusBenefitsBlock/BonusBenefitsBlockContent.ts +6 -2
- package/src/components/Calculator/getMonthlyPayment.ts +3 -1
- package/src/components/Header/HeaderSecondaryMenu.tsx +9 -2
- package/src/components/Tabs/LinkTab.tsx +8 -2
- package/src/components/Tabs/Tabs.tsx +18 -3
- package/src/components/Tabs/renderTab.tsx +7 -1
- package/src/hooks/useBranches.ts +43 -0
- package/src/ui-kit/BlockWrapper.tsx +1 -6
- package/src/ui-kit/TopItem/TopItem.tsx +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AlignType } from '../../model/AlignType';
|
|
2
|
-
import type { DescriptionProps,
|
|
2
|
+
import type { DescriptionProps, TitleProps } from '../../model/HeadlineType';
|
|
3
3
|
import type { UniBlockContent } from '../../model/JSXBlock';
|
|
4
4
|
import type { IconProps } from '../../model/Picture';
|
|
5
5
|
|
|
@@ -15,8 +15,12 @@ export type ColumnsCount = '3' | '4' | '5';
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @title Бонус и преимущество
|
|
18
|
+
* @default {
|
|
19
|
+
* "title": "Верхний заголовок",
|
|
20
|
+
* "description": "Нижний заголовок",
|
|
21
|
+
* }
|
|
18
22
|
*/
|
|
19
|
-
export type BonusBenefit =
|
|
23
|
+
export type BonusBenefit = TitleProps & IconProps & DescriptionProps;
|
|
20
24
|
|
|
21
25
|
/**
|
|
22
26
|
* @title Блок бонусов и преимуществ
|
|
@@ -9,7 +9,9 @@ import type { CreditCalculatorUserInputParams } from './useCreditCalculatorParam
|
|
|
9
9
|
export const getMonthlyPayment = (rate: number, params: CreditCalculatorUserInputParams) => {
|
|
10
10
|
const { isAnnuity, moneyValue, monthsValue } = params;
|
|
11
11
|
|
|
12
|
-
if (
|
|
12
|
+
if (rate === 0) {
|
|
13
|
+
return 0;
|
|
14
|
+
} else if (isAnnuity) {
|
|
13
15
|
const i = rate / MONTHLY_INTEREST_RATE; // Используется значение ставки в процентах
|
|
14
16
|
|
|
15
17
|
return moneyValue * (i + i / (Math.pow(1 + i, monthsValue) - 1));
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
3
|
import { useBool } from '../../hooks/useBool';
|
|
3
4
|
import { useLocation } from '../../hooks/useLocation';
|
|
4
5
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
5
6
|
import type { IconVersion } from '../../model/IconVersion';
|
|
7
|
+
import type { PreventableEvent } from '../../model/PreventableEvent';
|
|
8
|
+
import { projectSettings } from '../../ProjectSettings';
|
|
6
9
|
import type { ForeignOffice } from '../../services/sitemap/SitemapProps';
|
|
7
10
|
import { Location } from '../../ui-kit/Location/Location';
|
|
8
11
|
import { TopItem } from '../../ui-kit/TopItem/TopItem';
|
|
9
12
|
import { style } from '../../utils/style';
|
|
10
13
|
import { HeaderChatBotButton } from './HeaderChatBotButton';
|
|
11
|
-
import { projectSettings } from '../../ProjectSettings';
|
|
12
14
|
|
|
13
15
|
interface HeaderSecondaryMenuContent {
|
|
14
16
|
version?: BlockVersion;
|
|
@@ -30,6 +32,11 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
30
32
|
|
|
31
33
|
const iconVersion: IconVersion = version === 'transparent' ? 'white' : 'black';
|
|
32
34
|
|
|
35
|
+
const handleShowLocationModal = useCallback((ev?: PreventableEvent) => {
|
|
36
|
+
ev?.preventDefault();
|
|
37
|
+
showLocationModal();
|
|
38
|
+
}, []);
|
|
39
|
+
|
|
33
40
|
return (
|
|
34
41
|
<div className={style('flex items-center', className)}>
|
|
35
42
|
<TopItem
|
|
@@ -37,7 +44,7 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
37
44
|
flat={true}
|
|
38
45
|
href="#"
|
|
39
46
|
text={location.name}
|
|
40
|
-
onClick={
|
|
47
|
+
onClick={handleShowLocationModal}
|
|
41
48
|
/>
|
|
42
49
|
{officesLink ? (
|
|
43
50
|
<TopItem className="mr-7" flat={true} href={officesLink} text="Офисы и банкоматы" />
|
|
@@ -7,22 +7,28 @@ interface LinkTabProps {
|
|
|
7
7
|
tab: LinkTabData;
|
|
8
8
|
currentTab?: TabData;
|
|
9
9
|
isScrollable?: boolean;
|
|
10
|
+
onClick: (tab: TabData) => void;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export const LinkTab = JSX<LinkTabProps>((props) => {
|
|
13
|
-
const { tab, currentTab, isScrollable = false } = props;
|
|
14
|
+
const { tab, currentTab, onClick, isScrollable = false } = props;
|
|
14
15
|
const active = currentTab?.type === 'link' && currentTab.href === tab.href;
|
|
15
16
|
|
|
16
17
|
const link = useLink();
|
|
17
18
|
const adjustedProps = link(tab);
|
|
18
19
|
|
|
20
|
+
const handleClick = (ev?: { preventDefault: () => void }) => {
|
|
21
|
+
adjustedProps.onClick(ev);
|
|
22
|
+
onClick(tab);
|
|
23
|
+
};
|
|
24
|
+
|
|
19
25
|
return (
|
|
20
26
|
<a
|
|
21
27
|
role="tab"
|
|
22
28
|
className={getLinkTabClassName('link', active, isScrollable)}
|
|
23
29
|
target={tab.target}
|
|
24
30
|
href={adjustedProps.href}
|
|
25
|
-
onClick={
|
|
31
|
+
onClick={handleClick}
|
|
26
32
|
>
|
|
27
33
|
<span className={getLinkTabClassName('text', active, isScrollable)}>{tab.text}</span>
|
|
28
34
|
</a>
|
|
@@ -19,6 +19,14 @@ export const Tabs = JSX<TabsBlockProps>((props) => {
|
|
|
19
19
|
|
|
20
20
|
const [currentTab, setCurrentTab] = useState(tabs ? tabs[0] : undefined);
|
|
21
21
|
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!tabs || !tabs[0]) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
fireTabEvent(tabs[0]);
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
22
30
|
useEffect(() => {
|
|
23
31
|
if (currentTab?.type === 'group') {
|
|
24
32
|
defaultEventBus.subject('tab', { type: currentTab.type, label: currentTab.ref });
|
|
@@ -26,9 +34,7 @@ export const Tabs = JSX<TabsBlockProps>((props) => {
|
|
|
26
34
|
}, [currentTab]);
|
|
27
35
|
|
|
28
36
|
const handleClick = useCallback((selectedTab: TabData) => {
|
|
29
|
-
|
|
30
|
-
defaultEventBus.fire('tab', { type: selectedTab.type, label: selectedTab.ref });
|
|
31
|
-
}
|
|
37
|
+
fireTabEvent(selectedTab);
|
|
32
38
|
setCurrentTab(selectedTab);
|
|
33
39
|
}, []);
|
|
34
40
|
|
|
@@ -61,3 +67,12 @@ export const Tabs = JSX<TabsBlockProps>((props) => {
|
|
|
61
67
|
</BlockWrapper>
|
|
62
68
|
);
|
|
63
69
|
});
|
|
70
|
+
|
|
71
|
+
const fireTabEvent = (tab: TabData) => {
|
|
72
|
+
if (tab.type === 'group') {
|
|
73
|
+
defaultEventBus.fire('tab', { type: tab.type, label: tab.ref });
|
|
74
|
+
}
|
|
75
|
+
if (tab.type === 'link') {
|
|
76
|
+
defaultEventBus.fire('tab', { type: tab.type, label: tab.href });
|
|
77
|
+
}
|
|
78
|
+
};
|
|
@@ -26,7 +26,13 @@ export const renderTab =
|
|
|
26
26
|
return renderGroupTab({ page, currentTab, showCounter, onClick, isScrollable })(tab, i);
|
|
27
27
|
case 'link': {
|
|
28
28
|
return (
|
|
29
|
-
<LinkTab
|
|
29
|
+
<LinkTab
|
|
30
|
+
key={String(i)}
|
|
31
|
+
tab={tab}
|
|
32
|
+
currentTab={currentTab}
|
|
33
|
+
isScrollable={isScrollable}
|
|
34
|
+
onClick={onClick}
|
|
35
|
+
/>
|
|
30
36
|
);
|
|
31
37
|
}
|
|
32
38
|
default:
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
2
|
+
import { fetchJSON } from '../utils/fetchJSON';
|
|
3
|
+
|
|
4
|
+
export interface Tariff {
|
|
5
|
+
tariffType?: string;
|
|
6
|
+
tariffValue?: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface SafeBoxCase {
|
|
10
|
+
safeBoxCasesSize?: string;
|
|
11
|
+
tariffs?: Tariff[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface SafeBoxCaseVolume {
|
|
15
|
+
volume?: string;
|
|
16
|
+
safeBoxCases?: SafeBoxCase[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface Branch {
|
|
20
|
+
branchCode?: string;
|
|
21
|
+
address?: string;
|
|
22
|
+
gpsLatitude?: number;
|
|
23
|
+
gpsLongitude?: number;
|
|
24
|
+
safeBoxCaseVolumes?: SafeBoxCaseVolume[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const BRANCHES_URL = '/api/v1/branches';
|
|
28
|
+
const EMPTY_VALUE = [];
|
|
29
|
+
|
|
30
|
+
export function useBranches(regionCode?: string): Branch[] {
|
|
31
|
+
const { data } = useAsyncData<Branch[], any, string | null>(
|
|
32
|
+
regionCode ? `${BRANCHES_URL}?regionCode=${regionCode}` : null,
|
|
33
|
+
fetchSafeBoxes,
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
return data || EMPTY_VALUE;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const fetchSafeBoxes = async (url: string): Promise<Branch[]> => {
|
|
40
|
+
const result = await fetchJSON<Branch[]>(url, { method: 'GET' });
|
|
41
|
+
|
|
42
|
+
return result || EMPTY_VALUE;
|
|
43
|
+
};
|
|
@@ -38,12 +38,7 @@ export const BlockWrapper = JSX<BlockWrapperProps>(
|
|
|
38
38
|
() =>
|
|
39
39
|
defaultEventBus.subscribe('tab', (event) => {
|
|
40
40
|
setHidden(
|
|
41
|
-
Boolean(
|
|
42
|
-
event.type === 'group' &&
|
|
43
|
-
event.label &&
|
|
44
|
-
block?.labels?.length &&
|
|
45
|
-
!block.labels.includes(event.label),
|
|
46
|
-
),
|
|
41
|
+
Boolean(event.label && block?.labels?.length && !block.labels.includes(event.label)),
|
|
47
42
|
);
|
|
48
43
|
}),
|
|
49
44
|
[block],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useLink } from '../../hooks/useLink';
|
|
3
3
|
import type { LinkProps } from '../../model/LinkProps';
|
|
4
|
+
import type { PreventableEvent } from '../../model/PreventableEvent';
|
|
4
5
|
import { style } from '../../utils/style';
|
|
5
6
|
|
|
6
7
|
export interface TopItemContent extends LinkProps {
|
|
@@ -11,7 +12,7 @@ export interface TopItemProps extends TopItemContent {
|
|
|
11
12
|
className?: string;
|
|
12
13
|
flat?: boolean;
|
|
13
14
|
dataItemName?: string;
|
|
14
|
-
onClick?: () => void;
|
|
15
|
+
onClick?: (ev?: PreventableEvent) => void;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export const TopItem = JSX<TopItemProps>(({ className = '', active, flat, children, ...rest }) => {
|