@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
|
@@ -34,24 +34,30 @@ __export(PisellLongText_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(PisellLongText_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_PisellLongText = require("./PisellLongText.less");
|
|
42
44
|
var PisellLongText = (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 PisellLongText_default = import_react.default.memo(PisellLongText, (prevProps, nextProps) => {
|
|
57
63
|
return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled;
|
|
@@ -7,73 +7,6 @@
|
|
|
7
7
|
&-edit {
|
|
8
8
|
position: relative;
|
|
9
9
|
width: 100%;
|
|
10
|
-
|
|
11
|
-
// TextArea 样式(Figma 设计规范,覆盖时使用 pisell-lowcode-xxx)
|
|
12
|
-
.pisell-lowcode-input {
|
|
13
|
-
// 基础样式
|
|
14
|
-
font-size: 16px !important;
|
|
15
|
-
line-height: 24px !important;
|
|
16
|
-
|
|
17
|
-
// 边框和圆角
|
|
18
|
-
border-radius: 8px !important;
|
|
19
|
-
border: 1px solid #d0d5dd !important; // Gray/300
|
|
20
|
-
|
|
21
|
-
// 内边距(Figma: 垂直 12px,水平 14px)
|
|
22
|
-
padding: 12px 14px !important;
|
|
23
|
-
min-height: 80px !important; // 多行最小高度,由 rows 进一步控制
|
|
24
|
-
|
|
25
|
-
// 颜色
|
|
26
|
-
color: #101828 !important; // Gray/900
|
|
27
|
-
background-color: #ffffff !important;
|
|
28
|
-
|
|
29
|
-
&::placeholder {
|
|
30
|
-
color: #667085 !important; // Gray/500
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// 聚焦态
|
|
34
|
-
&:focus,
|
|
35
|
-
&:focus-within {
|
|
36
|
-
border-color: #d6bbfb !important; // Primary/300
|
|
37
|
-
box-shadow: 0 0 0 4px #f4ebff !important; // Primary/100
|
|
38
|
-
outline: none !important;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Hover 态
|
|
42
|
-
&:hover:not(:focus):not(:focus-within):not([disabled]) {
|
|
43
|
-
border-color: #b692f6 !important; // Primary/400
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// 禁用态
|
|
47
|
-
&[disabled],
|
|
48
|
-
&.pisell-lowcode-input-disabled {
|
|
49
|
-
background-color: #f9fafb !important; // Gray/50
|
|
50
|
-
color: #98a2b3 !important; // Gray/400
|
|
51
|
-
border-color: #d0d5dd !important;
|
|
52
|
-
cursor: not-allowed !important;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// 字数统计样式(TextArea showCount)
|
|
57
|
-
.pisell-lowcode-input-data-count,
|
|
58
|
-
.pisell-lowcode-input-show-count-suffix {
|
|
59
|
-
color: #667085 !important; // Gray/500
|
|
60
|
-
font-size: 14px !important;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// 错误状态
|
|
64
|
-
.pisell-lowcode-input-status-error {
|
|
65
|
-
border-color: #fda29b !important; // Error/300
|
|
66
|
-
|
|
67
|
-
&:focus,
|
|
68
|
-
&:focus-within {
|
|
69
|
-
border-color: #f97066 !important; // Error/400
|
|
70
|
-
box-shadow: 0 0 0 4px #fee4e2 !important; // Error/100
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
&:hover:not(:focus):not(:focus-within) {
|
|
74
|
-
border-color: #f97066 !important; // Error/400
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
10
|
}
|
|
78
11
|
|
|
79
12
|
&-error {
|
|
@@ -271,11 +271,15 @@ var PisellLookupComponent = (0, import_react.forwardRef)((props, ref) => {
|
|
|
271
271
|
}, [setKeyword, onSearch, debounceTime]);
|
|
272
272
|
const handleScan = (0, import_react.useCallback)(
|
|
273
273
|
(code) => {
|
|
274
|
+
isManualSelectRef.current = true;
|
|
274
275
|
setKeyword(code);
|
|
275
276
|
handleConfirmSearch(code);
|
|
276
277
|
onScan == null ? void 0 : onScan(code);
|
|
278
|
+
setTimeout(() => {
|
|
279
|
+
isManualSelectRef.current = false;
|
|
280
|
+
}, debounceTime + 100);
|
|
277
281
|
},
|
|
278
|
-
[setKeyword, handleConfirmSearch, onScan]
|
|
282
|
+
[setKeyword, handleConfirmSearch, onScan, debounceTime]
|
|
279
283
|
);
|
|
280
284
|
const handleSelectAuxiliary = (0, import_react.useCallback)(
|
|
281
285
|
(selectedKeyword) => {
|
|
@@ -39,59 +39,68 @@ var import_EditView = __toESM(require("./components/EditView"));
|
|
|
39
39
|
var import_DisabledView = __toESM(require("./components/DisabledView"));
|
|
40
40
|
var import_ReadOnlyView = __toESM(require("./components/ReadOnlyView"));
|
|
41
41
|
var import_PisellMultipleSelect = require("./PisellMultipleSelect.less");
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
return /* @__PURE__ */ import_react.default.createElement(import_EditView.default, { ...props, value: state.value, state, onChangeInternal: handleChange, ref: selectRef });
|
|
42
|
+
var import_pisell_components = require("../../theme/pisell-components");
|
|
43
|
+
var PisellMultipleSelect = (0, import_react.forwardRef)((props, ref) => {
|
|
44
|
+
const {
|
|
45
|
+
value,
|
|
46
|
+
defaultValue,
|
|
47
|
+
onChange,
|
|
48
|
+
options,
|
|
49
|
+
disabled,
|
|
50
|
+
readOnly,
|
|
51
|
+
maxCount
|
|
52
|
+
} = props;
|
|
53
|
+
const selectRef = (0, import_react.useRef)(null);
|
|
54
|
+
const state = (0, import_utils.useMultipleSelectState)({
|
|
55
|
+
value,
|
|
56
|
+
defaultValue,
|
|
57
|
+
onChange,
|
|
58
|
+
mode: "multiple"
|
|
59
|
+
});
|
|
60
|
+
const handleChange = (0, import_react.useCallback)(
|
|
61
|
+
(newValue) => {
|
|
62
|
+
if (maxCount && newValue.length > maxCount) {
|
|
63
|
+
import_antd.message.warning(`最多只能选择 ${maxCount} 项`);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const selectedOptions = newValue.map((v) => options.find((opt) => opt.value === v)).filter(Boolean);
|
|
67
|
+
state.setValue(newValue);
|
|
68
|
+
onChange == null ? void 0 : onChange(newValue, selectedOptions);
|
|
69
|
+
},
|
|
70
|
+
[maxCount, onChange, options, state]
|
|
71
|
+
);
|
|
72
|
+
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
73
|
+
focus: () => {
|
|
74
|
+
var _a;
|
|
75
|
+
return (_a = selectRef.current) == null ? void 0 : _a.focus();
|
|
76
|
+
},
|
|
77
|
+
blur: () => {
|
|
78
|
+
var _a;
|
|
79
|
+
return (_a = selectRef.current) == null ? void 0 : _a.blur();
|
|
80
|
+
},
|
|
81
|
+
getValue: () => state.value,
|
|
82
|
+
setValue: (newValue) => state.setValue(newValue),
|
|
83
|
+
clearValue: () => state.clearValue(),
|
|
84
|
+
addValue: (val) => state.addValue(val),
|
|
85
|
+
removeValue: (val) => state.removeValue(val)
|
|
86
|
+
}));
|
|
87
|
+
const theme = (0, import_pisell_components.getPisellComponentsThemeConfig)();
|
|
88
|
+
if (disabled) {
|
|
89
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.ConfigProvider, { theme }, /* @__PURE__ */ import_react.default.createElement(import_DisabledView.default, { ...props, ref: selectRef }));
|
|
90
|
+
}
|
|
91
|
+
if (readOnly) {
|
|
92
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.ConfigProvider, { theme }, /* @__PURE__ */ import_react.default.createElement(import_ReadOnlyView.default, { ...props }));
|
|
94
93
|
}
|
|
95
|
-
|
|
94
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.ConfigProvider, { theme }, /* @__PURE__ */ import_react.default.createElement(
|
|
95
|
+
import_EditView.default,
|
|
96
|
+
{
|
|
97
|
+
...props,
|
|
98
|
+
value: state.value,
|
|
99
|
+
state,
|
|
100
|
+
onChangeInternal: handleChange,
|
|
101
|
+
ref: selectRef
|
|
102
|
+
}
|
|
103
|
+
));
|
|
104
|
+
});
|
|
96
105
|
PisellMultipleSelect.displayName = "PisellMultipleSelect";
|
|
97
106
|
var PisellMultipleSelect_default = PisellMultipleSelect;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
.pisell-multiple-select {
|
|
7
|
-
height: 48px !important;
|
|
8
7
|
width: 100%;
|
|
9
8
|
|
|
10
9
|
.pisell-lowcode-select-clear {
|
|
@@ -22,88 +21,11 @@
|
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
// Select 触发器(Figma 设计规范,与 SingleSelect / Input 体系一致)
|
|
26
|
-
.pisell-lowcode-select:not(.pisell-lowcode-select-disabled):not(.pisell-lowcode-select-customize-input) {
|
|
27
|
-
.pisell-lowcode-select-selector {
|
|
28
|
-
font-size: 16px !important;
|
|
29
|
-
line-height: 24px !important;
|
|
30
|
-
border-radius: 8px !important;
|
|
31
|
-
border: 1px solid #d0d5dd !important; // Gray/300
|
|
32
|
-
padding: 12px 16px !important;
|
|
33
|
-
min-height: 48px !important;
|
|
34
|
-
color: #101828 !important; // Gray/900
|
|
35
|
-
background-color: #ffffff !important;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// 多选模式:内边距适配标签,高度保持 48px
|
|
39
|
-
&.pisell-lowcode-select-multiple .pisell-lowcode-select-selector {
|
|
40
|
-
padding: 6px 16px !important;
|
|
41
|
-
min-height: 48px !important;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&.pisell-lowcode-select-open .pisell-lowcode-select-selector {
|
|
45
|
-
border-color: #d6bbfb !important; // Primary/300
|
|
46
|
-
box-shadow: 0 0 0 4px #f4ebff !important; // Primary/100
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&:not(.pisell-lowcode-select-open):not(.pisell-lowcode-select-disabled)
|
|
50
|
-
.pisell-lowcode-select-selector:hover {
|
|
51
|
-
border-color: #b692f6 !important; // Primary/400
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&.pisell-lowcode-select-disabled .pisell-lowcode-select-selector {
|
|
55
|
-
background-color: #f9fafb !important; // Gray/50
|
|
56
|
-
color: #98a2b3 !important; // Gray/400
|
|
57
|
-
border-color: #d0d5dd !important;
|
|
58
|
-
cursor: not-allowed !important;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.pisell-lowcode-select-selection-placeholder {
|
|
62
|
-
color: #667085 !important; // Gray/500
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.pisell-lowcode-select-arrow {
|
|
66
|
-
color: #667085;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
// 多选标签(选择后展示的 item)高度 36px
|
|
71
|
-
.pisell-lowcode-select-selection-item {
|
|
72
|
-
border-radius: 6px !important;
|
|
73
|
-
padding: 0 10px !important;
|
|
74
|
-
margin-inline-end: 4px !important;
|
|
75
|
-
height: 36px !important;
|
|
76
|
-
min-height: 36px !important;
|
|
77
|
-
line-height: 36px !important;
|
|
78
|
-
|
|
79
|
-
&-content {
|
|
80
|
-
line-height: 36px !important;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
&-remove {
|
|
84
|
-
margin-left: 4px !important;
|
|
85
|
-
|
|
86
|
-
&:hover {
|
|
87
|
-
background-color: transparent !important;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
24
|
&-wrapper {
|
|
94
25
|
display: flex;
|
|
95
26
|
flex-direction: column;
|
|
96
27
|
gap: 8px;
|
|
97
28
|
position: relative;
|
|
98
|
-
|
|
99
|
-
// 下拉选项高度 48px(通过 getPopupContainer 挂到 wrapper 内,无需 :global)
|
|
100
|
-
.pisell-multiple-select-dropdown .pisell-lowcode-select-item {
|
|
101
|
-
min-height: 48px !important;
|
|
102
|
-
height: 48px !important;
|
|
103
|
-
line-height: 48px !important;
|
|
104
|
-
padding: 0 16px !important;
|
|
105
|
-
font-size: 16px !important;
|
|
106
|
-
}
|
|
107
29
|
}
|
|
108
30
|
|
|
109
31
|
&-label {
|
|
@@ -147,42 +69,25 @@
|
|
|
147
69
|
margin-left: 8px;
|
|
148
70
|
}
|
|
149
71
|
|
|
150
|
-
// 错误状态(Figma 设计体系 Error 色)
|
|
151
|
-
&-error {
|
|
152
|
-
.pisell-lowcode-select .pisell-lowcode-select-selector {
|
|
153
|
-
border-color: #fda29b !important; // Error/300
|
|
154
|
-
|
|
155
|
-
&:hover {
|
|
156
|
-
border-color: #f97066 !important; // Error/400
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.pisell-lowcode-select.pisell-lowcode-select-focused .pisell-lowcode-select-selector,
|
|
161
|
-
.pisell-lowcode-select.pisell-lowcode-select-open .pisell-lowcode-select-selector {
|
|
162
|
-
border-color: #f97066 !important; // Error/400
|
|
163
|
-
box-shadow: 0 0 0 4px #fee4e2 !important; // Error/100
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
72
|
// 聚合标签(maxTagPlaceholder)
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
73
|
+
//&-more-tag {
|
|
74
|
+
// display: inline-flex;
|
|
75
|
+
// align-items: center;
|
|
76
|
+
// background-color: #eaecf0;
|
|
77
|
+
// color: #344054; // Gray/700
|
|
78
|
+
// border: none;
|
|
79
|
+
// border-radius: 6px;
|
|
80
|
+
// padding: 6px 10px;
|
|
81
|
+
// font-size: 16px;
|
|
82
|
+
// font-weight: 500;
|
|
83
|
+
// line-height: 24px;
|
|
84
|
+
// cursor: pointer;
|
|
85
|
+
// transition: background-color 0.2s ease;
|
|
86
|
+
//
|
|
87
|
+
// &:hover {
|
|
88
|
+
// background-color: #d0d5dd; // Gray/300
|
|
89
|
+
// }
|
|
90
|
+
//}
|
|
186
91
|
|
|
187
92
|
// 只读状态
|
|
188
93
|
&-readonly {
|
|
@@ -228,32 +133,6 @@
|
|
|
228
133
|
}
|
|
229
134
|
}
|
|
230
135
|
|
|
231
|
-
// 下拉内搜索框(在 dropdown 内)
|
|
232
|
-
.pisell-select-search-wrapper {
|
|
233
|
-
padding: 6px;
|
|
234
|
-
border-bottom: 1px solid #eaecf0;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.pisell-select-search-input {
|
|
238
|
-
padding: 9px 10px !important;
|
|
239
|
-
font-size: 14px;
|
|
240
|
-
|
|
241
|
-
.pisell-lowcode-input {
|
|
242
|
-
font-size: 14px !important;
|
|
243
|
-
color: #344054 !important;
|
|
244
|
-
|
|
245
|
-
&::placeholder {
|
|
246
|
-
color: #98a2b3 !important;
|
|
247
|
-
font-size: 12px !important;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
&:hover,
|
|
252
|
-
&:focus-within {
|
|
253
|
-
background-color: transparent !important;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
136
|
@keyframes pisell-multiple-select-fadeIn {
|
|
258
137
|
from {
|
|
259
138
|
opacity: 0;
|
|
@@ -121,38 +121,50 @@ var EditView = (0, import_react.forwardRef)((props, ref) => {
|
|
|
121
121
|
},
|
|
122
122
|
[options, showTooltipOnOverflow]
|
|
123
123
|
);
|
|
124
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
125
|
-
"
|
|
124
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
125
|
+
"div",
|
|
126
126
|
{
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
ref: wrapperRef,
|
|
128
|
+
className: (0, import_classnames.default)("pisell-multiple-select-wrapper", className),
|
|
129
|
+
style
|
|
130
130
|
},
|
|
131
|
-
label
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
131
|
+
label && /* @__PURE__ */ import_react.default.createElement(
|
|
132
|
+
"label",
|
|
133
|
+
{
|
|
134
|
+
className: (0, import_classnames.default)("pisell-multiple-select-label", {
|
|
135
|
+
"pisell-multiple-select-label-required": required
|
|
136
|
+
})
|
|
137
|
+
},
|
|
138
|
+
label
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
141
|
+
import_antd.Select,
|
|
142
|
+
{
|
|
143
|
+
...restProps,
|
|
144
|
+
ref,
|
|
145
|
+
open: true,
|
|
146
|
+
mode: "multiple",
|
|
147
|
+
value,
|
|
148
|
+
options: filteredAntdOptions,
|
|
149
|
+
placeholder,
|
|
150
|
+
showSearch: false,
|
|
151
|
+
allowClear,
|
|
152
|
+
menuItemSelectedIcon,
|
|
153
|
+
dropdownRender,
|
|
154
|
+
onChange: onChangeInternal,
|
|
155
|
+
maxTagCount,
|
|
156
|
+
maxTagPlaceholder,
|
|
157
|
+
size,
|
|
158
|
+
popupClassName: "pisell-multiple-select-dropdown",
|
|
159
|
+
getPopupContainer: () => wrapperRef.current ?? document.body,
|
|
160
|
+
className: (0, import_classnames.default)("pisell-multiple-select", {
|
|
161
|
+
"pisell-multiple-select-error": error
|
|
162
|
+
})
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
helperText && !error && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-multiple-select-helper-text" }, helperText),
|
|
166
|
+
error && errorText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-multiple-select-error-text" }, errorText)
|
|
167
|
+
);
|
|
156
168
|
});
|
|
157
169
|
EditView.displayName = "PisellMultipleSelectEditView";
|
|
158
170
|
var EditView_default = EditView;
|
|
@@ -34,24 +34,30 @@ __export(PisellNumber_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(PisellNumber_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_PisellNumber = require("./PisellNumber.less");
|
|
42
44
|
var PisellNumber = (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 MemoizedPisellNumber = import_react.default.memo(PisellNumber, (prevProps, nextProps) => {
|
|
57
63
|
return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled;
|
|
@@ -10,109 +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: 1px solid #d0d5dd !important; // Gray/300
|
|
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;
|
|
70
|
-
font-size: 16px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.pisell-lowcode-input-number-suffix {
|
|
74
|
-
margin-left: 8px;
|
|
75
|
-
margin-right: 16px;
|
|
76
|
-
color: #667085;
|
|
77
|
-
font-size: 16px;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// 步进器按钮(controls)
|
|
81
|
-
.pisell-lowcode-input-number-handler-wrap {
|
|
82
|
-
border-left: 1px solid #d0d5dd !important;
|
|
83
|
-
background: #ffffff !important;
|
|
84
|
-
|
|
85
|
-
.pisell-lowcode-input-number-handler {
|
|
86
|
-
color: #667085;
|
|
87
|
-
border-color: #d0d5dd;
|
|
88
|
-
|
|
89
|
-
&:hover {
|
|
90
|
-
color: #344054;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
&.pisell-lowcode-input-number-handler-up-disabled,
|
|
94
|
-
&.pisell-lowcode-input-number-handler-down-disabled {
|
|
95
|
-
color: #98a2b3;
|
|
96
|
-
cursor: not-allowed;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// 错误状态
|
|
102
|
-
&.pisell-lowcode-input-number-status-error {
|
|
103
|
-
border-color: #fda29b !important; // Error/300
|
|
104
|
-
|
|
105
|
-
&.pisell-lowcode-input-number-focused,
|
|
106
|
-
&:focus-within {
|
|
107
|
-
border-color: #f97066 !important; // Error/400
|
|
108
|
-
box-shadow: 0 0 0 4px #fee4e2 !important; // Error/100
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
&:hover:not(:focus-within) {
|
|
112
|
-
border-color: #f97066 !important;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
13
|
}
|
|
117
14
|
|
|
118
15
|
// 错误提示(与设计体系一致)
|