@donglegeyu/company-ui 1.2.39 → 1.2.41
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/BaseInfoForm/index.d.ts +21 -7
- package/dist/cjs/shared-components/BaseInfoForm/index.js +101 -12
- package/dist/cjs/shared-components/SvgIcon/index.js +10 -1
- package/dist/cjs/shared-components/index.d.ts +1 -1
- package/dist/cjs/template-components/AdminLayoutTemplate/index.d.ts +1 -1
- package/dist/cjs/template-components/AdminLayoutTemplate/index.js +19 -2
- package/dist/cjs/template-components/AdminLayoutTemplate/index.scss +2 -0
- package/dist/cjs/template-components/CompanySidebar/FirstSidebar.d.ts +2 -1
- package/dist/cjs/template-components/CompanySidebar/FirstSidebar.js +2 -1
- package/dist/cjs/template-components/CompanySidebar/index.js +36 -3
- package/dist/cjs/template-components/CompanySidebar/menuIconMap.js +11 -2
- package/dist/cjs/template-components/DetailPageTemplate/index.scss +1 -0
- package/dist/cjs/template-components/FormPageTemplate/index.scss +1 -0
- package/dist/cjs/template-components/StatisticsListPage/index.scss +3 -0
- package/dist/es/shared-components/BaseInfoForm/index.d.ts +21 -7
- package/dist/es/shared-components/BaseInfoForm/index.js +121 -13
- package/dist/es/shared-components/SvgIcon/index.js +12 -0
- package/dist/es/shared-components/index.d.ts +1 -1
- package/dist/es/template-components/AdminLayoutTemplate/index.d.ts +1 -1
- package/dist/es/template-components/AdminLayoutTemplate/index.js +18 -6
- package/dist/es/template-components/AdminLayoutTemplate/index.scss +2 -0
- package/dist/es/template-components/CompanySidebar/FirstSidebar.d.ts +2 -1
- package/dist/es/template-components/CompanySidebar/FirstSidebar.js +2 -1
- package/dist/es/template-components/CompanySidebar/index.js +43 -7
- package/dist/es/template-components/CompanySidebar/menuIconMap.js +8 -1
- package/dist/es/template-components/DetailPageTemplate/index.scss +1 -0
- package/dist/es/template-components/FormPageTemplate/index.scss +1 -0
- package/dist/es/template-components/StatisticsListPage/index.scss +3 -0
- package/package.json +3 -2
|
@@ -1,27 +1,41 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { FormInstance, FormRule } from "antd";
|
|
3
3
|
import "./index.scss";
|
|
4
|
-
export type FormFieldValue = string | number | boolean | null | undefined;
|
|
4
|
+
export type FormFieldValue = string | number | boolean | null | undefined | (string | number)[];
|
|
5
|
+
export interface FormFieldOption {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string | number;
|
|
8
|
+
/** cascader 树形选项 */
|
|
9
|
+
children?: FormFieldOption[];
|
|
10
|
+
}
|
|
11
|
+
export type FormFieldItemType = "input" | "select" | "textarea" | "input-number" | "select-multi" | "radio" | "cascader" | "date" | "daterange";
|
|
5
12
|
export interface FormFieldItem {
|
|
6
13
|
name: string;
|
|
7
14
|
label: string;
|
|
8
|
-
type:
|
|
15
|
+
type: FormFieldItemType;
|
|
9
16
|
placeholder?: string;
|
|
10
17
|
readonly?: boolean;
|
|
11
18
|
disabled?: boolean;
|
|
12
|
-
options?:
|
|
13
|
-
value: string | number;
|
|
14
|
-
label: string;
|
|
15
|
-
}[];
|
|
19
|
+
options?: FormFieldOption[];
|
|
16
20
|
rules?: FormRule[];
|
|
17
21
|
required?: boolean;
|
|
18
22
|
rows?: number;
|
|
23
|
+
/** date / daterange 专用:是否展示时间选择 */
|
|
24
|
+
showTime?: boolean;
|
|
19
25
|
}
|
|
20
|
-
export interface
|
|
26
|
+
export interface FormFieldCompactGroup {
|
|
21
27
|
type: "compact";
|
|
22
28
|
label: string;
|
|
23
29
|
children: FormFieldItem[];
|
|
24
30
|
}
|
|
31
|
+
/** 视觉分组:带标题的独立小节,内部字段仍走响应式网格 */
|
|
32
|
+
export interface FormFieldSectionGroup {
|
|
33
|
+
type: "section";
|
|
34
|
+
label: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
children: FormFieldItem[];
|
|
37
|
+
}
|
|
38
|
+
export type FormFieldGroup = FormFieldCompactGroup | FormFieldSectionGroup;
|
|
25
39
|
export type FormField = FormFieldItem | FormFieldGroup;
|
|
26
40
|
export type FormValues = Record<string, FormFieldValue>;
|
|
27
41
|
export interface BaseInfoFormProps {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
|
|
19
29
|
// src/shared-components/BaseInfoForm/index.tsx
|
|
@@ -24,9 +34,37 @@ __export(BaseInfoForm_exports, {
|
|
|
24
34
|
module.exports = __toCommonJS(BaseInfoForm_exports);
|
|
25
35
|
var import_react = require("react");
|
|
26
36
|
var import_antd = require("antd");
|
|
37
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
27
38
|
var import_basic_components = require("../../basic-components");
|
|
39
|
+
var import_SectionTitle = __toESM(require("../SectionTitle"));
|
|
28
40
|
var import_index = require("./index.scss");
|
|
29
41
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
+
var DATE_FORMAT = "YYYY-MM-DD";
|
|
43
|
+
var DATETIME_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
|
44
|
+
var isDateLike = (type) => type === "date" || type === "daterange";
|
|
45
|
+
var getDateItemProps = (field) => {
|
|
46
|
+
const format = field.showTime ? DATETIME_FORMAT : DATE_FORMAT;
|
|
47
|
+
if (field.type === "date") {
|
|
48
|
+
return {
|
|
49
|
+
getValueProps: (val) => ({
|
|
50
|
+
value: val ? (0, import_dayjs.default)(val, format) : void 0
|
|
51
|
+
}),
|
|
52
|
+
getValueFromEvent: (_date, dateString) => dateString || void 0
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
getValueProps: (val) => ({
|
|
57
|
+
value: Array.isArray(val) && val.length === 2 ? [(0, import_dayjs.default)(String(val[0]), format), (0, import_dayjs.default)(String(val[1]), format)] : void 0
|
|
58
|
+
}),
|
|
59
|
+
getValueFromEvent: (_dates, dateStrings) => (dateStrings == null ? void 0 : dateStrings[0]) && (dateStrings == null ? void 0 : dateStrings[1]) ? dateStrings : void 0
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
var isEqualValue = (a, b) => {
|
|
63
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
64
|
+
return JSON.stringify(a ?? null) === JSON.stringify(b ?? null);
|
|
65
|
+
}
|
|
66
|
+
return a === b;
|
|
67
|
+
};
|
|
30
68
|
var BaseInfoForm = (0, import_react.forwardRef)(
|
|
31
69
|
({ value, fields, layout = "horizontal", labelMaxWidth = 8, onChange, onFieldChange }, ref) => {
|
|
32
70
|
const [form] = import_basic_components.CompanyForm.useForm();
|
|
@@ -63,7 +101,7 @@ var BaseInfoForm = (0, import_react.forwardRef)(
|
|
|
63
101
|
const diff = {};
|
|
64
102
|
for (const k of Object.keys(value)) {
|
|
65
103
|
const v = value[k] === "" ? void 0 : value[k];
|
|
66
|
-
if (v
|
|
104
|
+
if (!isEqualValue(v, currentFormValues[k])) {
|
|
67
105
|
diff[k] = v;
|
|
68
106
|
}
|
|
69
107
|
}
|
|
@@ -116,6 +154,49 @@ var BaseInfoForm = (0, import_react.forwardRef)(
|
|
|
116
154
|
style: { width: "100%" }
|
|
117
155
|
}
|
|
118
156
|
);
|
|
157
|
+
case "select-multi":
|
|
158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
159
|
+
import_basic_components.CompanySelect,
|
|
160
|
+
{
|
|
161
|
+
mode: "multiple",
|
|
162
|
+
placeholder: field.placeholder ?? "请选择",
|
|
163
|
+
disabled: field.disabled,
|
|
164
|
+
options: field.options,
|
|
165
|
+
maxTagCount: "responsive",
|
|
166
|
+
style: { width: "100%" }
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
case "radio":
|
|
170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_basic_components.CompanyRadio.Group, { options: field.options, disabled: field.disabled });
|
|
171
|
+
case "cascader":
|
|
172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
173
|
+
import_basic_components.CompanyCascader,
|
|
174
|
+
{
|
|
175
|
+
placeholder: field.placeholder ?? "请选择",
|
|
176
|
+
disabled: field.disabled,
|
|
177
|
+
options: field.options,
|
|
178
|
+
style: { width: "100%" }
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
case "date":
|
|
182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
183
|
+
import_basic_components.CompanyDatePicker,
|
|
184
|
+
{
|
|
185
|
+
placeholder: field.placeholder ?? "请选择",
|
|
186
|
+
disabled: field.disabled,
|
|
187
|
+
showTime: field.showTime,
|
|
188
|
+
style: { width: "100%" }
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
case "daterange":
|
|
192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
193
|
+
import_basic_components.CompanyDatePicker.RangePicker,
|
|
194
|
+
{
|
|
195
|
+
disabled: field.disabled,
|
|
196
|
+
showTime: field.showTime,
|
|
197
|
+
style: { width: "100%" }
|
|
198
|
+
}
|
|
199
|
+
);
|
|
119
200
|
case "textarea":
|
|
120
201
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
121
202
|
import_basic_components.CompanyInput.TextArea,
|
|
@@ -139,6 +220,18 @@ var BaseInfoForm = (0, import_react.forwardRef)(
|
|
|
139
220
|
return null;
|
|
140
221
|
}
|
|
141
222
|
};
|
|
223
|
+
const renderItem = (field) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
224
|
+
import_basic_components.CompanyForm.Item,
|
|
225
|
+
{
|
|
226
|
+
label: field.label,
|
|
227
|
+
name: field.name,
|
|
228
|
+
rules: field.rules,
|
|
229
|
+
required: field.required,
|
|
230
|
+
className: field.type === "textarea" ? "label-top" : void 0,
|
|
231
|
+
...isDateLike(field.type) ? getDateItemProps(field) : null,
|
|
232
|
+
children: renderField(field)
|
|
233
|
+
}
|
|
234
|
+
);
|
|
142
235
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
143
236
|
"div",
|
|
144
237
|
{
|
|
@@ -165,17 +258,13 @@ var BaseInfoForm = (0, import_react.forwardRef)(
|
|
|
165
258
|
child.name
|
|
166
259
|
)) }) }) }, `compact-${index}`);
|
|
167
260
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
className: field.type === "textarea" ? "label-top" : void 0,
|
|
176
|
-
children: renderField(field)
|
|
177
|
-
}
|
|
178
|
-
) }, field.name);
|
|
261
|
+
if (field.type === "section") {
|
|
262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Col, { span: 24, children: [
|
|
263
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SectionTitle.default, { title: field.label, description: field.description }),
|
|
264
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Row, { gutter: 24, children: (field.children || []).map((child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Col, { span: getColSpan(), children: renderItem(child) }, child.name)) })
|
|
265
|
+
] }, `section-${index}`);
|
|
266
|
+
}
|
|
267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Col, { span: getColSpan(), children: renderItem(field) }, field.name);
|
|
179
268
|
}) })
|
|
180
269
|
}
|
|
181
270
|
)
|
|
@@ -24,6 +24,7 @@ __export(SvgIcon_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(SvgIcon_exports);
|
|
25
25
|
var import_icons = require("./icons");
|
|
26
26
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
|
+
var FALLBACK_ICON = "folder-open";
|
|
27
28
|
function toCssSize(size, fallback) {
|
|
28
29
|
if (size === void 0 || size === null)
|
|
29
30
|
return fallback;
|
|
@@ -40,7 +41,15 @@ function SvgIcon({
|
|
|
40
41
|
onClick
|
|
41
42
|
}) {
|
|
42
43
|
const key = name ?? href;
|
|
43
|
-
|
|
44
|
+
let icon = key ? (0, import_icons.getIconDefinition)(key) : void 0;
|
|
45
|
+
if (!icon && name) {
|
|
46
|
+
if (process.env.NODE_ENV !== "production") {
|
|
47
|
+
console.warn(
|
|
48
|
+
`[SvgIcon] 未注册的图标 name "${name}",已回退为 "${FALLBACK_ICON}"。请使用内置图标集(/icon-library 精选)中的键。`
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
icon = (0, import_icons.getIconDefinition)(FALLBACK_ICON);
|
|
52
|
+
}
|
|
44
53
|
const dimension = toCssSize(size, 16);
|
|
45
54
|
const mergedStyle = {
|
|
46
55
|
width: dimension,
|
|
@@ -6,7 +6,7 @@ export { default as PageTitle } from "./PageTitle";
|
|
|
6
6
|
export { default as FormFooterActions } from "./FormFooterActions";
|
|
7
7
|
export { default as SectionTitle } from "./SectionTitle";
|
|
8
8
|
export { default as BaseInfoForm } from "./BaseInfoForm";
|
|
9
|
-
export type { FormField, FormFieldItem, FormFieldGroup, BaseInfoFormProps, BaseInfoFormRef, } from "./BaseInfoForm";
|
|
9
|
+
export type { FormField, FormFieldItem, FormFieldGroup, FormFieldCompactGroup, FormFieldSectionGroup, FormFieldItemType, FormFieldOption, FormFieldValue, FormValues, BaseInfoFormProps, BaseInfoFormRef, } from "./BaseInfoForm";
|
|
10
10
|
export { default as ColorScale } from "./ColorScale";
|
|
11
11
|
export { default as AccessibilityChecker } from "./AccessibilityChecker";
|
|
12
12
|
export { default as EllipsisText } from "./EllipsisText";
|
|
@@ -42,7 +42,7 @@ export interface AdminLayoutTemplateProps {
|
|
|
42
42
|
businessMenus: SidebarMenuItem[];
|
|
43
43
|
/** 一级图标菜单(默认:首页 + 收藏) */
|
|
44
44
|
firstMenus?: SidebarMenuItem[];
|
|
45
|
-
/**
|
|
45
|
+
/** 一级栏底部固定菜单(默认:超级搜索) */
|
|
46
46
|
systemBottomMenus?: SidebarMenuItem[];
|
|
47
47
|
/** 一级导航最多可见数量,超出进「更多应用」抽屉 */
|
|
48
48
|
visibleMenuCount?: number;
|
|
@@ -42,7 +42,7 @@ var DEFAULT_FIRST_MENUS = [
|
|
|
42
42
|
{ key: "favorites", label: "收藏", icon: "favorites" }
|
|
43
43
|
];
|
|
44
44
|
var DEFAULT_SYSTEM_BOTTOM_MENUS = [
|
|
45
|
-
{ key: "
|
|
45
|
+
{ key: "super-search", label: "超级搜索", icon: "search" }
|
|
46
46
|
];
|
|
47
47
|
function findMenuByKey(menus, key) {
|
|
48
48
|
var _a;
|
|
@@ -348,6 +348,12 @@ function AdminLayoutTemplate({
|
|
|
348
348
|
(menu) => {
|
|
349
349
|
var _a2;
|
|
350
350
|
setActiveKey(menu.key);
|
|
351
|
+
const parentModule = businessMenus.find((m) => findMenuByKey(m.children ?? [], menu.key));
|
|
352
|
+
if (parentModule && parentModule.key !== activeFirstMenu) {
|
|
353
|
+
setActiveFirstMenu(parentModule.key);
|
|
354
|
+
setExpandedKeys(collectParentKeys(parentModule.children ?? []));
|
|
355
|
+
onActiveFirstMenuChange == null ? void 0 : onActiveFirstMenuChange(parentModule.key);
|
|
356
|
+
}
|
|
351
357
|
if ((_a2 = menu.children) == null ? void 0 : _a2.length)
|
|
352
358
|
return;
|
|
353
359
|
if (systemMenuKeys.has(menu.key)) {
|
|
@@ -363,7 +369,18 @@ function AdminLayoutTemplate({
|
|
|
363
369
|
openTab(menu.key, (page == null ? void 0 : page.label) ?? menu.label, (page == null ? void 0 : page.path) ?? menu.path, page == null ? void 0 : page.closable);
|
|
364
370
|
onMenuOpen == null ? void 0 : onMenuOpen(menu);
|
|
365
371
|
},
|
|
366
|
-
[
|
|
372
|
+
[
|
|
373
|
+
businessMenus,
|
|
374
|
+
activeFirstMenu,
|
|
375
|
+
systemMenuKeys,
|
|
376
|
+
homeTab,
|
|
377
|
+
isTabActiveControlled,
|
|
378
|
+
onActiveTabChange,
|
|
379
|
+
onActiveFirstMenuChange,
|
|
380
|
+
onMenuOpen,
|
|
381
|
+
pages,
|
|
382
|
+
openTab
|
|
383
|
+
]
|
|
367
384
|
);
|
|
368
385
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `admin-layout-template${className ? ` ${className}` : ""}`, style, children: [
|
|
369
386
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
display: flex;
|
|
20
20
|
flex-direction: column;
|
|
21
21
|
overflow: hidden;
|
|
22
|
+
|
|
22
23
|
/* 主区灰底与 SmartListTemplate 等业务模板的 --color-bg-layout 对齐,
|
|
23
24
|
页签栏与内容未充满处不露出白底 */
|
|
24
25
|
background: var(--color-bg-layout, #f5f5f5);
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
/* 间距契约:内容区只做滚动容器,禁止加 padding/margin/background(业务模板自带)。
|
|
32
33
|
纵向 flex 让 SmartListTemplate(flex-grow:1 + align-self:stretch)充满剩余高度 */
|
|
33
34
|
.admin-layout-content {
|
|
35
|
+
position: relative; /* 为 FormPageTemplate/DetailPageTemplate 等 absolute+inset:0 模板提供定位上下文,防止逃逸到全屏祖先 */
|
|
34
36
|
flex: 1;
|
|
35
37
|
min-height: 0;
|
|
36
38
|
overflow: auto;
|
|
@@ -12,6 +12,7 @@ export interface FirstSidebarProps {
|
|
|
12
12
|
businessMenus: SidebarMenuItem[];
|
|
13
13
|
customNavMenus: SidebarMenuItem[];
|
|
14
14
|
activeKey: string;
|
|
15
|
+
activeFirstMenu: string;
|
|
15
16
|
visibleMenuCount?: number;
|
|
16
17
|
domainPopoverOpen: boolean;
|
|
17
18
|
adminPopoverOpen: boolean;
|
|
@@ -25,4 +26,4 @@ export interface FirstSidebarProps {
|
|
|
25
26
|
onThemeSettings?: () => void;
|
|
26
27
|
onLogout?: () => void;
|
|
27
28
|
}
|
|
28
|
-
export default function FirstSidebar({ domains, currentDomainId, userInfo, logo, brandName, firstMenus, systemBottomMenus, businessMenus, customNavMenus, activeKey, visibleMenuCount, domainPopoverOpen, adminPopoverOpen, onDomainPopoverOpenChange, onAdminPopoverOpenChange, onDomainChange, onMenuClick, onBusinessMenuEnter, onBusinessMenuLeave, onOpenMore, onThemeSettings, onLogout, }: FirstSidebarProps): import("react").JSX.Element;
|
|
29
|
+
export default function FirstSidebar({ domains, currentDomainId, userInfo, logo, brandName, firstMenus, systemBottomMenus, businessMenus, customNavMenus, activeKey, activeFirstMenu, visibleMenuCount, domainPopoverOpen, adminPopoverOpen, onDomainPopoverOpenChange, onAdminPopoverOpenChange, onDomainChange, onMenuClick, onBusinessMenuEnter, onBusinessMenuLeave, onOpenMore, onThemeSettings, onLogout, }: FirstSidebarProps): import("react").JSX.Element;
|
|
@@ -37,6 +37,7 @@ function FirstSidebar({
|
|
|
37
37
|
businessMenus,
|
|
38
38
|
customNavMenus,
|
|
39
39
|
activeKey,
|
|
40
|
+
activeFirstMenu,
|
|
40
41
|
visibleMenuCount = 6,
|
|
41
42
|
domainPopoverOpen,
|
|
42
43
|
adminPopoverOpen,
|
|
@@ -108,7 +109,7 @@ function FirstSidebar({
|
|
|
108
109
|
displayMenus.map((menu) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
109
110
|
"div",
|
|
110
111
|
{
|
|
111
|
-
className: `business-menu-item${activeKey === menu.key ? " active" : ""}`,
|
|
112
|
+
className: `business-menu-item${activeFirstMenu === menu.key || activeKey === menu.key ? " active" : ""}`,
|
|
112
113
|
onClick: () => onMenuClick(menu),
|
|
113
114
|
onMouseEnter: () => onBusinessMenuEnter(menu),
|
|
114
115
|
onMouseLeave: onBusinessMenuLeave,
|
|
@@ -41,6 +41,24 @@ var import_menuIconMap = require("./menuIconMap");
|
|
|
41
41
|
var import_default_logo = require("./default-logo");
|
|
42
42
|
var import_index = require("./index.scss");
|
|
43
43
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
+
function buildLeafToFirstKeyMap(menus) {
|
|
45
|
+
const map = /* @__PURE__ */ new Map();
|
|
46
|
+
const walk = (items, firstKey) => {
|
|
47
|
+
(items || []).forEach((item) => {
|
|
48
|
+
var _a;
|
|
49
|
+
map.set(item.key, firstKey);
|
|
50
|
+
if ((_a = item.children) == null ? void 0 : _a.length)
|
|
51
|
+
walk(item.children, firstKey);
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
(menus || []).forEach((menu) => {
|
|
55
|
+
var _a;
|
|
56
|
+
map.set(menu.key, menu.key);
|
|
57
|
+
if ((_a = menu.children) == null ? void 0 : _a.length)
|
|
58
|
+
walk(menu.children, menu.key);
|
|
59
|
+
});
|
|
60
|
+
return map;
|
|
61
|
+
}
|
|
44
62
|
function DefaultFallback() {
|
|
45
63
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "company-sidebar-error", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "导航加载失败" }) });
|
|
46
64
|
}
|
|
@@ -89,6 +107,17 @@ function CompanySidebar({
|
|
|
89
107
|
const resolvedBusinessMenus = (0, import_react.useMemo)(() => (0, import_menuIconMap.resolveMenuIcons)(businessMenus), [businessMenus]);
|
|
90
108
|
const resolvedSecondMenus = (0, import_react.useMemo)(() => (0, import_menuIconMap.resolveMenuIcons)(secondMenus), [secondMenus]);
|
|
91
109
|
const resolvedCustomNavMenus = (0, import_react.useMemo)(() => (0, import_menuIconMap.resolveMenuIcons)(customNavMenus), [customNavMenus]);
|
|
110
|
+
const leafToFirstKeyMap = (0, import_react.useMemo)(() => buildLeafToFirstKeyMap(businessMenus), [businessMenus]);
|
|
111
|
+
const handleLeafMenuClick = (0, import_react.useCallback)(
|
|
112
|
+
(menu) => {
|
|
113
|
+
const firstKey = leafToFirstKeyMap.get(menu.key);
|
|
114
|
+
if (firstKey && firstKey !== activeFirstMenu) {
|
|
115
|
+
onFirstMenuSelect(firstKey);
|
|
116
|
+
}
|
|
117
|
+
onMenuClick(menu);
|
|
118
|
+
},
|
|
119
|
+
[leafToFirstKeyMap, activeFirstMenu, onFirstMenuSelect, onMenuClick]
|
|
120
|
+
);
|
|
92
121
|
(0, import_react.useEffect)(() => {
|
|
93
122
|
setState((prev) => ({ ...prev, localExpandedKeys: expandedKeys }));
|
|
94
123
|
}, [expandedKeys]);
|
|
@@ -126,10 +155,13 @@ function CompanySidebar({
|
|
|
126
155
|
}, [delayHideSidebar]);
|
|
127
156
|
const handleFirstMenuClick = (0, import_react.useCallback)(
|
|
128
157
|
(menu) => {
|
|
129
|
-
|
|
158
|
+
const firstKey = leafToFirstKeyMap.get(menu.key) || menu.key;
|
|
159
|
+
if (firstKey !== activeFirstMenu) {
|
|
160
|
+
onFirstMenuSelect(firstKey);
|
|
161
|
+
}
|
|
130
162
|
onMenuClick(menu);
|
|
131
163
|
},
|
|
132
|
-
[onFirstMenuSelect, onMenuClick]
|
|
164
|
+
[leafToFirstKeyMap, activeFirstMenu, onFirstMenuSelect, onMenuClick]
|
|
133
165
|
);
|
|
134
166
|
const handleMoreSelect = (0, import_react.useCallback)(
|
|
135
167
|
(menu, child) => {
|
|
@@ -185,6 +217,7 @@ function CompanySidebar({
|
|
|
185
217
|
businessMenus: resolvedBusinessMenus,
|
|
186
218
|
customNavMenus: resolvedCustomNavMenus,
|
|
187
219
|
activeKey,
|
|
220
|
+
activeFirstMenu,
|
|
188
221
|
visibleMenuCount,
|
|
189
222
|
domainPopoverOpen: state.domainPopoverOpen,
|
|
190
223
|
adminPopoverOpen: state.adminPopoverOpen,
|
|
@@ -211,7 +244,7 @@ function CompanySidebar({
|
|
|
211
244
|
expandedKeys: state.localExpandedKeys,
|
|
212
245
|
emptyImage,
|
|
213
246
|
onMenuClick: (menu) => {
|
|
214
|
-
|
|
247
|
+
handleLeafMenuClick(menu);
|
|
215
248
|
if (!secondSidebarFixed) {
|
|
216
249
|
delayHideSidebar();
|
|
217
250
|
}
|
|
@@ -24,6 +24,8 @@ __export(menuIconMap_exports, {
|
|
|
24
24
|
resolveMenuIcons: () => resolveMenuIcons
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(menuIconMap_exports);
|
|
27
|
+
var import_icons = require("../../shared-components/SvgIcon/icons");
|
|
28
|
+
var VALID_ICONS = new Set(import_icons.iconNames);
|
|
27
29
|
var KEYWORD_ICON_MAP = [
|
|
28
30
|
{ keywords: ["商品", "货品", "物料", "spu", "sku", "product"], icon: "commodity" },
|
|
29
31
|
{ keywords: ["采购", "进货", "供应商", "purchase"], icon: "buy" },
|
|
@@ -47,8 +49,15 @@ var KEYWORD_ICON_MAP = [
|
|
|
47
49
|
];
|
|
48
50
|
var DEFAULT_ICON = "folder-open";
|
|
49
51
|
function getMenuIcon(menu) {
|
|
50
|
-
if (menu.icon)
|
|
51
|
-
|
|
52
|
+
if (menu.icon) {
|
|
53
|
+
if (VALID_ICONS.has(menu.icon))
|
|
54
|
+
return menu.icon;
|
|
55
|
+
if (process.env.NODE_ENV !== "production") {
|
|
56
|
+
console.warn(
|
|
57
|
+
`[CompanySidebar] 菜单 "${menu.label}" 的 icon "${menu.icon}" 不在内置图标集中,已回退为关键词匹配。内置图标键可查阅文档站 /icon-library 精选集。`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
52
61
|
const label = (menu.label || "").toLowerCase();
|
|
53
62
|
for (const { keywords, icon } of KEYWORD_ICON_MAP) {
|
|
54
63
|
if (keywords.some((kw) => label.includes(kw.toLowerCase()))) {
|
|
@@ -171,6 +171,9 @@
|
|
|
171
171
|
justify-content: flex-end;
|
|
172
172
|
padding: calc(var(--spacing-md, 16) * 1px);
|
|
173
173
|
border-top: 1px solid var(--color-border-secondary, rgba(5, 5, 5, 0.06));
|
|
174
|
+
|
|
175
|
+
/* 吸底:表格高度由 scroll.y 控制不一定填满 wrapper,margin-top:auto 保证分页器始终贴白卡底部(对齐 SmartListTemplate 视觉契约) */
|
|
176
|
+
margin-top: auto;
|
|
174
177
|
}
|
|
175
178
|
}
|
|
176
179
|
}
|
|
@@ -1,27 +1,41 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { FormInstance, FormRule } from "antd";
|
|
3
3
|
import "./index.scss";
|
|
4
|
-
export type FormFieldValue = string | number | boolean | null | undefined;
|
|
4
|
+
export type FormFieldValue = string | number | boolean | null | undefined | (string | number)[];
|
|
5
|
+
export interface FormFieldOption {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string | number;
|
|
8
|
+
/** cascader 树形选项 */
|
|
9
|
+
children?: FormFieldOption[];
|
|
10
|
+
}
|
|
11
|
+
export type FormFieldItemType = "input" | "select" | "textarea" | "input-number" | "select-multi" | "radio" | "cascader" | "date" | "daterange";
|
|
5
12
|
export interface FormFieldItem {
|
|
6
13
|
name: string;
|
|
7
14
|
label: string;
|
|
8
|
-
type:
|
|
15
|
+
type: FormFieldItemType;
|
|
9
16
|
placeholder?: string;
|
|
10
17
|
readonly?: boolean;
|
|
11
18
|
disabled?: boolean;
|
|
12
|
-
options?:
|
|
13
|
-
value: string | number;
|
|
14
|
-
label: string;
|
|
15
|
-
}[];
|
|
19
|
+
options?: FormFieldOption[];
|
|
16
20
|
rules?: FormRule[];
|
|
17
21
|
required?: boolean;
|
|
18
22
|
rows?: number;
|
|
23
|
+
/** date / daterange 专用:是否展示时间选择 */
|
|
24
|
+
showTime?: boolean;
|
|
19
25
|
}
|
|
20
|
-
export interface
|
|
26
|
+
export interface FormFieldCompactGroup {
|
|
21
27
|
type: "compact";
|
|
22
28
|
label: string;
|
|
23
29
|
children: FormFieldItem[];
|
|
24
30
|
}
|
|
31
|
+
/** 视觉分组:带标题的独立小节,内部字段仍走响应式网格 */
|
|
32
|
+
export interface FormFieldSectionGroup {
|
|
33
|
+
type: "section";
|
|
34
|
+
label: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
children: FormFieldItem[];
|
|
37
|
+
}
|
|
38
|
+
export type FormFieldGroup = FormFieldCompactGroup | FormFieldSectionGroup;
|
|
25
39
|
export type FormField = FormFieldItem | FormFieldGroup;
|
|
26
40
|
export type FormValues = Record<string, FormFieldValue>;
|
|
27
41
|
export interface BaseInfoFormProps {
|
|
@@ -1,4 +1,6 @@
|
|
|
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
|
+
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; }
|
|
3
|
+
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; }
|
|
2
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; }
|
|
3
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
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); }
|
|
@@ -10,9 +12,52 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
10
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
13
|
import { forwardRef, useImperativeHandle, useRef, useEffect, useState } from "react";
|
|
12
14
|
import { Row, Col, Space } from "antd";
|
|
13
|
-
import
|
|
15
|
+
import dayjs from "dayjs";
|
|
16
|
+
import { CompanyForm, CompanyInput, CompanySelect, CompanyInputNumber, CompanyDatePicker, CompanyCascader, CompanyRadio } from "../../basic-components";
|
|
17
|
+
import SectionTitle from "../SectionTitle";
|
|
14
18
|
import "./index.scss";
|
|
19
|
+
|
|
20
|
+
/** 视觉分组:带标题的独立小节,内部字段仍走响应式网格 */
|
|
15
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
var DATE_FORMAT = "YYYY-MM-DD";
|
|
24
|
+
var DATETIME_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
|
25
|
+
var isDateLike = function isDateLike(type) {
|
|
26
|
+
return type === "date" || type === "daterange";
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** 日期类字段:value 统一为格式化字符串(可 JSON 序列化),控件内部用 Dayjs */
|
|
30
|
+
var getDateItemProps = function getDateItemProps(field) {
|
|
31
|
+
var format = field.showTime ? DATETIME_FORMAT : DATE_FORMAT;
|
|
32
|
+
if (field.type === "date") {
|
|
33
|
+
return {
|
|
34
|
+
getValueProps: function getValueProps(val) {
|
|
35
|
+
return {
|
|
36
|
+
value: val ? dayjs(val, format) : undefined
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
getValueFromEvent: function getValueFromEvent(_date, dateString) {
|
|
40
|
+
return dateString || undefined;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
getValueProps: function getValueProps(val) {
|
|
46
|
+
return {
|
|
47
|
+
value: Array.isArray(val) && val.length === 2 ? [dayjs(String(val[0]), format), dayjs(String(val[1]), format)] : undefined
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
getValueFromEvent: function getValueFromEvent(_dates, dateStrings) {
|
|
51
|
+
return dateStrings !== null && dateStrings !== void 0 && dateStrings[0] && dateStrings !== null && dateStrings !== void 0 && dateStrings[1] ? dateStrings : undefined;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
var isEqualValue = function isEqualValue(a, b) {
|
|
56
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
57
|
+
return JSON.stringify(a !== null && a !== void 0 ? a : null) === JSON.stringify(b !== null && b !== void 0 ? b : null);
|
|
58
|
+
}
|
|
59
|
+
return a === b;
|
|
60
|
+
};
|
|
16
61
|
var BaseInfoForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
17
62
|
var value = _ref.value,
|
|
18
63
|
fields = _ref.fields,
|
|
@@ -60,7 +105,7 @@ var BaseInfoForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
60
105
|
for (var _i = 0, _Object$keys = Object.keys(value); _i < _Object$keys.length; _i++) {
|
|
61
106
|
var k = _Object$keys[_i];
|
|
62
107
|
var v = value[k] === "" ? undefined : value[k];
|
|
63
|
-
if (v
|
|
108
|
+
if (!isEqualValue(v, currentFormValues[k])) {
|
|
64
109
|
diff[k] = v;
|
|
65
110
|
}
|
|
66
111
|
}
|
|
@@ -98,7 +143,7 @@ var BaseInfoForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
98
143
|
};
|
|
99
144
|
}, [form]);
|
|
100
145
|
var renderField = function renderField(field) {
|
|
101
|
-
var _field$placeholder, _field$placeholder2, _field$placeholder3, _field$placeholder4;
|
|
146
|
+
var _field$placeholder, _field$placeholder2, _field$placeholder3, _field$placeholder4, _field$placeholder5, _field$placeholder6, _field$placeholder7;
|
|
102
147
|
switch (field.type) {
|
|
103
148
|
case "input":
|
|
104
149
|
return /*#__PURE__*/_jsx(CompanyInput, {
|
|
@@ -115,9 +160,51 @@ var BaseInfoForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
115
160
|
width: "100%"
|
|
116
161
|
}
|
|
117
162
|
});
|
|
163
|
+
case "select-multi":
|
|
164
|
+
return /*#__PURE__*/_jsx(CompanySelect, {
|
|
165
|
+
mode: "multiple",
|
|
166
|
+
placeholder: (_field$placeholder3 = field.placeholder) !== null && _field$placeholder3 !== void 0 ? _field$placeholder3 : "请选择",
|
|
167
|
+
disabled: field.disabled,
|
|
168
|
+
options: field.options,
|
|
169
|
+
maxTagCount: "responsive",
|
|
170
|
+
style: {
|
|
171
|
+
width: "100%"
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
case "radio":
|
|
175
|
+
return /*#__PURE__*/_jsx(CompanyRadio.Group, {
|
|
176
|
+
options: field.options,
|
|
177
|
+
disabled: field.disabled
|
|
178
|
+
});
|
|
179
|
+
case "cascader":
|
|
180
|
+
return /*#__PURE__*/_jsx(CompanyCascader, {
|
|
181
|
+
placeholder: (_field$placeholder4 = field.placeholder) !== null && _field$placeholder4 !== void 0 ? _field$placeholder4 : "请选择",
|
|
182
|
+
disabled: field.disabled,
|
|
183
|
+
options: field.options,
|
|
184
|
+
style: {
|
|
185
|
+
width: "100%"
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
case "date":
|
|
189
|
+
return /*#__PURE__*/_jsx(CompanyDatePicker, {
|
|
190
|
+
placeholder: (_field$placeholder5 = field.placeholder) !== null && _field$placeholder5 !== void 0 ? _field$placeholder5 : "请选择",
|
|
191
|
+
disabled: field.disabled,
|
|
192
|
+
showTime: field.showTime,
|
|
193
|
+
style: {
|
|
194
|
+
width: "100%"
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
case "daterange":
|
|
198
|
+
return /*#__PURE__*/_jsx(CompanyDatePicker.RangePicker, {
|
|
199
|
+
disabled: field.disabled,
|
|
200
|
+
showTime: field.showTime,
|
|
201
|
+
style: {
|
|
202
|
+
width: "100%"
|
|
203
|
+
}
|
|
204
|
+
});
|
|
118
205
|
case "textarea":
|
|
119
206
|
return /*#__PURE__*/_jsx(CompanyInput.TextArea, {
|
|
120
|
-
placeholder: (_field$
|
|
207
|
+
placeholder: (_field$placeholder6 = field.placeholder) !== null && _field$placeholder6 !== void 0 ? _field$placeholder6 : "请输入",
|
|
121
208
|
disabled: field.disabled,
|
|
122
209
|
rows: field.rows,
|
|
123
210
|
style: {
|
|
@@ -126,7 +213,7 @@ var BaseInfoForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
126
213
|
});
|
|
127
214
|
case "input-number":
|
|
128
215
|
return /*#__PURE__*/_jsx(CompanyInputNumber, {
|
|
129
|
-
placeholder: (_field$
|
|
216
|
+
placeholder: (_field$placeholder7 = field.placeholder) !== null && _field$placeholder7 !== void 0 ? _field$placeholder7 : "请输入",
|
|
130
217
|
disabled: field.disabled,
|
|
131
218
|
style: {
|
|
132
219
|
width: "100%"
|
|
@@ -136,6 +223,17 @@ var BaseInfoForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
136
223
|
return null;
|
|
137
224
|
}
|
|
138
225
|
};
|
|
226
|
+
var renderItem = function renderItem(field) {
|
|
227
|
+
return /*#__PURE__*/_jsx(CompanyForm.Item, _objectSpread(_objectSpread({
|
|
228
|
+
label: field.label,
|
|
229
|
+
name: field.name,
|
|
230
|
+
rules: field.rules,
|
|
231
|
+
required: field.required,
|
|
232
|
+
className: field.type === "textarea" ? "label-top" : undefined
|
|
233
|
+
}, isDateLike(field.type) ? getDateItemProps(field) : null), {}, {
|
|
234
|
+
children: renderField(field)
|
|
235
|
+
}));
|
|
236
|
+
};
|
|
139
237
|
return /*#__PURE__*/_jsx("div", {
|
|
140
238
|
ref: formRef,
|
|
141
239
|
className: "base-info-form",
|
|
@@ -169,16 +267,26 @@ var BaseInfoForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
169
267
|
})
|
|
170
268
|
}, "compact-".concat(index));
|
|
171
269
|
}
|
|
270
|
+
if (field.type === "section") {
|
|
271
|
+
return /*#__PURE__*/_jsxs(Col, {
|
|
272
|
+
span: 24,
|
|
273
|
+
children: [/*#__PURE__*/_jsx(SectionTitle, {
|
|
274
|
+
title: field.label,
|
|
275
|
+
description: field.description
|
|
276
|
+
}), /*#__PURE__*/_jsx(Row, {
|
|
277
|
+
gutter: 24,
|
|
278
|
+
children: (field.children || []).map(function (child) {
|
|
279
|
+
return /*#__PURE__*/_jsx(Col, {
|
|
280
|
+
span: getColSpan(),
|
|
281
|
+
children: renderItem(child)
|
|
282
|
+
}, child.name);
|
|
283
|
+
})
|
|
284
|
+
})]
|
|
285
|
+
}, "section-".concat(index));
|
|
286
|
+
}
|
|
172
287
|
return /*#__PURE__*/_jsx(Col, {
|
|
173
288
|
span: getColSpan(),
|
|
174
|
-
children:
|
|
175
|
-
label: field.label,
|
|
176
|
-
name: field.name,
|
|
177
|
-
rules: field.rules,
|
|
178
|
-
required: field.required,
|
|
179
|
-
className: field.type === "textarea" ? "label-top" : undefined,
|
|
180
|
-
children: renderField(field)
|
|
181
|
-
})
|
|
289
|
+
children: renderItem(field)
|
|
182
290
|
}, field.name);
|
|
183
291
|
})
|
|
184
292
|
})
|
|
@@ -5,7 +5,10 @@ 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
|
+
|
|
9
|
+
// 未注册图标键的兜底图标,保证任何输入都有可见输出(业务环境无 iconpark sprite,不能依赖 <use> 静默回退)
|
|
8
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
var FALLBACK_ICON = "folder-open";
|
|
9
12
|
function toCssSize(size, fallback) {
|
|
10
13
|
if (size === undefined || size === null) return fallback;
|
|
11
14
|
return typeof size === "number" ? "".concat(size, "px") : size;
|
|
@@ -23,6 +26,15 @@ export default function SvgIcon(_ref) {
|
|
|
23
26
|
onClick = _ref.onClick;
|
|
24
27
|
var key = name !== null && name !== void 0 ? name : href;
|
|
25
28
|
var icon = key ? getIconDefinition(key) : undefined;
|
|
29
|
+
|
|
30
|
+
// name 未注册:dev 警告并兜底渲染,避免业务环境静默空白
|
|
31
|
+
// (href 未注册不警告,IconParkGallery 全量库走 <use> sprite 是合法路径)
|
|
32
|
+
if (!icon && name) {
|
|
33
|
+
if (process.env.NODE_ENV !== "production") {
|
|
34
|
+
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"));
|
|
35
|
+
}
|
|
36
|
+
icon = getIconDefinition(FALLBACK_ICON);
|
|
37
|
+
}
|
|
26
38
|
var dimension = toCssSize(size, 16);
|
|
27
39
|
var mergedStyle = _objectSpread(_objectSpread({
|
|
28
40
|
width: dimension,
|
|
@@ -6,7 +6,7 @@ export { default as PageTitle } from "./PageTitle";
|
|
|
6
6
|
export { default as FormFooterActions } from "./FormFooterActions";
|
|
7
7
|
export { default as SectionTitle } from "./SectionTitle";
|
|
8
8
|
export { default as BaseInfoForm } from "./BaseInfoForm";
|
|
9
|
-
export type { FormField, FormFieldItem, FormFieldGroup, BaseInfoFormProps, BaseInfoFormRef, } from "./BaseInfoForm";
|
|
9
|
+
export type { FormField, FormFieldItem, FormFieldGroup, FormFieldCompactGroup, FormFieldSectionGroup, FormFieldItemType, FormFieldOption, FormFieldValue, FormValues, BaseInfoFormProps, BaseInfoFormRef, } from "./BaseInfoForm";
|
|
10
10
|
export { default as ColorScale } from "./ColorScale";
|
|
11
11
|
export { default as AccessibilityChecker } from "./AccessibilityChecker";
|
|
12
12
|
export { default as EllipsisText } from "./EllipsisText";
|
|
@@ -42,7 +42,7 @@ export interface AdminLayoutTemplateProps {
|
|
|
42
42
|
businessMenus: SidebarMenuItem[];
|
|
43
43
|
/** 一级图标菜单(默认:首页 + 收藏) */
|
|
44
44
|
firstMenus?: SidebarMenuItem[];
|
|
45
|
-
/**
|
|
45
|
+
/** 一级栏底部固定菜单(默认:超级搜索) */
|
|
46
46
|
systemBottomMenus?: SidebarMenuItem[];
|
|
47
47
|
/** 一级导航最多可见数量,超出进「更多应用」抽屉 */
|
|
48
48
|
visibleMenuCount?: number;
|
|
@@ -41,11 +41,11 @@ var DEFAULT_FIRST_MENUS = [{
|
|
|
41
41
|
icon: "favorites"
|
|
42
42
|
}];
|
|
43
43
|
|
|
44
|
-
/**
|
|
44
|
+
/** 默认一级栏底部固定菜单:超级搜索(与组件库标准 demo 一致) */
|
|
45
45
|
var DEFAULT_SYSTEM_BOTTOM_MENUS = [{
|
|
46
|
-
key: "
|
|
47
|
-
label: "
|
|
48
|
-
icon: "
|
|
46
|
+
key: "super-search",
|
|
47
|
+
label: "超级搜索",
|
|
48
|
+
icon: "search"
|
|
49
49
|
}];
|
|
50
50
|
|
|
51
51
|
/** 在菜单树中按键查找菜单项 */
|
|
@@ -447,9 +447,21 @@ export default function AdminLayoutTemplate(_ref) {
|
|
|
447
447
|
var handleMenuClick = useCallback(function (menu) {
|
|
448
448
|
var _menu$children5, _page$label2, _page$path2;
|
|
449
449
|
setActiveKey(menu.key);
|
|
450
|
+
// 反向同步一级菜单高亮:从收藏/更多应用/自定义导航面板点击叶子菜单时,
|
|
451
|
+
// activeFirstMenu 可能停留在其他模块(与 handleTabChange 的反向同步保持一致)
|
|
452
|
+
var parentModule = businessMenus.find(function (m) {
|
|
453
|
+
var _m$children2;
|
|
454
|
+
return findMenuByKey((_m$children2 = m.children) !== null && _m$children2 !== void 0 ? _m$children2 : [], menu.key);
|
|
455
|
+
});
|
|
456
|
+
if (parentModule && parentModule.key !== activeFirstMenu) {
|
|
457
|
+
var _parentModule$childre2;
|
|
458
|
+
setActiveFirstMenu(parentModule.key);
|
|
459
|
+
setExpandedKeys(collectParentKeys((_parentModule$childre2 = parentModule.children) !== null && _parentModule$childre2 !== void 0 ? _parentModule$childre2 : []));
|
|
460
|
+
onActiveFirstMenuChange === null || onActiveFirstMenuChange === void 0 || onActiveFirstMenuChange(parentModule.key);
|
|
461
|
+
}
|
|
450
462
|
// 父级菜单只负责展开(展开交互由 CompanySidebar 内部处理)
|
|
451
463
|
if ((_menu$children5 = menu.children) !== null && _menu$children5 !== void 0 && _menu$children5.length) return;
|
|
452
|
-
//
|
|
464
|
+
// 一级系统菜单(首页/收藏/超级搜索)不开页签;首页激活 homeTab
|
|
453
465
|
if (systemMenuKeys.has(menu.key)) {
|
|
454
466
|
if (homeTab && menu.key === homeTab.key) {
|
|
455
467
|
if (!isTabActiveControlled) setInternalActiveTabKey(homeTab.key);
|
|
@@ -467,7 +479,7 @@ export default function AdminLayoutTemplate(_ref) {
|
|
|
467
479
|
});
|
|
468
480
|
openTab(menu.key, (_page$label2 = page === null || page === void 0 ? void 0 : page.label) !== null && _page$label2 !== void 0 ? _page$label2 : menu.label, (_page$path2 = page === null || page === void 0 ? void 0 : page.path) !== null && _page$path2 !== void 0 ? _page$path2 : menu.path, page === null || page === void 0 ? void 0 : page.closable);
|
|
469
481
|
onMenuOpen === null || onMenuOpen === void 0 || onMenuOpen(menu);
|
|
470
|
-
}, [systemMenuKeys, homeTab, isTabActiveControlled, onActiveTabChange, onMenuOpen, pages, openTab]);
|
|
482
|
+
}, [businessMenus, activeFirstMenu, systemMenuKeys, homeTab, isTabActiveControlled, onActiveTabChange, onActiveFirstMenuChange, onMenuOpen, pages, openTab]);
|
|
471
483
|
return /*#__PURE__*/_jsxs("div", {
|
|
472
484
|
className: "admin-layout-template".concat(className ? " ".concat(className) : ""),
|
|
473
485
|
style: style,
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
display: flex;
|
|
20
20
|
flex-direction: column;
|
|
21
21
|
overflow: hidden;
|
|
22
|
+
|
|
22
23
|
/* 主区灰底与 SmartListTemplate 等业务模板的 --color-bg-layout 对齐,
|
|
23
24
|
页签栏与内容未充满处不露出白底 */
|
|
24
25
|
background: var(--color-bg-layout, #f5f5f5);
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
/* 间距契约:内容区只做滚动容器,禁止加 padding/margin/background(业务模板自带)。
|
|
32
33
|
纵向 flex 让 SmartListTemplate(flex-grow:1 + align-self:stretch)充满剩余高度 */
|
|
33
34
|
.admin-layout-content {
|
|
35
|
+
position: relative; /* 为 FormPageTemplate/DetailPageTemplate 等 absolute+inset:0 模板提供定位上下文,防止逃逸到全屏祖先 */
|
|
34
36
|
flex: 1;
|
|
35
37
|
min-height: 0;
|
|
36
38
|
overflow: auto;
|
|
@@ -12,6 +12,7 @@ export interface FirstSidebarProps {
|
|
|
12
12
|
businessMenus: SidebarMenuItem[];
|
|
13
13
|
customNavMenus: SidebarMenuItem[];
|
|
14
14
|
activeKey: string;
|
|
15
|
+
activeFirstMenu: string;
|
|
15
16
|
visibleMenuCount?: number;
|
|
16
17
|
domainPopoverOpen: boolean;
|
|
17
18
|
adminPopoverOpen: boolean;
|
|
@@ -25,4 +26,4 @@ export interface FirstSidebarProps {
|
|
|
25
26
|
onThemeSettings?: () => void;
|
|
26
27
|
onLogout?: () => void;
|
|
27
28
|
}
|
|
28
|
-
export default function FirstSidebar({ domains, currentDomainId, userInfo, logo, brandName, firstMenus, systemBottomMenus, businessMenus, customNavMenus, activeKey, visibleMenuCount, domainPopoverOpen, adminPopoverOpen, onDomainPopoverOpenChange, onAdminPopoverOpenChange, onDomainChange, onMenuClick, onBusinessMenuEnter, onBusinessMenuLeave, onOpenMore, onThemeSettings, onLogout, }: FirstSidebarProps): import("react").JSX.Element;
|
|
29
|
+
export default function FirstSidebar({ domains, currentDomainId, userInfo, logo, brandName, firstMenus, systemBottomMenus, businessMenus, customNavMenus, activeKey, activeFirstMenu, visibleMenuCount, domainPopoverOpen, adminPopoverOpen, onDomainPopoverOpenChange, onAdminPopoverOpenChange, onDomainChange, onMenuClick, onBusinessMenuEnter, onBusinessMenuLeave, onOpenMore, onThemeSettings, onLogout, }: FirstSidebarProps): import("react").JSX.Element;
|
|
@@ -15,6 +15,7 @@ export default function FirstSidebar(_ref) {
|
|
|
15
15
|
businessMenus = _ref.businessMenus,
|
|
16
16
|
customNavMenus = _ref.customNavMenus,
|
|
17
17
|
activeKey = _ref.activeKey,
|
|
18
|
+
activeFirstMenu = _ref.activeFirstMenu,
|
|
18
19
|
_ref$visibleMenuCount = _ref.visibleMenuCount,
|
|
19
20
|
visibleMenuCount = _ref$visibleMenuCount === void 0 ? 6 : _ref$visibleMenuCount,
|
|
20
21
|
domainPopoverOpen = _ref.domainPopoverOpen,
|
|
@@ -120,7 +121,7 @@ export default function FirstSidebar(_ref) {
|
|
|
120
121
|
className: "business-menus",
|
|
121
122
|
children: [displayMenus.map(function (menu) {
|
|
122
123
|
return /*#__PURE__*/_jsxs("div", {
|
|
123
|
-
className: "business-menu-item".concat(activeKey === menu.key ? " active" : ""),
|
|
124
|
+
className: "business-menu-item".concat(activeFirstMenu === menu.key || activeKey === menu.key ? " active" : ""),
|
|
124
125
|
onClick: function onClick() {
|
|
125
126
|
return onMenuClick(menu);
|
|
126
127
|
},
|
|
@@ -18,9 +18,27 @@ import CustomNavPanel from "./CustomNavPanel";
|
|
|
18
18
|
import { resolveMenuIcons } from "./menuIconMap";
|
|
19
19
|
import { DEFAULT_LOGO } from "./default-logo";
|
|
20
20
|
import "./index.scss";
|
|
21
|
+
|
|
22
|
+
// 反查表:任意叶子菜单 key -> 所属一级业务菜单 key(选中二级时同步高亮一级)
|
|
21
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
24
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
25
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
|
+
function buildLeafToFirstKeyMap(menus) {
|
|
27
|
+
var map = new Map();
|
|
28
|
+
var walk = function walk(items, firstKey) {
|
|
29
|
+
(items || []).forEach(function (item) {
|
|
30
|
+
var _item$children;
|
|
31
|
+
map.set(item.key, firstKey);
|
|
32
|
+
if ((_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length) walk(item.children, firstKey);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
(menus || []).forEach(function (menu) {
|
|
36
|
+
var _menu$children;
|
|
37
|
+
map.set(menu.key, menu.key);
|
|
38
|
+
if ((_menu$children = menu.children) !== null && _menu$children !== void 0 && _menu$children.length) walk(menu.children, menu.key);
|
|
39
|
+
});
|
|
40
|
+
return map;
|
|
41
|
+
}
|
|
24
42
|
function DefaultFallback() {
|
|
25
43
|
return /*#__PURE__*/_jsx("div", {
|
|
26
44
|
className: "company-sidebar-error",
|
|
@@ -52,7 +70,7 @@ export default function CompanySidebar(_ref) {
|
|
|
52
70
|
activeFirstMenu = _ref.activeFirstMenu,
|
|
53
71
|
activeKey = _ref.activeKey,
|
|
54
72
|
onFirstMenuSelect = _ref.onFirstMenuSelect,
|
|
55
|
-
|
|
73
|
+
onMenuClick = _ref.onMenuClick,
|
|
56
74
|
expandedKeys = _ref.expandedKeys,
|
|
57
75
|
onExpandedKeysChange = _ref.onExpandedKeysChange,
|
|
58
76
|
secondSidebarFixed = _ref.secondSidebarFixed,
|
|
@@ -84,6 +102,20 @@ export default function CompanySidebar(_ref) {
|
|
|
84
102
|
var resolvedCustomNavMenus = useMemo(function () {
|
|
85
103
|
return resolveMenuIcons(customNavMenus);
|
|
86
104
|
}, [customNavMenus]);
|
|
105
|
+
|
|
106
|
+
// 叶子 key -> 一级菜单 key 反查表(业务菜单树全量)
|
|
107
|
+
var leafToFirstKeyMap = useMemo(function () {
|
|
108
|
+
return buildLeafToFirstKeyMap(businessMenus);
|
|
109
|
+
}, [businessMenus]);
|
|
110
|
+
|
|
111
|
+
// 内部统一的叶子菜单点击处理:命中业务菜单时同步 activeFirstMenu,保证一级导航同步高亮
|
|
112
|
+
var handleLeafMenuClick = useCallback(function (menu) {
|
|
113
|
+
var firstKey = leafToFirstKeyMap.get(menu.key);
|
|
114
|
+
if (firstKey && firstKey !== activeFirstMenu) {
|
|
115
|
+
onFirstMenuSelect(firstKey);
|
|
116
|
+
}
|
|
117
|
+
onMenuClick(menu);
|
|
118
|
+
}, [leafToFirstKeyMap, activeFirstMenu, onFirstMenuSelect, onMenuClick]);
|
|
87
119
|
useEffect(function () {
|
|
88
120
|
setState(function (prev) {
|
|
89
121
|
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
@@ -133,19 +165,22 @@ export default function CompanySidebar(_ref) {
|
|
|
133
165
|
delayHideSidebar();
|
|
134
166
|
}, [delayHideSidebar]);
|
|
135
167
|
var handleFirstMenuClick = useCallback(function (menu) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
168
|
+
var firstKey = leafToFirstKeyMap.get(menu.key) || menu.key;
|
|
169
|
+
if (firstKey !== activeFirstMenu) {
|
|
170
|
+
onFirstMenuSelect(firstKey);
|
|
171
|
+
}
|
|
172
|
+
onMenuClick(menu);
|
|
173
|
+
}, [leafToFirstKeyMap, activeFirstMenu, onFirstMenuSelect, onMenuClick]);
|
|
139
174
|
var handleMoreSelect = useCallback(function (menu, child) {
|
|
140
175
|
var target = child || menu;
|
|
141
176
|
onFirstMenuSelect(menu.key);
|
|
142
|
-
|
|
177
|
+
onMenuClick(target);
|
|
143
178
|
setState(function (prev) {
|
|
144
179
|
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
145
180
|
moreDrawerOpen: false
|
|
146
181
|
});
|
|
147
182
|
});
|
|
148
|
-
}, [onFirstMenuSelect,
|
|
183
|
+
}, [onFirstMenuSelect, onMenuClick]);
|
|
149
184
|
var handleOpenCustomNav = useCallback(function () {
|
|
150
185
|
setState(function (prev) {
|
|
151
186
|
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
@@ -192,6 +227,7 @@ export default function CompanySidebar(_ref) {
|
|
|
192
227
|
businessMenus: resolvedBusinessMenus,
|
|
193
228
|
customNavMenus: resolvedCustomNavMenus,
|
|
194
229
|
activeKey: activeKey,
|
|
230
|
+
activeFirstMenu: activeFirstMenu,
|
|
195
231
|
visibleMenuCount: visibleMenuCount,
|
|
196
232
|
domainPopoverOpen: state.domainPopoverOpen,
|
|
197
233
|
adminPopoverOpen: state.adminPopoverOpen,
|
|
@@ -232,7 +268,7 @@ export default function CompanySidebar(_ref) {
|
|
|
232
268
|
expandedKeys: state.localExpandedKeys,
|
|
233
269
|
emptyImage: emptyImage,
|
|
234
270
|
onMenuClick: function onMenuClick(menu) {
|
|
235
|
-
|
|
271
|
+
handleLeafMenuClick(menu);
|
|
236
272
|
if (!secondSidebarFixed) {
|
|
237
273
|
delayHideSidebar();
|
|
238
274
|
}
|
|
@@ -7,6 +7,8 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
8
8
|
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); }
|
|
9
9
|
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; }
|
|
10
|
+
import { iconNames } from "../../shared-components/SvgIcon/icons";
|
|
11
|
+
var VALID_ICONS = new Set(iconNames);
|
|
10
12
|
var KEYWORD_ICON_MAP = [{
|
|
11
13
|
keywords: ["商品", "货品", "物料", "spu", "sku", "product"],
|
|
12
14
|
icon: "commodity"
|
|
@@ -67,7 +69,12 @@ var KEYWORD_ICON_MAP = [{
|
|
|
67
69
|
}];
|
|
68
70
|
var DEFAULT_ICON = "folder-open";
|
|
69
71
|
export function getMenuIcon(menu) {
|
|
70
|
-
if (menu.icon)
|
|
72
|
+
if (menu.icon) {
|
|
73
|
+
if (VALID_ICONS.has(menu.icon)) return menu.icon;
|
|
74
|
+
if (process.env.NODE_ENV !== "production") {
|
|
75
|
+
console.warn("[CompanySidebar] \u83DC\u5355 \"".concat(menu.label, "\" \u7684 icon \"").concat(menu.icon, "\" \u4E0D\u5728\u5185\u7F6E\u56FE\u6807\u96C6\u4E2D\uFF0C\u5DF2\u56DE\u9000\u4E3A\u5173\u952E\u8BCD\u5339\u914D\u3002\u5185\u7F6E\u56FE\u6807\u952E\u53EF\u67E5\u9605\u6587\u6863\u7AD9 /icon-library \u7CBE\u9009\u96C6\u3002"));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
71
78
|
var label = (menu.label || "").toLowerCase();
|
|
72
79
|
var _iterator = _createForOfIteratorHelper(KEYWORD_ICON_MAP),
|
|
73
80
|
_step;
|
|
@@ -171,6 +171,9 @@
|
|
|
171
171
|
justify-content: flex-end;
|
|
172
172
|
padding: calc(var(--spacing-md, 16) * 1px);
|
|
173
173
|
border-top: 1px solid var(--color-border-secondary, rgba(5, 5, 5, 0.06));
|
|
174
|
+
|
|
175
|
+
/* 吸底:表格高度由 scroll.y 控制不一定填满 wrapper,margin-top:auto 保证分页器始终贴白卡底部(对齐 SmartListTemplate 视觉契约) */
|
|
176
|
+
margin-top: auto;
|
|
174
177
|
}
|
|
175
178
|
}
|
|
176
179
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@donglegeyu/company-ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.41",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/es/index.js",
|
|
6
6
|
"types": "dist/es/index.d.ts",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"test:run": "vitest run",
|
|
32
32
|
"test:coverage": "vitest run --coverage",
|
|
33
33
|
"prepare": "husky",
|
|
34
|
-
"prepublishOnly": "bash scripts/check-clean.sh && npm run build"
|
|
34
|
+
"prepublishOnly": "bash scripts/check-clean.sh && npm run build",
|
|
35
|
+
"verify:skill-examples": "node scripts/verify-skill-examples.mjs"
|
|
35
36
|
},
|
|
36
37
|
"keywords": [
|
|
37
38
|
"antd",
|