@digigov/ui 1.0.0-480e3d97 → 1.0.0-60addd4a
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/app/Footer/Footer.stories.playwright.json +2 -2
- package/app/Header/Header.stories.playwright.json +1 -1
- package/app/Header/__stories__/WithHeaderNavigation.js +13 -21
- package/app/Header/__stories__/WithNavigation.js +8 -40
- package/app/Masthead/Masthead.stories.playwright.json +1 -1
- package/app/ThemeOptions/index.js +2 -2
- package/content/Details/index.mdx +5 -0
- package/content/Table/__stories__/WithFloatingScroll.js +10 -4
- package/content/Table/index.js +7 -5
- package/content/Table/index.mdx +1 -1
- package/es/app/Footer/Footer.stories.playwright.json +2 -2
- package/es/app/Header/Header.stories.playwright.json +1 -1
- package/es/app/Header/__stories__/WithHeaderNavigation.js +13 -13
- package/es/app/Header/__stories__/WithNavigation.js +9 -36
- package/es/app/Masthead/Masthead.stories.playwright.json +1 -1
- package/es/app/ThemeOptions/index.js +2 -2
- package/es/content/Details/index.mdx +5 -0
- package/es/content/Table/__stories__/WithFloatingScroll.js +5 -4
- package/es/content/Table/index.js +7 -4
- package/es/content/Table/index.mdx +1 -1
- package/es/feedback/ServiceBadge/index.mdx +9 -5
- package/es/form/Button/index.mdx +4 -4
- package/es/form/Checkbox/index.mdx +5 -0
- package/es/form/DateInputContainer/index.mdx +5 -0
- package/es/form/FileUpload/index.mdx +2 -0
- package/es/form/RadioContainer/index.mdx +5 -0
- package/es/form/SelectContainer/index.mdx +6 -0
- package/es/layouts/Grid/Grid.stories.js +1 -0
- package/es/layouts/Grid/__stories__/ResponsiveSpacing.js +79 -0
- package/es/navigation/Breadcrumbs/index.mdx +5 -0
- package/es/navigation/Drawer/__stories__/Default.js +25 -66
- package/es/navigation/Dropdown/__stories__/AlignRight.js +9 -8
- package/es/navigation/Dropdown/__stories__/Default.js +9 -8
- package/es/navigation/Dropdown/__stories__/PlacementTop.js +9 -8
- package/es/navigation/Dropdown/index.mdx +0 -2
- package/es/navigation/Link/index.mdx +2 -0
- package/es/navigation/NavList/NavList.stories.playwright.json +2 -2
- package/es/navigation/NavList/NavListAuto/index.js +54 -0
- package/es/navigation/NavList/{NavMenuContainerContentList.js → NavMenuContentList.js} +5 -5
- package/es/navigation/NavList/__stories__/Default.js +12 -28
- package/es/navigation/NavList/__stories__/NavVerticalLayout.js +12 -26
- package/es/navigation/NavList/hooks/useNavList.js +2 -2
- package/es/navigation/NavList/hooks/useTogglableNav.js +33 -18
- package/es/navigation/NavList/index.js +16 -17
- package/es/navigation/NavList/types.js +1 -6
- package/es/navigation/Pagination/__stories__/Default.js +7 -65
- package/es/navigation/Pagination/index.mdx +1 -2
- package/es/navigation/Tabs/index.mdx +6 -0
- package/es/registry.js +4 -40
- package/es/typography/Hint/index.mdx +2 -0
- package/es/typography/NormalText/index.mdx +2 -0
- package/es/typography/Paragraph/index.mdx +1 -0
- package/esm/app/Footer/Footer.stories.playwright.json +2 -2
- package/esm/app/Header/Header.stories.playwright.json +1 -1
- package/esm/app/Header/__stories__/WithHeaderNavigation.js +13 -13
- package/esm/app/Header/__stories__/WithNavigation.js +9 -36
- package/esm/app/Masthead/Masthead.stories.playwright.json +1 -1
- package/esm/app/ThemeOptions/index.js +2 -2
- package/esm/content/Details/index.mdx +5 -0
- package/esm/content/Table/__stories__/WithFloatingScroll.js +5 -4
- package/esm/content/Table/index.js +7 -4
- package/esm/content/Table/index.mdx +1 -1
- package/esm/feedback/ServiceBadge/index.mdx +9 -5
- package/esm/form/Button/index.mdx +4 -4
- package/esm/form/Checkbox/index.mdx +5 -0
- package/esm/form/DateInputContainer/index.mdx +5 -0
- package/esm/form/FileUpload/index.mdx +2 -0
- package/esm/form/RadioContainer/index.mdx +5 -0
- package/esm/form/SelectContainer/index.mdx +6 -0
- package/esm/index.js +1 -1
- package/esm/layouts/Grid/Grid.stories.js +1 -0
- package/esm/layouts/Grid/__stories__/ResponsiveSpacing.js +79 -0
- package/esm/navigation/Breadcrumbs/index.mdx +5 -0
- package/esm/navigation/Drawer/__stories__/Default.js +25 -66
- package/esm/navigation/Dropdown/__stories__/AlignRight.js +9 -8
- package/esm/navigation/Dropdown/__stories__/Default.js +9 -8
- package/esm/navigation/Dropdown/__stories__/PlacementTop.js +9 -8
- package/esm/navigation/Dropdown/index.mdx +0 -2
- package/esm/navigation/Link/index.mdx +2 -0
- package/esm/navigation/NavList/NavList.stories.playwright.json +2 -2
- package/esm/navigation/NavList/NavListAuto/index.js +54 -0
- package/esm/navigation/NavList/{NavMenuContainerContentList.js → NavMenuContentList.js} +5 -5
- package/esm/navigation/NavList/__stories__/Default.js +12 -28
- package/esm/navigation/NavList/__stories__/NavVerticalLayout.js +12 -26
- package/esm/navigation/NavList/hooks/useNavList.js +2 -2
- package/esm/navigation/NavList/hooks/useTogglableNav.js +33 -18
- package/esm/navigation/NavList/index.js +16 -17
- package/esm/navigation/NavList/types.js +1 -6
- package/esm/navigation/Pagination/__stories__/Default.js +7 -65
- package/esm/navigation/Pagination/index.mdx +1 -2
- package/esm/navigation/Tabs/index.mdx +6 -0
- package/esm/registry.js +4 -40
- package/esm/typography/Hint/index.mdx +2 -0
- package/esm/typography/NormalText/index.mdx +2 -0
- package/esm/typography/Paragraph/index.mdx +1 -0
- package/feedback/ServiceBadge/index.mdx +9 -5
- package/form/Button/index.mdx +4 -4
- package/form/Checkbox/index.mdx +5 -0
- package/form/DateInputContainer/index.mdx +5 -0
- package/form/FileUpload/index.mdx +2 -0
- package/form/RadioContainer/index.mdx +5 -0
- package/form/SelectContainer/index.mdx +6 -0
- package/layouts/Basic/Content/index.d.ts +1 -1
- package/layouts/Basic/Side/index.d.ts +1 -1
- package/layouts/Grid/Grid.stories.d.ts +1 -0
- package/layouts/Grid/Grid.stories.js +14 -0
- package/layouts/Grid/__stories__/ResponsiveSpacing.d.ts +2 -0
- package/layouts/Grid/__stories__/ResponsiveSpacing.js +93 -0
- package/navigation/Breadcrumbs/index.mdx +5 -0
- package/navigation/Drawer/__stories__/Default.js +24 -68
- package/navigation/Dropdown/__stories__/AlignRight.js +9 -9
- package/navigation/Dropdown/__stories__/Default.js +9 -9
- package/navigation/Dropdown/__stories__/PlacementTop.js +9 -9
- package/navigation/Dropdown/index.mdx +0 -2
- package/navigation/Link/index.mdx +2 -0
- package/navigation/NavList/NavList.stories.playwright.json +2 -2
- package/navigation/NavList/NavListAuto/index.js +80 -0
- package/navigation/NavList/NavMenuContentList.d.ts +5 -0
- package/navigation/NavList/{NavMenuContainerContentList.js → NavMenuContentList.js} +10 -10
- package/navigation/NavList/__stories__/Default.js +12 -28
- package/navigation/NavList/__stories__/NavVerticalLayout.js +12 -32
- package/navigation/NavList/hooks/useNavList.d.ts +1 -1
- package/navigation/NavList/hooks/useNavList.js +2 -2
- package/navigation/NavList/hooks/useTogglableNav.d.ts +1 -0
- package/navigation/NavList/hooks/useTogglableNav.js +33 -18
- package/navigation/NavList/index.d.ts +16 -17
- package/navigation/NavList/index.js +54 -96
- package/navigation/NavList/types.d.ts +14 -17
- package/navigation/NavList/types.js +1 -14
- package/navigation/Pagination/__stories__/Default.js +7 -65
- package/navigation/Pagination/index.mdx +1 -2
- package/navigation/Tabs/index.mdx +6 -0
- package/package.json +3 -3
- package/registry.d.ts +2 -20
- package/registry.js +4 -58
- package/src/app/Footer/Footer.stories.playwright.json +2 -2
- package/src/app/Header/Header.stories.playwright.json +1 -1
- package/src/app/Header/__stories__/WithHeaderNavigation.tsx +23 -35
- package/src/app/Header/__stories__/WithNavigation.tsx +13 -34
- package/src/app/Masthead/Masthead.stories.playwright.json +1 -1
- package/src/app/ThemeOptions/index.tsx +3 -3
- package/src/content/Details/index.mdx +5 -0
- package/src/content/Table/__stories__/WithFloatingScroll.tsx +5 -7
- package/src/content/Table/index.mdx +1 -1
- package/src/content/Table/index.tsx +9 -8
- package/src/feedback/ServiceBadge/index.mdx +9 -5
- package/src/form/Button/index.mdx +4 -4
- package/src/form/Checkbox/index.mdx +5 -0
- package/src/form/DateInputContainer/index.mdx +5 -0
- package/src/form/FileUpload/index.mdx +2 -0
- package/src/form/RadioContainer/index.mdx +5 -0
- package/src/form/SelectContainer/index.mdx +6 -0
- package/src/layouts/Grid/Grid.stories.js +1 -0
- package/src/layouts/Grid/__stories__/ResponsiveSpacing.tsx +43 -0
- package/src/navigation/Breadcrumbs/index.mdx +5 -0
- package/src/navigation/Drawer/__stories__/Default.tsx +31 -84
- package/src/navigation/Dropdown/__stories__/AlignRight.tsx +13 -12
- package/src/navigation/Dropdown/__stories__/Default.tsx +10 -11
- package/src/navigation/Dropdown/__stories__/PlacementTop.tsx +11 -11
- package/src/navigation/Dropdown/index.mdx +0 -2
- package/src/navigation/Link/index.mdx +2 -0
- package/src/navigation/NavList/NavList.stories.playwright.json +2 -2
- package/src/navigation/NavList/NavListAuto/index.tsx +68 -0
- package/src/navigation/NavList/{NavMenuContainerContentList.tsx → NavMenuContentList.tsx} +8 -8
- package/src/navigation/NavList/__stories__/Default.tsx +28 -40
- package/src/navigation/NavList/__stories__/NavVerticalLayout.tsx +25 -33
- package/src/navigation/NavList/hooks/useNavList.ts +3 -3
- package/src/navigation/NavList/hooks/useTogglableNav.tsx +31 -19
- package/src/navigation/NavList/index.tsx +16 -17
- package/src/navigation/NavList/types.tsx +16 -28
- package/src/navigation/Pagination/__stories__/Default.tsx +2 -76
- package/src/navigation/Pagination/index.mdx +1 -2
- package/src/navigation/Tabs/index.mdx +6 -0
- package/src/registry.js +4 -40
- package/src/typography/Hint/index.mdx +2 -0
- package/src/typography/NormalText/index.mdx +2 -0
- package/src/typography/Paragraph/index.mdx +1 -0
- package/typography/Hint/index.mdx +2 -0
- package/typography/NormalText/index.mdx +2 -0
- package/typography/Paragraph/index.mdx +1 -0
- package/es/navigation/NavList/NavListAuto/NavListAuto.js +0 -31
- package/es/navigation/NavList/NavListAuto/NavListBaseAuto.js +0 -22
- package/es/navigation/NavList/NavListAuto/NavListContextAuto.js +0 -104
- package/es/navigation/NavList/NavListAuto/NavListItemAnchorAuto.js +0 -26
- package/es/navigation/NavList/NavListAuto/NavListItemAuto.js +0 -38
- package/es/navigation/NavList/NavListAuto/NavListItemButtonAuto.js +0 -30
- package/es/navigation/NavList/NavListAuto/NavListMenuAuto.js +0 -36
- package/es/navigation/NavList/NavListAuto/NavListSubMenuAuto.js +0 -26
- package/es/navigation/NavList/NavListItem.js +0 -23
- package/es/navigation/NavList/NavListItemBase.js +0 -44
- package/es/navigation/NavList/NavListItemButton.js +0 -3
- package/es/navigation/NavList/NavListItemLink.js +0 -3
- package/es/navigation/NavList/NavMenu.js +0 -3
- package/es/navigation/NavList/NavMenuContainer.js +0 -3
- package/es/navigation/NavList/NavMenuContainerContent.js +0 -3
- package/es/navigation/NavList/NavMenuContainerContentListItem.js +0 -3
- package/es/navigation/NavList/NavMenuContainerTitle.js +0 -3
- package/es/navigation/NavList/NavVertical.js +0 -3
- package/es/navigation/NavList/NavVerticalItem.js +0 -3
- package/esm/navigation/NavList/NavListAuto/NavListAuto.js +0 -31
- package/esm/navigation/NavList/NavListAuto/NavListBaseAuto.js +0 -22
- package/esm/navigation/NavList/NavListAuto/NavListContextAuto.js +0 -104
- package/esm/navigation/NavList/NavListAuto/NavListItemAnchorAuto.js +0 -26
- package/esm/navigation/NavList/NavListAuto/NavListItemAuto.js +0 -38
- package/esm/navigation/NavList/NavListAuto/NavListItemButtonAuto.js +0 -30
- package/esm/navigation/NavList/NavListAuto/NavListMenuAuto.js +0 -36
- package/esm/navigation/NavList/NavListAuto/NavListSubMenuAuto.js +0 -26
- package/esm/navigation/NavList/NavListItem.js +0 -23
- package/esm/navigation/NavList/NavListItemBase.js +0 -44
- package/esm/navigation/NavList/NavListItemButton.js +0 -3
- package/esm/navigation/NavList/NavListItemLink.js +0 -3
- package/esm/navigation/NavList/NavMenu.js +0 -3
- package/esm/navigation/NavList/NavMenuContainer.js +0 -3
- package/esm/navigation/NavList/NavMenuContainerContent.js +0 -3
- package/esm/navigation/NavList/NavMenuContainerContentListItem.js +0 -3
- package/esm/navigation/NavList/NavMenuContainerTitle.js +0 -3
- package/esm/navigation/NavList/NavVertical.js +0 -3
- package/esm/navigation/NavList/NavVerticalItem.js +0 -3
- package/navigation/NavList/NavListAuto/NavListAuto.js +0 -48
- package/navigation/NavList/NavListAuto/NavListBaseAuto.d.ts +0 -3
- package/navigation/NavList/NavListAuto/NavListBaseAuto.js +0 -38
- package/navigation/NavList/NavListAuto/NavListContextAuto.d.ts +0 -29
- package/navigation/NavList/NavListAuto/NavListContextAuto.js +0 -128
- package/navigation/NavList/NavListAuto/NavListItemAnchorAuto.d.ts +0 -9
- package/navigation/NavList/NavListAuto/NavListItemAnchorAuto.js +0 -51
- package/navigation/NavList/NavListAuto/NavListItemAuto.d.ts +0 -8
- package/navigation/NavList/NavListAuto/NavListItemAuto.js +0 -63
- package/navigation/NavList/NavListAuto/NavListItemButtonAuto.d.ts +0 -12
- package/navigation/NavList/NavListAuto/NavListItemButtonAuto.js +0 -48
- package/navigation/NavList/NavListAuto/NavListMenuAuto.d.ts +0 -11
- package/navigation/NavList/NavListAuto/NavListMenuAuto.js +0 -56
- package/navigation/NavList/NavListAuto/NavListSubMenuAuto.d.ts +0 -9
- package/navigation/NavList/NavListAuto/NavListSubMenuAuto.js +0 -44
- package/navigation/NavList/NavListItem.d.ts +0 -4
- package/navigation/NavList/NavListItem.js +0 -42
- package/navigation/NavList/NavListItemBase.d.ts +0 -15
- package/navigation/NavList/NavListItemBase.js +0 -68
- package/navigation/NavList/NavListItemButton.d.ts +0 -3
- package/navigation/NavList/NavListItemButton.js +0 -30
- package/navigation/NavList/NavListItemLink.d.ts +0 -3
- package/navigation/NavList/NavListItemLink.js +0 -30
- package/navigation/NavList/NavMenu.d.ts +0 -3
- package/navigation/NavList/NavMenu.js +0 -30
- package/navigation/NavList/NavMenuContainer.d.ts +0 -3
- package/navigation/NavList/NavMenuContainer.js +0 -30
- package/navigation/NavList/NavMenuContainerContent.d.ts +0 -3
- package/navigation/NavList/NavMenuContainerContent.js +0 -30
- package/navigation/NavList/NavMenuContainerContentList.d.ts +0 -5
- package/navigation/NavList/NavMenuContainerContentListItem.d.ts +0 -3
- package/navigation/NavList/NavMenuContainerContentListItem.js +0 -30
- package/navigation/NavList/NavMenuContainerTitle.d.ts +0 -3
- package/navigation/NavList/NavMenuContainerTitle.js +0 -30
- package/navigation/NavList/NavVertical.d.ts +0 -3
- package/navigation/NavList/NavVertical.js +0 -30
- package/navigation/NavList/NavVerticalItem.d.ts +0 -3
- package/navigation/NavList/NavVerticalItem.js +0 -30
- package/src/navigation/NavList/NavListAuto/NavListAuto.tsx +0 -34
- package/src/navigation/NavList/NavListAuto/NavListBaseAuto.tsx +0 -20
- package/src/navigation/NavList/NavListAuto/NavListContextAuto.tsx +0 -112
- package/src/navigation/NavList/NavListAuto/NavListItemAnchorAuto.tsx +0 -38
- package/src/navigation/NavList/NavListAuto/NavListItemAuto.tsx +0 -49
- package/src/navigation/NavList/NavListAuto/NavListItemButtonAuto.tsx +0 -53
- package/src/navigation/NavList/NavListAuto/NavListMenuAuto.tsx +0 -51
- package/src/navigation/NavList/NavListAuto/NavListSubMenuAuto.tsx +0 -32
- package/src/navigation/NavList/NavListItem.tsx +0 -46
- package/src/navigation/NavList/NavListItemBase.tsx +0 -63
- package/src/navigation/NavList/NavListItemButton.tsx +0 -3
- package/src/navigation/NavList/NavListItemLink.tsx +0 -3
- package/src/navigation/NavList/NavMenu.tsx +0 -3
- package/src/navigation/NavList/NavMenuContainer.tsx +0 -3
- package/src/navigation/NavList/NavMenuContainerContent.tsx +0 -3
- package/src/navigation/NavList/NavMenuContainerContentListItem.tsx +0 -3
- package/src/navigation/NavList/NavMenuContainerTitle.tsx +0 -3
- package/src/navigation/NavList/NavVertical.tsx +0 -3
- package/src/navigation/NavList/NavVerticalItem.tsx +0 -3
- /package/navigation/NavList/NavListAuto/{NavListAuto.d.ts → index.d.ts} +0 -0
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Link } from '@digigov/ui/navigation/Link';
|
|
3
|
-
import NavMenu from '@digigov/ui/navigation/NavList/NavMenu';
|
|
4
|
-
import NavMenuContainer from '@digigov/ui/navigation/NavList/NavMenuContainer';
|
|
5
|
-
import NavMenuContainerContent from '@digigov/ui/navigation/NavList/NavMenuContainerContent';
|
|
6
|
-
import NavMenuContainerContentList from '@digigov/ui/navigation/NavList/NavMenuContainerContentList';
|
|
7
|
-
import NavMenuContainerContentListItem from '@digigov/ui/navigation/NavList/NavMenuContainerContentListItem';
|
|
8
|
-
import NavMenuContainerTitle from '@digigov/ui/navigation/NavList/NavMenuContainerTitle';
|
|
9
|
-
export var NavListMenuAuto = function NavListMenuAuto(_ref) {
|
|
10
|
-
var layout = _ref.layout,
|
|
11
|
-
active = _ref.active,
|
|
12
|
-
title = _ref.title,
|
|
13
|
-
subMenu = _ref.subMenu,
|
|
14
|
-
id = _ref.id;
|
|
15
|
-
return /*#__PURE__*/React.createElement(NavMenu, {
|
|
16
|
-
layout: layout,
|
|
17
|
-
active: active,
|
|
18
|
-
id: id
|
|
19
|
-
}, /*#__PURE__*/React.createElement(NavMenuContainer, {
|
|
20
|
-
layout: layout,
|
|
21
|
-
paddingLeft: 5,
|
|
22
|
-
paddingRight: 5
|
|
23
|
-
}, /*#__PURE__*/React.createElement(NavMenuContainerTitle, null, title), /*#__PURE__*/React.createElement(NavMenuContainerContent, null, /*#__PURE__*/React.createElement(NavMenuContainerContentList, {
|
|
24
|
-
role: "menu"
|
|
25
|
-
}, subMenu === null || subMenu === void 0 ? void 0 : subMenu.map(function (item, index) {
|
|
26
|
-
return /*#__PURE__*/React.createElement(NavMenuContainerContentListItem, {
|
|
27
|
-
role: "presentation",
|
|
28
|
-
key: index
|
|
29
|
-
}, /*#__PURE__*/React.createElement(Link, {
|
|
30
|
-
role: "menuitem",
|
|
31
|
-
id: item.name,
|
|
32
|
-
href: item.href
|
|
33
|
-
}, item.label));
|
|
34
|
-
})))));
|
|
35
|
-
};
|
|
36
|
-
export default NavListMenuAuto;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["items", "open", "layout"];
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { Nav } from '@digigov/ui/navigation/NavList/Nav';
|
|
6
|
-
import { NavList } from '@digigov/ui/navigation/NavList/NavList';
|
|
7
|
-
import NavItemAuto from '@digigov/ui/navigation/NavList/NavListAuto/NavListItemAuto';
|
|
8
|
-
export var NavListSubMenuAuto = function NavListSubMenuAuto(_ref) {
|
|
9
|
-
var items = _ref.items,
|
|
10
|
-
open = _ref.open,
|
|
11
|
-
layout = _ref.layout,
|
|
12
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
-
|
|
14
|
-
return open ? /*#__PURE__*/React.createElement(Nav, _extends({
|
|
15
|
-
hidden: !open,
|
|
16
|
-
layout: layout
|
|
17
|
-
}, props, {
|
|
18
|
-
"aria-orientation": layout
|
|
19
|
-
}), /*#__PURE__*/React.createElement(NavList, null, items === null || items === void 0 ? void 0 : items.map(function (subMenuItem, index) {
|
|
20
|
-
return /*#__PURE__*/React.createElement(NavItemAuto, {
|
|
21
|
-
key: index,
|
|
22
|
-
item: subMenuItem
|
|
23
|
-
});
|
|
24
|
-
}))) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
25
|
-
};
|
|
26
|
-
export default NavListSubMenuAuto;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["link", "setRegisterButton", "setRegisterLink", "active", "children"];
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import NavListItemContainer from '@digigov/react-core/NavListItem';
|
|
6
|
-
import NavListItemButton from '@digigov/ui/navigation/NavList/NavListItemButton';
|
|
7
|
-
import { NavListItemLink } from '@digigov/ui/navigation/NavList/NavListItemLink';
|
|
8
|
-
import { isNavListItemLinkInterface, isNavListItemSubMenuInterface } from '@digigov/ui/navigation/NavList/types';
|
|
9
|
-
export var NavListItem = function NavListItem(_ref) {
|
|
10
|
-
var link = _ref.link,
|
|
11
|
-
setRegisterButton = _ref.setRegisterButton,
|
|
12
|
-
setRegisterLink = _ref.setRegisterLink,
|
|
13
|
-
active = _ref.active,
|
|
14
|
-
children = _ref.children,
|
|
15
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
-
|
|
17
|
-
return /*#__PURE__*/React.createElement(NavListItemContainer, null, children ? children : isNavListItemSubMenuInterface(link) && link !== null && link !== void 0 && link.subMenu ? /*#__PURE__*/React.createElement(NavListItemButton, _extends({}, setRegisterButton && setRegisterButton(link.name), props), link === null || link === void 0 ? void 0 : link.label) : isNavListItemLinkInterface(link) && /*#__PURE__*/React.createElement(NavListItemLink, _extends({
|
|
18
|
-
href: link === null || link === void 0 ? void 0 : link.href
|
|
19
|
-
}, setRegisterLink && setRegisterLink(link.name), {
|
|
20
|
-
active: active
|
|
21
|
-
}, props), link === null || link === void 0 ? void 0 : link.label));
|
|
22
|
-
};
|
|
23
|
-
export default NavListItem;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["container", "setRegisterButton", "children", "item", "layout", "role"];
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import Link from '@digigov/ui/navigation/Link';
|
|
6
|
-
import NavListItem from '@digigov/ui/navigation/NavList/NavListItem';
|
|
7
|
-
import NavMenu from '@digigov/ui/navigation/NavList/NavMenu';
|
|
8
|
-
import NavMenuContainer from '@digigov/ui/navigation/NavList/NavMenuContainer';
|
|
9
|
-
import NavMenuContainerContent from '@digigov/ui/navigation/NavList/NavMenuContainerContent';
|
|
10
|
-
import NavMenuContainerContentList from '@digigov/ui/navigation/NavList/NavMenuContainerContentList';
|
|
11
|
-
import NavMenuContainerContentListItem from '@digigov/ui/navigation/NavList/NavMenuContainerContentListItem';
|
|
12
|
-
import NavMenuContainerTitle from '@digigov/ui/navigation/NavList/NavMenuContainerTitle';
|
|
13
|
-
import { isNavListItemLinkInterface } from '@digigov/ui/navigation/NavList/types';
|
|
14
|
-
export var NavListItemBase = function NavListItemBase(_ref) {
|
|
15
|
-
var _item$subMenu;
|
|
16
|
-
|
|
17
|
-
var container = _ref.container,
|
|
18
|
-
setRegisterButton = _ref.setRegisterButton,
|
|
19
|
-
children = _ref.children,
|
|
20
|
-
item = _ref.item,
|
|
21
|
-
_ref$layout = _ref.layout,
|
|
22
|
-
layout = _ref$layout === void 0 ? 'horizontal' : _ref$layout,
|
|
23
|
-
role = _ref.role,
|
|
24
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
-
|
|
26
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NavListItem, _extends({
|
|
27
|
-
link: item,
|
|
28
|
-
setRegisterButton: setRegisterButton,
|
|
29
|
-
role: "menuitem"
|
|
30
|
-
}, props)), /*#__PURE__*/React.createElement(NavMenu, _extends({
|
|
31
|
-
layout: layout
|
|
32
|
-
}, container && container(item.name)), /*#__PURE__*/React.createElement(NavMenuContainer, {
|
|
33
|
-
layout: layout,
|
|
34
|
-
paddingLeft: 5,
|
|
35
|
-
paddingRight: 5
|
|
36
|
-
}, /*#__PURE__*/React.createElement(NavMenuContainerTitle, null, item.label), /*#__PURE__*/React.createElement(NavMenuContainerContent, null, /*#__PURE__*/React.createElement(NavMenuContainerContentList, null, (_item$subMenu = item.subMenu) === null || _item$subMenu === void 0 ? void 0 : _item$subMenu.map(function (subMenu, menuIndex) {
|
|
37
|
-
return isNavListItemLinkInterface(subMenu) && /*#__PURE__*/React.createElement(NavMenuContainerContentListItem, {
|
|
38
|
-
key: menuIndex
|
|
39
|
-
}, /*#__PURE__*/React.createElement(Link, {
|
|
40
|
-
href: subMenu.href
|
|
41
|
-
}, subMenu.label));
|
|
42
|
-
}))))));
|
|
43
|
-
};
|
|
44
|
-
export default NavListItemBase;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = exports.NavListAuto = void 0;
|
|
9
|
-
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
|
-
var _NavListBaseAuto = require("@digigov/ui/navigation/NavList/NavListAuto/NavListBaseAuto");
|
|
17
|
-
|
|
18
|
-
var _NavListContextAuto = require("@digigov/ui/navigation/NavList/NavListAuto/NavListContextAuto");
|
|
19
|
-
|
|
20
|
-
var _excluded = ["layout", "border", "fixed", "openSubMenus", "links", "role"];
|
|
21
|
-
|
|
22
|
-
var NavListAuto = function NavListAuto(_ref) {
|
|
23
|
-
var layout = _ref.layout,
|
|
24
|
-
border = _ref.border,
|
|
25
|
-
fixed = _ref.fixed,
|
|
26
|
-
_ref$openSubMenus = _ref.openSubMenus,
|
|
27
|
-
openSubMenus = _ref$openSubMenus === void 0 ? false : _ref$openSubMenus,
|
|
28
|
-
_ref$links = _ref.links,
|
|
29
|
-
links = _ref$links === void 0 ? [] : _ref$links,
|
|
30
|
-
role = _ref.role,
|
|
31
|
-
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
32
|
-
return /*#__PURE__*/_react["default"].createElement(_NavListContextAuto.NavListProviderAuto, {
|
|
33
|
-
openSubMenus: openSubMenus,
|
|
34
|
-
layout: layout,
|
|
35
|
-
border: border,
|
|
36
|
-
fixed: fixed,
|
|
37
|
-
links: links
|
|
38
|
-
}, /*#__PURE__*/_react["default"].createElement(_NavListBaseAuto.NavListBaseAuto, (0, _extends2["default"])({
|
|
39
|
-
layout: layout,
|
|
40
|
-
border: border,
|
|
41
|
-
fixed: fixed,
|
|
42
|
-
role: role
|
|
43
|
-
}, props)));
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
exports.NavListAuto = NavListAuto;
|
|
47
|
-
var _default = NavListAuto;
|
|
48
|
-
exports["default"] = _default;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.NavListBaseAuto = void 0;
|
|
9
|
-
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
|
-
var _Nav = _interopRequireDefault(require("@digigov/ui/navigation/NavList/Nav"));
|
|
17
|
-
|
|
18
|
-
var _NavList = _interopRequireDefault(require("@digigov/ui/navigation/NavList/NavList"));
|
|
19
|
-
|
|
20
|
-
var _excluded = ["className", "children", "floating", "layout", "subMenu", "role"];
|
|
21
|
-
|
|
22
|
-
var NavListBaseAuto = function NavListBaseAuto(_ref) {
|
|
23
|
-
var className = _ref.className,
|
|
24
|
-
children = _ref.children,
|
|
25
|
-
floating = _ref.floating,
|
|
26
|
-
layout = _ref.layout,
|
|
27
|
-
subMenu = _ref.subMenu,
|
|
28
|
-
role = _ref.role,
|
|
29
|
-
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
30
|
-
return /*#__PURE__*/_react["default"].createElement(_Nav["default"], (0, _extends2["default"])({
|
|
31
|
-
open: true,
|
|
32
|
-
layout: layout
|
|
33
|
-
}, props, {
|
|
34
|
-
"aria-orientation": layout
|
|
35
|
-
}), /*#__PURE__*/_react["default"].createElement(_NavList["default"], null, children));
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
exports.NavListBaseAuto = NavListBaseAuto;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { NavListLayout } from '@digigov/ui/navigation/NavList/types';
|
|
3
|
-
export interface NavLinkInterface {
|
|
4
|
-
name?: string;
|
|
5
|
-
label?: string;
|
|
6
|
-
href?: string;
|
|
7
|
-
children?: React.ReactNode;
|
|
8
|
-
subMenu?: NavLinkInterface[];
|
|
9
|
-
}
|
|
10
|
-
export interface NavListContextInterface {
|
|
11
|
-
layout?: NavListLayout;
|
|
12
|
-
border?: boolean;
|
|
13
|
-
fixed?: boolean;
|
|
14
|
-
openSubMenus?: boolean;
|
|
15
|
-
showDividers?: boolean;
|
|
16
|
-
links: NavLinkInterface[];
|
|
17
|
-
activeLink?: NavLinkInterface;
|
|
18
|
-
activeSubMenu?: NavLinkInterface[];
|
|
19
|
-
onSubMenuActive?: (name: string) => void;
|
|
20
|
-
container?: (key: string) => {
|
|
21
|
-
active: boolean;
|
|
22
|
-
id: string;
|
|
23
|
-
};
|
|
24
|
-
setRegisterButton?: (name: string) => any;
|
|
25
|
-
setRegisterLink?: (name: string) => any;
|
|
26
|
-
}
|
|
27
|
-
export declare const NavListContextAuto: React.Context<NavListContextInterface>;
|
|
28
|
-
export declare const NavListProviderAuto: React.FC<NavListContextInterface>;
|
|
29
|
-
export default NavListContextAuto;
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = exports.NavListProviderAuto = exports.NavListContextAuto = void 0;
|
|
11
|
-
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
|
|
16
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
|
|
18
|
-
var _useNavList2 = require("@digigov/ui/navigation/NavList/hooks/useNavList");
|
|
19
|
-
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
|
-
var NavListContextAuto = /*#__PURE__*/(0, _react.createContext)({
|
|
25
|
-
layout: 'horizontal',
|
|
26
|
-
border: true,
|
|
27
|
-
fixed: true,
|
|
28
|
-
openSubMenus: false,
|
|
29
|
-
links: [],
|
|
30
|
-
activeLink: {},
|
|
31
|
-
activeSubMenu: []
|
|
32
|
-
});
|
|
33
|
-
exports.NavListContextAuto = NavListContextAuto;
|
|
34
|
-
var TRAILING_SLASH = /\/$/gm;
|
|
35
|
-
|
|
36
|
-
var NavListProviderAuto = function NavListProviderAuto(_ref) {
|
|
37
|
-
var children = _ref.children,
|
|
38
|
-
layout = _ref.layout,
|
|
39
|
-
border = _ref.border,
|
|
40
|
-
fixed = _ref.fixed,
|
|
41
|
-
_ref$openSubMenus = _ref.openSubMenus,
|
|
42
|
-
openSubMenus = _ref$openSubMenus === void 0 ? false : _ref$openSubMenus,
|
|
43
|
-
_ref$showDividers = _ref.showDividers,
|
|
44
|
-
showDividers = _ref$showDividers === void 0 ? false : _ref$showDividers,
|
|
45
|
-
_ref$links = _ref.links,
|
|
46
|
-
links = _ref$links === void 0 ? [] : _ref$links;
|
|
47
|
-
|
|
48
|
-
var _useState = (0, _react.useState)([]),
|
|
49
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
50
|
-
activeSubMenu = _useState2[0],
|
|
51
|
-
setActiveSubMenu = _useState2[1];
|
|
52
|
-
|
|
53
|
-
var _useState3 = (0, _react.useState)({}),
|
|
54
|
-
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
55
|
-
activeLink = _useState4[0],
|
|
56
|
-
setActiveLink = _useState4[1];
|
|
57
|
-
|
|
58
|
-
var _useNavList = (0, _useNavList2.useNavList)(),
|
|
59
|
-
container = _useNavList.container,
|
|
60
|
-
registerButton = _useNavList.registerButton,
|
|
61
|
-
registerLink = _useNavList.registerLink;
|
|
62
|
-
|
|
63
|
-
var setRegisterButton = function setRegisterButton(name) {
|
|
64
|
-
return (0, _extends2["default"])({}, registerButton(name));
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
var setRegisterLink = function setRegisterLink(name) {
|
|
68
|
-
return (0, _extends2["default"])({}, registerLink(name));
|
|
69
|
-
}; // TODO: Cleanup unused props
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
(0, _react.useEffect)(function () {
|
|
73
|
-
var currentActiveLink = links.find(function (link) {
|
|
74
|
-
var _link$subMenu;
|
|
75
|
-
|
|
76
|
-
if ((_link$subMenu = link.subMenu) !== null && _link$subMenu !== void 0 && _link$subMenu.length) {
|
|
77
|
-
return !!~link.subMenu.findIndex(function (subMenuLink) {
|
|
78
|
-
var _window, _subMenuLink$href;
|
|
79
|
-
|
|
80
|
-
return ((_window = window) === null || _window === void 0 ? void 0 : _window.location.pathname.replace(TRAILING_SLASH, '')) === ((_subMenuLink$href = subMenuLink.href) === null || _subMenuLink$href === void 0 ? void 0 : _subMenuLink$href.replace(TRAILING_SLASH, ''));
|
|
81
|
-
});
|
|
82
|
-
} else {
|
|
83
|
-
var _window2, _link$href;
|
|
84
|
-
|
|
85
|
-
return ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.location.pathname.replace(TRAILING_SLASH, '')) === ((_link$href = link.href) === null || _link$href === void 0 ? void 0 : _link$href.replace(TRAILING_SLASH, '')) || false;
|
|
86
|
-
}
|
|
87
|
-
}) || {
|
|
88
|
-
label: '',
|
|
89
|
-
href: ''
|
|
90
|
-
};
|
|
91
|
-
setActiveLink(currentActiveLink);
|
|
92
|
-
}, [links]);
|
|
93
|
-
|
|
94
|
-
var onSubMenuActive = function onSubMenuActive(href) {
|
|
95
|
-
if (href === null) {
|
|
96
|
-
setActiveSubMenu([]);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
var link = links.find(function (link) {
|
|
100
|
-
return link.href === href && link.subMenu && link.subMenu.length;
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
if (link && link.subMenu) {
|
|
104
|
-
setActiveSubMenu(link.subMenu);
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
return /*#__PURE__*/_react["default"].createElement(NavListContextAuto.Provider, {
|
|
109
|
-
value: {
|
|
110
|
-
openSubMenus: openSubMenus,
|
|
111
|
-
layout: layout,
|
|
112
|
-
border: border,
|
|
113
|
-
fixed: fixed,
|
|
114
|
-
showDividers: showDividers,
|
|
115
|
-
links: links,
|
|
116
|
-
activeLink: activeLink,
|
|
117
|
-
activeSubMenu: activeSubMenu,
|
|
118
|
-
onSubMenuActive: onSubMenuActive,
|
|
119
|
-
container: container,
|
|
120
|
-
setRegisterButton: setRegisterButton,
|
|
121
|
-
setRegisterLink: setRegisterLink
|
|
122
|
-
}
|
|
123
|
-
}, children);
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
exports.NavListProviderAuto = NavListProviderAuto;
|
|
127
|
-
var _default = NavListContextAuto;
|
|
128
|
-
exports["default"] = _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface NavListItemAnchorAutoProps {
|
|
3
|
-
name: string;
|
|
4
|
-
href?: string;
|
|
5
|
-
active?: boolean;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
export declare const NavListItemAnchorAuto: React.FC<NavListItemAnchorAutoProps>;
|
|
9
|
-
export default NavListItemAnchorAuto;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = exports.NavListItemAnchorAuto = void 0;
|
|
11
|
-
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
-
|
|
16
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
|
|
18
|
-
var _NavListItem = _interopRequireDefault(require("@digigov/react-core/NavListItem"));
|
|
19
|
-
|
|
20
|
-
var _NavListContextAuto = _interopRequireDefault(require("@digigov/ui/navigation/NavList/NavListAuto/NavListContextAuto"));
|
|
21
|
-
|
|
22
|
-
var _NavListItemLink = require("@digigov/ui/navigation/NavList/NavListItemLink");
|
|
23
|
-
|
|
24
|
-
var _excluded = ["name", "href", "active", "children"];
|
|
25
|
-
|
|
26
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
-
|
|
28
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
-
|
|
30
|
-
var NavListItemAnchorAuto = function NavListItemAnchorAuto(_ref) {
|
|
31
|
-
var _container;
|
|
32
|
-
|
|
33
|
-
var name = _ref.name,
|
|
34
|
-
href = _ref.href,
|
|
35
|
-
active = _ref.active,
|
|
36
|
-
children = _ref.children,
|
|
37
|
-
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
38
|
-
|
|
39
|
-
var _useContext = (0, _react.useContext)(_NavListContextAuto["default"]),
|
|
40
|
-
container = _useContext.container,
|
|
41
|
-
setRegisterLink = _useContext.setRegisterLink;
|
|
42
|
-
|
|
43
|
-
return /*#__PURE__*/_react["default"].createElement(_NavListItem["default"], null, setRegisterLink && /*#__PURE__*/_react["default"].createElement(_NavListItemLink.NavListItemLink, (0, _extends2["default"])({
|
|
44
|
-
href: href,
|
|
45
|
-
active: active || container && ((_container = container(name)) === null || _container === void 0 ? void 0 : _container.active)
|
|
46
|
-
}, props, setRegisterLink(name)), children));
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
exports.NavListItemAnchorAuto = NavListItemAnchorAuto;
|
|
50
|
-
var _default = NavListItemAnchorAuto;
|
|
51
|
-
exports["default"] = _default;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = exports.NavListItemAuto = void 0;
|
|
11
|
-
|
|
12
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
|
-
var _SectionBreak = _interopRequireDefault(require("@digigov/react-core/SectionBreak"));
|
|
17
|
-
|
|
18
|
-
var _NavListContextAuto = _interopRequireDefault(require("@digigov/ui/navigation/NavList/NavListAuto/NavListContextAuto"));
|
|
19
|
-
|
|
20
|
-
var _NavListItemAnchorAuto = _interopRequireDefault(require("@digigov/ui/navigation/NavList/NavListAuto/NavListItemAnchorAuto"));
|
|
21
|
-
|
|
22
|
-
var _NavListItemButtonAuto = _interopRequireDefault(require("@digigov/ui/navigation/NavList/NavListAuto/NavListItemButtonAuto"));
|
|
23
|
-
|
|
24
|
-
var _NavListItem = require("@digigov/ui/navigation/NavList/NavListItem");
|
|
25
|
-
|
|
26
|
-
var _excluded = ["item", "children", "role"];
|
|
27
|
-
|
|
28
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
-
|
|
30
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
|
-
|
|
32
|
-
var _ref2 = /*#__PURE__*/_react["default"].createElement(_SectionBreak["default"], null);
|
|
33
|
-
|
|
34
|
-
var NavListItemAuto = function NavListItemAuto(_ref) {
|
|
35
|
-
var _container;
|
|
36
|
-
|
|
37
|
-
var item = _ref.item,
|
|
38
|
-
children = _ref.children,
|
|
39
|
-
role = _ref.role,
|
|
40
|
-
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
41
|
-
|
|
42
|
-
var _useContext = (0, _react.useContext)(_NavListContextAuto["default"]),
|
|
43
|
-
layout = _useContext.layout,
|
|
44
|
-
showDividers = _useContext.showDividers,
|
|
45
|
-
container = _useContext.container,
|
|
46
|
-
setRegisterButton = _useContext.setRegisterButton;
|
|
47
|
-
|
|
48
|
-
var itemName = item !== null && item !== void 0 && item.name ? item.name : item === null || item === void 0 ? void 0 : item.label;
|
|
49
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children ? /*#__PURE__*/_react["default"].createElement(_NavListItem.NavListItem, props, children) : item !== null && item !== void 0 && item.menu || item !== null && item !== void 0 && item.subMenu ? /*#__PURE__*/_react["default"].createElement(_NavListItemButtonAuto["default"], {
|
|
50
|
-
item: item,
|
|
51
|
-
name: itemName,
|
|
52
|
-
active: container && ((_container = container(itemName)) === null || _container === void 0 ? void 0 : _container.active),
|
|
53
|
-
onSelect: setRegisterButton,
|
|
54
|
-
layout: layout
|
|
55
|
-
}, item === null || item === void 0 ? void 0 : item.label) : /*#__PURE__*/_react["default"].createElement(_NavListItemAnchorAuto["default"], {
|
|
56
|
-
href: item === null || item === void 0 ? void 0 : item.href,
|
|
57
|
-
name: itemName
|
|
58
|
-
}, item === null || item === void 0 ? void 0 : item.label), showDividers && _ref2);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
exports.NavListItemAuto = NavListItemAuto;
|
|
62
|
-
var _default = NavListItemAuto;
|
|
63
|
-
exports["default"] = _default;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { NavListLayout } from '@digigov/ui/navigation/NavList/types';
|
|
3
|
-
interface NavListItemButtonAutoProps {
|
|
4
|
-
item?: any;
|
|
5
|
-
name: string;
|
|
6
|
-
active?: boolean;
|
|
7
|
-
onSelect?: (name: string) => any;
|
|
8
|
-
layout?: NavListLayout;
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
export declare const NavListItemButtonAuto: React.FC<NavListItemButtonAutoProps>;
|
|
12
|
-
export default NavListItemButtonAuto;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = exports.NavListItemButtonAuto = void 0;
|
|
9
|
-
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
|
-
var _NavListMenuAuto = _interopRequireDefault(require("@digigov/ui/navigation/NavList/NavListAuto/NavListMenuAuto"));
|
|
15
|
-
|
|
16
|
-
var _NavListSubMenuAuto = _interopRequireDefault(require("@digigov/ui/navigation/NavList/NavListAuto/NavListSubMenuAuto"));
|
|
17
|
-
|
|
18
|
-
var _NavListItem = _interopRequireDefault(require("@digigov/ui/navigation/NavList/NavListItem"));
|
|
19
|
-
|
|
20
|
-
var _NavListItemButton = _interopRequireDefault(require("@digigov/ui/navigation/NavList/NavListItemButton"));
|
|
21
|
-
|
|
22
|
-
var NavListItemButtonAuto = function NavListItemButtonAuto(_ref) {
|
|
23
|
-
var _item$menu, _item$menu2;
|
|
24
|
-
|
|
25
|
-
var item = _ref.item,
|
|
26
|
-
name = _ref.name,
|
|
27
|
-
active = _ref.active,
|
|
28
|
-
onSelect = _ref.onSelect,
|
|
29
|
-
layout = _ref.layout,
|
|
30
|
-
children = _ref.children;
|
|
31
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, onSelect && /*#__PURE__*/_react["default"].createElement(_NavListItem["default"], null, /*#__PURE__*/_react["default"].createElement(_NavListItemButton["default"], (0, _extends2["default"])({
|
|
32
|
-
active: active
|
|
33
|
-
}, onSelect(name)), children)), item !== null && item !== void 0 && item.subMenu ? /*#__PURE__*/_react["default"].createElement(_NavListSubMenuAuto["default"], {
|
|
34
|
-
items: item === null || item === void 0 ? void 0 : item.subMenu,
|
|
35
|
-
open: active,
|
|
36
|
-
layout: layout
|
|
37
|
-
}) : /*#__PURE__*/_react["default"].createElement(_NavListMenuAuto["default"], {
|
|
38
|
-
subMenu: item === null || item === void 0 ? void 0 : (_item$menu = item.menu) === null || _item$menu === void 0 ? void 0 : _item$menu.links,
|
|
39
|
-
title: item === null || item === void 0 ? void 0 : (_item$menu2 = item.menu) === null || _item$menu2 === void 0 ? void 0 : _item$menu2.title,
|
|
40
|
-
active: active,
|
|
41
|
-
layout: layout,
|
|
42
|
-
id: name
|
|
43
|
-
}));
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
exports.NavListItemButtonAuto = NavListItemButtonAuto;
|
|
47
|
-
var _default = NavListItemButtonAuto;
|
|
48
|
-
exports["default"] = _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { NavListLayout } from '@digigov/ui/navigation/NavList/types';
|
|
3
|
-
interface NavListMenuAutoProps {
|
|
4
|
-
layout?: NavListLayout;
|
|
5
|
-
title?: string;
|
|
6
|
-
active?: boolean;
|
|
7
|
-
subMenu?: any[];
|
|
8
|
-
id?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const NavListMenuAuto: React.FC<NavListMenuAutoProps>;
|
|
11
|
-
export default NavListMenuAuto;
|