@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.
Files changed (202) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +3 -3
  6. package/build/lowcode/preview.js +9 -9
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +20 -20
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +23 -23
  11. package/es/components/PisellCards/index.d.ts +3 -0
  12. package/es/components/PisellCards/index.js +3 -1
  13. package/es/components/PisellContactBrief/PisellContactBrief.d.ts +13 -0
  14. package/es/components/PisellContactBrief/PisellContactBrief.js +223 -0
  15. package/es/components/PisellContactBrief/PisellContactBrief.less +192 -0
  16. package/es/components/PisellContactBrief/PisellContactBrief.stories.d.ts +31 -0
  17. package/es/components/PisellContactBrief/PisellContactBrief.stories.js +196 -0
  18. package/es/components/PisellContactBrief/components/ContactFormModal.d.ts +23 -0
  19. package/es/components/PisellContactBrief/components/ContactFormModal.js +177 -0
  20. package/es/components/PisellContactBrief/components/index.d.ts +5 -0
  21. package/es/components/PisellContactBrief/components/index.js +4 -0
  22. package/es/components/PisellContactBrief/index.d.ts +6 -0
  23. package/es/components/PisellContactBrief/index.js +5 -0
  24. package/es/components/PisellContactBrief/locales.d.ts +55 -0
  25. package/es/components/PisellContactBrief/locales.js +54 -0
  26. package/es/components/PisellContactBrief/types.d.ts +82 -0
  27. package/es/components/PisellContactBrief/types.js +1 -0
  28. package/es/components/dataSourceComponents/fields/Tabs/Tabs.less +8 -0
  29. package/es/components/pisellActionPanel/PisellActionPanel.d.ts +13 -0
  30. package/es/components/pisellActionPanel/PisellActionPanel.js +98 -0
  31. package/es/components/pisellActionPanel/PisellActionPanel.less +69 -0
  32. package/es/components/pisellActionPanel/PisellActionPanel.stories.d.ts +19 -0
  33. package/es/components/pisellActionPanel/PisellActionPanel.stories.js +208 -0
  34. package/es/components/pisellActionPanel/index.d.ts +6 -0
  35. package/es/components/pisellActionPanel/index.js +5 -0
  36. package/es/components/pisellActionPanel/types.d.ts +83 -0
  37. package/es/components/pisellActionPanel/types.js +1 -0
  38. package/es/components/pisellBaseCard/PisellBaseCard.d.ts +8 -0
  39. package/es/components/pisellBaseCard/PisellBaseCard.js +96 -0
  40. package/es/components/pisellBaseCard/PisellBaseCard.less +25 -0
  41. package/es/components/pisellBaseCard/PisellBaseCard.stories.d.ts +19 -0
  42. package/es/components/pisellBaseCard/PisellBaseCard.stories.js +99 -0
  43. package/es/components/pisellBaseCard/index.d.ts +5 -0
  44. package/es/components/pisellBaseCard/index.js +4 -0
  45. package/es/components/pisellBaseCard/types.d.ts +45 -0
  46. package/es/components/pisellBaseCard/types.js +1 -0
  47. package/es/components/pisellCurrency/PisellCurrency.js +18 -12
  48. package/es/components/pisellCurrency/PisellCurrency.less +0 -123
  49. package/es/components/pisellCustomerBrief/PisellCustomerBrief.d.ts +15 -0
  50. package/es/components/pisellCustomerBrief/PisellCustomerBrief.js +145 -0
  51. package/es/components/pisellCustomerBrief/PisellCustomerBrief.less +8 -0
  52. package/es/components/pisellCustomerBrief/PisellCustomerBrief.stories.d.ts +23 -0
  53. package/es/components/pisellCustomerBrief/PisellCustomerBrief.stories.js +193 -0
  54. package/es/components/pisellCustomerBrief/index.d.ts +6 -0
  55. package/es/components/pisellCustomerBrief/index.js +5 -0
  56. package/es/components/pisellCustomerBrief/types.d.ts +82 -0
  57. package/es/components/pisellCustomerBrief/types.js +1 -0
  58. package/es/components/pisellEmail/PisellEmail.js +48 -42
  59. package/es/components/pisellEmail/PisellEmail.less +0 -92
  60. package/es/components/pisellEntityCard/PisellEntityCard.d.ts +8 -0
  61. package/es/components/pisellEntityCard/PisellEntityCard.js +474 -0
  62. package/es/components/pisellEntityCard/PisellEntityCard.less +362 -0
  63. package/es/components/pisellEntityCard/PisellEntityCard.stories.d.ts +47 -0
  64. package/es/components/pisellEntityCard/PisellEntityCard.stories.js +450 -0
  65. package/es/components/pisellEntityCard/index.d.ts +5 -0
  66. package/es/components/pisellEntityCard/index.js +4 -0
  67. package/es/components/pisellEntityCard/types.d.ts +144 -0
  68. package/es/components/pisellEntityCard/types.js +1 -0
  69. package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +32 -4
  70. package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +4 -2
  71. package/es/components/pisellFloorMapLayout/components/ViewControls.d.ts +4 -0
  72. package/es/components/pisellFloorMapLayout/components/ViewControls.js +12 -2
  73. package/es/components/pisellFloorMapLayout/types.d.ts +2 -0
  74. package/es/components/pisellLongText/PisellLongText.js +18 -12
  75. package/es/components/pisellLongText/PisellLongText.less +0 -67
  76. package/es/components/pisellLookup/PisellLookup.js +8 -1
  77. package/es/components/pisellMultipleSelect/PisellMultipleSelect.js +14 -6
  78. package/es/components/pisellMultipleSelect/PisellMultipleSelect.less +18 -139
  79. package/es/components/pisellMultipleSelect/components/EditView.js +1 -0
  80. package/es/components/pisellNumber/PisellNumber.js +18 -12
  81. package/es/components/pisellNumber/PisellNumber.less +0 -103
  82. package/es/components/pisellPhone/PisellPhone.js +18 -12
  83. package/es/components/pisellPhone/PisellPhone.less +0 -119
  84. package/es/components/pisellPhone/components/EditView.js +44 -33
  85. package/es/components/pisellPhone/constants/countryCodes.d.ts +1 -0
  86. package/es/components/pisellPhone/constants/countryCodes.js +26 -25
  87. package/es/components/pisellPhone/types.d.ts +2 -2
  88. package/es/components/pisellPhone/utils/countryCodeHelper.d.ts +4 -4
  89. package/es/components/pisellPhone/utils/countryCodeHelper.js +5 -5
  90. package/es/components/pisellRating/PisellRating.js +7 -3
  91. package/es/components/pisellSingleLineText/PisellSingleLineText.js +27 -20
  92. package/es/components/pisellSingleLineText/PisellSingleLineText.less +58 -201
  93. package/es/components/pisellSingleSelect/PisellSingleSelect.js +14 -5
  94. package/es/components/pisellSingleSelect/PisellSingleSelect.less +5 -106
  95. package/es/components/pisellUrl/PisellUrl.js +48 -42
  96. package/es/components/pisellWalletPassCard/index.js +2 -1
  97. package/es/index.d.ts +15 -4
  98. package/es/index.js +8 -4
  99. package/es/theme/pisell-components.d.ts +14 -0
  100. package/es/theme/pisell-components.js +74 -0
  101. package/lib/components/PisellCards/index.d.ts +3 -0
  102. package/lib/components/PisellCards/index.js +3 -1
  103. package/lib/components/PisellContactBrief/PisellContactBrief.d.ts +13 -0
  104. package/lib/components/PisellContactBrief/PisellContactBrief.js +231 -0
  105. package/lib/components/PisellContactBrief/PisellContactBrief.less +192 -0
  106. package/lib/components/PisellContactBrief/PisellContactBrief.stories.d.ts +31 -0
  107. package/lib/components/PisellContactBrief/PisellContactBrief.stories.js +188 -0
  108. package/lib/components/PisellContactBrief/components/ContactFormModal.d.ts +23 -0
  109. package/lib/components/PisellContactBrief/components/ContactFormModal.js +154 -0
  110. package/lib/components/PisellContactBrief/components/index.d.ts +5 -0
  111. package/lib/components/PisellContactBrief/components/index.js +29 -0
  112. package/lib/components/PisellContactBrief/index.d.ts +6 -0
  113. package/lib/components/PisellContactBrief/index.js +29 -0
  114. package/lib/components/PisellContactBrief/locales.d.ts +55 -0
  115. package/lib/components/PisellContactBrief/locales.js +74 -0
  116. package/lib/components/PisellContactBrief/types.d.ts +82 -0
  117. package/lib/components/PisellContactBrief/types.js +17 -0
  118. package/lib/components/dataSourceComponents/fields/Tabs/Tabs.less +8 -0
  119. package/lib/components/pisellActionPanel/PisellActionPanel.d.ts +13 -0
  120. package/lib/components/pisellActionPanel/PisellActionPanel.js +124 -0
  121. package/lib/components/pisellActionPanel/PisellActionPanel.less +69 -0
  122. package/lib/components/pisellActionPanel/PisellActionPanel.stories.d.ts +19 -0
  123. package/lib/components/pisellActionPanel/PisellActionPanel.stories.js +186 -0
  124. package/lib/components/pisellActionPanel/index.d.ts +6 -0
  125. package/lib/components/pisellActionPanel/index.js +29 -0
  126. package/lib/components/pisellActionPanel/types.d.ts +83 -0
  127. package/lib/components/pisellActionPanel/types.js +17 -0
  128. package/lib/components/pisellBaseCard/PisellBaseCard.d.ts +8 -0
  129. package/lib/components/pisellBaseCard/PisellBaseCard.js +124 -0
  130. package/lib/components/pisellBaseCard/PisellBaseCard.less +25 -0
  131. package/lib/components/pisellBaseCard/PisellBaseCard.stories.d.ts +19 -0
  132. package/lib/components/pisellBaseCard/PisellBaseCard.stories.js +107 -0
  133. package/lib/components/pisellBaseCard/index.d.ts +5 -0
  134. package/lib/components/pisellBaseCard/index.js +29 -0
  135. package/lib/components/pisellBaseCard/types.d.ts +45 -0
  136. package/lib/components/pisellBaseCard/types.js +17 -0
  137. package/lib/components/pisellCurrency/PisellCurrency.js +16 -10
  138. package/lib/components/pisellCurrency/PisellCurrency.less +0 -123
  139. package/lib/components/pisellCustomerBrief/PisellCustomerBrief.d.ts +15 -0
  140. package/lib/components/pisellCustomerBrief/PisellCustomerBrief.js +143 -0
  141. package/lib/components/pisellCustomerBrief/PisellCustomerBrief.less +8 -0
  142. package/lib/components/pisellCustomerBrief/PisellCustomerBrief.stories.d.ts +23 -0
  143. package/lib/components/pisellCustomerBrief/PisellCustomerBrief.stories.js +171 -0
  144. package/lib/components/pisellCustomerBrief/index.d.ts +6 -0
  145. package/lib/components/pisellCustomerBrief/index.js +29 -0
  146. package/lib/components/pisellCustomerBrief/types.d.ts +82 -0
  147. package/lib/components/pisellCustomerBrief/types.js +17 -0
  148. package/lib/components/pisellEmail/PisellEmail.js +16 -10
  149. package/lib/components/pisellEmail/PisellEmail.less +0 -92
  150. package/lib/components/pisellEntityCard/PisellEntityCard.d.ts +8 -0
  151. package/lib/components/pisellEntityCard/PisellEntityCard.js +426 -0
  152. package/lib/components/pisellEntityCard/PisellEntityCard.less +362 -0
  153. package/lib/components/pisellEntityCard/PisellEntityCard.stories.d.ts +47 -0
  154. package/lib/components/pisellEntityCard/PisellEntityCard.stories.js +349 -0
  155. package/lib/components/pisellEntityCard/index.d.ts +5 -0
  156. package/lib/components/pisellEntityCard/index.js +29 -0
  157. package/lib/components/pisellEntityCard/types.d.ts +144 -0
  158. package/lib/components/pisellEntityCard/types.js +17 -0
  159. package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +22 -3
  160. package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +2 -2
  161. package/lib/components/pisellFloorMapLayout/components/ViewControls.d.ts +4 -0
  162. package/lib/components/pisellFloorMapLayout/components/ViewControls.js +11 -1
  163. package/lib/components/pisellFloorMapLayout/types.d.ts +2 -0
  164. package/lib/components/pisellLongText/PisellLongText.js +16 -10
  165. package/lib/components/pisellLongText/PisellLongText.less +0 -67
  166. package/lib/components/pisellLookup/PisellLookup.js +5 -1
  167. package/lib/components/pisellMultipleSelect/PisellMultipleSelect.js +62 -53
  168. package/lib/components/pisellMultipleSelect/PisellMultipleSelect.less +18 -139
  169. package/lib/components/pisellMultipleSelect/components/EditView.js +42 -30
  170. package/lib/components/pisellNumber/PisellNumber.js +16 -10
  171. package/lib/components/pisellNumber/PisellNumber.less +0 -103
  172. package/lib/components/pisellPhone/PisellPhone.js +16 -10
  173. package/lib/components/pisellPhone/PisellPhone.less +0 -119
  174. package/lib/components/pisellPhone/components/EditView.js +40 -24
  175. package/lib/components/pisellPhone/constants/countryCodes.d.ts +1 -0
  176. package/lib/components/pisellPhone/constants/countryCodes.js +24 -24
  177. package/lib/components/pisellPhone/types.d.ts +2 -2
  178. package/lib/components/pisellPhone/utils/countryCodeHelper.d.ts +4 -4
  179. package/lib/components/pisellPhone/utils/countryCodeHelper.js +1 -1
  180. package/lib/components/pisellRating/PisellRating.js +4 -2
  181. package/lib/components/pisellSingleLineText/PisellSingleLineText.js +16 -10
  182. package/lib/components/pisellSingleLineText/PisellSingleLineText.less +58 -201
  183. package/lib/components/pisellSingleSelect/PisellSingleSelect.js +34 -35
  184. package/lib/components/pisellSingleSelect/PisellSingleSelect.less +5 -106
  185. package/lib/components/pisellUrl/PisellUrl.js +16 -10
  186. package/lib/components/pisellWalletPassCard/index.js +1 -1
  187. package/lib/index.d.ts +15 -4
  188. package/lib/index.js +18 -3
  189. package/lib/theme/pisell-components.d.ts +14 -0
  190. package/lib/theme/pisell-components.js +89 -0
  191. package/lowcode/pisell-action-panel/meta.ts +146 -0
  192. package/lowcode/pisell-action-panel/snippets.ts +42 -0
  193. package/lowcode/pisell-base-card/meta.ts +98 -0
  194. package/lowcode/pisell-base-card/snippets.ts +13 -0
  195. package/lowcode/pisell-contact-brief/meta.ts +178 -0
  196. package/lowcode/pisell-contact-brief/snippets.ts +40 -0
  197. package/lowcode/pisell-customer-brief/meta.ts +262 -0
  198. package/lowcode/pisell-customer-brief/snippets.ts +46 -0
  199. package/lowcode/pisell-entity-card/meta.ts +296 -0
  200. package/lowcode/pisell-entity-card/snippets.ts +41 -0
  201. package/lowcode/pisell-floor-map-layout/meta.ts +37 -1
  202. package/package.json +4 -4
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Pisell 项目统一的 Ant Design Token 配置
3
+ * 基于 Figma 设计规范
4
+ *
5
+ * 使用场景:
6
+ * - 低代码平台(page/index.tsx)
7
+ * - Storybook 预览
8
+ * - 其他需要主题配置的场景
9
+ */
10
+
11
+ /**
12
+ * 获取完整的主题配置
13
+ */
14
+ export function getPisellComponentsThemeConfig() {
15
+ return {
16
+ components: {
17
+ Input: {
18
+ controlHeight: 48,
19
+ paddingInline: 16,
20
+ paddingBlock: 12,
21
+ activeShadow: '0px 0px 0px 4px #F4EBFF, 0px 1px 2px rgba(16, 24, 40, 0.05)',
22
+ activeBorderColor: 'rgb(214,187,251)',
23
+ paddingBlockLG: 12,
24
+ paddingBlockSM: 8,
25
+ paddingInlineLG: 16,
26
+ paddingInlineSM: 8,
27
+ controlHeightLG: 52,
28
+ controlHeightSM: 44,
29
+ borderRadius: 8,
30
+ paddingXXS: 8
31
+ },
32
+ InputNumber: {
33
+ controlHeight: 48,
34
+ paddingInline: 16,
35
+ paddingBlock: 12,
36
+ activeShadow: '0px 0px 0px 4px #F4EBFF, 0px 1px 2px rgba(16, 24, 40, 0.05)',
37
+ activeBorderColor: 'rgb(214,187,251)',
38
+ paddingBlockLG: 12,
39
+ paddingBlockSM: 8,
40
+ paddingInlineLG: 16,
41
+ paddingInlineSM: 8,
42
+ controlHeightLG: 52,
43
+ controlHeightSM: 44,
44
+ borderRadius: 8,
45
+ paddingXXS: 8,
46
+ handleWidth: 20
47
+ },
48
+ Select: {
49
+ controlHeight: 48,
50
+ optionHeight: 48,
51
+ fontSize: 16,
52
+ fontSizeLG: 18,
53
+ fontSizeSM: 14,
54
+ borderRadius: 8,
55
+ boxShadowSecondary: '0px 4px 6px -2px rgba(16, 24, 40, 0.03), 0px 12px 16px -4px rgba(16, 24, 40, 0.08)',
56
+ optionSelectedBg: 'rgb(244,235,255)',
57
+ multipleItemBg: 'rgb(234,236,240)',
58
+ controlHeightLG: 52,
59
+ controlHeightSM: 40,
60
+ borderRadiusSM: 8,
61
+ paddingXXS: 6,
62
+ optionPadding: '10px 8px',
63
+ multipleItemHeight: 36,
64
+ multipleItemHeightLG: 40
65
+ }
66
+ },
67
+ token: {
68
+ colorPrimary: '#7f56d9',
69
+ colorInfo: '#7f56d9',
70
+ borderRadius: 8,
71
+ colorPrimaryHover: '#d6bbfb'
72
+ }
73
+ };
74
+ }
@@ -1,10 +1,12 @@
1
1
  /// <reference types="react" />
2
+ import { PisellEntityCard } from '../pisellEntityCard';
2
3
  declare const PisellCards: {
3
4
  TabCard: (props: any) => JSX.Element;
4
5
  TextCard: (props: any) => JSX.Element;
5
6
  GraphicTextCard: (props: import("./components/GraphicTextCard").GraphicTextCardProps) => JSX.Element;
6
7
  MultilevelCard: (props: any) => JSX.Element;
7
8
  PisellImageCard: (props: import("./components/PisellImageCard").PisellImageCardProps) => JSX.Element;
9
+ PisellEntityCard: typeof PisellEntityCard;
8
10
  };
9
11
  export default PisellCards;
10
12
  export type { PisellBasicCardProps } from './types';
@@ -13,3 +15,4 @@ export type { TextCardProps } from './components/TextCard/types';
13
15
  export type { GraphicTextCardProps, GraphicTextCardVariant, GraphicTextCardSize, GraphicConfig, } from './components/GraphicTextCard/types';
14
16
  export type { MultilevelCardProps } from './components/MultilevelCard/types';
15
17
  export type { PisellImageCardProps, ImageDataSource, ImageFillMode, } from './components/PisellImageCard/types';
18
+ export type { PisellEntityCardProps, EntityCardDensity, EntityCardLayout, EntityCardWidth, EntityCardMediaType, EntityCardMediaConfig, EntityCardSecondaryItem, EntityCardTagItem, EntityCardActionItem, EntityCardTagPosition, } from '../pisellEntityCard';
@@ -37,11 +37,13 @@ var import_TextCard = __toESM(require("./components/TextCard"));
37
37
  var import_GraphicTextCard = __toESM(require("./components/GraphicTextCard"));
38
38
  var import_MultilevelCard = __toESM(require("./components/MultilevelCard"));
39
39
  var import_PisellImageCard = __toESM(require("./components/PisellImageCard"));
40
+ var import_pisellEntityCard = require("../pisellEntityCard");
40
41
  var PisellCards = {
41
42
  TabCard: import_TabCard.default,
42
43
  TextCard: import_TextCard.default,
43
44
  GraphicTextCard: import_GraphicTextCard.default,
44
45
  MultilevelCard: import_MultilevelCard.default,
45
- PisellImageCard: import_PisellImageCard.default
46
+ PisellImageCard: import_PisellImageCard.default,
47
+ PisellEntityCard: import_pisellEntityCard.PisellEntityCard
46
48
  };
47
49
  var PisellCards_default = PisellCards;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { PisellContactBriefCreateButtonProps, PisellContactBriefProps } from './types';
3
+ import './PisellContactBrief.less';
4
+ /**
5
+ * PisellContactBrief 联系人简要卡片
6
+ * 基于 PisellEntityCard 展示姓名、电话、邮箱及扩展字段,右侧编辑图标调起编辑弹窗
7
+ */
8
+ export declare function PisellContactBrief({ name, phone, email, avatar, extraData, extraFields, onSubmit, onDelete, swipeToDelete, layout, showAvatar, showPhone, showEmail, primaryLineClamp, secondaryLineClamp, className, style, hoverStyle, activeStyle, disabledStyle, clickable, disabled, onClick, }: PisellContactBriefProps): JSX.Element;
9
+ /**
10
+ * 新建联系人入口按钮
11
+ * 展示「Add Contact」+ 占位头像 + plus 图标,点击打开新建弹窗
12
+ */
13
+ export declare function PisellContactBriefCreateButton({ extraFields, onCreate, onClick: onClickProp, className, style, }: PisellContactBriefCreateButtonProps): JSX.Element;
@@ -0,0 +1,231 @@
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/PisellContactBrief/PisellContactBrief.tsx
30
+ var PisellContactBrief_exports = {};
31
+ __export(PisellContactBrief_exports, {
32
+ PisellContactBrief: () => PisellContactBrief,
33
+ PisellContactBriefCreateButton: () => PisellContactBriefCreateButton
34
+ });
35
+ module.exports = __toCommonJS(PisellContactBrief_exports);
36
+ var import_react = __toESM(require("react"));
37
+ var import_icons = require("@ant-design/icons");
38
+ var import_utils = require("@pisell/utils");
39
+ var import_pisellEntityCard = require("../pisellEntityCard");
40
+ var import_components = require("./components");
41
+ var import_locales = __toESM(require("./locales"));
42
+ var import_PisellContactBrief = require("./PisellContactBrief.less");
43
+ function ensureLocales() {
44
+ var _a, _b;
45
+ try {
46
+ const current = ((_b = (_a = import_utils.locales).getLocale) == null ? void 0 : _b.call(_a)) ?? "en";
47
+ const locale = current === "zh-TW" ? "zh-HK" : current;
48
+ import_utils.locales.init(import_locales.default, locale);
49
+ } catch {
50
+ }
51
+ }
52
+ function PisellContactBrief({
53
+ name,
54
+ phone,
55
+ email,
56
+ avatar,
57
+ extraData = {},
58
+ extraFields = [],
59
+ onSubmit,
60
+ onDelete,
61
+ swipeToDelete = false,
62
+ layout = "horizontal",
63
+ showAvatar = true,
64
+ showPhone = true,
65
+ showEmail = true,
66
+ primaryLineClamp,
67
+ secondaryLineClamp,
68
+ className,
69
+ style,
70
+ hoverStyle,
71
+ activeStyle,
72
+ disabledStyle,
73
+ clickable = true,
74
+ disabled = false,
75
+ onClick
76
+ }) {
77
+ const [editModalVisible, setEditModalVisible] = (0, import_react.useState)(false);
78
+ (0, import_react.useEffect)(() => {
79
+ ensureLocales();
80
+ }, []);
81
+ const media = (0, import_react.useMemo)(() => {
82
+ if (!showAvatar) return void 0;
83
+ return {
84
+ type: "avatar",
85
+ src: avatar,
86
+ alt: name,
87
+ size: 32,
88
+ shape: "circle"
89
+ };
90
+ }, [showAvatar, avatar, name]);
91
+ const secondaryTexts = (0, import_react.useMemo)(() => {
92
+ const list = [];
93
+ if (showEmail && email) list.push({ text: email });
94
+ extraFields.forEach((f) => {
95
+ const v = extraData[f.key];
96
+ if (v) list.push({ text: v });
97
+ });
98
+ return list;
99
+ }, [showEmail, email, extraFields, extraData]);
100
+ const editAction = (0, import_react.useMemo)(
101
+ () => ({
102
+ type: "icon",
103
+ icon: /* @__PURE__ */ import_react.default.createElement(import_icons.EditOutlined, { className: "pisell-contact-brief-action-edit" }),
104
+ onClick: () => {
105
+ setEditModalVisible(true);
106
+ }
107
+ }),
108
+ []
109
+ );
110
+ const initialEditValues = (0, import_react.useMemo)(
111
+ () => ({
112
+ name,
113
+ phone,
114
+ email,
115
+ ...extraData
116
+ }),
117
+ [name, phone, email, extraData]
118
+ );
119
+ const handleEditSubmit = (0, import_react.useCallback)(
120
+ (values) => {
121
+ onSubmit == null ? void 0 : onSubmit(values);
122
+ setEditModalVisible(false);
123
+ },
124
+ [onSubmit]
125
+ );
126
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-contact-brief-wrap" }, /* @__PURE__ */ import_react.default.createElement(
127
+ import_pisellEntityCard.PisellEntityCard,
128
+ {
129
+ className,
130
+ style,
131
+ hoverStyle,
132
+ activeStyle,
133
+ disabledStyle,
134
+ clickable,
135
+ disabled,
136
+ onClick,
137
+ media,
138
+ primaryText: name,
139
+ subtitleText: showPhone && phone ? phone : void 0,
140
+ secondaryTexts,
141
+ showMedia: showAvatar,
142
+ showPrimaryText: true,
143
+ showSubtitle: showPhone,
144
+ showSecondaryText: true,
145
+ showTags: false,
146
+ showActions: true,
147
+ actions: [editAction],
148
+ density: "B2",
149
+ layout,
150
+ width: "content",
151
+ swipeToDelete,
152
+ onDelete,
153
+ primaryLineClamp,
154
+ secondaryLineClamp
155
+ }
156
+ )), /* @__PURE__ */ import_react.default.createElement(
157
+ import_components.ContactFormModal,
158
+ {
159
+ visible: editModalVisible,
160
+ onCancel: () => setEditModalVisible(false),
161
+ onSubmit: handleEditSubmit,
162
+ mode: "edit",
163
+ initialValues: initialEditValues,
164
+ extraFields
165
+ }
166
+ ));
167
+ }
168
+ function PisellContactBriefCreateButton({
169
+ extraFields = [],
170
+ onCreate,
171
+ onClick: onClickProp,
172
+ className,
173
+ style
174
+ }) {
175
+ const [createModalVisible, setCreateModalVisible] = (0, import_react.useState)(false);
176
+ (0, import_react.useEffect)(() => {
177
+ ensureLocales();
178
+ }, []);
179
+ const handleClick = (0, import_react.useCallback)(
180
+ (e) => {
181
+ if (onClickProp) {
182
+ onClickProp(e);
183
+ return;
184
+ }
185
+ setCreateModalVisible(true);
186
+ },
187
+ [onClickProp]
188
+ );
189
+ const handleCreateSubmit = (0, import_react.useCallback)(
190
+ (values) => {
191
+ onCreate == null ? void 0 : onCreate(values);
192
+ setCreateModalVisible(false);
193
+ },
194
+ [onCreate]
195
+ );
196
+ const addContactText = import_utils.locales.getText("pisell.contact.brief.addContact");
197
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
198
+ "div",
199
+ {
200
+ role: "button",
201
+ tabIndex: 0,
202
+ className: `pisell-contact-brief-create-btn ${className ?? ""}`.trim(),
203
+ style,
204
+ onClick: handleClick,
205
+ onKeyDown: (e) => {
206
+ if (e.key === "Enter" || e.key === " ") {
207
+ e.preventDefault();
208
+ handleClick(e);
209
+ }
210
+ }
211
+ },
212
+ /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-contact-brief-create-btn-avatar" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-contact-brief-create-btn-avatar-inner" })),
213
+ /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-contact-brief-create-btn-text" }, addContactText),
214
+ /* @__PURE__ */ import_react.default.createElement(import_icons.PlusCircleOutlined, { className: "pisell-contact-brief-create-btn-icon" })
215
+ ), /* @__PURE__ */ import_react.default.createElement(
216
+ import_components.ContactFormModal,
217
+ {
218
+ visible: createModalVisible,
219
+ onCancel: () => setCreateModalVisible(false),
220
+ onSubmit: handleCreateSubmit,
221
+ mode: "create",
222
+ extraFields
223
+ }
224
+ ));
225
+ }
226
+ PisellContactBrief.CreateButton = PisellContactBriefCreateButton;
227
+ // Annotate the CommonJS export names for ESM import in node:
228
+ 0 && (module.exports = {
229
+ PisellContactBrief,
230
+ PisellContactBriefCreateButton
231
+ });
@@ -0,0 +1,192 @@
1
+ /**
2
+ * PisellContactBrief 样式
3
+ * 类名前缀 pisell-contact-brief-
4
+ */
5
+ .pisell-contact-brief-wrap {
6
+ box-sizing: border-box;
7
+ min-width: 0;
8
+ }
9
+
10
+ /* 编辑图标与右侧操作区 */
11
+ .pisell-contact-brief-action-edit {
12
+ font-size: 16px;
13
+ color: #667085;
14
+ }
15
+
16
+ /* 新建按钮:水平布局,占位头像 + 文案 + plus 图标,与设计稿一致 */
17
+ .pisell-contact-brief-create-btn {
18
+ display: flex;
19
+ align-items: center;
20
+ gap: 8px;
21
+ min-width: 0;
22
+ padding: 6px 14px;
23
+ box-sizing: border-box;
24
+ cursor: pointer;
25
+ border-radius: 8px;
26
+ border: 1px solid #d0d5dd;
27
+ background-color: #ffffff;
28
+ transition: background-color 0.2s, border-color 0.2s;
29
+
30
+ &:hover {
31
+ background-color: #f9fafb;
32
+ border-color: #d0d5dd;
33
+ }
34
+ }
35
+
36
+ .pisell-contact-brief-create-btn-avatar {
37
+ flex-shrink: 0;
38
+ width: 32px;
39
+ height: 32px;
40
+ border-radius: 50%;
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ background-color: #f2f4f7;
45
+ }
46
+
47
+ .pisell-contact-brief-create-btn-avatar-inner {
48
+ width: 32px;
49
+ height: 32px;
50
+ border-radius: 50%;
51
+ background-color: #e4e7ec;
52
+ }
53
+
54
+ .pisell-contact-brief-create-btn-text {
55
+ flex: 1;
56
+ min-width: 0;
57
+ font-size: 14px;
58
+ font-weight: 500;
59
+ color: #000000;
60
+ overflow: hidden;
61
+ text-overflow: ellipsis;
62
+ white-space: nowrap;
63
+ }
64
+
65
+ .pisell-contact-brief-create-btn-icon {
66
+ flex-shrink: 0;
67
+ font-size: 24px;
68
+ color: #667085;
69
+ }
70
+
71
+ /* 弹窗:对齐 Figma 新建/编辑弹窗,新建与编辑完全一致 */
72
+ .pisell-contact-brief-modal {
73
+ /* 容器:12px 圆角、Shadow xl */
74
+
75
+ .ant-modal-content,
76
+ .pisell-lowcode-modal-content {
77
+ border-radius: 12px;
78
+ box-shadow: 0 20px 24px -4px rgba(16, 24, 40, 0.08), 0 8px 8px -4px rgba(16, 24, 40, 0.03);
79
+ overflow: hidden;
80
+ padding: 0;
81
+ }
82
+
83
+ /* Header:24px 16px,标题 18px Semibold #101828 */
84
+
85
+ .ant-modal-header,
86
+ .pisell-lowcode-modal-header {
87
+ padding: 16px 24px;
88
+ border-bottom: none;
89
+ margin-bottom: 0;
90
+ }
91
+
92
+ .ant-modal-title,
93
+ .pisell-lowcode-modal-title {
94
+ font-size: 18px;
95
+ font-weight: 600;
96
+ line-height: 28px;
97
+ color: #101828;
98
+ }
99
+
100
+ /* Header 下方分割线 */
101
+
102
+ .ant-modal-header + .ant-modal-body,
103
+ .pisell-lowcode-modal-header + .pisell-lowcode-modal-body {
104
+ border-top: 1px solid #eaecf0;
105
+ }
106
+
107
+ /* Body:24px padding */
108
+
109
+ .ant-modal-body,
110
+ .pisell-lowcode-modal-body {
111
+ padding: 24px;
112
+ }
113
+
114
+ /* 表单:表单项间距 24px */
115
+
116
+ .pisell-contact-brief-modal-form.ant-form,
117
+ .pisell-contact-brief-modal-form.pisell-lowcode-form {
118
+ .ant-form-item,
119
+ .pisell-lowcode-form-item {
120
+ margin-bottom: 24px;
121
+ }
122
+
123
+ .ant-form-item:last-child,
124
+ .pisell-lowcode-form-item:last-child {
125
+ margin-bottom: 0;
126
+ }
127
+ }
128
+
129
+ /* 第一行:Firstname + Lastname 两列,间距 16px */
130
+
131
+ .pisell-contact-brief-modal-form-row {
132
+ display: flex;
133
+ gap: 16px;
134
+
135
+ .ant-form-item,
136
+ .pisell-lowcode-form-item {
137
+ flex: 1;
138
+ margin-bottom: 0;
139
+ }
140
+ }
141
+
142
+ /* Label:14px Medium #344054 */
143
+
144
+ .ant-form-item-label > label,
145
+ .pisell-lowcode-form-item-label > label {
146
+ font-size: 14px;
147
+ font-weight: 500;
148
+ line-height: 20px;
149
+ color: #344054;
150
+ }
151
+
152
+ /* Footer:顶部分割线、24px padding、按钮间距 12px */
153
+
154
+ .ant-modal-footer,
155
+ .pisell-lowcode-modal-footer {
156
+ padding: 24px;
157
+ border-top: 1px solid #eaecf0;
158
+ gap: 12px;
159
+ margin-top: 0;
160
+ }
161
+
162
+ /* 取消:白底、边框 #D0D5DD、48px 高、16px Semibold #344054 */
163
+
164
+ .ant-btn-default,
165
+ .pisell-lowcode-btn-default {
166
+ height: 48px;
167
+ padding: 12px 20px;
168
+ border-radius: 8px;
169
+ border-color: #d0d5dd;
170
+ font-size: 16px;
171
+ font-weight: 600;
172
+ line-height: 24px;
173
+ color: #344054;
174
+ box-shadow: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
175
+ }
176
+
177
+ /* 主按钮:Primary #7F56D9、白字 */
178
+
179
+ .ant-btn-primary,
180
+ .pisell-lowcode-btn-primary {
181
+ height: 48px;
182
+ padding: 12px 20px;
183
+ border-radius: 8px;
184
+ background-color: #7f56d9;
185
+ border-color: #7f56d9;
186
+ font-size: 16px;
187
+ font-weight: 600;
188
+ line-height: 24px;
189
+ color: #fff;
190
+ box-shadow: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
191
+ }
192
+ }
@@ -0,0 +1,31 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { PisellContactBrief } from './PisellContactBrief';
3
+ declare const meta: Meta<typeof PisellContactBrief>;
4
+ export default meta;
5
+ declare type Story = StoryObj<typeof PisellContactBrief>;
6
+ /** 默认:姓名 + 电话 + 邮箱,横向,有编辑图标 */
7
+ export declare const Default: Story;
8
+ /** 无头像(占位) */
9
+ export declare const NoAvatar: Story;
10
+ /** 有头像 */
11
+ export declare const WithAvatar: Story;
12
+ /** 竖向布局 */
13
+ export declare const Vertical: Story;
14
+ /** 仅姓名 + 电话(无邮箱) */
15
+ export declare const NoEmail: Story;
16
+ /** 仅姓名 + 邮箱(无电话) */
17
+ export declare const NoPhone: Story;
18
+ /** 扩展字段:生日、地址 */
19
+ export declare const WithExtraFields: Story;
20
+ /** 左滑删除 */
21
+ export declare const SwipeToDelete: Story;
22
+ /** 编辑提交回调(仅日志) */
23
+ export declare const WithEditSubmit: Story;
24
+ /** 禁用态 */
25
+ export declare const Disabled: Story;
26
+ /** 主文案行数限制为 1 */
27
+ export declare const PrimaryLineClamp: Story;
28
+ /** 新建联系人按钮(CreateButton) */
29
+ export declare const CreateButtonOnly: Story;
30
+ /** 卡片 + 新建按钮(列表场景) */
31
+ export declare const ListWithCreateButton: Story;