@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,23 @@
1
+ /// <reference types="react" />
2
+ import type { ContactFormValues } from '../types';
3
+ import type { ContactBriefExtraField } from '../types';
4
+ export declare type ContactFormModalMode = 'create' | 'edit';
5
+ export interface ContactFormModalProps {
6
+ /** 显隐 */
7
+ visible: boolean;
8
+ /** 关闭回调 */
9
+ onCancel: () => void;
10
+ /** 提交回调(新建时即 onCreate,编辑时即 onSubmit) */
11
+ onSubmit: (values: ContactFormValues) => void;
12
+ /** 新建 / 编辑 */
13
+ mode: ContactFormModalMode;
14
+ /** 初始值(编辑时传入) */
15
+ initialValues?: Partial<ContactFormValues>;
16
+ /** 可增加字段配置,顺序即表单项顺序 */
17
+ extraFields?: ContactBriefExtraField[];
18
+ }
19
+ /**
20
+ * 联系人新建/编辑弹窗
21
+ * 表单含 Firstname、Lastname、Phone、Email + extraFields,与 Figma 新建/编辑弹窗一致
22
+ */
23
+ export declare function ContactFormModal({ visible, onCancel, onSubmit, mode, initialValues, extraFields, }: ContactFormModalProps): JSX.Element;
@@ -0,0 +1,177 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import React, { useEffect } from 'react';
12
+ import { Form, Modal } from 'antd';
13
+ import { locales } from '@pisell/utils';
14
+ import { PisellSingleLineText } from "../../pisellSingleLineText";
15
+ import { PisellPhone } from "../../pisellPhone";
16
+ import { PisellEmail } from "../../pisellEmail";
17
+ var FIRSTNAME_FIELD = 'firstname';
18
+ var LASTNAME_FIELD = 'lastname';
19
+ var PHONE_FIELD = 'phone';
20
+ var EMAIL_FIELD = 'email';
21
+
22
+ /** 将 name 拆分为 firstname + lastname(按首个空格) */
23
+ function splitName(name) {
24
+ if (!name || !name.trim()) return ['', ''];
25
+ var idx = name.trim().indexOf(' ');
26
+ if (idx <= 0) return [name.trim(), ''];
27
+ return [name.trim().slice(0, idx), name.trim().slice(idx + 1)];
28
+ }
29
+
30
+ /** 将 firstname + lastname 合并为 name */
31
+ function joinName(first, last) {
32
+ return [first, last].map(function (s) {
33
+ return s === null || s === void 0 ? void 0 : s.trim();
34
+ }).filter(Boolean).join(' ');
35
+ }
36
+
37
+ /**
38
+ * 联系人新建/编辑弹窗
39
+ * 表单含 Firstname、Lastname、Phone、Email + extraFields,与 Figma 新建/编辑弹窗一致
40
+ */
41
+ export function ContactFormModal(_ref) {
42
+ var visible = _ref.visible,
43
+ onCancel = _ref.onCancel,
44
+ onSubmit = _ref.onSubmit,
45
+ mode = _ref.mode,
46
+ initialValues = _ref.initialValues,
47
+ _ref$extraFields = _ref.extraFields,
48
+ extraFields = _ref$extraFields === void 0 ? [] : _ref$extraFields;
49
+ var _Form$useForm = Form.useForm(),
50
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
51
+ form = _Form$useForm2[0];
52
+ useEffect(function () {
53
+ if (visible) {
54
+ var _initialValues$name, _initialValues$phone, _initialValues$email;
55
+ var _splitName = splitName(initialValues === null || initialValues === void 0 ? void 0 : initialValues.name),
56
+ _splitName2 = _slicedToArray(_splitName, 2),
57
+ firstname = _splitName2[0],
58
+ lastname = _splitName2[1];
59
+ var _values = {
60
+ firstname: firstname,
61
+ lastname: lastname,
62
+ name: (_initialValues$name = initialValues === null || initialValues === void 0 ? void 0 : initialValues.name) !== null && _initialValues$name !== void 0 ? _initialValues$name : '',
63
+ phone: (_initialValues$phone = initialValues === null || initialValues === void 0 ? void 0 : initialValues.phone) !== null && _initialValues$phone !== void 0 ? _initialValues$phone : '',
64
+ email: (_initialValues$email = initialValues === null || initialValues === void 0 ? void 0 : initialValues.email) !== null && _initialValues$email !== void 0 ? _initialValues$email : ''
65
+ };
66
+ if (initialValues && extraFields.length > 0) {
67
+ extraFields.forEach(function (f) {
68
+ var _initialValues$f$key;
69
+ _values[f.key] = (_initialValues$f$key = initialValues[f.key]) !== null && _initialValues$f$key !== void 0 ? _initialValues$f$key : '';
70
+ });
71
+ }
72
+ form.setFieldsValue(_values);
73
+ }
74
+ }, [visible, initialValues, extraFields, form]);
75
+ var handleOk = /*#__PURE__*/function () {
76
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
77
+ var _raw$firstname, _raw$lastname, raw, name, _values2;
78
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
79
+ while (1) switch (_context.prev = _context.next) {
80
+ case 0:
81
+ _context.prev = 0;
82
+ _context.next = 3;
83
+ return form.validateFields();
84
+ case 3:
85
+ raw = _context.sent;
86
+ name = joinName((_raw$firstname = raw.firstname) !== null && _raw$firstname !== void 0 ? _raw$firstname : '', (_raw$lastname = raw.lastname) !== null && _raw$lastname !== void 0 ? _raw$lastname : '');
87
+ _values2 = {
88
+ name: name,
89
+ phone: raw.phone,
90
+ email: raw.email
91
+ };
92
+ extraFields.forEach(function (f) {
93
+ _values2[f.key] = raw[f.key];
94
+ });
95
+ onSubmit(_values2);
96
+ form.resetFields();
97
+ onCancel();
98
+ _context.next = 14;
99
+ break;
100
+ case 12:
101
+ _context.prev = 12;
102
+ _context.t0 = _context["catch"](0);
103
+ case 14:
104
+ case "end":
105
+ return _context.stop();
106
+ }
107
+ }, _callee, null, [[0, 12]]);
108
+ }));
109
+ return function handleOk() {
110
+ return _ref2.apply(this, arguments);
111
+ };
112
+ }();
113
+ var handleCancel = function handleCancel() {
114
+ form.resetFields();
115
+ onCancel();
116
+ };
117
+ var title = mode === 'create' ? locales.getText('pisell.contact.brief.modal.title.create') : locales.getText('pisell.contact.brief.modal.title.edit');
118
+ var okText = locales.getText('pisell.contact.brief.modal.save');
119
+ var cancelText = locales.getText('pisell.contact.brief.modal.cancel');
120
+ return /*#__PURE__*/React.createElement(Modal, {
121
+ title: title,
122
+ open: visible,
123
+ onOk: handleOk,
124
+ onCancel: handleCancel,
125
+ okText: okText,
126
+ cancelText: cancelText,
127
+ destroyOnClose: true,
128
+ width: 480,
129
+ className: "pisell-contact-brief-modal"
130
+ }, /*#__PURE__*/React.createElement(Form, {
131
+ form: form,
132
+ layout: "vertical",
133
+ preserve: false,
134
+ className: "pisell-contact-brief-modal-form"
135
+ }, /*#__PURE__*/React.createElement("div", {
136
+ className: "pisell-contact-brief-modal-form-row"
137
+ }, /*#__PURE__*/React.createElement(Form.Item, {
138
+ name: FIRSTNAME_FIELD,
139
+ label: locales.getText('pisell.contact.brief.modal.field.firstname'),
140
+ rules: [{
141
+ required: true,
142
+ message: locales.getText('pisell.contact.brief.modal.field.required')
143
+ }],
144
+ className: "pisell-contact-brief-modal-form-item-half"
145
+ }, /*#__PURE__*/React.createElement(PisellSingleLineText, {
146
+ placeholder: "",
147
+ mode: "edit"
148
+ })), /*#__PURE__*/React.createElement(Form.Item, {
149
+ name: LASTNAME_FIELD,
150
+ label: locales.getText('pisell.contact.brief.modal.field.lastname'),
151
+ className: "pisell-contact-brief-modal-form-item-half"
152
+ }, /*#__PURE__*/React.createElement(PisellSingleLineText, {
153
+ placeholder: "",
154
+ mode: "edit"
155
+ }))), /*#__PURE__*/React.createElement(Form.Item, {
156
+ name: PHONE_FIELD,
157
+ label: locales.getText('pisell.contact.brief.modal.field.phone')
158
+ }, /*#__PURE__*/React.createElement(PisellPhone, {
159
+ placeholder: locales.getText('pisell.contact.brief.modal.field.phone.placeholder'),
160
+ mode: "edit"
161
+ })), /*#__PURE__*/React.createElement(Form.Item, {
162
+ name: EMAIL_FIELD,
163
+ label: locales.getText('pisell.contact.brief.modal.field.email')
164
+ }, /*#__PURE__*/React.createElement(PisellEmail, {
165
+ placeholder: locales.getText('pisell.contact.brief.modal.field.email.placeholder'),
166
+ mode: "edit"
167
+ })), extraFields.map(function (f) {
168
+ return /*#__PURE__*/React.createElement(Form.Item, {
169
+ key: f.key,
170
+ name: f.key,
171
+ label: f.label
172
+ }, /*#__PURE__*/React.createElement(PisellSingleLineText, {
173
+ placeholder: "",
174
+ mode: "edit"
175
+ }));
176
+ })));
177
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * PisellContactBrief 子组件导出
3
+ */
4
+ export { ContactFormModal } from './ContactFormModal';
5
+ export type { ContactFormModalProps, ContactFormModalMode } from './ContactFormModal';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * PisellContactBrief 子组件导出
3
+ */
4
+ export { ContactFormModal } from "./ContactFormModal";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * PisellContactBrief 组件导出
3
+ * 联系人简要卡片 + CreateButton(PisellContactBrief.CreateButton)
4
+ */
5
+ export { PisellContactBrief } from './PisellContactBrief';
6
+ export type { PisellContactBriefProps, PisellContactBriefCreateButtonProps, PisellContactBriefComponent, ContactFormValues, ContactBriefExtraField, } from './types';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * PisellContactBrief 组件导出
3
+ * 联系人简要卡片 + CreateButton(PisellContactBrief.CreateButton)
4
+ */
5
+ export { PisellContactBrief } from "./PisellContactBrief";
@@ -0,0 +1,55 @@
1
+ /**
2
+ * PisellContactBrief 多语言文案
3
+ * 中、英、繁;由业务 locales.init 合并或组件内 init 后使用 locales.getText(key)
4
+ */
5
+ declare const _default: {
6
+ en: {
7
+ 'pisell.contact.brief.addContact': string;
8
+ 'pisell.contact.brief.edit': string;
9
+ 'pisell.contact.brief.delete': string;
10
+ 'pisell.contact.brief.modal.title.create': string;
11
+ 'pisell.contact.brief.modal.title.edit': string;
12
+ 'pisell.contact.brief.modal.cancel': string;
13
+ 'pisell.contact.brief.modal.save': string;
14
+ 'pisell.contact.brief.modal.field.firstname': string;
15
+ 'pisell.contact.brief.modal.field.lastname': string;
16
+ 'pisell.contact.brief.modal.field.phone': string;
17
+ 'pisell.contact.brief.modal.field.email': string;
18
+ 'pisell.contact.brief.modal.field.phone.placeholder': string;
19
+ 'pisell.contact.brief.modal.field.email.placeholder': string;
20
+ 'pisell.contact.brief.modal.field.required': string;
21
+ };
22
+ 'zh-CN': {
23
+ 'pisell.contact.brief.addContact': string;
24
+ 'pisell.contact.brief.edit': string;
25
+ 'pisell.contact.brief.delete': string;
26
+ 'pisell.contact.brief.modal.title.create': string;
27
+ 'pisell.contact.brief.modal.title.edit': string;
28
+ 'pisell.contact.brief.modal.cancel': string;
29
+ 'pisell.contact.brief.modal.save': string;
30
+ 'pisell.contact.brief.modal.field.firstname': string;
31
+ 'pisell.contact.brief.modal.field.lastname': string;
32
+ 'pisell.contact.brief.modal.field.phone': string;
33
+ 'pisell.contact.brief.modal.field.email': string;
34
+ 'pisell.contact.brief.modal.field.phone.placeholder': string;
35
+ 'pisell.contact.brief.modal.field.email.placeholder': string;
36
+ 'pisell.contact.brief.modal.field.required': string;
37
+ };
38
+ 'zh-HK': {
39
+ 'pisell.contact.brief.addContact': string;
40
+ 'pisell.contact.brief.edit': string;
41
+ 'pisell.contact.brief.delete': string;
42
+ 'pisell.contact.brief.modal.title.create': string;
43
+ 'pisell.contact.brief.modal.title.edit': string;
44
+ 'pisell.contact.brief.modal.cancel': string;
45
+ 'pisell.contact.brief.modal.save': string;
46
+ 'pisell.contact.brief.modal.field.firstname': string;
47
+ 'pisell.contact.brief.modal.field.lastname': string;
48
+ 'pisell.contact.brief.modal.field.phone': string;
49
+ 'pisell.contact.brief.modal.field.email': string;
50
+ 'pisell.contact.brief.modal.field.phone.placeholder': string;
51
+ 'pisell.contact.brief.modal.field.email.placeholder': string;
52
+ 'pisell.contact.brief.modal.field.required': string;
53
+ };
54
+ };
55
+ export default _default;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * PisellContactBrief 多语言文案
3
+ * 中、英、繁;由业务 locales.init 合并或组件内 init 后使用 locales.getText(key)
4
+ */
5
+ export default {
6
+ en: {
7
+ 'pisell.contact.brief.addContact': 'Add Contact',
8
+ 'pisell.contact.brief.edit': 'Edit',
9
+ 'pisell.contact.brief.delete': 'Delete',
10
+ 'pisell.contact.brief.modal.title.create': 'Add Contact',
11
+ 'pisell.contact.brief.modal.title.edit': 'Edit Contact',
12
+ 'pisell.contact.brief.modal.cancel': 'Cancel',
13
+ 'pisell.contact.brief.modal.save': 'Save',
14
+ 'pisell.contact.brief.modal.field.firstname': 'Firstname',
15
+ 'pisell.contact.brief.modal.field.lastname': 'Lastname',
16
+ 'pisell.contact.brief.modal.field.phone': 'Phone number',
17
+ 'pisell.contact.brief.modal.field.email': 'Email address',
18
+ 'pisell.contact.brief.modal.field.phone.placeholder': '+1 (555) 000-0000',
19
+ 'pisell.contact.brief.modal.field.email.placeholder': 'Enter your email',
20
+ 'pisell.contact.brief.modal.field.required': 'Required'
21
+ },
22
+ 'zh-CN': {
23
+ 'pisell.contact.brief.addContact': '添加联系人',
24
+ 'pisell.contact.brief.edit': '编辑',
25
+ 'pisell.contact.brief.delete': '删除',
26
+ 'pisell.contact.brief.modal.title.create': '新建联系人',
27
+ 'pisell.contact.brief.modal.title.edit': '编辑联系人',
28
+ 'pisell.contact.brief.modal.cancel': '取消',
29
+ 'pisell.contact.brief.modal.save': '保存',
30
+ 'pisell.contact.brief.modal.field.firstname': '名',
31
+ 'pisell.contact.brief.modal.field.lastname': '姓',
32
+ 'pisell.contact.brief.modal.field.phone': '电话',
33
+ 'pisell.contact.brief.modal.field.email': '邮箱',
34
+ 'pisell.contact.brief.modal.field.phone.placeholder': '请输入电话',
35
+ 'pisell.contact.brief.modal.field.email.placeholder': '请输入邮箱',
36
+ 'pisell.contact.brief.modal.field.required': '必填'
37
+ },
38
+ 'zh-HK': {
39
+ 'pisell.contact.brief.addContact': '添加聯繫人',
40
+ 'pisell.contact.brief.edit': '編輯',
41
+ 'pisell.contact.brief.delete': '刪除',
42
+ 'pisell.contact.brief.modal.title.create': '新建聯繫人',
43
+ 'pisell.contact.brief.modal.title.edit': '編輯聯繫人',
44
+ 'pisell.contact.brief.modal.cancel': '取消',
45
+ 'pisell.contact.brief.modal.save': '保存',
46
+ 'pisell.contact.brief.modal.field.firstname': '名',
47
+ 'pisell.contact.brief.modal.field.lastname': '姓',
48
+ 'pisell.contact.brief.modal.field.phone': '電話',
49
+ 'pisell.contact.brief.modal.field.email': '郵箱',
50
+ 'pisell.contact.brief.modal.field.phone.placeholder': '請輸入電話',
51
+ 'pisell.contact.brief.modal.field.email.placeholder': '請輸入郵箱',
52
+ 'pisell.contact.brief.modal.field.required': '必填'
53
+ }
54
+ };
@@ -0,0 +1,82 @@
1
+ import type React from 'react';
2
+ import type { PisellBaseCardProps } from '../pisellBaseCard/types';
3
+ import type { EntityCardLayout } from '../pisellEntityCard/types';
4
+ /**
5
+ * 联系人表单值(新建/编辑弹窗提交结构)
6
+ * 基础字段 name、phone、email + 扩展字段(与 extraFields[].key 对应)扁平在同一对象
7
+ */
8
+ export interface ContactFormValues {
9
+ /** 姓名 */
10
+ name: string;
11
+ /** 电话 */
12
+ phone?: string;
13
+ /** 邮箱 */
14
+ email?: string;
15
+ /** 扩展字段及任意表单项,key 与 extraFields 配置对应 */
16
+ [key: string]: string | undefined;
17
+ }
18
+ /**
19
+ * 可增加字段配置项
20
+ * 顺序即卡片展示与弹窗表单项顺序
21
+ */
22
+ export interface ContactBriefExtraField {
23
+ /** 字段 key,与 extraData / ContactFormValues 对应 */
24
+ key: string;
25
+ /** 展示与表单项 label(可配合多语言) */
26
+ label: string;
27
+ }
28
+ /**
29
+ * PisellContactBrief 组件 Props
30
+ * 基于 PisellEntityCard 展示联系人简要信息,内置编辑弹窗
31
+ */
32
+ export interface PisellContactBriefProps extends Pick<PisellBaseCardProps, 'className' | 'style' | 'hoverStyle' | 'activeStyle' | 'disabledStyle' | 'clickable' | 'disabled' | 'onClick'> {
33
+ /** 联系人姓名(主文案) */
34
+ name: string;
35
+ /** 电话(副标题,与姓名同行) */
36
+ phone?: string;
37
+ /** 邮箱(次级文案) */
38
+ email?: string;
39
+ /** 头像图片地址,不传则显示默认占位 */
40
+ avatar?: string;
41
+ /** 扩展字段值,key 与 extraFields 配置对应 */
42
+ extraData?: Record<string, string>;
43
+ /** 可增加字段配置,顺序即展示与表单顺序 */
44
+ extraFields?: ContactBriefExtraField[];
45
+ /** 编辑弹窗提交回调 */
46
+ onSubmit?: (values: ContactFormValues) => void;
47
+ /** 左滑删除回调(透传 Entity Card) */
48
+ onDelete?: () => void;
49
+ /** 是否开启左滑删除 @default false */
50
+ swipeToDelete?: boolean;
51
+ /** 布局方向 @default 'horizontal' */
52
+ layout?: EntityCardLayout;
53
+ /** 是否显示头像 @default true */
54
+ showAvatar?: boolean;
55
+ /** 是否显示电话 @default true */
56
+ showPhone?: boolean;
57
+ /** 是否显示邮箱 @default true */
58
+ showEmail?: boolean;
59
+ /** 主文案行数限制 */
60
+ primaryLineClamp?: number;
61
+ /** 次级文案行数限制 */
62
+ secondaryLineClamp?: number;
63
+ }
64
+ /**
65
+ * PisellContactBrief.CreateButton 组件 Props
66
+ * 点击后打开新建联系人弹窗
67
+ */
68
+ export interface PisellContactBriefCreateButtonProps extends Pick<PisellBaseCardProps, 'className' | 'style'> {
69
+ /** 可增加字段配置,与卡片一致,弹窗内表单项与之对应 */
70
+ extraFields?: ContactBriefExtraField[];
71
+ /** 新建弹窗提交回调,调用方保存数据后可更新列表 */
72
+ onCreate?: (values: ContactFormValues) => void;
73
+ /** 自定义点击行为;不传则使用内置打开新建弹窗 */
74
+ onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
75
+ }
76
+ /**
77
+ * 复合组件类型:PisellContactBrief + CreateButton
78
+ */
79
+ export interface PisellContactBriefComponent {
80
+ (props: PisellContactBriefProps): React.ReactElement;
81
+ CreateButton: React.ComponentType<PisellContactBriefCreateButtonProps>;
82
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -13,6 +13,14 @@
13
13
  background-color: rgba(0, 0, 0, .04);
14
14
  overflow-x: auto;
15
15
 
16
+ /* 隐藏滚动条:兼容 WebKit(Chrome/Safari/Edge)、Firefox、IE/Edge 旧版 */
17
+ -ms-overflow-style: none;
18
+ scrollbar-width: none;
19
+
20
+ &::-webkit-scrollbar {
21
+ display: none;
22
+ }
23
+
16
24
  &-item {
17
25
  min-height: 36px;
18
26
  min-width: 90px;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { PisellActionPanelProps } from './types';
3
+ import './PisellActionPanel.less';
4
+ /**
5
+ * PisellActionPanel 操作面板
6
+ * 用于统一承载、编排和呈现一组用户可执行操作(Actions)的 Pro 组件。
7
+ * 支持分组、布局、对齐、主/次/危险层级与条件显隐。
8
+ *
9
+ * 设计文档:Action Panel (pcp_ge_actionPanel_V1.0)
10
+ *
11
+ * @param props 组件 Props
12
+ */
13
+ export declare function PisellActionPanel({ groups, layout, align, overflowStrategy, groupGap, itemGap, className, style, }: PisellActionPanelProps): JSX.Element;
@@ -0,0 +1,98 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ import React, { useMemo } from 'react';
8
+ import { Button, Space } from 'antd';
9
+ import classNames from 'classnames';
10
+ import "./PisellActionPanel.less";
11
+
12
+ /**
13
+ * 单条操作项渲染为 Button(带可选 icon)
14
+ * 根据 priority 映射为 antd Button type
15
+ */
16
+ function renderActionItem(item, index) {
17
+ var _item$key, _item$priority;
18
+ var visible = item.visible !== false;
19
+ if (!visible) return null;
20
+ var key = (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : "action-".concat(index);
21
+ var priority = (_item$priority = item.priority) !== null && _item$priority !== void 0 ? _item$priority : 'default';
22
+ var buttonType = priority === 'danger' ? 'primary' : priority === 'primary' ? 'primary' : 'default';
23
+ var danger = priority === 'danger';
24
+ return /*#__PURE__*/React.createElement(Button, {
25
+ key: key,
26
+ type: buttonType,
27
+ danger: danger,
28
+ icon: item.icon,
29
+ onClick: item.onClick,
30
+ disabled: item.disabled,
31
+ className: classNames('pisell-action-panel-btn', item.className),
32
+ style: item.style
33
+ }, item.label);
34
+ }
35
+
36
+ /**
37
+ * PisellActionPanel 操作面板
38
+ * 用于统一承载、编排和呈现一组用户可执行操作(Actions)的 Pro 组件。
39
+ * 支持分组、布局、对齐、主/次/危险层级与条件显隐。
40
+ *
41
+ * 设计文档:Action Panel (pcp_ge_actionPanel_V1.0)
42
+ *
43
+ * @param props 组件 Props
44
+ */
45
+ export function PisellActionPanel(_ref) {
46
+ var groups = _ref.groups,
47
+ _ref$layout = _ref.layout,
48
+ layout = _ref$layout === void 0 ? 'horizontal' : _ref$layout,
49
+ _ref$align = _ref.align,
50
+ align = _ref$align === void 0 ? 'left' : _ref$align,
51
+ _ref$overflowStrategy = _ref.overflowStrategy,
52
+ overflowStrategy = _ref$overflowStrategy === void 0 ? 'wrap' : _ref$overflowStrategy,
53
+ groupGap = _ref.groupGap,
54
+ itemGap = _ref.itemGap,
55
+ className = _ref.className,
56
+ style = _ref.style;
57
+ /** 过滤可见分组,并过滤每组内可见项 */
58
+ var effectiveGroups = useMemo(function () {
59
+ return groups.filter(function (g) {
60
+ return g.visible !== false;
61
+ }).map(function (g) {
62
+ return _objectSpread(_objectSpread({}, g), {}, {
63
+ items: g.items.filter(function (i) {
64
+ return i.visible !== false;
65
+ })
66
+ });
67
+ }).filter(function (g) {
68
+ return g.items.length > 0;
69
+ });
70
+ }, [groups]);
71
+ var rootStyle = useMemo(function () {
72
+ var s = _objectSpread({}, style);
73
+ if (groupGap !== undefined) {
74
+ s.gap = typeof groupGap === 'number' ? "".concat(groupGap, "px") : groupGap;
75
+ }
76
+ return s;
77
+ }, [style, groupGap]);
78
+ var itemGapValue = typeof itemGap === 'number' ? itemGap : itemGap !== null && itemGap !== void 0 ? itemGap : 8;
79
+ var isVertical = layout === 'vertical';
80
+ return /*#__PURE__*/React.createElement("div", {
81
+ className: classNames('pisell-action-panel-root', "pisell-action-panel-layout-".concat(layout), "pisell-action-panel-align-".concat(align), overflowStrategy === 'scroll' && 'pisell-action-panel-overflow-scroll', overflowStrategy === 'wrap' && 'pisell-action-panel-overflow-wrap', className),
82
+ style: rootStyle
83
+ }, effectiveGroups.map(function (group, groupIndex) {
84
+ var _group$key;
85
+ return /*#__PURE__*/React.createElement("div", {
86
+ key: (_group$key = group.key) !== null && _group$key !== void 0 ? _group$key : "group-".concat(groupIndex),
87
+ className: classNames('pisell-action-panel-group', group.className),
88
+ style: group.style
89
+ }, /*#__PURE__*/React.createElement(Space, {
90
+ size: itemGapValue,
91
+ direction: isVertical ? 'vertical' : 'horizontal',
92
+ wrap: !isVertical && overflowStrategy === 'wrap',
93
+ className: "pisell-action-panel-group-space"
94
+ }, group.items.map(function (item, itemIndex) {
95
+ return renderActionItem(item, itemIndex);
96
+ })));
97
+ }));
98
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * PisellActionPanel 样式
3
+ * 操作面板:分组、布局、对齐;不设置 font-family,使用项目统一配置
4
+ * 覆盖 antd 时使用 pisell-lowcode-xxx
5
+ */
6
+
7
+ .pisell-action-panel-root {
8
+ display: flex;
9
+ flex-wrap: wrap;
10
+ align-items: center;
11
+ min-width: 0;
12
+ box-sizing: border-box;
13
+
14
+ &.pisell-action-panel-layout-horizontal {
15
+ flex-direction: row;
16
+ }
17
+
18
+ &.pisell-action-panel-layout-vertical {
19
+ flex-direction: column;
20
+ align-items: stretch;
21
+ }
22
+
23
+ &.pisell-action-panel-layout-grid {
24
+ display: grid;
25
+ grid-auto-flow: column;
26
+ align-items: center;
27
+ }
28
+
29
+ &.pisell-action-panel-align-left {
30
+ justify-content: flex-start;
31
+ }
32
+
33
+ &.pisell-action-panel-align-center {
34
+ justify-content: center;
35
+ }
36
+
37
+ &.pisell-action-panel-align-right {
38
+ justify-content: flex-end;
39
+ }
40
+
41
+ &.pisell-action-panel-align-space-between {
42
+ justify-content: space-between;
43
+ }
44
+
45
+ &.pisell-action-panel-overflow-wrap {
46
+ flex-wrap: wrap;
47
+ }
48
+
49
+ &.pisell-action-panel-overflow-scroll {
50
+ flex-wrap: nowrap;
51
+ overflow-x: auto;
52
+ overflow-y: hidden;
53
+ }
54
+ }
55
+
56
+ .pisell-action-panel-group {
57
+ display: inline-flex;
58
+ align-items: center;
59
+ min-width: 0;
60
+ }
61
+
62
+ .pisell-action-panel-group-space {
63
+ display: inline-flex;
64
+ min-width: 0;
65
+ }
66
+
67
+ .pisell-action-panel-btn {
68
+ flex-shrink: 0;
69
+ }