@pisell/materials 1.0.1057 → 1.0.1059
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +3 -3
- package/build/lowcode/preview.js +9 -9
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +20 -20
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +23 -23
- package/es/components/PisellCards/index.d.ts +3 -0
- package/es/components/PisellCards/index.js +3 -1
- package/es/components/PisellContactBrief/PisellContactBrief.d.ts +13 -0
- package/es/components/PisellContactBrief/PisellContactBrief.js +223 -0
- package/es/components/PisellContactBrief/PisellContactBrief.less +192 -0
- package/es/components/PisellContactBrief/PisellContactBrief.stories.d.ts +31 -0
- package/es/components/PisellContactBrief/PisellContactBrief.stories.js +196 -0
- package/es/components/PisellContactBrief/components/ContactFormModal.d.ts +23 -0
- package/es/components/PisellContactBrief/components/ContactFormModal.js +177 -0
- package/es/components/PisellContactBrief/components/index.d.ts +5 -0
- package/es/components/PisellContactBrief/components/index.js +4 -0
- package/es/components/PisellContactBrief/index.d.ts +6 -0
- package/es/components/PisellContactBrief/index.js +5 -0
- package/es/components/PisellContactBrief/locales.d.ts +55 -0
- package/es/components/PisellContactBrief/locales.js +54 -0
- package/es/components/PisellContactBrief/types.d.ts +82 -0
- package/es/components/PisellContactBrief/types.js +1 -0
- package/es/components/dataSourceComponents/fields/Tabs/Tabs.less +8 -0
- package/es/components/pisellActionPanel/PisellActionPanel.d.ts +13 -0
- package/es/components/pisellActionPanel/PisellActionPanel.js +98 -0
- package/es/components/pisellActionPanel/PisellActionPanel.less +69 -0
- package/es/components/pisellActionPanel/PisellActionPanel.stories.d.ts +19 -0
- package/es/components/pisellActionPanel/PisellActionPanel.stories.js +208 -0
- package/es/components/pisellActionPanel/index.d.ts +6 -0
- package/es/components/pisellActionPanel/index.js +5 -0
- package/es/components/pisellActionPanel/types.d.ts +83 -0
- package/es/components/pisellActionPanel/types.js +1 -0
- package/es/components/pisellBaseCard/PisellBaseCard.d.ts +8 -0
- package/es/components/pisellBaseCard/PisellBaseCard.js +96 -0
- package/es/components/pisellBaseCard/PisellBaseCard.less +25 -0
- package/es/components/pisellBaseCard/PisellBaseCard.stories.d.ts +19 -0
- package/es/components/pisellBaseCard/PisellBaseCard.stories.js +99 -0
- package/es/components/pisellBaseCard/index.d.ts +5 -0
- package/es/components/pisellBaseCard/index.js +4 -0
- package/es/components/pisellBaseCard/types.d.ts +45 -0
- package/es/components/pisellBaseCard/types.js +1 -0
- package/es/components/pisellCurrency/PisellCurrency.js +18 -12
- package/es/components/pisellCurrency/PisellCurrency.less +0 -123
- package/es/components/pisellCustomerBrief/PisellCustomerBrief.d.ts +15 -0
- package/es/components/pisellCustomerBrief/PisellCustomerBrief.js +145 -0
- package/es/components/pisellCustomerBrief/PisellCustomerBrief.less +8 -0
- package/es/components/pisellCustomerBrief/PisellCustomerBrief.stories.d.ts +23 -0
- package/es/components/pisellCustomerBrief/PisellCustomerBrief.stories.js +193 -0
- package/es/components/pisellCustomerBrief/index.d.ts +6 -0
- package/es/components/pisellCustomerBrief/index.js +5 -0
- package/es/components/pisellCustomerBrief/types.d.ts +82 -0
- package/es/components/pisellCustomerBrief/types.js +1 -0
- package/es/components/pisellEmail/PisellEmail.js +48 -42
- package/es/components/pisellEmail/PisellEmail.less +0 -92
- package/es/components/pisellEntityCard/PisellEntityCard.d.ts +8 -0
- package/es/components/pisellEntityCard/PisellEntityCard.js +474 -0
- package/es/components/pisellEntityCard/PisellEntityCard.less +362 -0
- package/es/components/pisellEntityCard/PisellEntityCard.stories.d.ts +47 -0
- package/es/components/pisellEntityCard/PisellEntityCard.stories.js +450 -0
- package/es/components/pisellEntityCard/index.d.ts +5 -0
- package/es/components/pisellEntityCard/index.js +4 -0
- package/es/components/pisellEntityCard/types.d.ts +144 -0
- package/es/components/pisellEntityCard/types.js +1 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +32 -4
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +4 -2
- package/es/components/pisellFloorMapLayout/components/ViewControls.d.ts +4 -0
- package/es/components/pisellFloorMapLayout/components/ViewControls.js +12 -2
- package/es/components/pisellFloorMapLayout/types.d.ts +2 -0
- package/es/components/pisellLongText/PisellLongText.js +18 -12
- package/es/components/pisellLongText/PisellLongText.less +0 -67
- package/es/components/pisellLookup/PisellLookup.js +8 -1
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.js +14 -6
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.less +18 -139
- package/es/components/pisellMultipleSelect/components/EditView.js +1 -0
- package/es/components/pisellNumber/PisellNumber.js +18 -12
- package/es/components/pisellNumber/PisellNumber.less +0 -103
- package/es/components/pisellPhone/PisellPhone.js +18 -12
- package/es/components/pisellPhone/PisellPhone.less +0 -119
- package/es/components/pisellPhone/components/EditView.js +44 -33
- package/es/components/pisellPhone/constants/countryCodes.d.ts +1 -0
- package/es/components/pisellPhone/constants/countryCodes.js +26 -25
- package/es/components/pisellPhone/types.d.ts +2 -2
- package/es/components/pisellPhone/utils/countryCodeHelper.d.ts +4 -4
- package/es/components/pisellPhone/utils/countryCodeHelper.js +5 -5
- package/es/components/pisellRating/PisellRating.js +7 -3
- package/es/components/pisellSingleLineText/PisellSingleLineText.js +27 -20
- package/es/components/pisellSingleLineText/PisellSingleLineText.less +58 -201
- package/es/components/pisellSingleSelect/PisellSingleSelect.js +14 -5
- package/es/components/pisellSingleSelect/PisellSingleSelect.less +5 -106
- package/es/components/pisellUrl/PisellUrl.js +48 -42
- package/es/components/pisellWalletPassCard/index.js +2 -1
- package/es/index.d.ts +15 -4
- package/es/index.js +8 -4
- package/es/theme/pisell-components.d.ts +14 -0
- package/es/theme/pisell-components.js +74 -0
- package/lib/components/PisellCards/index.d.ts +3 -0
- package/lib/components/PisellCards/index.js +3 -1
- package/lib/components/PisellContactBrief/PisellContactBrief.d.ts +13 -0
- package/lib/components/PisellContactBrief/PisellContactBrief.js +231 -0
- package/lib/components/PisellContactBrief/PisellContactBrief.less +192 -0
- package/lib/components/PisellContactBrief/PisellContactBrief.stories.d.ts +31 -0
- package/lib/components/PisellContactBrief/PisellContactBrief.stories.js +188 -0
- package/lib/components/PisellContactBrief/components/ContactFormModal.d.ts +23 -0
- package/lib/components/PisellContactBrief/components/ContactFormModal.js +154 -0
- package/lib/components/PisellContactBrief/components/index.d.ts +5 -0
- package/lib/components/PisellContactBrief/components/index.js +29 -0
- package/lib/components/PisellContactBrief/index.d.ts +6 -0
- package/lib/components/PisellContactBrief/index.js +29 -0
- package/lib/components/PisellContactBrief/locales.d.ts +55 -0
- package/lib/components/PisellContactBrief/locales.js +74 -0
- package/lib/components/PisellContactBrief/types.d.ts +82 -0
- package/lib/components/PisellContactBrief/types.js +17 -0
- package/lib/components/dataSourceComponents/fields/Tabs/Tabs.less +8 -0
- package/lib/components/pisellActionPanel/PisellActionPanel.d.ts +13 -0
- package/lib/components/pisellActionPanel/PisellActionPanel.js +124 -0
- package/lib/components/pisellActionPanel/PisellActionPanel.less +69 -0
- package/lib/components/pisellActionPanel/PisellActionPanel.stories.d.ts +19 -0
- package/lib/components/pisellActionPanel/PisellActionPanel.stories.js +186 -0
- package/lib/components/pisellActionPanel/index.d.ts +6 -0
- package/lib/components/pisellActionPanel/index.js +29 -0
- package/lib/components/pisellActionPanel/types.d.ts +83 -0
- package/lib/components/pisellActionPanel/types.js +17 -0
- package/lib/components/pisellBaseCard/PisellBaseCard.d.ts +8 -0
- package/lib/components/pisellBaseCard/PisellBaseCard.js +124 -0
- package/lib/components/pisellBaseCard/PisellBaseCard.less +25 -0
- package/lib/components/pisellBaseCard/PisellBaseCard.stories.d.ts +19 -0
- package/lib/components/pisellBaseCard/PisellBaseCard.stories.js +107 -0
- package/lib/components/pisellBaseCard/index.d.ts +5 -0
- package/lib/components/pisellBaseCard/index.js +29 -0
- package/lib/components/pisellBaseCard/types.d.ts +45 -0
- package/lib/components/pisellBaseCard/types.js +17 -0
- package/lib/components/pisellCurrency/PisellCurrency.js +16 -10
- package/lib/components/pisellCurrency/PisellCurrency.less +0 -123
- package/lib/components/pisellCustomerBrief/PisellCustomerBrief.d.ts +15 -0
- package/lib/components/pisellCustomerBrief/PisellCustomerBrief.js +143 -0
- package/lib/components/pisellCustomerBrief/PisellCustomerBrief.less +8 -0
- package/lib/components/pisellCustomerBrief/PisellCustomerBrief.stories.d.ts +23 -0
- package/lib/components/pisellCustomerBrief/PisellCustomerBrief.stories.js +171 -0
- package/lib/components/pisellCustomerBrief/index.d.ts +6 -0
- package/lib/components/pisellCustomerBrief/index.js +29 -0
- package/lib/components/pisellCustomerBrief/types.d.ts +82 -0
- package/lib/components/pisellCustomerBrief/types.js +17 -0
- package/lib/components/pisellEmail/PisellEmail.js +16 -10
- package/lib/components/pisellEmail/PisellEmail.less +0 -92
- package/lib/components/pisellEntityCard/PisellEntityCard.d.ts +8 -0
- package/lib/components/pisellEntityCard/PisellEntityCard.js +426 -0
- package/lib/components/pisellEntityCard/PisellEntityCard.less +362 -0
- package/lib/components/pisellEntityCard/PisellEntityCard.stories.d.ts +47 -0
- package/lib/components/pisellEntityCard/PisellEntityCard.stories.js +349 -0
- package/lib/components/pisellEntityCard/index.d.ts +5 -0
- package/lib/components/pisellEntityCard/index.js +29 -0
- package/lib/components/pisellEntityCard/types.d.ts +144 -0
- package/lib/components/pisellEntityCard/types.js +17 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +22 -3
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +2 -2
- package/lib/components/pisellFloorMapLayout/components/ViewControls.d.ts +4 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControls.js +11 -1
- package/lib/components/pisellFloorMapLayout/types.d.ts +2 -0
- package/lib/components/pisellLongText/PisellLongText.js +16 -10
- package/lib/components/pisellLongText/PisellLongText.less +0 -67
- package/lib/components/pisellLookup/PisellLookup.js +5 -1
- package/lib/components/pisellMultipleSelect/PisellMultipleSelect.js +62 -53
- package/lib/components/pisellMultipleSelect/PisellMultipleSelect.less +18 -139
- package/lib/components/pisellMultipleSelect/components/EditView.js +42 -30
- package/lib/components/pisellNumber/PisellNumber.js +16 -10
- package/lib/components/pisellNumber/PisellNumber.less +0 -103
- package/lib/components/pisellPhone/PisellPhone.js +16 -10
- package/lib/components/pisellPhone/PisellPhone.less +0 -119
- package/lib/components/pisellPhone/components/EditView.js +40 -24
- package/lib/components/pisellPhone/constants/countryCodes.d.ts +1 -0
- package/lib/components/pisellPhone/constants/countryCodes.js +24 -24
- package/lib/components/pisellPhone/types.d.ts +2 -2
- package/lib/components/pisellPhone/utils/countryCodeHelper.d.ts +4 -4
- package/lib/components/pisellPhone/utils/countryCodeHelper.js +1 -1
- package/lib/components/pisellRating/PisellRating.js +4 -2
- package/lib/components/pisellSingleLineText/PisellSingleLineText.js +16 -10
- package/lib/components/pisellSingleLineText/PisellSingleLineText.less +58 -201
- package/lib/components/pisellSingleSelect/PisellSingleSelect.js +34 -35
- package/lib/components/pisellSingleSelect/PisellSingleSelect.less +5 -106
- package/lib/components/pisellUrl/PisellUrl.js +16 -10
- package/lib/components/pisellWalletPassCard/index.js +1 -1
- package/lib/index.d.ts +15 -4
- package/lib/index.js +18 -3
- package/lib/theme/pisell-components.d.ts +14 -0
- package/lib/theme/pisell-components.js +89 -0
- package/lowcode/pisell-action-panel/meta.ts +146 -0
- package/lowcode/pisell-action-panel/snippets.ts +42 -0
- package/lowcode/pisell-base-card/meta.ts +98 -0
- package/lowcode/pisell-base-card/snippets.ts +13 -0
- package/lowcode/pisell-contact-brief/meta.ts +178 -0
- package/lowcode/pisell-contact-brief/snippets.ts +40 -0
- package/lowcode/pisell-customer-brief/meta.ts +262 -0
- package/lowcode/pisell-customer-brief/snippets.ts +46 -0
- package/lowcode/pisell-entity-card/meta.ts +296 -0
- package/lowcode/pisell-entity-card/snippets.ts +41 -0
- package/lowcode/pisell-floor-map-layout/meta.ts +37 -1
- package/package.json +4 -4
|
@@ -13,6 +13,14 @@
|
|
|
13
13
|
background-color: rgba(0, 0, 0, .04);
|
|
14
14
|
overflow-x: auto;
|
|
15
15
|
|
|
16
|
+
/* 隐藏滚动条:兼容 WebKit(Chrome/Safari/Edge)、Firefox、IE/Edge 旧版 */
|
|
17
|
+
-ms-overflow-style: none;
|
|
18
|
+
scrollbar-width: none;
|
|
19
|
+
|
|
20
|
+
&::-webkit-scrollbar {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
16
24
|
&-item {
|
|
17
25
|
min-height: 36px;
|
|
18
26
|
min-width: 90px;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PisellActionPanelProps } from './types';
|
|
3
|
+
import './PisellActionPanel.less';
|
|
4
|
+
/**
|
|
5
|
+
* PisellActionPanel 操作面板
|
|
6
|
+
* 用于统一承载、编排和呈现一组用户可执行操作(Actions)的 Pro 组件。
|
|
7
|
+
* 支持分组、布局、对齐、主/次/危险层级与条件显隐。
|
|
8
|
+
*
|
|
9
|
+
* 设计文档:Action Panel (pcp_ge_actionPanel_V1.0)
|
|
10
|
+
*
|
|
11
|
+
* @param props 组件 Props
|
|
12
|
+
*/
|
|
13
|
+
export declare function PisellActionPanel({ groups, layout, align, overflowStrategy, groupGap, itemGap, className, style, }: PisellActionPanelProps): JSX.Element;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
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
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellActionPanel/PisellActionPanel.tsx
|
|
30
|
+
var PisellActionPanel_exports = {};
|
|
31
|
+
__export(PisellActionPanel_exports, {
|
|
32
|
+
PisellActionPanel: () => PisellActionPanel
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(PisellActionPanel_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_PisellActionPanel = require("./PisellActionPanel.less");
|
|
39
|
+
function renderActionItem(item, index) {
|
|
40
|
+
const visible = item.visible !== false;
|
|
41
|
+
if (!visible) return null;
|
|
42
|
+
const key = item.key ?? `action-${index}`;
|
|
43
|
+
const priority = item.priority ?? "default";
|
|
44
|
+
const buttonType = priority === "danger" ? "primary" : priority === "primary" ? "primary" : "default";
|
|
45
|
+
const danger = priority === "danger";
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
47
|
+
import_antd.Button,
|
|
48
|
+
{
|
|
49
|
+
key,
|
|
50
|
+
type: buttonType,
|
|
51
|
+
danger,
|
|
52
|
+
icon: item.icon,
|
|
53
|
+
onClick: item.onClick,
|
|
54
|
+
disabled: item.disabled,
|
|
55
|
+
className: (0, import_classnames.default)("pisell-action-panel-btn", item.className),
|
|
56
|
+
style: item.style
|
|
57
|
+
},
|
|
58
|
+
item.label
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
function PisellActionPanel({
|
|
62
|
+
groups,
|
|
63
|
+
layout = "horizontal",
|
|
64
|
+
align = "left",
|
|
65
|
+
overflowStrategy = "wrap",
|
|
66
|
+
groupGap,
|
|
67
|
+
itemGap,
|
|
68
|
+
className,
|
|
69
|
+
style
|
|
70
|
+
}) {
|
|
71
|
+
const effectiveGroups = (0, import_react.useMemo)(() => {
|
|
72
|
+
return groups.filter((g) => g.visible !== false).map((g) => ({
|
|
73
|
+
...g,
|
|
74
|
+
items: g.items.filter((i) => i.visible !== false)
|
|
75
|
+
})).filter((g) => g.items.length > 0);
|
|
76
|
+
}, [groups]);
|
|
77
|
+
const rootStyle = (0, import_react.useMemo)(() => {
|
|
78
|
+
const s = { ...style };
|
|
79
|
+
if (groupGap !== void 0) {
|
|
80
|
+
s.gap = typeof groupGap === "number" ? `${groupGap}px` : groupGap;
|
|
81
|
+
}
|
|
82
|
+
return s;
|
|
83
|
+
}, [style, groupGap]);
|
|
84
|
+
const itemGapValue = typeof itemGap === "number" ? itemGap : itemGap ?? 8;
|
|
85
|
+
const isVertical = layout === "vertical";
|
|
86
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
className: (0, import_classnames.default)(
|
|
90
|
+
"pisell-action-panel-root",
|
|
91
|
+
`pisell-action-panel-layout-${layout}`,
|
|
92
|
+
`pisell-action-panel-align-${align}`,
|
|
93
|
+
overflowStrategy === "scroll" && "pisell-action-panel-overflow-scroll",
|
|
94
|
+
overflowStrategy === "wrap" && "pisell-action-panel-overflow-wrap",
|
|
95
|
+
className
|
|
96
|
+
),
|
|
97
|
+
style: rootStyle
|
|
98
|
+
},
|
|
99
|
+
effectiveGroups.map((group, groupIndex) => /* @__PURE__ */ import_react.default.createElement(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
key: group.key ?? `group-${groupIndex}`,
|
|
103
|
+
className: (0, import_classnames.default)("pisell-action-panel-group", group.className),
|
|
104
|
+
style: group.style
|
|
105
|
+
},
|
|
106
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
107
|
+
import_antd.Space,
|
|
108
|
+
{
|
|
109
|
+
size: itemGapValue,
|
|
110
|
+
direction: isVertical ? "vertical" : "horizontal",
|
|
111
|
+
wrap: !isVertical && overflowStrategy === "wrap",
|
|
112
|
+
className: "pisell-action-panel-group-space"
|
|
113
|
+
},
|
|
114
|
+
group.items.map(
|
|
115
|
+
(item, itemIndex) => renderActionItem(item, itemIndex)
|
|
116
|
+
)
|
|
117
|
+
)
|
|
118
|
+
))
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
122
|
+
0 && (module.exports = {
|
|
123
|
+
PisellActionPanel
|
|
124
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PisellActionPanel 样式
|
|
3
|
+
* 操作面板:分组、布局、对齐;不设置 font-family,使用项目统一配置
|
|
4
|
+
* 覆盖 antd 时使用 pisell-lowcode-xxx
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
.pisell-action-panel-root {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
align-items: center;
|
|
11
|
+
min-width: 0;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
|
|
14
|
+
&.pisell-action-panel-layout-horizontal {
|
|
15
|
+
flex-direction: row;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.pisell-action-panel-layout-vertical {
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: stretch;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&.pisell-action-panel-layout-grid {
|
|
24
|
+
display: grid;
|
|
25
|
+
grid-auto-flow: column;
|
|
26
|
+
align-items: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.pisell-action-panel-align-left {
|
|
30
|
+
justify-content: flex-start;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.pisell-action-panel-align-center {
|
|
34
|
+
justify-content: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.pisell-action-panel-align-right {
|
|
38
|
+
justify-content: flex-end;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&.pisell-action-panel-align-space-between {
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&.pisell-action-panel-overflow-wrap {
|
|
46
|
+
flex-wrap: wrap;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.pisell-action-panel-overflow-scroll {
|
|
50
|
+
flex-wrap: nowrap;
|
|
51
|
+
overflow-x: auto;
|
|
52
|
+
overflow-y: hidden;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.pisell-action-panel-group {
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
min-width: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.pisell-action-panel-group-space {
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
min-width: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.pisell-action-panel-btn {
|
|
68
|
+
flex-shrink: 0;
|
|
69
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { PisellActionPanel } from './PisellActionPanel';
|
|
3
|
+
declare const meta: Meta<typeof PisellActionPanel>;
|
|
4
|
+
export default meta;
|
|
5
|
+
declare type Story = StoryObj<typeof PisellActionPanel>;
|
|
6
|
+
/** 默认:单组两按钮 */
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
/** 右对齐(表单底部常见) */
|
|
9
|
+
export declare const AlignRight: Story;
|
|
10
|
+
/** 多组:主操作 + 危险操作 */
|
|
11
|
+
export declare const MultipleGroups: Story;
|
|
12
|
+
/** 竖向布局 */
|
|
13
|
+
export declare const VerticalLayout: Story;
|
|
14
|
+
/** 条件显隐(某条 visible: false) */
|
|
15
|
+
export declare const ConditionalVisible: Story;
|
|
16
|
+
/** 居中 */
|
|
17
|
+
export declare const AlignCenter: Story;
|
|
18
|
+
/** space-between 两端对齐 */
|
|
19
|
+
export declare const SpaceBetween: Story;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/pisellActionPanel/PisellActionPanel.stories.tsx
|
|
20
|
+
var PisellActionPanel_stories_exports = {};
|
|
21
|
+
__export(PisellActionPanel_stories_exports, {
|
|
22
|
+
AlignCenter: () => AlignCenter,
|
|
23
|
+
AlignRight: () => AlignRight,
|
|
24
|
+
ConditionalVisible: () => ConditionalVisible,
|
|
25
|
+
Default: () => Default,
|
|
26
|
+
MultipleGroups: () => MultipleGroups,
|
|
27
|
+
SpaceBetween: () => SpaceBetween,
|
|
28
|
+
VerticalLayout: () => VerticalLayout,
|
|
29
|
+
default: () => PisellActionPanel_stories_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(PisellActionPanel_stories_exports);
|
|
32
|
+
var import_icons = require("@ant-design/icons");
|
|
33
|
+
var import_PisellActionPanel = require("./PisellActionPanel");
|
|
34
|
+
var meta = {
|
|
35
|
+
title: "General/PisellActionPanel",
|
|
36
|
+
component: import_PisellActionPanel.PisellActionPanel,
|
|
37
|
+
tags: ["autodocs"],
|
|
38
|
+
argTypes: {
|
|
39
|
+
layout: {
|
|
40
|
+
description: "布局方式",
|
|
41
|
+
control: "select",
|
|
42
|
+
options: ["horizontal", "vertical", "grid"]
|
|
43
|
+
},
|
|
44
|
+
align: {
|
|
45
|
+
description: "对齐方式",
|
|
46
|
+
control: "select",
|
|
47
|
+
options: ["left", "center", "right", "space-between"]
|
|
48
|
+
},
|
|
49
|
+
overflowStrategy: {
|
|
50
|
+
description: "溢出策略",
|
|
51
|
+
control: "select",
|
|
52
|
+
options: ["wrap", "scroll", "moreMenu"]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
args: {
|
|
56
|
+
groups: [
|
|
57
|
+
{
|
|
58
|
+
items: [
|
|
59
|
+
{ label: "取消", onClick: () => console.log("取消") },
|
|
60
|
+
{ label: "确定", priority: "primary", onClick: () => console.log("确定") }
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
var PisellActionPanel_stories_default = meta;
|
|
67
|
+
var Default = {
|
|
68
|
+
args: {
|
|
69
|
+
groups: [
|
|
70
|
+
{
|
|
71
|
+
items: [
|
|
72
|
+
{ label: "取消", onClick: () => console.log("取消") },
|
|
73
|
+
{ label: "确定", priority: "primary", onClick: () => console.log("确定") }
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
var AlignRight = {
|
|
80
|
+
args: {
|
|
81
|
+
groups: [
|
|
82
|
+
{
|
|
83
|
+
items: [
|
|
84
|
+
{ label: "取消", onClick: () => console.log("取消") },
|
|
85
|
+
{ label: "提交", priority: "primary", onClick: () => console.log("提交") }
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
align: "right",
|
|
90
|
+
groupGap: 16,
|
|
91
|
+
itemGap: 8
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
var MultipleGroups = {
|
|
95
|
+
args: {
|
|
96
|
+
groups: [
|
|
97
|
+
{
|
|
98
|
+
items: [
|
|
99
|
+
{ label: "编辑", icon: /* @__PURE__ */ React.createElement(import_icons.EditOutlined, null), onClick: () => console.log("编辑") },
|
|
100
|
+
{ label: "删除", icon: /* @__PURE__ */ React.createElement(import_icons.DeleteOutlined, null), priority: "danger", onClick: () => console.log("删除") }
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
items: [
|
|
105
|
+
{ label: "取消", onClick: () => console.log("取消") },
|
|
106
|
+
{ label: "保存", icon: /* @__PURE__ */ React.createElement(import_icons.SaveOutlined, null), priority: "primary", onClick: () => console.log("保存") }
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
align: "right",
|
|
111
|
+
groupGap: 24,
|
|
112
|
+
itemGap: 8
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
var VerticalLayout = {
|
|
116
|
+
args: {
|
|
117
|
+
layout: "vertical",
|
|
118
|
+
groups: [
|
|
119
|
+
{
|
|
120
|
+
items: [
|
|
121
|
+
{ label: "主操作", priority: "primary", onClick: () => console.log("主操作") },
|
|
122
|
+
{ label: "次操作", onClick: () => console.log("次操作") }
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
var ConditionalVisible = {
|
|
129
|
+
args: {
|
|
130
|
+
groups: [
|
|
131
|
+
{
|
|
132
|
+
items: [
|
|
133
|
+
{ label: "始终显示", onClick: () => {
|
|
134
|
+
} },
|
|
135
|
+
{ label: "隐藏项", visible: false, onClick: () => {
|
|
136
|
+
} },
|
|
137
|
+
{ label: "确定", priority: "primary", onClick: () => {
|
|
138
|
+
} }
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
var AlignCenter = {
|
|
145
|
+
args: {
|
|
146
|
+
align: "center",
|
|
147
|
+
groups: [
|
|
148
|
+
{
|
|
149
|
+
items: [
|
|
150
|
+
{ label: "取消", onClick: () => {
|
|
151
|
+
} },
|
|
152
|
+
{ label: "确定", priority: "primary", onClick: () => {
|
|
153
|
+
} }
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
var SpaceBetween = {
|
|
160
|
+
args: {
|
|
161
|
+
align: "space-between",
|
|
162
|
+
groups: [
|
|
163
|
+
{
|
|
164
|
+
items: [
|
|
165
|
+
{ label: "返回", onClick: () => console.log("返回") }
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
items: [
|
|
170
|
+
{ label: "保存草稿", onClick: () => console.log("草稿") },
|
|
171
|
+
{ label: "发布", priority: "primary", onClick: () => console.log("发布") }
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
178
|
+
0 && (module.exports = {
|
|
179
|
+
AlignCenter,
|
|
180
|
+
AlignRight,
|
|
181
|
+
ConditionalVisible,
|
|
182
|
+
Default,
|
|
183
|
+
MultipleGroups,
|
|
184
|
+
SpaceBetween,
|
|
185
|
+
VerticalLayout
|
|
186
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PisellActionPanel 组件导出
|
|
3
|
+
* 操作面板:统一承载、编排一组用户可执行操作
|
|
4
|
+
*/
|
|
5
|
+
export { PisellActionPanel } from './PisellActionPanel';
|
|
6
|
+
export type { PisellActionPanelProps, PisellActionPanelGroup, PisellActionPanelItem, ActionPanelLayout, ActionPanelAlign, ActionPanelOverflowStrategy, ActionPanelItemPriority, } from './types';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/pisellActionPanel/index.tsx
|
|
20
|
+
var pisellActionPanel_exports = {};
|
|
21
|
+
__export(pisellActionPanel_exports, {
|
|
22
|
+
PisellActionPanel: () => import_PisellActionPanel.PisellActionPanel
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(pisellActionPanel_exports);
|
|
25
|
+
var import_PisellActionPanel = require("./PisellActionPanel");
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
PisellActionPanel
|
|
29
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 操作项层级(主/次/危险)
|
|
4
|
+
*/
|
|
5
|
+
export declare type ActionPanelItemPriority = 'primary' | 'secondary' | 'danger' | 'default';
|
|
6
|
+
/**
|
|
7
|
+
* Action Panel 单条操作项
|
|
8
|
+
* 对应设计文档 Action Item,可渲染为 Button / IconButton
|
|
9
|
+
*/
|
|
10
|
+
export interface PisellActionPanelItem {
|
|
11
|
+
/** 唯一 key,用于 React key;不传则用 index */
|
|
12
|
+
key?: string;
|
|
13
|
+
/** 展示文案(Button 时显示) */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** 图标节点(可单独图标或与 label 同显) */
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
/** 点击回调 */
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
/** 是否禁用 */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** 是否显示(条件显隐) @default true */
|
|
22
|
+
visible?: boolean;
|
|
23
|
+
/** 层级:主/次/危险/默认,影响按钮样式 */
|
|
24
|
+
priority?: ActionPanelItemPriority;
|
|
25
|
+
/** 单项内联样式 */
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
/** 单项类名 */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Action Panel 分组
|
|
32
|
+
* 对应设计文档 Action Group,内包含多个 Action Item
|
|
33
|
+
*/
|
|
34
|
+
export interface PisellActionPanelGroup {
|
|
35
|
+
/** 唯一 key;不传则用 index */
|
|
36
|
+
key?: string;
|
|
37
|
+
/** 本组操作项 */
|
|
38
|
+
items: PisellActionPanelItem[];
|
|
39
|
+
/** 组内整体优先级(可影响组内按钮默认 priority) */
|
|
40
|
+
priority?: ActionPanelItemPriority;
|
|
41
|
+
/** 是否显示该组 @default true */
|
|
42
|
+
visible?: boolean;
|
|
43
|
+
/** 组内对齐方式(组内多个 item 时的对齐) */
|
|
44
|
+
align?: 'start' | 'center' | 'end';
|
|
45
|
+
/** 组容器类名 */
|
|
46
|
+
className?: string;
|
|
47
|
+
/** 组容器样式 */
|
|
48
|
+
style?: CSSProperties;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Panel 布局方式
|
|
52
|
+
*/
|
|
53
|
+
export declare type ActionPanelLayout = 'horizontal' | 'vertical' | 'grid';
|
|
54
|
+
/**
|
|
55
|
+
* Panel 对齐方式
|
|
56
|
+
*/
|
|
57
|
+
export declare type ActionPanelAlign = 'left' | 'center' | 'right' | 'space-between';
|
|
58
|
+
/**
|
|
59
|
+
* 溢出策略:换行 / 滚动 / 更多菜单收纳
|
|
60
|
+
*/
|
|
61
|
+
export declare type ActionPanelOverflowStrategy = 'wrap' | 'scroll' | 'moreMenu';
|
|
62
|
+
/**
|
|
63
|
+
* PisellActionPanel 组件 Props
|
|
64
|
+
* 设计文档:Action Panel (pcp_ge_actionPanel_V1.0)
|
|
65
|
+
*/
|
|
66
|
+
export interface PisellActionPanelProps {
|
|
67
|
+
/** 操作分组列表,顺序即展示顺序 */
|
|
68
|
+
groups: PisellActionPanelGroup[];
|
|
69
|
+
/** 布局方式 @default 'horizontal' */
|
|
70
|
+
layout?: ActionPanelLayout;
|
|
71
|
+
/** 整体对齐方式 @default 'left' */
|
|
72
|
+
align?: ActionPanelAlign;
|
|
73
|
+
/** 溢出策略 @default 'wrap' */
|
|
74
|
+
overflowStrategy?: ActionPanelOverflowStrategy;
|
|
75
|
+
/** 组与组之间的间距(CSS gap 或 number px) */
|
|
76
|
+
groupGap?: number | string;
|
|
77
|
+
/** 组内操作项之间的间距(CSS gap 或 number px) */
|
|
78
|
+
itemGap?: number | string;
|
|
79
|
+
/** 根节点类名 */
|
|
80
|
+
className?: string;
|
|
81
|
+
/** 根节点样式 */
|
|
82
|
+
style?: CSSProperties;
|
|
83
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/components/pisellActionPanel/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PisellBaseCardProps } from './types';
|
|
3
|
+
import './PisellBaseCard.less';
|
|
4
|
+
/**
|
|
5
|
+
* PisellBaseCard 基础卡片容器
|
|
6
|
+
* 提供可定制的容器用于承载子内容,支持默认/悬停/按下/禁用四态样式,可点击时支持焦点与键盘触发
|
|
7
|
+
*/
|
|
8
|
+
export declare function PisellBaseCard({ children, className, style, hoverStyle, activeStyle, disabledStyle, clickable, disabled, onClick, }: PisellBaseCardProps): JSX.Element;
|