@aloudata/aloudata-design 2.14.13 → 2.15.1

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.
@@ -1,3 +1,8 @@
1
- import { Collapse } from 'antd';
1
+ import { CollapseProps } from 'antd';
2
+ import React from 'react';
2
3
  export type { CollapsePanelProps, CollapseProps } from 'antd/lib/collapse';
4
+ declare const Collapse: {
5
+ (props: CollapseProps): React.JSX.Element;
6
+ Panel: React.ForwardRefExoticComponent<import("antd").CollapsePanelProps & React.RefAttributes<HTMLDivElement>>;
7
+ };
3
8
  export default Collapse;
@@ -1,2 +1,20 @@
1
- import { Collapse } from 'antd';
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ import { Collapse as AntdCollapse } from 'antd';
3
+ import React from 'react';
4
+ import { ArrowDownLightLine, ArrowRightLightLine } from "../Icon";
5
+ var Collapse = function Collapse(props) {
6
+ return /*#__PURE__*/React.createElement(AntdCollapse, _extends({}, props, {
7
+ className: "ald-collapse",
8
+ expandIcon: function expandIcon(props) {
9
+ return props.isActive ? /*#__PURE__*/React.createElement(ArrowDownLightLine, {
10
+ size: 20,
11
+ color: "#6B7280"
12
+ }) : /*#__PURE__*/React.createElement(ArrowRightLightLine, {
13
+ size: 20,
14
+ color: "#6B7280"
15
+ });
16
+ }
17
+ }));
18
+ };
19
+ Collapse.Panel = AntdCollapse.Panel;
2
20
  export default Collapse;
@@ -1 +1,107 @@
1
1
  @import '../../style/index.less';
2
+ @border-radius: 6px;
3
+ @header-default-padding: 11px;
4
+ @header-small-padding: 7px;
5
+ @content-default-padding: 16px;
6
+
7
+ .ald-collapse.ant-collapse.ant-collapse {
8
+ border-radius: @border-radius;
9
+ border: 1px solid var(--alias-colors-border-default, #e5e7eb);
10
+ border-bottom: 0;
11
+ background: var(--alias-colors-bg-skeleton-subtle, #f9fafb);
12
+
13
+ .ant-collapse-item {
14
+ .ant-collapse-header {
15
+ padding: @header-default-padding @header-default-padding;
16
+
17
+ .ant-collapse-expand-icon {
18
+ padding-inline-end: 8px;
19
+ }
20
+
21
+ .ant-collapse-header-text {
22
+ color: var(--alias-colors-text-default, #1f2937);
23
+ font-family: 'PingFang SC';
24
+ font-size: 14px;
25
+ line-height: 20px; /* 142.857% */
26
+ }
27
+ }
28
+
29
+ .ant-collapse-content {
30
+ .ant-collapse-content-box {
31
+ padding: @content-default-padding @content-default-padding
32
+ @content-default-padding - 1px @content-default-padding;
33
+ color: var(--alias-colors-text-subtle, #4b5563);
34
+ font-family: 'PingFang SC';
35
+ font-size: 14px;
36
+ line-height: 20px; /* 142.857% */
37
+ }
38
+ }
39
+
40
+ &:last-child {
41
+ border-radius: 0 0 @border-radius @border-radius;
42
+ border-bottom: 1px solid var(--alias-colors-border-default, #e5e7eb);
43
+
44
+ & > .ant-collapse-content {
45
+ overflow: hidden;
46
+ border-radius: 0 0 @border-radius @border-radius;
47
+ }
48
+ }
49
+
50
+ &.ant-collapse-item-disabled {
51
+ opacity: 0.4;
52
+ }
53
+ }
54
+
55
+ &.ant-collapse-small {
56
+ .ant-collapse-header {
57
+ padding: @header-small-padding @header-small-padding;
58
+ }
59
+ }
60
+
61
+ &.ant-collapse-large {
62
+ .ant-collapse-header {
63
+ .ant-collapse-header-text {
64
+ color: var(--alias-colors-text-default, #1f2937);
65
+ font-family: 'PingFang SC';
66
+ font-size: 16px;
67
+ line-height: 24px; /* 150% */
68
+ }
69
+ }
70
+ }
71
+ }
72
+
73
+ .ald-collapse.ald-collapse.ant-collapse-ghost.ant-collapse-ghost {
74
+ border: none;
75
+ background: transparent;
76
+
77
+ .ant-collapse-item {
78
+ &:last-child {
79
+ border: none;
80
+ }
81
+
82
+ .ant-collapse-content-box {
83
+ padding: 0 @content-default-padding @content-default-padding 40px;
84
+ }
85
+ }
86
+ }
87
+
88
+ .ald-collapse.ald-collapse.ant-collapse-borderless.ant-collapse-borderless {
89
+ border: none;
90
+
91
+ .ant-collapse-item {
92
+ .ant-collapse-content-box {
93
+ padding: 0 @content-default-padding @content-default-padding 40px;
94
+ background: var(--alias-colors-bg-skeleton-subtle, #f9fafb);
95
+ }
96
+
97
+ &:last-child {
98
+ border: none;
99
+ border-radius: 0 0 @border-radius @border-radius;
100
+
101
+ & > .ant-collapse-content {
102
+ border-radius: 0 0 @border-radius @border-radius;
103
+ overflow: hidden;
104
+ }
105
+ }
106
+ }
107
+ }
@@ -1,3 +1,9 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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; }
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
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1
7
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
8
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
9
  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); }
@@ -48,6 +54,9 @@ export default function Menu(props) {
48
54
  label: subMenuItemLabel,
49
55
  disabled: item.disabled,
50
56
  gap: 0,
57
+ menuStyle: _objectSpread(_objectSpread({}, menuStyle), {}, {
58
+ overflow: isLeafMenu(item.children) ? 'auto' : undefined
59
+ }),
51
60
  menuClassName: classNames('ald-menu-submenu-popup', item.popupClassName),
52
61
  overflow: isLeafMenu(item.children) ? 'auto' : undefined
53
62
  }, getMenuItems(item.children, currPath));
@@ -93,7 +102,9 @@ export default function Menu(props) {
93
102
  ref: ref
94
103
  }), /*#__PURE__*/React.createElement(ControlledMenu, {
95
104
  state: "open",
96
- menuStyle: menuStyle,
105
+ menuStyle: _objectSpread(_objectSpread({}, menuStyle), {}, {
106
+ overflow: isLeafMenu(items) ? 'auto' : undefined
107
+ }),
97
108
  anchorRef: ref,
98
109
  className: classNames(className, 'ald-menu'),
99
110
  position: "auto",