@aloudata/aloudata-design 0.1.0-beta.4 → 0.2.0-beta.2

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.
Files changed (121) hide show
  1. package/es/Empty/index.d.ts +8 -0
  2. package/es/Empty/index.js +57 -0
  3. package/es/Empty/style/index.d.ts +1 -0
  4. package/es/Empty/style/index.js +1 -0
  5. package/es/Empty/style/index.less +23 -0
  6. package/es/Icon/iconfont/demo_index.html +3 -3
  7. package/es/Icon/iconfont/iconfont.css +3 -3
  8. package/es/Icon/iconfont/iconfont.ttf +0 -0
  9. package/es/Icon/iconfont/iconfont.woff +0 -0
  10. package/es/Icon/iconfont/iconfont.woff2 +0 -0
  11. package/es/Icon/index.less +2 -2
  12. package/es/Input/components/Group/index.d.ts +0 -1
  13. package/es/Input/components/Password/index.d.ts +3 -3
  14. package/es/Input/components/Password/index.js +1 -1
  15. package/es/Input/demo/basic/index.less +8 -0
  16. package/es/Menu/Divider.d.ts +0 -1
  17. package/es/Menu/style/index.less +4 -0
  18. package/es/Navigator/components/Menu/index.d.ts +19 -0
  19. package/es/Navigator/components/Menu/index.js +187 -0
  20. package/es/Navigator/demo/basic/index.d.ts +4 -0
  21. package/es/Navigator/demo/basic/index.js +45 -0
  22. package/es/Navigator/demo/basic/index.less +3 -0
  23. package/es/Navigator/demo/example/index.d.ts +4 -0
  24. package/es/Navigator/demo/example/index.js +153 -0
  25. package/es/Navigator/demo/example/index.less +10 -0
  26. package/es/Navigator/demo/logo.png +0 -0
  27. package/es/Navigator/demo/menuWithFooter/index.d.ts +4 -0
  28. package/es/Navigator/demo/menuWithFooter/index.js +73 -0
  29. package/es/Navigator/demo/menuWithFooter/index.less +3 -0
  30. package/es/Navigator/demo/subMenu/index.d.ts +4 -0
  31. package/es/Navigator/demo/subMenu/index.js +71 -0
  32. package/es/Navigator/demo/subMenu/index.less +3 -0
  33. package/es/Navigator/index.d.ts +41 -0
  34. package/es/Navigator/index.js +45 -0
  35. package/es/Navigator/style/index.d.ts +2 -0
  36. package/es/Navigator/style/index.js +2 -0
  37. package/es/Navigator/style/index.less +224 -0
  38. package/es/Table/demo/basic/createData.d.ts +9 -0
  39. package/es/Table/demo/basic/createData.js +18 -0
  40. package/es/Table/demo/basic/index.d.ts +2 -0
  41. package/es/Table/demo/basic/index.js +64 -0
  42. package/es/Table/demo/editCell/index.d.ts +2 -0
  43. package/es/Table/demo/editCell/index.js +39 -0
  44. package/es/Table/demo/renderHeaderRight/index.d.ts +2 -0
  45. package/es/Table/demo/renderHeaderRight/index.js +37 -0
  46. package/es/Table/demo/rowSelect/index.d.ts +2 -0
  47. package/es/Table/demo/rowSelect/index.js +40 -0
  48. package/es/Table/demo/sort/index.d.ts +2 -0
  49. package/es/Table/demo/sort/index.js +32 -0
  50. package/es/Table/demo/virtualList/index.d.ts +2 -0
  51. package/es/Table/demo/virtualList/index.js +88 -0
  52. package/es/Table/index.d.ts +5 -0
  53. package/es/Table/index.js +201 -0
  54. package/es/Table/interface.d.ts +14 -0
  55. package/es/Table/interface.js +1 -0
  56. package/es/Table/style/index.d.ts +2 -0
  57. package/es/Table/style/index.js +2 -0
  58. package/es/Table/style/index.less +111 -0
  59. package/es/index.d.ts +2 -0
  60. package/es/index.js +3 -1
  61. package/lib/Empty/index.d.ts +8 -0
  62. package/lib/Empty/index.js +71 -0
  63. package/lib/Empty/style/index.d.ts +1 -0
  64. package/lib/Empty/style/index.js +3 -0
  65. package/lib/Empty/style/index.less +23 -0
  66. package/lib/Icon/iconfont/demo_index.html +3 -3
  67. package/lib/Icon/iconfont/iconfont.css +3 -3
  68. package/lib/Icon/iconfont/iconfont.ttf +0 -0
  69. package/lib/Icon/iconfont/iconfont.woff +0 -0
  70. package/lib/Icon/iconfont/iconfont.woff2 +0 -0
  71. package/lib/Icon/index.less +2 -2
  72. package/lib/Input/components/Group/index.d.ts +0 -1
  73. package/lib/Input/components/Password/index.d.ts +3 -3
  74. package/lib/Input/components/Password/index.js +2 -2
  75. package/lib/Input/demo/basic/index.less +8 -0
  76. package/lib/Menu/Divider.d.ts +0 -1
  77. package/lib/Menu/style/index.less +4 -0
  78. package/lib/Navigator/components/Menu/index.d.ts +19 -0
  79. package/lib/Navigator/components/Menu/index.js +205 -0
  80. package/lib/Navigator/demo/basic/index.d.ts +4 -0
  81. package/lib/Navigator/demo/basic/index.js +62 -0
  82. package/lib/Navigator/demo/basic/index.less +3 -0
  83. package/lib/Navigator/demo/example/index.d.ts +4 -0
  84. package/lib/Navigator/demo/example/index.js +179 -0
  85. package/lib/Navigator/demo/example/index.less +10 -0
  86. package/lib/Navigator/demo/logo.png +0 -0
  87. package/lib/Navigator/demo/menuWithFooter/index.d.ts +4 -0
  88. package/lib/Navigator/demo/menuWithFooter/index.js +92 -0
  89. package/lib/Navigator/demo/menuWithFooter/index.less +3 -0
  90. package/lib/Navigator/demo/subMenu/index.d.ts +4 -0
  91. package/lib/Navigator/demo/subMenu/index.js +88 -0
  92. package/lib/Navigator/demo/subMenu/index.less +3 -0
  93. package/lib/Navigator/index.d.ts +41 -0
  94. package/lib/Navigator/index.js +64 -0
  95. package/lib/Navigator/style/index.d.ts +2 -0
  96. package/lib/Navigator/style/index.js +5 -0
  97. package/lib/Navigator/style/index.less +224 -0
  98. package/lib/Table/demo/basic/createData.d.ts +9 -0
  99. package/lib/Table/demo/basic/createData.js +23 -0
  100. package/lib/Table/demo/basic/index.d.ts +2 -0
  101. package/lib/Table/demo/basic/index.js +80 -0
  102. package/lib/Table/demo/editCell/index.d.ts +2 -0
  103. package/lib/Table/demo/editCell/index.js +54 -0
  104. package/lib/Table/demo/renderHeaderRight/index.d.ts +2 -0
  105. package/lib/Table/demo/renderHeaderRight/index.js +52 -0
  106. package/lib/Table/demo/rowSelect/index.d.ts +2 -0
  107. package/lib/Table/demo/rowSelect/index.js +55 -0
  108. package/lib/Table/demo/sort/index.d.ts +2 -0
  109. package/lib/Table/demo/sort/index.js +47 -0
  110. package/lib/Table/demo/virtualList/index.d.ts +2 -0
  111. package/lib/Table/demo/virtualList/index.js +103 -0
  112. package/lib/Table/index.d.ts +5 -0
  113. package/lib/Table/index.js +225 -0
  114. package/lib/Table/interface.d.ts +14 -0
  115. package/lib/Table/interface.js +5 -0
  116. package/lib/Table/style/index.d.ts +2 -0
  117. package/lib/Table/style/index.js +5 -0
  118. package/lib/Table/style/index.less +111 -0
  119. package/lib/index.d.ts +2 -0
  120. package/lib/index.js +16 -0
  121. package/package.json +10 -4
@@ -0,0 +1,153 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14
+
15
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
16
+
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
19
+ import React, { useState, useMemo } from 'react';
20
+ import { Navigator, Button } from '@aloudata/aloudata-design';
21
+ import Icon from '../../../Icon';
22
+ import logoSrc from '../logo.png';
23
+ import { useLocation } from 'umi';
24
+ import _ from 'lodash';
25
+ import '../../style/index.less';
26
+ import './index.less';
27
+ var mockData = [{
28
+ title: '查询',
29
+ icon: /*#__PURE__*/React.createElement(Icon, {
30
+ type: 'add'
31
+ }),
32
+ key: 'query',
33
+ path: '/navigator#search'
34
+ }, {
35
+ title: '数据',
36
+ icon: /*#__PURE__*/React.createElement(Icon, {
37
+ type: 'add'
38
+ }),
39
+ key: 'data',
40
+ path: '/navigator#data',
41
+ children: [{
42
+ title: '数据空间',
43
+ key: 'dataSpace',
44
+ path: '/navigator#dataSpace'
45
+ }, {
46
+ title: '数据源',
47
+ key: 'datasource',
48
+ path: '/navigator#datasource'
49
+ }]
50
+ }, {
51
+ title: '计算',
52
+ icon: /*#__PURE__*/React.createElement(Icon, {
53
+ type: 'add'
54
+ }),
55
+ key: 'calculate',
56
+ path: '/navigator#calculate',
57
+ children: [{
58
+ title: '任务记录',
59
+ key: 'job',
60
+ path: '/navigator#job'
61
+ }, {
62
+ title: '查询引擎',
63
+ key: 'queryEngine',
64
+ path: '/navigator#queryEngine'
65
+ }]
66
+ }, {
67
+ title: '测试',
68
+ key: 'test',
69
+ icon: /*#__PURE__*/React.createElement(Icon, {
70
+ type: 'add'
71
+ }),
72
+ path: '/navigator#calculate',
73
+ children: [{
74
+ title: '测试菜单1',
75
+ key: 'hello',
76
+ path: '/navigator#hello'
77
+ }, {
78
+ title: '测试菜单2',
79
+ key: 'hello2',
80
+ path: '/navigator#hello2'
81
+ }]
82
+ }];
83
+ export default (function () {
84
+ // 根据路由信息去匹配菜单信息
85
+ var _useLocation = useLocation(),
86
+ pathname = _useLocation.pathname;
87
+
88
+ var flattenMenuByMenuPath = useMemo(function () {
89
+ return getFlattenMenuByPath(mockData);
90
+ }, []);
91
+
92
+ var menuInfo = _.get(flattenMenuByMenuPath, pathname, {
93
+ path: '',
94
+ key: ''
95
+ });
96
+
97
+ var _useState = useState(menuInfo.key || ''),
98
+ _useState2 = _slicedToArray(_useState, 2),
99
+ selectedKey = _useState2[0],
100
+ setSelectedKey = _useState2[1];
101
+
102
+ var onMenuSelect = function onMenuSelect(menuInfo) {
103
+ console.log('menuInfo', menuInfo);
104
+ var path = menuInfo.path; // 进行路由跳转
105
+ };
106
+
107
+ var mockBtnClick = function mockBtnClick(key) {
108
+ setSelectedKey(key);
109
+ };
110
+
111
+ return /*#__PURE__*/React.createElement("div", {
112
+ className: 'ald-nav-demo-example'
113
+ }, /*#__PURE__*/React.createElement(Navigator, {
114
+ menuList: mockData,
115
+ selectedKey: selectedKey,
116
+ footer: /*#__PURE__*/React.createElement("div", null, "Footer Wrap"),
117
+ logoSrc: logoSrc,
118
+ onMenuSelect: onMenuSelect
119
+ }), /*#__PURE__*/React.createElement("div", {
120
+ className: 'ald-nav-content'
121
+ }, /*#__PURE__*/React.createElement("p", null, "\u5F53\u524D\u83DC\u5355\uFF1A", selectedKey), /*#__PURE__*/React.createElement(Button, {
122
+ onClick: function onClick() {
123
+ return mockBtnClick('query');
124
+ }
125
+ }, "\u6A21\u62DF\u67E5\u8BE2\u9875\u9762\u5237\u65B0"), /*#__PURE__*/React.createElement(Button, {
126
+ onClick: function onClick() {
127
+ return mockBtnClick('dataSpace');
128
+ }
129
+ }, "\u6A21\u62DF\u6570\u636E\u7A7A\u95F4\u5237\u65B0"), /*#__PURE__*/React.createElement(Button, {
130
+ onClick: function onClick() {
131
+ return mockBtnClick('job');
132
+ }
133
+ }, "\u6A21\u62DF\u4EFB\u52A1\u8BB0\u5F55\u5237\u65B0")));
134
+ });
135
+
136
+ function getFlattenMenuByPath(menuList) {
137
+ var flattenMenuByMenuPath = {};
138
+ menuList.forEach(function (item) {
139
+ if (!item.path) {
140
+ console.error('path is required');
141
+ }
142
+
143
+ if (item.children) {
144
+ flattenMenuByMenuPath[item.path] = _objectSpread({}, item);
145
+ item.children.forEach(function (childItem) {
146
+ flattenMenuByMenuPath[childItem.path] = _objectSpread({}, childItem);
147
+ });
148
+ } else {
149
+ flattenMenuByMenuPath[item.path] = _objectSpread({}, item);
150
+ }
151
+ });
152
+ return flattenMenuByMenuPath;
153
+ }
@@ -0,0 +1,10 @@
1
+ .ald-nav-demo-example {
2
+ border: 1px solid #ccc;
3
+ width: 800px;
4
+ height: 600px;
5
+ display: flex;
6
+
7
+ .ald-nav-content {
8
+ padding: 24px;
9
+ }
10
+ }
Binary file
@@ -0,0 +1,4 @@
1
+ import '../../style/index.less';
2
+ import './index.less';
3
+ declare const _default: () => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,73 @@
1
+ import React from 'react';
2
+ import { Navigator } from '@aloudata/aloudata-design';
3
+ import logoSrc from '../logo.png';
4
+ import Icon from '../../../Icon';
5
+ import '../../style/index.less';
6
+ import './index.less';
7
+ export default (function () {
8
+ var mockData = [{
9
+ title: '查询',
10
+ icon: /*#__PURE__*/React.createElement(Icon, {
11
+ type: 'add'
12
+ }),
13
+ key: 'query',
14
+ path: '/query'
15
+ }, {
16
+ title: '数据',
17
+ icon: /*#__PURE__*/React.createElement(Icon, {
18
+ type: 'add'
19
+ }),
20
+ key: 'data',
21
+ path: '/data',
22
+ children: [{
23
+ title: '数据空间',
24
+ key: 'dataSpace',
25
+ path: '/data/dataSpace'
26
+ }, {
27
+ title: '数据源',
28
+ key: 'datasource',
29
+ path: '/data/datasource'
30
+ }]
31
+ }, {
32
+ title: '计算',
33
+ icon: /*#__PURE__*/React.createElement(Icon, {
34
+ type: 'add'
35
+ }),
36
+ key: 'calculate',
37
+ path: '/calculate',
38
+ children: [{
39
+ title: '任务记录',
40
+ key: 'job',
41
+ path: '/calculate/job'
42
+ }, {
43
+ title: '查询引擎',
44
+ key: 'queryEngine',
45
+ path: '/calculate/'
46
+ }]
47
+ }, {
48
+ title: '测试',
49
+ icon: /*#__PURE__*/React.createElement(Icon, {
50
+ type: 'add'
51
+ }),
52
+ key: 'test',
53
+ path: '/calculate',
54
+ children: [{
55
+ title: '测试菜单1',
56
+ key: 'hello',
57
+ path: '/calculate/job'
58
+ }, {
59
+ title: '测试菜单2',
60
+ key: 'hello2',
61
+ path: '/calculate/'
62
+ }]
63
+ }];
64
+ var footer = /*#__PURE__*/React.createElement("div", null, "Footer Wrap");
65
+ return /*#__PURE__*/React.createElement("div", {
66
+ className: 'ald-nav-demo'
67
+ }, /*#__PURE__*/React.createElement(Navigator, {
68
+ menuList: mockData,
69
+ defaultSelectedKey: "dataSpace",
70
+ footer: footer,
71
+ logoSrc: logoSrc
72
+ }));
73
+ });
@@ -0,0 +1,3 @@
1
+ .ald-nav-demo {
2
+ height: 600px;
3
+ }
@@ -0,0 +1,4 @@
1
+ import '../../style/index.less';
2
+ import './index.less';
3
+ declare const _default: () => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,71 @@
1
+ import React from 'react';
2
+ import { Navigator } from '@aloudata/aloudata-design';
3
+ import logoSrc from '../logo.png';
4
+ import Icon from '../../../Icon';
5
+ import '../../style/index.less';
6
+ import './index.less';
7
+ export default (function () {
8
+ var mockData = [{
9
+ title: '查询',
10
+ icon: /*#__PURE__*/React.createElement(Icon, {
11
+ type: 'add'
12
+ }),
13
+ key: 'query',
14
+ path: '/query'
15
+ }, {
16
+ title: '数据',
17
+ icon: /*#__PURE__*/React.createElement(Icon, {
18
+ type: 'add'
19
+ }),
20
+ key: 'data',
21
+ path: '/data',
22
+ children: [{
23
+ title: '数据空间',
24
+ key: 'dataSpace',
25
+ path: '/data/dataSpace'
26
+ }, {
27
+ title: '数据源',
28
+ key: 'datasource',
29
+ path: '/data/datasource'
30
+ }]
31
+ }, {
32
+ title: '计算',
33
+ icon: /*#__PURE__*/React.createElement(Icon, {
34
+ type: 'add'
35
+ }),
36
+ key: 'calculate',
37
+ path: '/calculate',
38
+ children: [{
39
+ title: '任务记录',
40
+ key: 'job',
41
+ path: '/calculate/job'
42
+ }, {
43
+ title: '查询引擎',
44
+ key: 'queryEngine',
45
+ path: '/calculate/'
46
+ }]
47
+ }, {
48
+ title: '测试',
49
+ icon: /*#__PURE__*/React.createElement(Icon, {
50
+ type: 'add'
51
+ }),
52
+ key: 'test',
53
+ path: '/calculate',
54
+ children: [{
55
+ title: '测试菜单1',
56
+ key: 'hello',
57
+ path: '/calculate/job'
58
+ }, {
59
+ title: '测试菜单2',
60
+ key: 'hello2',
61
+ path: '/calculate/'
62
+ }]
63
+ }];
64
+ return /*#__PURE__*/React.createElement("div", {
65
+ className: 'ald-nav-demo'
66
+ }, /*#__PURE__*/React.createElement(Navigator, {
67
+ menuList: mockData,
68
+ defaultSelectedKey: "dataSpace",
69
+ logoSrc: logoSrc
70
+ }));
71
+ });
@@ -0,0 +1,3 @@
1
+ .ald-nav-demo {
2
+ height: 600px;
3
+ }
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { IMenuItem } from './components/Menu';
3
+ import './style';
4
+ export type { IMenuItem } from './components/Menu';
5
+ export interface INavigatorProps {
6
+ /**
7
+ * @description 菜单数据
8
+ * @default []
9
+ */
10
+ menuList: IMenuItem[];
11
+ /**
12
+ * @description 当前选中的菜单项
13
+ * @default --
14
+ */
15
+ selectedKey: string;
16
+ /**
17
+ * @description logo的地址 默认高度为24px
18
+ * @default --
19
+ */
20
+ logoSrc: string;
21
+ /**
22
+ * @description logo的点击(可选)
23
+ * @default --
24
+ */
25
+ onLogoClick?: () => void;
26
+ /**
27
+ * @description 导航底部信息 可自定义
28
+ * @default null
29
+ */
30
+ footer?: React.ReactNode;
31
+ /**
32
+ * @description 菜单被选中时调用(可选)
33
+ * @default --
34
+ */
35
+ onMenuSelect?: (menuInfo: {
36
+ key: string;
37
+ path: string;
38
+ }) => void;
39
+ }
40
+ declare function Navigator(props: INavigatorProps): JSX.Element;
41
+ export default Navigator;
@@ -0,0 +1,45 @@
1
+ import React, { useCallback } from 'react';
2
+ import classNames from 'classnames';
3
+ import Menu from './components/Menu';
4
+ import './style';
5
+
6
+ function Navigator(props) {
7
+ var menuList = props.menuList,
8
+ selectedKey = props.selectedKey,
9
+ logoSrc = props.logoSrc,
10
+ _props$footer = props.footer,
11
+ footer = _props$footer === void 0 ? null : _props$footer,
12
+ onLogoClick = props.onLogoClick,
13
+ onMenuSelect = props.onMenuSelect;
14
+ var renderMenu = useCallback(function () {
15
+ return /*#__PURE__*/React.createElement(Menu, {
16
+ menuList: menuList,
17
+ selectedKey: selectedKey,
18
+ onMenuSelect: onMenuSelect
19
+ });
20
+ }, [selectedKey, menuList, onMenuSelect]);
21
+ return /*#__PURE__*/React.createElement("div", {
22
+ className: classNames('ald-nav')
23
+ }, /*#__PURE__*/React.createElement("div", {
24
+ className: classNames('ald-nav-logo', {
25
+ 'ald-nav-logo-able-click': onLogoClick
26
+ })
27
+ }, logoSrc && /*#__PURE__*/React.createElement("div", {
28
+ onClick: onLogoClick,
29
+ className: "ald-nav-logo-wrap"
30
+ }, /*#__PURE__*/React.createElement("img", {
31
+ src: logoSrc,
32
+ alt: "",
33
+ draggable: false
34
+ }))), /*#__PURE__*/React.createElement("div", {
35
+ className: classNames('ald-nav-menu', {
36
+ 'ald-nav-menu-has-footer': !!footer
37
+ })
38
+ }, renderMenu()), footer && /*#__PURE__*/React.createElement("div", {
39
+ className: "ald-nav-footer"
40
+ }, /*#__PURE__*/React.createElement("div", {
41
+ className: "ald-nav-footer-wrap"
42
+ }, footer)));
43
+ }
44
+
45
+ export default Navigator;
@@ -0,0 +1,2 @@
1
+ import '../../style';
2
+ import './index.less';
@@ -0,0 +1,2 @@
1
+ import '../../style';
2
+ import './index.less';
@@ -0,0 +1,224 @@
1
+ @import '../../style/index.less';
2
+ @import '../../Icon/index.less';
3
+
4
+ /* stylelint-disable */
5
+
6
+ @ald-prefix:ant;
7
+
8
+ .supTitle() {
9
+ font-family: 'PingFang SC';
10
+ font-style: normal;
11
+ font-weight: 500;
12
+ font-size: 14px;
13
+ line-height: 20px;
14
+ }
15
+
16
+ .subTitle() {
17
+ font-family: 'PingFang SC';
18
+ font-style: normal;
19
+ font-weight: 400;
20
+ font-size: 12px;
21
+ line-height: 16px;
22
+ }
23
+
24
+ .ald-nav {
25
+ width: 216px;
26
+ background-color: @BBG15;
27
+ height: 100%;
28
+ display: flex;
29
+ flex-direction: column;
30
+ overflow: hidden;
31
+ user-select: none;
32
+
33
+ &-logo {
34
+ height: 72px;
35
+ padding: 24px;
36
+ width: 100%;
37
+
38
+ &-able-click {
39
+ cursor: pointer;
40
+ }
41
+ }
42
+
43
+ &-menu-icon-right.anticon {
44
+ color: @ND60;
45
+ }
46
+
47
+ &-menu {
48
+ flex: 1;
49
+ overflow-y: auto;
50
+ overflow-x: hidden;
51
+
52
+ .ant-menu-sub.ant-menu-inline {
53
+ background-color: unset;
54
+ }
55
+
56
+ .anticon.ant-menu-item-icon {
57
+ font-size: 20px !important;
58
+ width: 20px !important;
59
+ height: 20px !important;
60
+ }
61
+
62
+ &::-webkit-scrollbar-thumb {
63
+ border-radius: 6px;
64
+ background: @ND90;
65
+ border: 3px solid transparent;
66
+ background-clip: padding-box;
67
+ }
68
+
69
+ &::-webkit-scrollbar {
70
+ background-color: transparent;
71
+ width: 12px;
72
+ height: 12px;
73
+ }
74
+
75
+ .ant-menu-inline,
76
+ .ant-menu-vertical,
77
+ .ant-menu-vertical-left {
78
+ border-right: unset;
79
+ }
80
+
81
+ .ant-menu {
82
+ background: @BBG15;
83
+ color: @ND0;
84
+
85
+ &.ant-menu-root {
86
+
87
+ .ant-menu-item {
88
+ margin-bottom: 16px;
89
+ padding: 0 12px !important;
90
+ }
91
+
92
+ li:nth-last-child(1) {
93
+ margin-bottom: 0;
94
+ }
95
+ }
96
+
97
+ &.ant-menu-sub {
98
+ .ant-menu-item {
99
+ margin-top: 4px;
100
+ margin-bottom: 0;
101
+ padding: 0 12px 0 44px!important;
102
+ }
103
+ }
104
+
105
+ // 只有子级菜单相关颜色操作
106
+ .ant-menu-item-only-child {
107
+ color: @ND30;
108
+ height: 32px !important;
109
+ line-height: 32px !important;
110
+ font-size: 12px !important;
111
+ .subTitle();
112
+
113
+ &:hover {
114
+ color: @ND30 !important;
115
+ }
116
+
117
+ &.ant-menu-item-selected {
118
+ font-weight: 500;
119
+
120
+ &:hover {
121
+ color: @ND0 !important;
122
+ }
123
+ }
124
+ }
125
+
126
+ .ant-menu-item {
127
+ height: 40px;
128
+ width: 100%;
129
+ border-radius: 8px;
130
+ .supTitle();
131
+
132
+ &-selected {
133
+ background-color: @BBG20 !important;
134
+ color: @ND0;
135
+ position: relative;
136
+ overflow: unset;
137
+
138
+ ::before {
139
+ width: 4px;
140
+ content: '';
141
+ background: @B40;
142
+ height: 100%;
143
+ position: absolute;
144
+ top: 0;
145
+ left: -12px;
146
+ border-radius: 1px;
147
+ }
148
+ }
149
+
150
+ &::after {
151
+ display: none !important;
152
+ }
153
+ }
154
+
155
+ .ant-menu-submenu {
156
+ margin-bottom: 16px;
157
+
158
+ .ant-menu-submenu-title {
159
+ padding: 0 12px !important;
160
+ height: 40px;
161
+ line-height: 40px;
162
+ .supTitle();
163
+
164
+ &:hover {
165
+ color: @ND0;
166
+ }
167
+ }
168
+
169
+ &-selected {
170
+ color: @ND0;
171
+ }
172
+
173
+ &-active {
174
+ color: @ND0;
175
+ }
176
+ }
177
+
178
+ // 修改icon和文字的margin
179
+ .ant-menu-item .ant-menu-item-icon + span,
180
+ .ant-menu-submenu-title .ant-menu-item-icon + span,
181
+ .ant-menu-item .anticon + span,
182
+ .ant-menu-submenu-title .anticon + span {
183
+ margin-left: 12px;
184
+ }
185
+
186
+ // 取消item点击时的高亮背景色
187
+ .ant-menu-item:active,
188
+ .ant-menu-submenu-title:active {
189
+ background: unset;
190
+ }
191
+
192
+ .ant-menu-inline .ant-menu-item,
193
+ .ant-menu-inline .ant-menu-submenu-title {
194
+ width: 100% !important;
195
+ }
196
+
197
+ // 删除右侧的高亮
198
+ .ant-menu-vertical .ant-menu-item::after,
199
+ .ant-menu-vertical-left .ant-menu-item::after,
200
+ .ant-menu-vertical-right .ant-menu-item::after,
201
+ .ant-menu-inline .ant-menu-item::after {
202
+ display: none;
203
+ }
204
+ }
205
+
206
+ .ant-menu-light .ant-menu-item:hover,
207
+ .ant-menu-light .ant-menu-item-active,
208
+ .ant-menu-light .ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open,
209
+ .ant-menu-light .ant-menu-submenu-active,
210
+ .ant-menu-light .ant-menu-submenu-title:hover {
211
+ color: unset;
212
+ }
213
+ }
214
+
215
+ &-footer {
216
+ height: 56px;
217
+
218
+ &-wrap {
219
+ border: 1px solid @ND0;
220
+ color: @ND0;
221
+ height: 100%;
222
+ }
223
+ }
224
+ }
@@ -0,0 +1,9 @@
1
+ declare function makeData(length: number): {
2
+ firstName: string;
3
+ lastName: string;
4
+ age: number;
5
+ visits: number;
6
+ progress: number;
7
+ status: string;
8
+ }[];
9
+ export { makeData };
@@ -0,0 +1,18 @@
1
+ function makeData(length) {
2
+ var data = [];
3
+
4
+ for (var i = 0; i < length; i++) {
5
+ data.push({
6
+ firstName: 'supermarket',
7
+ lastName: 'charity',
8
+ age: i + 1,
9
+ visits: 47,
10
+ progress: 41,
11
+ status: 'relationship'
12
+ });
13
+ }
14
+
15
+ return data;
16
+ }
17
+
18
+ export { makeData };
@@ -0,0 +1,2 @@
1
+ declare const _default: () => JSX.Element;
2
+ export default _default;