@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(PisellPhone_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(PisellPhone_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_PisellPhone = require("./PisellPhone.less");
|
|
42
44
|
var PisellPhone = (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 PisellPhone_default = import_react.default.memo(PisellPhone, (prevProps, nextProps) => {
|
|
57
63
|
return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled && prevProps.countryCode === nextProps.countryCode;
|
|
@@ -7,125 +7,6 @@
|
|
|
7
7
|
&-edit {
|
|
8
8
|
position: relative;
|
|
9
9
|
width: 100%;
|
|
10
|
-
|
|
11
|
-
.pisell-lowcode-space-compact {
|
|
12
|
-
width: 100%;
|
|
13
|
-
position: relative;
|
|
14
|
-
border-radius: 8px;
|
|
15
|
-
|
|
16
|
-
// 聚焦时整体外圈(与 SingleLineText 一致)
|
|
17
|
-
&:focus-within {
|
|
18
|
-
box-shadow: 0 0 0 4px #f4ebff; // Primary/100
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// 国家码 Select 与 号码 Input 共用 Figma 设计 token
|
|
23
|
-
.pisell-lowcode-select-selector,
|
|
24
|
-
.pisell-lowcode-input {
|
|
25
|
-
font-size: 16px !important;
|
|
26
|
-
line-height: 24px !important;
|
|
27
|
-
border: 1px solid #d0d5dd !important; // Gray/300
|
|
28
|
-
color: #101828 !important; // Gray/900
|
|
29
|
-
background-color: #ffffff !important;
|
|
30
|
-
height: 48px !important;
|
|
31
|
-
padding: 12px 16px !important;
|
|
32
|
-
|
|
33
|
-
&::placeholder {
|
|
34
|
-
color: #667085 !important; // Gray/500
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&:hover:not(:focus):not(.pisell-lowcode-select-open):not([disabled]) {
|
|
38
|
-
border-color: #b692f6 !important; // Primary/400
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&[disabled],
|
|
42
|
-
&.pisell-lowcode-input-disabled {
|
|
43
|
-
background-color: #f9fafb !important; // Gray/50
|
|
44
|
-
color: #98a2b3 !important; // Gray/400
|
|
45
|
-
border-color: #d0d5dd !important;
|
|
46
|
-
cursor: not-allowed !important;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// 国家码选择器:左侧部分,去掉右侧边框与圆角
|
|
51
|
-
.pisell-lowcode-select {
|
|
52
|
-
flex-shrink: 0;
|
|
53
|
-
|
|
54
|
-
.pisell-lowcode-select-selector {
|
|
55
|
-
border-right: none !important;
|
|
56
|
-
border-top-right-radius: 0 !important;
|
|
57
|
-
border-bottom-right-radius: 0 !important;
|
|
58
|
-
border-top-left-radius: 8px !important;
|
|
59
|
-
border-bottom-left-radius: 8px !important;
|
|
60
|
-
min-height: 48px !important;
|
|
61
|
-
padding: 4px 12px 4px 16px !important;
|
|
62
|
-
align-items: center !important;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&.pisell-lowcode-select-focused .pisell-lowcode-select-selector {
|
|
66
|
-
border-color: #d6bbfb !important; // Primary/300
|
|
67
|
-
box-shadow: none !important;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// 号码输入框:右侧部分,去掉左侧边框与圆角
|
|
72
|
-
.pisell-lowcode-input {
|
|
73
|
-
flex: 1;
|
|
74
|
-
border-left: none !important;
|
|
75
|
-
border-top-left-radius: 0 !important;
|
|
76
|
-
border-bottom-left-radius: 0 !important;
|
|
77
|
-
border-top-right-radius: 8px !important;
|
|
78
|
-
border-bottom-right-radius: 8px !important;
|
|
79
|
-
|
|
80
|
-
&:focus {
|
|
81
|
-
border-color: #d6bbfb !important; // Primary/300
|
|
82
|
-
box-shadow: none !important;
|
|
83
|
-
outline: none !important;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// 整体聚焦时两侧边框统一为 Primary
|
|
88
|
-
.pisell-lowcode-space-compact:focus-within .pisell-lowcode-select-selector,
|
|
89
|
-
.pisell-lowcode-space-compact:focus-within .pisell-lowcode-input {
|
|
90
|
-
border-color: #d6bbfb !important;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.pisell-lowcode-space-compact:focus-within .pisell-lowcode-select-selector {
|
|
94
|
-
box-shadow: none !important;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// 清空按钮
|
|
98
|
-
.pisell-lowcode-input-clear-icon {
|
|
99
|
-
color: #667085 !important;
|
|
100
|
-
font-size: 14px !important;
|
|
101
|
-
|
|
102
|
-
&:hover {
|
|
103
|
-
color: #344054 !important; // Gray/700
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// 错误状态:Select + Input 整体
|
|
108
|
-
.pisell-lowcode-select-status-error .pisell-lowcode-select-selector,
|
|
109
|
-
.pisell-lowcode-input-status-error {
|
|
110
|
-
border-color: #fda29b !important; // Error/300
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.pisell-lowcode-space-compact:has(.pisell-lowcode-select-status-error) .pisell-lowcode-select-selector,
|
|
114
|
-
.pisell-lowcode-space-compact:has(.pisell-lowcode-input-status-error) .pisell-lowcode-input {
|
|
115
|
-
border-color: #fda29b !important;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.pisell-lowcode-space-compact:focus-within:has(.pisell-lowcode-input-status-error) .pisell-lowcode-select-selector,
|
|
119
|
-
.pisell-lowcode-space-compact:focus-within:has(.pisell-lowcode-input-status-error) .pisell-lowcode-input,
|
|
120
|
-
.pisell-lowcode-space-compact:focus-within:has(.pisell-lowcode-select-status-error) .pisell-lowcode-select-selector,
|
|
121
|
-
.pisell-lowcode-space-compact:focus-within:has(.pisell-lowcode-select-status-error) .pisell-lowcode-input {
|
|
122
|
-
border-color: #f97066 !important; // Error/400
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.pisell-lowcode-space-compact:focus-within:has(.pisell-lowcode-input-status-error),
|
|
126
|
-
.pisell-lowcode-space-compact:focus-within:has(.pisell-lowcode-select-status-error) {
|
|
127
|
-
box-shadow: 0 0 0 4px #fee4e2 !important; // Error/100
|
|
128
|
-
}
|
|
129
10
|
}
|
|
130
11
|
|
|
131
12
|
&-error {
|
|
@@ -57,36 +57,52 @@ var EditView = (props) => {
|
|
|
57
57
|
setCountryCode(code);
|
|
58
58
|
(_a = props.onCountryCodeChange) == null ? void 0 : _a.call(props, code);
|
|
59
59
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
optionFilterProp: "children",
|
|
68
|
-
className: "pisell-phone-country-select",
|
|
69
|
-
optionLabelProp: "value",
|
|
70
|
-
popupMatchSelectWidth: false,
|
|
71
|
-
dropdownStyle: { minWidth: 200 }
|
|
72
|
-
},
|
|
73
|
-
countryCodes.map((country, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
74
|
-
import_antd.Select.Option,
|
|
75
|
-
{
|
|
76
|
-
key: `${country.code}-${country.name}-${index}`,
|
|
77
|
-
value: country.code
|
|
78
|
-
},
|
|
79
|
-
/* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4 }, /* @__PURE__ */ import_react.default.createElement("span", null, country.flag), /* @__PURE__ */ import_react.default.createElement("span", null, country.code), /* @__PURE__ */ import_react.default.createElement("span", null, country.name))
|
|
80
|
-
))
|
|
81
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
|
60
|
+
const maxDigitLen = (0, import_utils2.getMaxLength)(countryCode, countryCodes);
|
|
61
|
+
const maxInputLength = (0, import_react.useMemo)(() => {
|
|
62
|
+
if (props.maxLength != null) return props.maxLength;
|
|
63
|
+
if (props.autoFormat === false) return maxDigitLen;
|
|
64
|
+
return (0, import_utils2.formatPhone)("9".repeat(maxDigitLen), countryCode).length;
|
|
65
|
+
}, [countryCode, maxDigitLen, props.maxLength, props.autoFormat]);
|
|
66
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-phone-edit" }, /* @__PURE__ */ import_react.default.createElement(
|
|
82
67
|
import_antd.Input,
|
|
83
68
|
{
|
|
69
|
+
prefix: countryCode ? /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-phone-prefix" }, countryCode) : void 0,
|
|
84
70
|
value,
|
|
85
71
|
onChange: handlePhoneChange,
|
|
72
|
+
addonBefore: props.showCountrySelector !== false ? /* @__PURE__ */ import_react.default.createElement(
|
|
73
|
+
import_antd.Select,
|
|
74
|
+
{
|
|
75
|
+
value: countryCode,
|
|
76
|
+
onChange: handleCountryCodeChange,
|
|
77
|
+
showSearch: true,
|
|
78
|
+
optionFilterProp: "children",
|
|
79
|
+
filterOption: (input, option) => {
|
|
80
|
+
const code = option == null ? void 0 : option.value;
|
|
81
|
+
const country = countryCodes.find((c) => c.code === code);
|
|
82
|
+
if (!country) return false;
|
|
83
|
+
const search = input.trim().toLowerCase();
|
|
84
|
+
if (!search) return true;
|
|
85
|
+
return country.name.toLowerCase().includes(search) || country.code.toLowerCase().includes(search) || country.flag.toLowerCase().includes(search);
|
|
86
|
+
},
|
|
87
|
+
className: "pisell-phone-country-select",
|
|
88
|
+
optionLabelProp: "label",
|
|
89
|
+
popupMatchSelectWidth: false,
|
|
90
|
+
dropdownStyle: { minWidth: 200 }
|
|
91
|
+
},
|
|
92
|
+
countryCodes.map((country, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
93
|
+
import_antd.Select.Option,
|
|
94
|
+
{
|
|
95
|
+
key: `${country.code}-${country.name}-${index}`,
|
|
96
|
+
value: country.code,
|
|
97
|
+
label: country.flag
|
|
98
|
+
},
|
|
99
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: 4 }, /* @__PURE__ */ import_react.default.createElement("span", null, country.flag), /* @__PURE__ */ import_react.default.createElement("span", null, country.code))
|
|
100
|
+
))
|
|
101
|
+
) : null,
|
|
86
102
|
onBlur: handleBlur,
|
|
87
103
|
onFocus: handleFocus,
|
|
88
104
|
placeholder: props.placeholder || "请输入电话号码",
|
|
89
|
-
maxLength:
|
|
105
|
+
maxLength: maxInputLength,
|
|
90
106
|
allowClear: props.allowClear,
|
|
91
107
|
disabled: props.disabled,
|
|
92
108
|
autoFocus: props.autoFocus,
|
|
@@ -96,6 +112,6 @@ var EditView = (props) => {
|
|
|
96
112
|
"aria-label": props["aria-label"],
|
|
97
113
|
"aria-describedby": props["aria-describedby"]
|
|
98
114
|
}
|
|
99
|
-
)
|
|
115
|
+
), !isValid && errors.length > 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-phone-error" }, errors[0]));
|
|
100
116
|
};
|
|
101
117
|
var EditView_default = EditView;
|
|
@@ -29,7 +29,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
29
29
|
{
|
|
30
30
|
code: "+86",
|
|
31
31
|
name: "中国",
|
|
32
|
-
flag: "
|
|
32
|
+
flag: "CN",
|
|
33
33
|
format: "XXX XXXX XXXX",
|
|
34
34
|
maxLength: 11,
|
|
35
35
|
pattern: /^1[3-9]\d{9}$/
|
|
@@ -37,7 +37,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
37
37
|
{
|
|
38
38
|
code: "+852",
|
|
39
39
|
name: "香港",
|
|
40
|
-
flag: "
|
|
40
|
+
flag: "HK",
|
|
41
41
|
format: "XXXX XXXX",
|
|
42
42
|
maxLength: 8,
|
|
43
43
|
pattern: /^\d{8}$/
|
|
@@ -45,7 +45,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
45
45
|
{
|
|
46
46
|
code: "+853",
|
|
47
47
|
name: "澳门",
|
|
48
|
-
flag: "
|
|
48
|
+
flag: "MO",
|
|
49
49
|
format: "XXXX XXXX",
|
|
50
50
|
maxLength: 8,
|
|
51
51
|
pattern: /^\d{8}$/
|
|
@@ -53,7 +53,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
53
53
|
{
|
|
54
54
|
code: "+886",
|
|
55
55
|
name: "台湾",
|
|
56
|
-
flag: "
|
|
56
|
+
flag: "TW",
|
|
57
57
|
format: "XXXX XXX XXX",
|
|
58
58
|
maxLength: 9,
|
|
59
59
|
pattern: /^\d{9}$/
|
|
@@ -61,7 +61,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
61
61
|
{
|
|
62
62
|
code: "+81",
|
|
63
63
|
name: "日本",
|
|
64
|
-
flag: "
|
|
64
|
+
flag: "JP",
|
|
65
65
|
format: "XX-XXXX-XXXX",
|
|
66
66
|
maxLength: 10,
|
|
67
67
|
pattern: /^\d{10}$/
|
|
@@ -69,7 +69,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
69
69
|
{
|
|
70
70
|
code: "+82",
|
|
71
71
|
name: "韩国",
|
|
72
|
-
flag: "
|
|
72
|
+
flag: "KR",
|
|
73
73
|
format: "XX-XXXX-XXXX",
|
|
74
74
|
maxLength: 10,
|
|
75
75
|
pattern: /^\d{10}$/
|
|
@@ -77,7 +77,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
77
77
|
{
|
|
78
78
|
code: "+65",
|
|
79
79
|
name: "新加坡",
|
|
80
|
-
flag: "
|
|
80
|
+
flag: "SG",
|
|
81
81
|
format: "XXXX XXXX",
|
|
82
82
|
maxLength: 8,
|
|
83
83
|
pattern: /^\d{8}$/
|
|
@@ -85,7 +85,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
85
85
|
{
|
|
86
86
|
code: "+60",
|
|
87
87
|
name: "马来西亚",
|
|
88
|
-
flag: "
|
|
88
|
+
flag: "MY",
|
|
89
89
|
format: "XX-XXXX XXXX",
|
|
90
90
|
maxLength: 10,
|
|
91
91
|
pattern: /^\d{9,10}$/
|
|
@@ -93,7 +93,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
93
93
|
{
|
|
94
94
|
code: "+66",
|
|
95
95
|
name: "泰国",
|
|
96
|
-
flag: "
|
|
96
|
+
flag: "TH",
|
|
97
97
|
format: "XX-XXX-XXXX",
|
|
98
98
|
maxLength: 9,
|
|
99
99
|
pattern: /^\d{9}$/
|
|
@@ -101,7 +101,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
101
101
|
{
|
|
102
102
|
code: "+91",
|
|
103
103
|
name: "印度",
|
|
104
|
-
flag: "
|
|
104
|
+
flag: "IN",
|
|
105
105
|
format: "XXXXX XXXXX",
|
|
106
106
|
maxLength: 10,
|
|
107
107
|
pattern: /^\d{10}$/
|
|
@@ -110,7 +110,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
110
110
|
{
|
|
111
111
|
code: "+44",
|
|
112
112
|
name: "英国",
|
|
113
|
-
flag: "
|
|
113
|
+
flag: "GB",
|
|
114
114
|
format: "XXXX XXX XXXX",
|
|
115
115
|
maxLength: 10,
|
|
116
116
|
pattern: /^\d{10}$/
|
|
@@ -118,7 +118,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
118
118
|
{
|
|
119
119
|
code: "+33",
|
|
120
120
|
name: "法国",
|
|
121
|
-
flag: "
|
|
121
|
+
flag: "FR",
|
|
122
122
|
format: "X XX XX XX XX",
|
|
123
123
|
maxLength: 9,
|
|
124
124
|
pattern: /^\d{9}$/
|
|
@@ -126,7 +126,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
126
126
|
{
|
|
127
127
|
code: "+49",
|
|
128
128
|
name: "德国",
|
|
129
|
-
flag: "
|
|
129
|
+
flag: "DE",
|
|
130
130
|
format: "XXX XXXXXXX",
|
|
131
131
|
maxLength: 11,
|
|
132
132
|
pattern: /^\d{10,11}$/
|
|
@@ -134,7 +134,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
134
134
|
{
|
|
135
135
|
code: "+39",
|
|
136
136
|
name: "意大利",
|
|
137
|
-
flag: "
|
|
137
|
+
flag: "IT",
|
|
138
138
|
format: "XXX XXX XXXX",
|
|
139
139
|
maxLength: 10,
|
|
140
140
|
pattern: /^\d{10}$/
|
|
@@ -142,7 +142,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
142
142
|
{
|
|
143
143
|
code: "+34",
|
|
144
144
|
name: "西班牙",
|
|
145
|
-
flag: "
|
|
145
|
+
flag: "ES",
|
|
146
146
|
format: "XXX XX XX XX",
|
|
147
147
|
maxLength: 9,
|
|
148
148
|
pattern: /^\d{9}$/
|
|
@@ -150,7 +150,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
150
150
|
{
|
|
151
151
|
code: "+7",
|
|
152
152
|
name: "俄罗斯",
|
|
153
|
-
flag: "
|
|
153
|
+
flag: "RU",
|
|
154
154
|
format: "XXX XXX-XX-XX",
|
|
155
155
|
maxLength: 10,
|
|
156
156
|
pattern: /^\d{10}$/
|
|
@@ -159,7 +159,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
159
159
|
{
|
|
160
160
|
code: "+1",
|
|
161
161
|
name: "美国",
|
|
162
|
-
flag: "
|
|
162
|
+
flag: "US",
|
|
163
163
|
format: "(XXX) XXX-XXXX",
|
|
164
164
|
maxLength: 10,
|
|
165
165
|
pattern: /^\d{10}$/
|
|
@@ -167,7 +167,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
167
167
|
{
|
|
168
168
|
code: "+1",
|
|
169
169
|
name: "加拿大",
|
|
170
|
-
flag: "
|
|
170
|
+
flag: "CA",
|
|
171
171
|
format: "(XXX) XXX-XXXX",
|
|
172
172
|
maxLength: 10,
|
|
173
173
|
pattern: /^\d{10}$/
|
|
@@ -175,7 +175,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
175
175
|
{
|
|
176
176
|
code: "+52",
|
|
177
177
|
name: "墨西哥",
|
|
178
|
-
flag: "
|
|
178
|
+
flag: "MX",
|
|
179
179
|
format: "XX XXXX XXXX",
|
|
180
180
|
maxLength: 10,
|
|
181
181
|
pattern: /^\d{10}$/
|
|
@@ -183,7 +183,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
183
183
|
{
|
|
184
184
|
code: "+55",
|
|
185
185
|
name: "巴西",
|
|
186
|
-
flag: "
|
|
186
|
+
flag: "BR",
|
|
187
187
|
format: "XX XXXXX-XXXX",
|
|
188
188
|
maxLength: 11,
|
|
189
189
|
pattern: /^\d{10,11}$/
|
|
@@ -192,7 +192,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
192
192
|
{
|
|
193
193
|
code: "+61",
|
|
194
194
|
name: "澳大利亚",
|
|
195
|
-
flag: "
|
|
195
|
+
flag: "AU",
|
|
196
196
|
format: "XXX XXX XXX",
|
|
197
197
|
maxLength: 9,
|
|
198
198
|
pattern: /^\d{9}$/
|
|
@@ -200,7 +200,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
200
200
|
{
|
|
201
201
|
code: "+64",
|
|
202
202
|
name: "新西兰",
|
|
203
|
-
flag: "
|
|
203
|
+
flag: "NZ",
|
|
204
204
|
format: "XX XXX XXXX",
|
|
205
205
|
maxLength: 9,
|
|
206
206
|
pattern: /^\d{9}$/
|
|
@@ -209,7 +209,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
209
209
|
{
|
|
210
210
|
code: "+971",
|
|
211
211
|
name: "阿联酋",
|
|
212
|
-
flag: "
|
|
212
|
+
flag: "AE",
|
|
213
213
|
format: "XX XXX XXXX",
|
|
214
214
|
maxLength: 9,
|
|
215
215
|
pattern: /^\d{9}$/
|
|
@@ -217,7 +217,7 @@ var PRESET_COUNTRY_CODES = [
|
|
|
217
217
|
{
|
|
218
218
|
code: "+966",
|
|
219
219
|
name: "沙特阿拉伯",
|
|
220
|
-
flag: "
|
|
220
|
+
flag: "SA",
|
|
221
221
|
format: "XX XXX XXXX",
|
|
222
222
|
maxLength: 9,
|
|
223
223
|
pattern: /^\d{9}$/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { CountryCode, PisellPhoneProps } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* 根据国家码获取国家/地区展示标识(正常文本,如 CN、US)
|
|
4
4
|
* @param countryCode 国家码
|
|
5
|
-
* @returns
|
|
5
|
+
* @returns 展示用标识,未匹配时返回 '--'
|
|
6
6
|
*/
|
|
7
7
|
export declare function getCountryFlag(countryCode: string): string;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* 根据国家码获取最大长度(数字位数)
|
|
10
10
|
* @param countryCode 国家码
|
|
11
11
|
* @param countryCodes 国家码列表
|
|
12
|
-
* @returns
|
|
12
|
+
* @returns 最大长度(如中国 11 位数字)
|
|
13
13
|
*/
|
|
14
14
|
export declare function getMaxLength(countryCode: string, countryCodes: CountryCode[]): number;
|
|
15
15
|
/**
|
|
@@ -28,7 +28,7 @@ module.exports = __toCommonJS(countryCodeHelper_exports);
|
|
|
28
28
|
var import_countryCodes = require("../constants/countryCodes");
|
|
29
29
|
function getCountryFlag(countryCode) {
|
|
30
30
|
const country = import_countryCodes.PRESET_COUNTRY_CODES.find((c) => c.code === countryCode);
|
|
31
|
-
return (country == null ? void 0 : country.flag) || "
|
|
31
|
+
return (country == null ? void 0 : country.flag) || "--";
|
|
32
32
|
}
|
|
33
33
|
function getMaxLength(countryCode, countryCodes) {
|
|
34
34
|
const country = countryCodes.find((c) => c.code === countryCode);
|
|
@@ -36,6 +36,7 @@ module.exports = __toCommonJS(PisellRating_exports);
|
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var import_antd = require("antd");
|
|
38
38
|
var import_utils = require("@pisell/utils");
|
|
39
|
+
var import_pisell_components = require("../../theme/pisell-components");
|
|
39
40
|
var import_PisellRating = require("./PisellRating.less");
|
|
40
41
|
var PisellRating = (props) => {
|
|
41
42
|
const {
|
|
@@ -72,7 +73,8 @@ var PisellRating = (props) => {
|
|
|
72
73
|
color,
|
|
73
74
|
...style
|
|
74
75
|
};
|
|
75
|
-
|
|
76
|
+
const theme = (0, import_pisell_components.getPisellComponentsThemeConfig)();
|
|
77
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.ConfigProvider, { theme }, /* @__PURE__ */ import_react.default.createElement(
|
|
76
78
|
"div",
|
|
77
79
|
{
|
|
78
80
|
className: `pisell-rating pisell-rating-${displayState} ${className || ""}`,
|
|
@@ -99,7 +101,7 @@ var PisellRating = (props) => {
|
|
|
99
101
|
),
|
|
100
102
|
showValue && value !== void 0 && /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-rating-value", style: { marginLeft: 8 } }, value.toFixed(allowHalf ? 1 : 0)),
|
|
101
103
|
showCount && reviewCount !== void 0 && /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-rating-count", style: { marginLeft: 8, color: "#999" } }, "(", reviewCount, " 人评价)")
|
|
102
|
-
);
|
|
104
|
+
));
|
|
103
105
|
};
|
|
104
106
|
var PisellRating_default = import_react.default.memo(PisellRating, (prevProps, nextProps) => {
|
|
105
107
|
return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled;
|
|
@@ -39,19 +39,25 @@ var import_ReadOnlyView = __toESM(require("./components/ReadOnlyView"));
|
|
|
39
39
|
var import_EditView = __toESM(require("./components/EditView"));
|
|
40
40
|
var import_DisabledView = __toESM(require("./components/DisabledView"));
|
|
41
41
|
var import_PisellSingleLineText = require("./PisellSingleLineText.less");
|
|
42
|
+
var import_antd = require("antd");
|
|
43
|
+
var import_pisell_components = require("../../theme/pisell-components");
|
|
42
44
|
var PisellSingleLineText = (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 PisellSingleLineText_default = import_react.default.memo(PisellSingleLineText, (prevProps, nextProps) => {
|
|
57
63
|
return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled;
|