@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
|
@@ -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/pisellBaseCard/PisellBaseCard.tsx
|
|
30
|
+
var PisellBaseCard_exports = {};
|
|
31
|
+
__export(PisellBaseCard_exports, {
|
|
32
|
+
PisellBaseCard: () => PisellBaseCard
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(PisellBaseCard_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_PisellBaseCard = require("./PisellBaseCard.less");
|
|
38
|
+
function mergeStateStyle(base, hover, active, disabled, isHover, isActive, isDisabled) {
|
|
39
|
+
let s = { ...base };
|
|
40
|
+
if (isDisabled && disabled) {
|
|
41
|
+
Object.assign(s, disabled);
|
|
42
|
+
return s;
|
|
43
|
+
}
|
|
44
|
+
if (isActive && active) Object.assign(s, active);
|
|
45
|
+
if (isHover && hover) Object.assign(s, hover);
|
|
46
|
+
return s;
|
|
47
|
+
}
|
|
48
|
+
function PisellBaseCard({
|
|
49
|
+
children,
|
|
50
|
+
className,
|
|
51
|
+
style,
|
|
52
|
+
hoverStyle,
|
|
53
|
+
activeStyle,
|
|
54
|
+
disabledStyle,
|
|
55
|
+
clickable = true,
|
|
56
|
+
disabled = false,
|
|
57
|
+
onClick
|
|
58
|
+
}) {
|
|
59
|
+
const [isHover, setIsHover] = (0, import_react.useState)(false);
|
|
60
|
+
const [isActive, setIsActive] = (0, import_react.useState)(false);
|
|
61
|
+
const mergedStyle = mergeStateStyle(
|
|
62
|
+
style,
|
|
63
|
+
hoverStyle,
|
|
64
|
+
activeStyle,
|
|
65
|
+
disabledStyle,
|
|
66
|
+
isHover,
|
|
67
|
+
isActive,
|
|
68
|
+
disabled
|
|
69
|
+
);
|
|
70
|
+
const handleClick = (0, import_react.useCallback)(
|
|
71
|
+
(e) => {
|
|
72
|
+
if (!clickable || disabled) return;
|
|
73
|
+
onClick == null ? void 0 : onClick(e);
|
|
74
|
+
},
|
|
75
|
+
[clickable, disabled, onClick]
|
|
76
|
+
);
|
|
77
|
+
const handleKeyDown = (0, import_react.useCallback)(
|
|
78
|
+
(e) => {
|
|
79
|
+
if (!clickable || disabled) return;
|
|
80
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
e.target.click();
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
[clickable, disabled]
|
|
86
|
+
);
|
|
87
|
+
const handlePointerEnter = (0, import_react.useCallback)(() => {
|
|
88
|
+
if (!disabled) setIsHover(true);
|
|
89
|
+
}, [disabled]);
|
|
90
|
+
const handlePointerLeave = (0, import_react.useCallback)(() => {
|
|
91
|
+
setIsHover(false);
|
|
92
|
+
setIsActive(false);
|
|
93
|
+
}, []);
|
|
94
|
+
const handlePointerDown = (0, import_react.useCallback)(() => {
|
|
95
|
+
if (clickable && !disabled) setIsActive(true);
|
|
96
|
+
}, [clickable, disabled]);
|
|
97
|
+
const handlePointerUp = (0, import_react.useCallback)(() => {
|
|
98
|
+
setIsActive(false);
|
|
99
|
+
}, []);
|
|
100
|
+
const canInteract = clickable && !disabled;
|
|
101
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
className: (0, import_classnames.default)("pisell-base-card-root", className),
|
|
105
|
+
style: mergedStyle,
|
|
106
|
+
"data-clickable": clickable,
|
|
107
|
+
"data-disabled": disabled,
|
|
108
|
+
role: canInteract ? "button" : void 0,
|
|
109
|
+
"aria-disabled": disabled ? true : void 0,
|
|
110
|
+
tabIndex: canInteract ? 0 : void 0,
|
|
111
|
+
onClick: handleClick,
|
|
112
|
+
onKeyDown: handleKeyDown,
|
|
113
|
+
onPointerEnter: handlePointerEnter,
|
|
114
|
+
onPointerLeave: handlePointerLeave,
|
|
115
|
+
onPointerDown: handlePointerDown,
|
|
116
|
+
onPointerUp: handlePointerUp
|
|
117
|
+
},
|
|
118
|
+
children
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
122
|
+
0 && (module.exports = {
|
|
123
|
+
PisellBaseCard
|
|
124
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PisellBaseCard 样式
|
|
3
|
+
* 默认态依设计稿写死:背景 #FFF、边框 #EAECF0、圆角 12px、padding 16px、阴影
|
|
4
|
+
*/
|
|
5
|
+
.pisell-base-card-root {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
/* 设计稿默认:背景、边框、圆角、内边距、阴影 */
|
|
8
|
+
background-color: #ffffff;
|
|
9
|
+
border: 1px solid #eaecf0;
|
|
10
|
+
border-radius: 12px;
|
|
11
|
+
padding: 16px;
|
|
12
|
+
box-shadow: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
|
|
13
|
+
/* 最小 padding 避免内容贴边 */
|
|
14
|
+
min-height: 0;
|
|
15
|
+
min-width: 0;
|
|
16
|
+
|
|
17
|
+
/* 可点击时鼠标指针 */
|
|
18
|
+
&[data-clickable='true'] {
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&[data-disabled='true'] {
|
|
23
|
+
cursor: not-allowed;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { PisellBaseCard } from './PisellBaseCard';
|
|
3
|
+
declare const meta: Meta<typeof PisellBaseCard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
declare type Story = StoryObj<typeof PisellBaseCard>;
|
|
6
|
+
/** 默认:可点击、无内容 */
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
/** 带内容 */
|
|
9
|
+
export declare const WithChildren: Story;
|
|
10
|
+
/** 可点击并带点击回调 */
|
|
11
|
+
export declare const Clickable: Story;
|
|
12
|
+
/** 禁用态 */
|
|
13
|
+
export declare const Disabled: Story;
|
|
14
|
+
/** 不可点击(仅容器) */
|
|
15
|
+
export declare const NotClickable: Story;
|
|
16
|
+
/** 自定义默认样式 */
|
|
17
|
+
export declare const CustomStyle: Story;
|
|
18
|
+
/** 悬停/按下/禁用样式 */
|
|
19
|
+
export declare const StateStyles: Story;
|
|
@@ -0,0 +1,107 @@
|
|
|
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/pisellBaseCard/PisellBaseCard.stories.tsx
|
|
20
|
+
var PisellBaseCard_stories_exports = {};
|
|
21
|
+
__export(PisellBaseCard_stories_exports, {
|
|
22
|
+
Clickable: () => Clickable,
|
|
23
|
+
CustomStyle: () => CustomStyle,
|
|
24
|
+
Default: () => Default,
|
|
25
|
+
Disabled: () => Disabled,
|
|
26
|
+
NotClickable: () => NotClickable,
|
|
27
|
+
StateStyles: () => StateStyles,
|
|
28
|
+
WithChildren: () => WithChildren,
|
|
29
|
+
default: () => PisellBaseCard_stories_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(PisellBaseCard_stories_exports);
|
|
32
|
+
var import_PisellBaseCard = require("./PisellBaseCard");
|
|
33
|
+
var meta = {
|
|
34
|
+
title: "Data Display/PisellBaseCard",
|
|
35
|
+
component: import_PisellBaseCard.PisellBaseCard,
|
|
36
|
+
tags: ["autodocs"],
|
|
37
|
+
argTypes: {
|
|
38
|
+
clickable: {
|
|
39
|
+
description: "是否可点击",
|
|
40
|
+
control: "boolean"
|
|
41
|
+
},
|
|
42
|
+
disabled: {
|
|
43
|
+
description: "是否禁用",
|
|
44
|
+
control: "boolean"
|
|
45
|
+
},
|
|
46
|
+
children: {
|
|
47
|
+
description: "卡片内容",
|
|
48
|
+
control: "text"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var PisellBaseCard_stories_default = meta;
|
|
53
|
+
var Default = {
|
|
54
|
+
args: {}
|
|
55
|
+
};
|
|
56
|
+
var WithChildren = {
|
|
57
|
+
args: {
|
|
58
|
+
children: /* @__PURE__ */ React.createElement("div", { style: { padding: 8 } }, /* @__PURE__ */ React.createElement("div", null, "标题"), /* @__PURE__ */ React.createElement("div", { style: { color: "#666", fontSize: 14 } }, "描述文字"))
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var Clickable = {
|
|
62
|
+
args: {
|
|
63
|
+
children: "点击我",
|
|
64
|
+
onClick: () => alert("卡片被点击")
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var Disabled = {
|
|
68
|
+
args: {
|
|
69
|
+
children: "禁用卡片",
|
|
70
|
+
disabled: true
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var NotClickable = {
|
|
74
|
+
args: {
|
|
75
|
+
children: "不可点击,无 role",
|
|
76
|
+
clickable: false
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
var CustomStyle = {
|
|
80
|
+
args: {
|
|
81
|
+
children: "自定义背景与圆角",
|
|
82
|
+
style: {
|
|
83
|
+
backgroundColor: "#f0f5ff",
|
|
84
|
+
borderRadius: 16,
|
|
85
|
+
padding: 24
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
var StateStyles = {
|
|
90
|
+
args: {
|
|
91
|
+
children: "悬停与按下有样式变化",
|
|
92
|
+
style: { padding: 16 },
|
|
93
|
+
hoverStyle: { backgroundColor: "#e6f4ff", borderColor: "#91caff" },
|
|
94
|
+
activeStyle: { backgroundColor: "#bae0ff" },
|
|
95
|
+
disabledStyle: { opacity: 0.6 }
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
99
|
+
0 && (module.exports = {
|
|
100
|
+
Clickable,
|
|
101
|
+
CustomStyle,
|
|
102
|
+
Default,
|
|
103
|
+
Disabled,
|
|
104
|
+
NotClickable,
|
|
105
|
+
StateStyles,
|
|
106
|
+
WithChildren
|
|
107
|
+
});
|
|
@@ -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/pisellBaseCard/index.tsx
|
|
20
|
+
var pisellBaseCard_exports = {};
|
|
21
|
+
__export(pisellBaseCard_exports, {
|
|
22
|
+
PisellBaseCard: () => import_PisellBaseCard.PisellBaseCard
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(pisellBaseCard_exports);
|
|
25
|
+
var import_PisellBaseCard = require("./PisellBaseCard");
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
PisellBaseCard
|
|
29
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* PisellBaseCard 组件 Props
|
|
4
|
+
* @description 基础卡片容器,支持四态样式与可点击配置,无选中逻辑(选中由低代码处理)
|
|
5
|
+
*/
|
|
6
|
+
export interface PisellBaseCardProps {
|
|
7
|
+
/**
|
|
8
|
+
* 卡片内容,由低代码插槽或直接传入
|
|
9
|
+
*/
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* 自定义类名,应用于根节点
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 默认状态下的内联样式(背景、圆角、边框、阴影、padding、宽高等)
|
|
17
|
+
*/
|
|
18
|
+
style?: CSSProperties;
|
|
19
|
+
/**
|
|
20
|
+
* 悬停时的样式覆盖,与 style 合并后应用
|
|
21
|
+
*/
|
|
22
|
+
hoverStyle?: CSSProperties;
|
|
23
|
+
/**
|
|
24
|
+
* 按下(active)时的样式覆盖,与 style 合并后应用
|
|
25
|
+
*/
|
|
26
|
+
activeStyle?: CSSProperties;
|
|
27
|
+
/**
|
|
28
|
+
* 禁用时的样式覆盖,与 style 合并后应用
|
|
29
|
+
*/
|
|
30
|
+
disabledStyle?: CSSProperties;
|
|
31
|
+
/**
|
|
32
|
+
* 是否可点击(可聚焦并触发 onClick)
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
clickable?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 是否禁用,禁用时应用 disabledStyle 且不响应点击与焦点
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 点击回调,仅在 clickable 且非 disabled 时触发
|
|
43
|
+
*/
|
|
44
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
45
|
+
}
|
|
@@ -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/pisellBaseCard/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -34,24 +34,30 @@ __export(PisellCurrency_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(PisellCurrency_exports);
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_antd = require("antd");
|
|
37
38
|
var import_utils = require("@pisell/utils");
|
|
38
39
|
var import_ReadOnlyView = __toESM(require("./components/ReadOnlyView"));
|
|
39
40
|
var import_EditView = __toESM(require("./components/EditView"));
|
|
40
41
|
var import_DisabledView = __toESM(require("./components/DisabledView"));
|
|
42
|
+
var import_pisell_components = require("../../theme/pisell-components");
|
|
41
43
|
var import_PisellCurrency = require("./PisellCurrency.less");
|
|
42
44
|
var PisellCurrency = (props) => {
|
|
43
45
|
const { mode = "edit", disabled = false } = props;
|
|
44
46
|
const displayState = (0, import_utils.getDisplayState)(mode, disabled);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
const render = () => {
|
|
48
|
+
switch (displayState) {
|
|
49
|
+
case "read":
|
|
50
|
+
return /* @__PURE__ */ import_react.default.createElement(import_ReadOnlyView.default, { ...props });
|
|
51
|
+
case "edit":
|
|
52
|
+
return /* @__PURE__ */ import_react.default.createElement(import_EditView.default, { ...props });
|
|
53
|
+
case "disabled":
|
|
54
|
+
return /* @__PURE__ */ import_react.default.createElement(import_DisabledView.default, { ...props });
|
|
55
|
+
default:
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const theme = (0, import_pisell_components.getPisellComponentsThemeConfig)();
|
|
60
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.ConfigProvider, { theme }, render());
|
|
55
61
|
};
|
|
56
62
|
var MemoizedPisellCurrency = import_react.default.memo(PisellCurrency, (prevProps, nextProps) => {
|
|
57
63
|
return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled && prevProps.currencySymbol === nextProps.currencySymbol && prevProps.symbolPosition === nextProps.symbolPosition;
|
|
@@ -10,129 +10,6 @@
|
|
|
10
10
|
&-edit {
|
|
11
11
|
position: relative;
|
|
12
12
|
width: 100%;
|
|
13
|
-
|
|
14
|
-
// InputNumber 外层(Figma 设计规范,无边框避免双边框)
|
|
15
|
-
.pisell-lowcode-input-number {
|
|
16
|
-
width: 100% !important;
|
|
17
|
-
font-size: 16px !important;
|
|
18
|
-
line-height: 24px !important;
|
|
19
|
-
border-radius: 8px !important;
|
|
20
|
-
border: none !important;
|
|
21
|
-
color: #101828 !important; // Gray/900
|
|
22
|
-
background-color: #ffffff !important;
|
|
23
|
-
|
|
24
|
-
// 内层 input
|
|
25
|
-
.pisell-lowcode-input-number-input {
|
|
26
|
-
height: 46px !important; // 48 - 2px border
|
|
27
|
-
padding: 12px 16px !important;
|
|
28
|
-
font-size: 16px !important;
|
|
29
|
-
line-height: 24px !important;
|
|
30
|
-
color: #101828 !important;
|
|
31
|
-
background: transparent !important;
|
|
32
|
-
border: none !important;
|
|
33
|
-
|
|
34
|
-
&::placeholder {
|
|
35
|
-
color: #667085 !important; // Gray/500
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// 聚焦态
|
|
40
|
-
&.pisell-lowcode-input-number-focused,
|
|
41
|
-
&:focus,
|
|
42
|
-
&:focus-within {
|
|
43
|
-
border-color: #d6bbfb !important; // Primary/300
|
|
44
|
-
box-shadow: 0 0 0 4px #f4ebff !important; // Primary/100
|
|
45
|
-
outline: none !important;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Hover 态
|
|
49
|
-
&:hover:not(.pisell-lowcode-input-number-disabled):not(.pisell-lowcode-input-number-focused) {
|
|
50
|
-
border-color: #b692f6 !important; // Primary/400
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// 禁用态
|
|
54
|
-
&.pisell-lowcode-input-number-disabled {
|
|
55
|
-
background-color: #f9fafb !important; // Gray/50
|
|
56
|
-
border-color: #d0d5dd !important;
|
|
57
|
-
cursor: not-allowed !important;
|
|
58
|
-
|
|
59
|
-
.pisell-lowcode-input-number-input {
|
|
60
|
-
color: #98a2b3 !important; // Gray/400
|
|
61
|
-
cursor: not-allowed !important;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// 货币符号:前缀
|
|
66
|
-
.pisell-lowcode-input-number-prefix {
|
|
67
|
-
margin-right: 8px;
|
|
68
|
-
margin-left: 16px;
|
|
69
|
-
color: #667085; // Gray/500
|
|
70
|
-
font-size: 16px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// 货币符号:后置(addonAfter)
|
|
74
|
-
.pisell-lowcode-input-number-suffix {
|
|
75
|
-
margin-left: 8px;
|
|
76
|
-
margin-right: 16px;
|
|
77
|
-
color: #667085;
|
|
78
|
-
font-size: 16px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// addonBefore / addonAfter 包裹(InputNumber 后置符号可能用 addon 渲染)
|
|
82
|
-
.pisell-lowcode-input-number-group-addon {
|
|
83
|
-
background-color: #ffffff !important;
|
|
84
|
-
border: 1px solid #d0d5dd !important;
|
|
85
|
-
color: #344054; // Gray/700
|
|
86
|
-
font-size: 16px !important;
|
|
87
|
-
padding: 12px 16px !important;
|
|
88
|
-
|
|
89
|
-
&:first-child {
|
|
90
|
-
border-right: none !important;
|
|
91
|
-
border-radius: 8px 0 0 8px !important;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&:last-child {
|
|
95
|
-
border-left: none !important;
|
|
96
|
-
border-radius: 0 8px 8px 0 !important;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// 步进器按钮(controls)
|
|
101
|
-
.pisell-lowcode-input-number-handler-wrap {
|
|
102
|
-
border-left: 1px solid #d0d5dd !important;
|
|
103
|
-
background: #ffffff !important;
|
|
104
|
-
|
|
105
|
-
.pisell-lowcode-input-number-handler {
|
|
106
|
-
color: #667085;
|
|
107
|
-
border-color: #d0d5dd;
|
|
108
|
-
|
|
109
|
-
&:hover {
|
|
110
|
-
color: #344054;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
&.pisell-lowcode-input-number-handler-up-disabled,
|
|
114
|
-
&.pisell-lowcode-input-number-handler-down-disabled {
|
|
115
|
-
color: #98a2b3;
|
|
116
|
-
cursor: not-allowed;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// 错误状态
|
|
122
|
-
&.pisell-lowcode-input-number-status-error {
|
|
123
|
-
border-color: #fda29b !important; // Error/300
|
|
124
|
-
|
|
125
|
-
&.pisell-lowcode-input-number-focused,
|
|
126
|
-
&:focus-within {
|
|
127
|
-
border-color: #f97066 !important; // Error/400
|
|
128
|
-
box-shadow: 0 0 0 4px #fee4e2 !important; // Error/100
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&:hover:not(:focus-within) {
|
|
132
|
-
border-color: #f97066 !important;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
13
|
}
|
|
137
14
|
|
|
138
15
|
// 错误提示(与设计体系一致)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PisellCustomerBriefProps } from './types';
|
|
3
|
+
import './PisellCustomerBrief.less';
|
|
4
|
+
/**
|
|
5
|
+
* PisellCustomerBrief 客户简要卡片
|
|
6
|
+
* 基于 PisellEntityCard,用于展示客户(Customer)实体的核心识别信息与客户级属性。
|
|
7
|
+
* 设计文档:Customer Info (pcl_customerInfon_V1.0)
|
|
8
|
+
*
|
|
9
|
+
* - 无头像时显示默认占位 Avatar
|
|
10
|
+
* - 文本过长按配置省略
|
|
11
|
+
* - Actions 为空时不占位
|
|
12
|
+
*
|
|
13
|
+
* @param props 组件 Props
|
|
14
|
+
*/
|
|
15
|
+
export declare function PisellCustomerBrief({ name, subtitle, avatar, email, address, company, date, extendedFields, tags, actions, showActions, showAvatar, showPrimaryText, showSubtitle, showExtended, showTags, density, layout, width, swipeToDelete, onDelete, tagPosition, contentGap, primaryLineClamp, secondaryLineClamp, renderMedia, renderPrimary, renderSubtitle, renderSecondary, renderTags, renderActions, className, style, hoverStyle, activeStyle, disabledStyle, clickable, disabled, onClick, }: PisellCustomerBriefProps): JSX.Element;
|