@donglegeyu/company-ui 2.2.0 → 2.4.0
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/dist/cjs/shared-components/IconExplorer/index.js +2 -1
- package/dist/cjs/shared-components/IconParkGallery/index.js +12 -4
- package/dist/cjs/shared-components/IconParkGallery/useIconPark.d.ts +3 -3
- package/dist/cjs/shared-components/IconParkGallery/useIconPark.js +21 -60
- package/dist/cjs/shared-components/SectionTitle/index.scss +1 -1
- package/dist/cjs/shared-components/SvgIcon/all-icons.d.ts +19 -0
- package/dist/cjs/shared-components/SvgIcon/all-icons.js +137145 -0
- package/dist/cjs/shared-components/SvgIcon/icon-meta.json +1 -1
- package/dist/cjs/shared-components/SvgIcon/icons.js +4 -4
- package/dist/cjs/shared-components/SvgIcon/index.js +2 -1
- package/dist/cjs/template-components/DrawerDetailTemplate/index.d.ts +2 -0
- package/dist/cjs/template-components/DrawerDetailTemplate/index.js +24 -19
- package/dist/cjs/template-components/DrawerDetailTemplate/index.scss +30 -5
- package/dist/es/shared-components/IconExplorer/index.js +2 -1
- package/dist/es/shared-components/IconParkGallery/index.js +6 -4
- package/dist/es/shared-components/IconParkGallery/useIconPark.d.ts +3 -3
- package/dist/es/shared-components/IconParkGallery/useIconPark.js +33 -98
- package/dist/es/shared-components/SectionTitle/index.scss +1 -1
- package/dist/es/shared-components/SvgIcon/all-icons.d.ts +19 -0
- package/dist/es/shared-components/SvgIcon/all-icons.js +3 -0
- package/dist/es/shared-components/SvgIcon/icon-meta.json +1 -1
- package/dist/es/shared-components/SvgIcon/icons.js +4 -4
- package/dist/es/shared-components/SvgIcon/index.js +6 -4
- package/dist/es/template-components/DrawerDetailTemplate/index.d.ts +2 -0
- package/dist/es/template-components/DrawerDetailTemplate/index.js +6 -9
- package/dist/es/template-components/DrawerDetailTemplate/index.scss +30 -5
- package/package.json +1 -1
|
@@ -762,7 +762,7 @@ var iconPaths = {
|
|
|
762
762
|
category: "system",
|
|
763
763
|
children: /*#__PURE__*/_jsxs(_Fragment, {
|
|
764
764
|
children: [/*#__PURE__*/_jsx("g", {
|
|
765
|
-
clipPath: "url(#icon-
|
|
765
|
+
clipPath: "url(#icon-d27f2bfb4e0022c)",
|
|
766
766
|
children: /*#__PURE__*/_jsx("path", {
|
|
767
767
|
d: "M10.6963 17.5042C13.3347 14.8657 16.4701 14.9387 19.8781 16.8076L32.62 9.74509L31.8989 4.78683L43.2126 16.1005L38.2656 15.3907L31.1918 28.1214C32.9752 31.7589 33.1337 34.6647 30.4953 37.3032C30.4953 37.3032 26.235 33.0429 22.7171 29.525L6.44305 41.5564L18.4382 25.2461C14.9202 21.7281 10.6963 17.5042 10.6963 17.5042Z",
|
|
768
768
|
fill: "none",
|
|
@@ -772,7 +772,7 @@ var iconPaths = {
|
|
|
772
772
|
})
|
|
773
773
|
}), /*#__PURE__*/_jsx("defs", {
|
|
774
774
|
children: /*#__PURE__*/_jsx("clipPath", {
|
|
775
|
-
id: "icon-
|
|
775
|
+
id: "icon-d27f2bfb4e0022c",
|
|
776
776
|
children: /*#__PURE__*/_jsx("rect", {
|
|
777
777
|
width: "48",
|
|
778
778
|
height: "48",
|
|
@@ -789,7 +789,7 @@ var iconPaths = {
|
|
|
789
789
|
category: "system",
|
|
790
790
|
children: /*#__PURE__*/_jsxs(_Fragment, {
|
|
791
791
|
children: [/*#__PURE__*/_jsx("g", {
|
|
792
|
-
clipPath: "url(#icon-
|
|
792
|
+
clipPath: "url(#icon-ac342f6b4e0022c)",
|
|
793
793
|
children: /*#__PURE__*/_jsx("path", {
|
|
794
794
|
d: "M10.6963 17.5042C13.3347 14.8657 16.4701 14.9387 19.8781 16.8076L32.62 9.74509L31.8989 4.78683L43.2126 16.1005L38.2656 15.3907L31.1918 28.1214C32.9752 31.7589 33.1337 34.6647 30.4953 37.3032C30.4953 37.3032 26.235 33.0429 22.7171 29.525L6.44305 41.5564L18.4382 25.2461C14.9202 21.7281 10.6963 17.5042 10.6963 17.5042Z",
|
|
795
795
|
fill: "currentColor",
|
|
@@ -799,7 +799,7 @@ var iconPaths = {
|
|
|
799
799
|
})
|
|
800
800
|
}), /*#__PURE__*/_jsx("defs", {
|
|
801
801
|
children: /*#__PURE__*/_jsx("clipPath", {
|
|
802
|
-
id: "icon-
|
|
802
|
+
id: "icon-ac342f6b4e0022c",
|
|
803
803
|
children: /*#__PURE__*/_jsx("rect", {
|
|
804
804
|
width: "48",
|
|
805
805
|
height: "48",
|
|
@@ -5,8 +5,9 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { getIconDefinition } from "./icons";
|
|
8
|
+
import { getAllIconDefinition } from "./all-icons";
|
|
8
9
|
|
|
9
|
-
//
|
|
10
|
+
// 未注册图标键的兜底图标,保证任何输入都有可见输出
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
12
|
var FALLBACK_ICON = "folder-open";
|
|
12
13
|
function toCssSize(size, fallback) {
|
|
@@ -14,6 +15,7 @@ function toCssSize(size, fallback) {
|
|
|
14
15
|
return typeof size === "number" ? "".concat(size, "px") : size;
|
|
15
16
|
}
|
|
16
17
|
export default function SvgIcon(_ref) {
|
|
18
|
+
var _getIconDefinition;
|
|
17
19
|
var name = _ref.name,
|
|
18
20
|
href = _ref.href,
|
|
19
21
|
className = _ref.className,
|
|
@@ -26,10 +28,10 @@ export default function SvgIcon(_ref) {
|
|
|
26
28
|
ariaLabel = _ref.ariaLabel,
|
|
27
29
|
onClick = _ref.onClick;
|
|
28
30
|
var key = name !== null && name !== void 0 ? name : href;
|
|
29
|
-
|
|
31
|
+
// 查找优先级:精选内置表 → 全量编译表(方案 A:业务环境零网络渲染全量图标)→ href sprite
|
|
32
|
+
var icon = key ? (_getIconDefinition = getIconDefinition(key)) !== null && _getIconDefinition !== void 0 ? _getIconDefinition : getAllIconDefinition(key) : undefined;
|
|
30
33
|
|
|
31
|
-
// name
|
|
32
|
-
// (href 未注册不警告,IconParkGallery 全量库走 <use> sprite 是合法路径)
|
|
34
|
+
// name 未命中内置与全量表:dev 警告并兜底渲染,避免业务环境静默空白
|
|
33
35
|
if (!icon && name) {
|
|
34
36
|
if (process.env.NODE_ENV !== "production") {
|
|
35
37
|
console.warn("[SvgIcon] \u672A\u6CE8\u518C\u7684\u56FE\u6807 name \"".concat(name, "\"\uFF0C\u5DF2\u56DE\u9000\u4E3A \"").concat(FALLBACK_ICON, "\"\u3002\u8BF7\u4F7F\u7528\u5185\u7F6E\u56FE\u6807\u96C6\uFF08/icon-library \u7CBE\u9009\uFF09\u4E2D\u7684\u952E\u3002"));
|
|
@@ -36,6 +36,8 @@ export interface DrawerDetailTemplateProps extends Omit<DrawerProps, "onClose" |
|
|
|
36
36
|
maskClosable?: boolean;
|
|
37
37
|
/** 自定义顶部核心区内容(传入后替代内置 name/tags/titleActions/fields 结构) */
|
|
38
38
|
headerContent?: ReactNode;
|
|
39
|
+
/** 顶部核心区底部是否显示分割线;Tab 模式下 TabBar 自带分割线,可设为 false 避免双线 */
|
|
40
|
+
headerDivider?: boolean;
|
|
39
41
|
/** 顶部核心区副标题/说明文字(内置结构时渲染在 fields 下方、分割线上方) */
|
|
40
42
|
description?: ReactNode;
|
|
41
43
|
/** 内容区分 Tab 配置;不传则直接渲染 children */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["open", "onClose", "title", "name", "tags", "titleActions", "fields", "width", "maskClosable", "headerContent", "description", "tabs", "activeTabKey", "defaultActiveTabKey", "onTabChange", "children", "footer", "classNames", "styles"];
|
|
2
|
+
var _excluded = ["open", "onClose", "title", "name", "tags", "titleActions", "fields", "width", "maskClosable", "headerContent", "headerDivider", "description", "tabs", "activeTabKey", "defaultActiveTabKey", "onTabChange", "children", "footer", "classNames", "styles"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
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; }
|
|
@@ -8,7 +8,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
8
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
10
|
import { forwardRef } from "react";
|
|
11
|
-
import { ConfigProvider
|
|
11
|
+
import { ConfigProvider } from "antd";
|
|
12
12
|
import { CompanyDrawer, CompanyTabs } from "../../basic-components";
|
|
13
13
|
import { companyTheme } from "../../theme";
|
|
14
14
|
import "./index.scss";
|
|
@@ -31,6 +31,8 @@ var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
|
|
|
31
31
|
_ref$maskClosable = _ref.maskClosable,
|
|
32
32
|
maskClosable = _ref$maskClosable === void 0 ? true : _ref$maskClosable,
|
|
33
33
|
headerContent = _ref.headerContent,
|
|
34
|
+
_ref$headerDivider = _ref.headerDivider,
|
|
35
|
+
headerDivider = _ref$headerDivider === void 0 ? true : _ref$headerDivider,
|
|
34
36
|
description = _ref.description,
|
|
35
37
|
tabs = _ref.tabs,
|
|
36
38
|
activeTabKey = _ref.activeTabKey,
|
|
@@ -41,8 +43,6 @@ var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
|
|
|
41
43
|
classNames = _ref.classNames,
|
|
42
44
|
styles = _ref.styles,
|
|
43
45
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
44
|
-
var _theme$useToken = theme.useToken(),
|
|
45
|
-
token = _theme$useToken.token;
|
|
46
46
|
var isPresent = function isPresent(value) {
|
|
47
47
|
return value !== undefined && value !== null;
|
|
48
48
|
};
|
|
@@ -60,12 +60,9 @@ var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
|
|
|
60
60
|
className: "drawer-detail-template",
|
|
61
61
|
ref: ref,
|
|
62
62
|
children: [hasHeader ? /*#__PURE__*/_jsx("div", {
|
|
63
|
-
className: "drawer-detail-template__header",
|
|
63
|
+
className: "drawer-detail-template__header".concat(headerDivider ? "" : " drawer-detail-template__header--no-divider"),
|
|
64
64
|
children: headerContent !== null && headerContent !== void 0 ? headerContent : /*#__PURE__*/_jsxs("div", {
|
|
65
65
|
className: "drawer-detail-template__header-inner",
|
|
66
|
-
style: {
|
|
67
|
-
padding: "".concat(token.paddingMD, "px ").concat(token.paddingLG, "px")
|
|
68
|
-
},
|
|
69
66
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
70
67
|
className: "drawer-detail-template__name-row",
|
|
71
68
|
children: [isPresent(name) ? /*#__PURE__*/_jsx("span", {
|
|
@@ -98,7 +95,7 @@ var DrawerDetailTemplateInner = function DrawerDetailTemplateInner(_ref, ref) {
|
|
|
98
95
|
}) : null]
|
|
99
96
|
})
|
|
100
97
|
}) : null, /*#__PURE__*/_jsx("div", {
|
|
101
|
-
className: "drawer-detail-template__content",
|
|
98
|
+
className: "drawer-detail-template__content".concat(tabs && tabs.length > 0 ? " drawer-detail-template__content--tabs" : ""),
|
|
102
99
|
children: tabs && tabs.length > 0 ? /*#__PURE__*/_jsx(CompanyTabs, {
|
|
103
100
|
className: "drawer-detail-template__tabs",
|
|
104
101
|
activeKey: activeTabKey,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// 抽屉 body 改为 flex 容器且禁止整体滚动——顶部核心区固定、下方内容区滚动
|
|
2
|
-
.drawer-
|
|
3
|
-
|
|
2
|
+
// 特异性 (0,3,0) 覆盖 antd (.ant-drawer .ant-drawer-body) (0,2,0);padding 恢复 antd 默认 24px
|
|
3
|
+
.ant-drawer .ant-drawer-body.drawer-detail-template__drawer-body {
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
overflow: hidden;
|
|
@@ -19,6 +19,16 @@
|
|
|
19
19
|
background: var(--color-bg-container);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
// Tab 模式下 TabBar 自带底部分割线,去掉 header 的避免双线
|
|
23
|
+
&__header--no-divider {
|
|
24
|
+
border-bottom: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 内置结构化头部:底部留 24px(分割线上方间距)
|
|
28
|
+
&__header-inner {
|
|
29
|
+
padding-bottom: 24px;
|
|
30
|
+
}
|
|
31
|
+
|
|
22
32
|
// 大标题行:24px/600 大标题 + 状态 Tag + 弹性占位 + 操作按钮
|
|
23
33
|
&__name-row {
|
|
24
34
|
display: flex;
|
|
@@ -73,11 +83,22 @@
|
|
|
73
83
|
color: var(--color-text-tertiary);
|
|
74
84
|
}
|
|
75
85
|
|
|
76
|
-
//
|
|
86
|
+
// 内容区:唯一滚动区域(顶部留 24px,对齐 header 分割线下方间距)
|
|
77
87
|
&__content {
|
|
78
88
|
flex: 1;
|
|
79
89
|
min-height: 0;
|
|
80
90
|
overflow: auto;
|
|
91
|
+
padding-top: 24px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Tab 模式:TabBar 紧贴 header,无上间距
|
|
95
|
+
&__content--tabs {
|
|
96
|
+
padding-top: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// 内容区垂直 Space(size="small")行间距由 antd 默认 8px 提到 16px,贴合详情排版
|
|
100
|
+
.ant-space-gap-row-small {
|
|
101
|
+
row-gap: 16px;
|
|
81
102
|
}
|
|
82
103
|
|
|
83
104
|
// Tab 模式:tabBar 固定在内容区顶部,仅 pane 内容滚动
|
|
@@ -88,8 +109,12 @@
|
|
|
88
109
|
|
|
89
110
|
.ant-tabs-nav {
|
|
90
111
|
flex-shrink: 0;
|
|
91
|
-
margin-bottom:
|
|
92
|
-
|
|
112
|
+
margin-bottom: 16px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// antd 分割线 ::before 紧贴 tab 文字底部,线下方 16px 才是页签内容(margin 放 nav 上,避免撑高导致线错位)
|
|
116
|
+
.ant-tabs-nav-wrap {
|
|
117
|
+
padding-bottom: 0;
|
|
93
118
|
}
|
|
94
119
|
|
|
95
120
|
.ant-tabs-content-holder {
|