@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,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { PisellActionPanel } from './PisellActionPanel';
3
+ declare const meta: Meta<typeof PisellActionPanel>;
4
+ export default meta;
5
+ declare type Story = StoryObj<typeof PisellActionPanel>;
6
+ /** 默认:单组两按钮 */
7
+ export declare const Default: Story;
8
+ /** 右对齐(表单底部常见) */
9
+ export declare const AlignRight: Story;
10
+ /** 多组:主操作 + 危险操作 */
11
+ export declare const MultipleGroups: Story;
12
+ /** 竖向布局 */
13
+ export declare const VerticalLayout: Story;
14
+ /** 条件显隐(某条 visible: false) */
15
+ export declare const ConditionalVisible: Story;
16
+ /** 居中 */
17
+ export declare const AlignCenter: Story;
18
+ /** space-between 两端对齐 */
19
+ export declare const SpaceBetween: Story;
@@ -0,0 +1,208 @@
1
+ import { DeleteOutlined, EditOutlined, SaveOutlined } from '@ant-design/icons';
2
+ import { PisellActionPanel } from "./PisellActionPanel";
3
+ var meta = {
4
+ title: 'General/PisellActionPanel',
5
+ component: PisellActionPanel,
6
+ tags: ['autodocs'],
7
+ argTypes: {
8
+ layout: {
9
+ description: '布局方式',
10
+ control: 'select',
11
+ options: ['horizontal', 'vertical', 'grid']
12
+ },
13
+ align: {
14
+ description: '对齐方式',
15
+ control: 'select',
16
+ options: ['left', 'center', 'right', 'space-between']
17
+ },
18
+ overflowStrategy: {
19
+ description: '溢出策略',
20
+ control: 'select',
21
+ options: ['wrap', 'scroll', 'moreMenu']
22
+ }
23
+ },
24
+ args: {
25
+ groups: [{
26
+ items: [{
27
+ label: '取消',
28
+ onClick: function onClick() {
29
+ return console.log('取消');
30
+ }
31
+ }, {
32
+ label: '确定',
33
+ priority: 'primary',
34
+ onClick: function onClick() {
35
+ return console.log('确定');
36
+ }
37
+ }]
38
+ }]
39
+ }
40
+ };
41
+ export default meta;
42
+ /** 默认:单组两按钮 */
43
+ export var Default = {
44
+ args: {
45
+ groups: [{
46
+ items: [{
47
+ label: '取消',
48
+ onClick: function onClick() {
49
+ return console.log('取消');
50
+ }
51
+ }, {
52
+ label: '确定',
53
+ priority: 'primary',
54
+ onClick: function onClick() {
55
+ return console.log('确定');
56
+ }
57
+ }]
58
+ }]
59
+ }
60
+ };
61
+
62
+ /** 右对齐(表单底部常见) */
63
+ export var AlignRight = {
64
+ args: {
65
+ groups: [{
66
+ items: [{
67
+ label: '取消',
68
+ onClick: function onClick() {
69
+ return console.log('取消');
70
+ }
71
+ }, {
72
+ label: '提交',
73
+ priority: 'primary',
74
+ onClick: function onClick() {
75
+ return console.log('提交');
76
+ }
77
+ }]
78
+ }],
79
+ align: 'right',
80
+ groupGap: 16,
81
+ itemGap: 8
82
+ }
83
+ };
84
+
85
+ /** 多组:主操作 + 危险操作 */
86
+ export var MultipleGroups = {
87
+ args: {
88
+ groups: [{
89
+ items: [{
90
+ label: '编辑',
91
+ icon: /*#__PURE__*/React.createElement(EditOutlined, null),
92
+ onClick: function onClick() {
93
+ return console.log('编辑');
94
+ }
95
+ }, {
96
+ label: '删除',
97
+ icon: /*#__PURE__*/React.createElement(DeleteOutlined, null),
98
+ priority: 'danger',
99
+ onClick: function onClick() {
100
+ return console.log('删除');
101
+ }
102
+ }]
103
+ }, {
104
+ items: [{
105
+ label: '取消',
106
+ onClick: function onClick() {
107
+ return console.log('取消');
108
+ }
109
+ }, {
110
+ label: '保存',
111
+ icon: /*#__PURE__*/React.createElement(SaveOutlined, null),
112
+ priority: 'primary',
113
+ onClick: function onClick() {
114
+ return console.log('保存');
115
+ }
116
+ }]
117
+ }],
118
+ align: 'right',
119
+ groupGap: 24,
120
+ itemGap: 8
121
+ }
122
+ };
123
+
124
+ /** 竖向布局 */
125
+ export var VerticalLayout = {
126
+ args: {
127
+ layout: 'vertical',
128
+ groups: [{
129
+ items: [{
130
+ label: '主操作',
131
+ priority: 'primary',
132
+ onClick: function onClick() {
133
+ return console.log('主操作');
134
+ }
135
+ }, {
136
+ label: '次操作',
137
+ onClick: function onClick() {
138
+ return console.log('次操作');
139
+ }
140
+ }]
141
+ }]
142
+ }
143
+ };
144
+
145
+ /** 条件显隐(某条 visible: false) */
146
+ export var ConditionalVisible = {
147
+ args: {
148
+ groups: [{
149
+ items: [{
150
+ label: '始终显示',
151
+ onClick: function onClick() {}
152
+ }, {
153
+ label: '隐藏项',
154
+ visible: false,
155
+ onClick: function onClick() {}
156
+ }, {
157
+ label: '确定',
158
+ priority: 'primary',
159
+ onClick: function onClick() {}
160
+ }]
161
+ }]
162
+ }
163
+ };
164
+
165
+ /** 居中 */
166
+ export var AlignCenter = {
167
+ args: {
168
+ align: 'center',
169
+ groups: [{
170
+ items: [{
171
+ label: '取消',
172
+ onClick: function onClick() {}
173
+ }, {
174
+ label: '确定',
175
+ priority: 'primary',
176
+ onClick: function onClick() {}
177
+ }]
178
+ }]
179
+ }
180
+ };
181
+
182
+ /** space-between 两端对齐 */
183
+ export var SpaceBetween = {
184
+ args: {
185
+ align: 'space-between',
186
+ groups: [{
187
+ items: [{
188
+ label: '返回',
189
+ onClick: function onClick() {
190
+ return console.log('返回');
191
+ }
192
+ }]
193
+ }, {
194
+ items: [{
195
+ label: '保存草稿',
196
+ onClick: function onClick() {
197
+ return console.log('草稿');
198
+ }
199
+ }, {
200
+ label: '发布',
201
+ priority: 'primary',
202
+ onClick: function onClick() {
203
+ return console.log('发布');
204
+ }
205
+ }]
206
+ }]
207
+ }
208
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * PisellActionPanel 组件导出
3
+ * 操作面板:统一承载、编排一组用户可执行操作
4
+ */
5
+ export { PisellActionPanel } from './PisellActionPanel';
6
+ export type { PisellActionPanelProps, PisellActionPanelGroup, PisellActionPanelItem, ActionPanelLayout, ActionPanelAlign, ActionPanelOverflowStrategy, ActionPanelItemPriority, } from './types';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * PisellActionPanel 组件导出
3
+ * 操作面板:统一承载、编排一组用户可执行操作
4
+ */
5
+ export { PisellActionPanel } from "./PisellActionPanel";
@@ -0,0 +1,83 @@
1
+ import type { CSSProperties, ReactNode } from 'react';
2
+ /**
3
+ * 操作项层级(主/次/危险)
4
+ */
5
+ export declare type ActionPanelItemPriority = 'primary' | 'secondary' | 'danger' | 'default';
6
+ /**
7
+ * Action Panel 单条操作项
8
+ * 对应设计文档 Action Item,可渲染为 Button / IconButton
9
+ */
10
+ export interface PisellActionPanelItem {
11
+ /** 唯一 key,用于 React key;不传则用 index */
12
+ key?: string;
13
+ /** 展示文案(Button 时显示) */
14
+ label?: string;
15
+ /** 图标节点(可单独图标或与 label 同显) */
16
+ icon?: ReactNode;
17
+ /** 点击回调 */
18
+ onClick?: () => void;
19
+ /** 是否禁用 */
20
+ disabled?: boolean;
21
+ /** 是否显示(条件显隐) @default true */
22
+ visible?: boolean;
23
+ /** 层级:主/次/危险/默认,影响按钮样式 */
24
+ priority?: ActionPanelItemPriority;
25
+ /** 单项内联样式 */
26
+ style?: CSSProperties;
27
+ /** 单项类名 */
28
+ className?: string;
29
+ }
30
+ /**
31
+ * Action Panel 分组
32
+ * 对应设计文档 Action Group,内包含多个 Action Item
33
+ */
34
+ export interface PisellActionPanelGroup {
35
+ /** 唯一 key;不传则用 index */
36
+ key?: string;
37
+ /** 本组操作项 */
38
+ items: PisellActionPanelItem[];
39
+ /** 组内整体优先级(可影响组内按钮默认 priority) */
40
+ priority?: ActionPanelItemPriority;
41
+ /** 是否显示该组 @default true */
42
+ visible?: boolean;
43
+ /** 组内对齐方式(组内多个 item 时的对齐) */
44
+ align?: 'start' | 'center' | 'end';
45
+ /** 组容器类名 */
46
+ className?: string;
47
+ /** 组容器样式 */
48
+ style?: CSSProperties;
49
+ }
50
+ /**
51
+ * Panel 布局方式
52
+ */
53
+ export declare type ActionPanelLayout = 'horizontal' | 'vertical' | 'grid';
54
+ /**
55
+ * Panel 对齐方式
56
+ */
57
+ export declare type ActionPanelAlign = 'left' | 'center' | 'right' | 'space-between';
58
+ /**
59
+ * 溢出策略:换行 / 滚动 / 更多菜单收纳
60
+ */
61
+ export declare type ActionPanelOverflowStrategy = 'wrap' | 'scroll' | 'moreMenu';
62
+ /**
63
+ * PisellActionPanel 组件 Props
64
+ * 设计文档:Action Panel (pcp_ge_actionPanel_V1.0)
65
+ */
66
+ export interface PisellActionPanelProps {
67
+ /** 操作分组列表,顺序即展示顺序 */
68
+ groups: PisellActionPanelGroup[];
69
+ /** 布局方式 @default 'horizontal' */
70
+ layout?: ActionPanelLayout;
71
+ /** 整体对齐方式 @default 'left' */
72
+ align?: ActionPanelAlign;
73
+ /** 溢出策略 @default 'wrap' */
74
+ overflowStrategy?: ActionPanelOverflowStrategy;
75
+ /** 组与组之间的间距(CSS gap 或 number px) */
76
+ groupGap?: number | string;
77
+ /** 组内操作项之间的间距(CSS gap 或 number px) */
78
+ itemGap?: number | string;
79
+ /** 根节点类名 */
80
+ className?: string;
81
+ /** 根节点样式 */
82
+ style?: CSSProperties;
83
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { PisellBaseCardProps } from './types';
3
+ import './PisellBaseCard.less';
4
+ /**
5
+ * PisellBaseCard 基础卡片容器
6
+ * 提供可定制的容器用于承载子内容,支持默认/悬停/按下/禁用四态样式,可点击时支持焦点与键盘触发
7
+ */
8
+ export declare function PisellBaseCard({ children, className, style, hoverStyle, activeStyle, disabledStyle, clickable, disabled, onClick, }: PisellBaseCardProps): JSX.Element;
@@ -0,0 +1,96 @@
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ 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."); }
4
+ 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); }
5
+ 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; }
6
+ 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; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ 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; }
9
+ 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; }
10
+ 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; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ 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); }
13
+ import React, { useCallback, useState } from 'react';
14
+ import classNames from 'classnames';
15
+ import "./PisellBaseCard.less";
16
+
17
+ /**
18
+ * 合并默认样式与状态样式
19
+ */
20
+ function mergeStateStyle(base, hover, active, disabled, isHover, isActive, isDisabled) {
21
+ var s = _objectSpread({}, base);
22
+ if (isDisabled && disabled) {
23
+ Object.assign(s, disabled);
24
+ return s;
25
+ }
26
+ if (isActive && active) Object.assign(s, active);
27
+ if (isHover && hover) Object.assign(s, hover);
28
+ return s;
29
+ }
30
+
31
+ /**
32
+ * PisellBaseCard 基础卡片容器
33
+ * 提供可定制的容器用于承载子内容,支持默认/悬停/按下/禁用四态样式,可点击时支持焦点与键盘触发
34
+ */
35
+ export function PisellBaseCard(_ref) {
36
+ var children = _ref.children,
37
+ className = _ref.className,
38
+ style = _ref.style,
39
+ hoverStyle = _ref.hoverStyle,
40
+ activeStyle = _ref.activeStyle,
41
+ disabledStyle = _ref.disabledStyle,
42
+ _ref$clickable = _ref.clickable,
43
+ clickable = _ref$clickable === void 0 ? true : _ref$clickable,
44
+ _ref$disabled = _ref.disabled,
45
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
46
+ onClick = _ref.onClick;
47
+ var _useState = useState(false),
48
+ _useState2 = _slicedToArray(_useState, 2),
49
+ isHover = _useState2[0],
50
+ setIsHover = _useState2[1];
51
+ var _useState3 = useState(false),
52
+ _useState4 = _slicedToArray(_useState3, 2),
53
+ isActive = _useState4[0],
54
+ setIsActive = _useState4[1];
55
+ var mergedStyle = mergeStateStyle(style, hoverStyle, activeStyle, disabledStyle, isHover, isActive, disabled);
56
+ var handleClick = useCallback(function (e) {
57
+ if (!clickable || disabled) return;
58
+ onClick === null || onClick === void 0 || onClick(e);
59
+ }, [clickable, disabled, onClick]);
60
+ var handleKeyDown = useCallback(function (e) {
61
+ if (!clickable || disabled) return;
62
+ if (e.key === 'Enter' || e.key === ' ') {
63
+ e.preventDefault();
64
+ e.target.click();
65
+ }
66
+ }, [clickable, disabled]);
67
+ var handlePointerEnter = useCallback(function () {
68
+ if (!disabled) setIsHover(true);
69
+ }, [disabled]);
70
+ var handlePointerLeave = useCallback(function () {
71
+ setIsHover(false);
72
+ setIsActive(false);
73
+ }, []);
74
+ var handlePointerDown = useCallback(function () {
75
+ if (clickable && !disabled) setIsActive(true);
76
+ }, [clickable, disabled]);
77
+ var handlePointerUp = useCallback(function () {
78
+ setIsActive(false);
79
+ }, []);
80
+ var canInteract = clickable && !disabled;
81
+ return /*#__PURE__*/React.createElement("div", {
82
+ className: classNames('pisell-base-card-root', className),
83
+ style: mergedStyle,
84
+ "data-clickable": clickable,
85
+ "data-disabled": disabled,
86
+ role: canInteract ? 'button' : undefined,
87
+ "aria-disabled": disabled ? true : undefined,
88
+ tabIndex: canInteract ? 0 : undefined,
89
+ onClick: handleClick,
90
+ onKeyDown: handleKeyDown,
91
+ onPointerEnter: handlePointerEnter,
92
+ onPointerLeave: handlePointerLeave,
93
+ onPointerDown: handlePointerDown,
94
+ onPointerUp: handlePointerUp
95
+ }, children);
96
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * PisellBaseCard 样式
3
+ * 默认态依设计稿写死:背景 #FFF、边框 #EAECF0、圆角 12px、padding 16px、阴影
4
+ */
5
+ .pisell-base-card-root {
6
+ box-sizing: border-box;
7
+ /* 设计稿默认:背景、边框、圆角、内边距、阴影 */
8
+ background-color: #ffffff;
9
+ border: 1px solid #eaecf0;
10
+ border-radius: 12px;
11
+ padding: 16px;
12
+ box-shadow: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
13
+ /* 最小 padding 避免内容贴边 */
14
+ min-height: 0;
15
+ min-width: 0;
16
+
17
+ /* 可点击时鼠标指针 */
18
+ &[data-clickable='true'] {
19
+ cursor: pointer;
20
+ }
21
+
22
+ &[data-disabled='true'] {
23
+ cursor: not-allowed;
24
+ }
25
+ }
@@ -0,0 +1,19 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { PisellBaseCard } from './PisellBaseCard';
3
+ declare const meta: Meta<typeof PisellBaseCard>;
4
+ export default meta;
5
+ declare type Story = StoryObj<typeof PisellBaseCard>;
6
+ /** 默认:可点击、无内容 */
7
+ export declare const Default: Story;
8
+ /** 带内容 */
9
+ export declare const WithChildren: Story;
10
+ /** 可点击并带点击回调 */
11
+ export declare const Clickable: Story;
12
+ /** 禁用态 */
13
+ export declare const Disabled: Story;
14
+ /** 不可点击(仅容器) */
15
+ export declare const NotClickable: Story;
16
+ /** 自定义默认样式 */
17
+ export declare const CustomStyle: Story;
18
+ /** 悬停/按下/禁用样式 */
19
+ export declare const StateStyles: Story;
@@ -0,0 +1,99 @@
1
+ import { PisellBaseCard } from "./PisellBaseCard";
2
+ var meta = {
3
+ title: 'Data Display/PisellBaseCard',
4
+ component: PisellBaseCard,
5
+ tags: ['autodocs'],
6
+ argTypes: {
7
+ clickable: {
8
+ description: '是否可点击',
9
+ control: 'boolean'
10
+ },
11
+ disabled: {
12
+ description: '是否禁用',
13
+ control: 'boolean'
14
+ },
15
+ children: {
16
+ description: '卡片内容',
17
+ control: 'text'
18
+ }
19
+ }
20
+ };
21
+ export default meta;
22
+ /** 默认:可点击、无内容 */
23
+ export var Default = {
24
+ args: {}
25
+ };
26
+
27
+ /** 带内容 */
28
+ export var WithChildren = {
29
+ args: {
30
+ children: /*#__PURE__*/React.createElement("div", {
31
+ style: {
32
+ padding: 8
33
+ }
34
+ }, /*#__PURE__*/React.createElement("div", null, "\u6807\u9898"), /*#__PURE__*/React.createElement("div", {
35
+ style: {
36
+ color: '#666',
37
+ fontSize: 14
38
+ }
39
+ }, "\u63CF\u8FF0\u6587\u5B57"))
40
+ }
41
+ };
42
+
43
+ /** 可点击并带点击回调 */
44
+ export var Clickable = {
45
+ args: {
46
+ children: '点击我',
47
+ onClick: function onClick() {
48
+ return alert('卡片被点击');
49
+ }
50
+ }
51
+ };
52
+
53
+ /** 禁用态 */
54
+ export var Disabled = {
55
+ args: {
56
+ children: '禁用卡片',
57
+ disabled: true
58
+ }
59
+ };
60
+
61
+ /** 不可点击(仅容器) */
62
+ export var NotClickable = {
63
+ args: {
64
+ children: '不可点击,无 role',
65
+ clickable: false
66
+ }
67
+ };
68
+
69
+ /** 自定义默认样式 */
70
+ export var CustomStyle = {
71
+ args: {
72
+ children: '自定义背景与圆角',
73
+ style: {
74
+ backgroundColor: '#f0f5ff',
75
+ borderRadius: 16,
76
+ padding: 24
77
+ }
78
+ }
79
+ };
80
+
81
+ /** 悬停/按下/禁用样式 */
82
+ export var StateStyles = {
83
+ args: {
84
+ children: '悬停与按下有样式变化',
85
+ style: {
86
+ padding: 16
87
+ },
88
+ hoverStyle: {
89
+ backgroundColor: '#e6f4ff',
90
+ borderColor: '#91caff'
91
+ },
92
+ activeStyle: {
93
+ backgroundColor: '#bae0ff'
94
+ },
95
+ disabledStyle: {
96
+ opacity: 0.6
97
+ }
98
+ }
99
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * PisellBaseCard 组件导出
3
+ */
4
+ export { PisellBaseCard } from './PisellBaseCard';
5
+ export type { PisellBaseCardProps } from './types';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * PisellBaseCard 组件导出
3
+ */
4
+ export { PisellBaseCard } from "./PisellBaseCard";
@@ -0,0 +1,45 @@
1
+ import type { CSSProperties, ReactNode } from 'react';
2
+ /**
3
+ * PisellBaseCard 组件 Props
4
+ * @description 基础卡片容器,支持四态样式与可点击配置,无选中逻辑(选中由低代码处理)
5
+ */
6
+ export interface PisellBaseCardProps {
7
+ /**
8
+ * 卡片内容,由低代码插槽或直接传入
9
+ */
10
+ children?: ReactNode;
11
+ /**
12
+ * 自定义类名,应用于根节点
13
+ */
14
+ className?: string;
15
+ /**
16
+ * 默认状态下的内联样式(背景、圆角、边框、阴影、padding、宽高等)
17
+ */
18
+ style?: CSSProperties;
19
+ /**
20
+ * 悬停时的样式覆盖,与 style 合并后应用
21
+ */
22
+ hoverStyle?: CSSProperties;
23
+ /**
24
+ * 按下(active)时的样式覆盖,与 style 合并后应用
25
+ */
26
+ activeStyle?: CSSProperties;
27
+ /**
28
+ * 禁用时的样式覆盖,与 style 合并后应用
29
+ */
30
+ disabledStyle?: CSSProperties;
31
+ /**
32
+ * 是否可点击(可聚焦并触发 onClick)
33
+ * @default true
34
+ */
35
+ clickable?: boolean;
36
+ /**
37
+ * 是否禁用,禁用时应用 disabledStyle 且不响应点击与焦点
38
+ * @default false
39
+ */
40
+ disabled?: boolean;
41
+ /**
42
+ * 点击回调,仅在 clickable 且非 disabled 时触发
43
+ */
44
+ onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
45
+ }
@@ -0,0 +1 @@
1
+ export {};