@hsu-react/ui 0.0.1 → 0.0.3

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 (175) hide show
  1. package/README.md +2 -0
  2. package/es/components/ChainGraph/_components/SearchSelect/index.js +13 -10
  3. package/es/components/ChainGraph/_components/SearchSelect/index.module.less +8 -2
  4. package/es/components/ChainGraph/index.module.less +1 -1
  5. package/es/components/Chat/ChatInput/_components/SendButton/index.module.less +1 -1
  6. package/es/components/Chat/ChatInput/_components/UploadButton/index.module.less +1 -1
  7. package/es/components/Chat/ChatInput/index.module.less +2 -2
  8. package/es/components/Chat/ChatList/_components/Assistant/AssistantItem/index.module.less +1 -1
  9. package/es/components/Checkbox/CheckboxGroup/index.module.less +16 -16
  10. package/es/components/Checkbox/index.module.less +13 -13
  11. package/es/components/CodeMirror/index.module.less +4 -4
  12. package/es/components/DatePicker/RangePicker/index.module.less +1 -1
  13. package/es/components/DatePicker/StepPicker/index.module.less +1 -1
  14. package/es/components/DatePicker/index.module.less +2 -1
  15. package/es/components/Form/DrawerForm/index.module.less +2 -2
  16. package/es/components/FormItem/FormInput/FormPasswordStrength/index.js +2 -2
  17. package/es/components/FormItem/FormInput/FormPasswordStrength/index.module.less +12 -0
  18. package/es/components/FormItem/FormRadio/index.module.less +9 -9
  19. package/es/components/FormItem/FormSegmented/index.module.less +2 -2
  20. package/es/components/FormItem/FormUpload/index.module.less +4 -4
  21. package/es/components/FormItem/ItemContainer/index.module.less +22 -22
  22. package/es/components/Icon/index.js +9 -24
  23. package/es/components/Input/Number/index.module.less +9 -9
  24. package/es/components/Input/Password/index.module.less +3 -3
  25. package/es/components/Input/Range/index.module.less +4 -4
  26. package/es/components/Input/Search/index.module.less +5 -5
  27. package/es/components/Input/TextArea/index.module.less +5 -5
  28. package/es/components/Input/index.module.less +7 -4
  29. package/es/components/Modal/index.module.less +2 -2
  30. package/es/components/Operate/index.module.less +2 -2
  31. package/es/components/Panel/IframePanel/index.module.less +1 -1
  32. package/es/components/Panel/ListPanel/_components/ColumnMgt/index.module.less +1 -1
  33. package/es/components/Search/index.module.less +2 -2
  34. package/es/components/Select/AutoCompleteSelect/index.module.less +35 -35
  35. package/es/components/Select/IconSelect/index.module.less +3 -3
  36. package/es/components/Select/TreeSelect/index.module.less +17 -17
  37. package/es/components/Select/_utils/getElementPosition.d.ts +6 -2
  38. package/es/components/Select/_utils/getElementPosition.js +8 -6
  39. package/es/components/Select/index.module.less +37 -34
  40. package/es/components/Slider/index.module.less +5 -4
  41. package/es/components/Spreadsheet/index.module.less +4 -4
  42. package/es/components/Switch/index.js +12 -8
  43. package/es/components/Switch/index.module.less +7 -0
  44. package/es/components/Table/_components/Pagination/index.module.less +23 -23
  45. package/es/components/Table/index.module.less +61 -61
  46. package/es/components/Tree/index.module.less +11 -11
  47. package/es/components/Upload/index.module.less +3 -3
  48. package/es/styles/antd-overload.less +1 -1
  49. package/lib/components/ChainGraph/_components/SearchSelect/index.js +10 -7
  50. package/lib/components/ChainGraph/_components/SearchSelect/index.module.less +8 -2
  51. package/lib/components/ChainGraph/index.module.less +1 -1
  52. package/lib/components/Chat/ChatInput/_components/SendButton/index.module.less +1 -1
  53. package/lib/components/Chat/ChatInput/_components/UploadButton/index.module.less +1 -1
  54. package/lib/components/Chat/ChatInput/index.module.less +2 -2
  55. package/lib/components/Chat/ChatList/_components/Assistant/AssistantItem/index.module.less +1 -1
  56. package/lib/components/Checkbox/CheckboxGroup/index.module.less +16 -16
  57. package/lib/components/Checkbox/index.module.less +13 -13
  58. package/lib/components/CodeMirror/index.module.less +4 -4
  59. package/lib/components/DatePicker/RangePicker/index.module.less +1 -1
  60. package/lib/components/DatePicker/StepPicker/index.module.less +1 -1
  61. package/lib/components/DatePicker/index.module.less +2 -1
  62. package/lib/components/Form/DrawerForm/index.module.less +2 -2
  63. package/lib/components/FormItem/FormInput/FormPasswordStrength/index.js +2 -1
  64. package/lib/components/FormItem/FormInput/FormPasswordStrength/index.module.less +12 -0
  65. package/lib/components/FormItem/FormRadio/index.module.less +9 -9
  66. package/lib/components/FormItem/FormSegmented/index.module.less +2 -2
  67. package/lib/components/FormItem/FormUpload/index.module.less +4 -4
  68. package/lib/components/FormItem/ItemContainer/index.module.less +22 -22
  69. package/lib/components/Icon/index.js +9 -27
  70. package/lib/components/Input/Number/index.module.less +9 -9
  71. package/lib/components/Input/Password/index.module.less +3 -3
  72. package/lib/components/Input/Range/index.module.less +4 -4
  73. package/lib/components/Input/Search/index.module.less +5 -5
  74. package/lib/components/Input/TextArea/index.module.less +5 -5
  75. package/lib/components/Input/index.module.less +7 -4
  76. package/lib/components/Modal/index.module.less +2 -2
  77. package/lib/components/Operate/index.module.less +2 -2
  78. package/lib/components/Panel/IframePanel/index.module.less +1 -1
  79. package/lib/components/Panel/ListPanel/_components/ColumnMgt/index.module.less +1 -1
  80. package/lib/components/Search/index.module.less +2 -2
  81. package/lib/components/Select/AutoCompleteSelect/index.module.less +35 -35
  82. package/lib/components/Select/IconSelect/index.module.less +3 -3
  83. package/lib/components/Select/TreeSelect/index.module.less +17 -17
  84. package/lib/components/Select/_utils/getElementPosition.d.ts +6 -2
  85. package/lib/components/Select/_utils/getElementPosition.js +8 -6
  86. package/lib/components/Select/index.module.less +37 -34
  87. package/lib/components/Slider/index.module.less +5 -4
  88. package/lib/components/Spreadsheet/index.module.less +4 -4
  89. package/lib/components/Switch/index.js +8 -4
  90. package/lib/components/Switch/index.module.less +7 -0
  91. package/lib/components/Table/_components/Pagination/index.module.less +23 -23
  92. package/lib/components/Table/index.module.less +61 -61
  93. package/lib/components/Tree/index.module.less +11 -11
  94. package/lib/components/Upload/index.module.less +3 -3
  95. package/lib/styles/antd-overload.less +1 -1
  96. package/package.json +1 -1
  97. package/src/components/Button/index.md +20 -4
  98. package/src/components/ChainGraph/_components/SearchSelect/index.module.less +8 -2
  99. package/src/components/ChainGraph/_components/SearchSelect/index.tsx +18 -16
  100. package/src/components/ChainGraph/index.md +67 -1
  101. package/src/components/ChainGraph/index.module.less +1 -1
  102. package/src/components/Chart/index.md +351 -1
  103. package/src/components/Chat/ChatInput/_components/SendButton/index.module.less +1 -1
  104. package/src/components/Chat/ChatInput/_components/UploadButton/index.module.less +1 -1
  105. package/src/components/Chat/ChatInput/index.module.less +2 -2
  106. package/src/components/Chat/ChatList/_components/Assistant/AssistantItem/index.module.less +1 -1
  107. package/src/components/Chat/index.md +140 -1
  108. package/src/components/Checkbox/CheckboxGroup/index.module.less +16 -16
  109. package/src/components/Checkbox/index.md +85 -1
  110. package/src/components/Checkbox/index.module.less +13 -13
  111. package/src/components/CodeMirror/index.md +41 -1
  112. package/src/components/CodeMirror/index.module.less +4 -4
  113. package/src/components/Copy/index.md +1 -1
  114. package/src/components/DatePicker/RangePicker/index.module.less +1 -1
  115. package/src/components/DatePicker/StepPicker/index.module.less +1 -1
  116. package/src/components/DatePicker/index.md +82 -1
  117. package/src/components/DatePicker/index.module.less +2 -1
  118. package/src/components/Descriptions/index.md +45 -1
  119. package/src/components/Editor/index.md +40 -1
  120. package/src/components/FileCol/index.md +24 -1
  121. package/src/components/FilePreview/index.md +45 -1
  122. package/src/components/FlexFill/index.md +46 -1
  123. package/src/components/Form/DrawerForm/index.module.less +2 -2
  124. package/src/components/Form/index.md +179 -1
  125. package/src/components/FormItem/FormInput/FormPasswordStrength/index.module.less +12 -0
  126. package/src/components/FormItem/FormInput/FormPasswordStrength/index.tsx +2 -2
  127. package/src/components/FormItem/FormRadio/index.module.less +9 -9
  128. package/src/components/FormItem/FormSegmented/index.module.less +2 -2
  129. package/src/components/FormItem/FormUpload/index.module.less +4 -4
  130. package/src/components/FormItem/ItemContainer/index.module.less +22 -22
  131. package/src/components/FormItem/index.md +514 -1
  132. package/src/components/Icon/index.md +24 -4
  133. package/src/components/Icon/index.tsx +9 -37
  134. package/src/components/Input/Number/index.module.less +9 -9
  135. package/src/components/Input/Password/index.module.less +3 -3
  136. package/src/components/Input/Range/index.module.less +4 -4
  137. package/src/components/Input/Search/index.module.less +5 -5
  138. package/src/components/Input/TextArea/index.module.less +5 -5
  139. package/src/components/Input/index.md +148 -1
  140. package/src/components/Input/index.module.less +7 -4
  141. package/src/components/Markdown/index.md +73 -1
  142. package/src/components/Modal/index.md +43 -1
  143. package/src/components/Modal/index.module.less +2 -2
  144. package/src/components/Operate/index.md +43 -1
  145. package/src/components/Operate/index.module.less +2 -2
  146. package/src/components/Panel/IframePanel/index.module.less +1 -1
  147. package/src/components/Panel/ListPanel/_components/ColumnMgt/index.module.less +1 -1
  148. package/src/components/Panel/index.md +193 -1
  149. package/src/components/Search/index.md +248 -1
  150. package/src/components/Search/index.module.less +2 -2
  151. package/src/components/SecondConf/index.md +39 -1
  152. package/src/components/Select/AutoCompleteSelect/index.module.less +35 -35
  153. package/src/components/Select/IconSelect/index.module.less +3 -3
  154. package/src/components/Select/TreeSelect/index.module.less +17 -17
  155. package/src/components/Select/_utils/getElementPosition.ts +8 -6
  156. package/src/components/Select/index.md +47 -1
  157. package/src/components/Select/index.module.less +37 -34
  158. package/src/components/Slider/index.md +28 -1
  159. package/src/components/Slider/index.module.less +5 -4
  160. package/src/components/Spreadsheet/index.md +42 -1
  161. package/src/components/Spreadsheet/index.module.less +4 -4
  162. package/src/components/Switch/index.md +33 -1
  163. package/src/components/Switch/index.module.less +7 -0
  164. package/src/components/Switch/index.tsx +14 -11
  165. package/src/components/TabBar/index.md +70 -1
  166. package/src/components/Table/_components/Pagination/index.module.less +23 -23
  167. package/src/components/Table/index.md +60 -1
  168. package/src/components/Table/index.module.less +61 -61
  169. package/src/components/Tags/index.md +23 -1
  170. package/src/components/TextEllipsis/index.md +29 -1
  171. package/src/components/Tree/index.md +66 -1
  172. package/src/components/Tree/index.module.less +11 -11
  173. package/src/components/Upload/index.md +72 -1
  174. package/src/components/Upload/index.module.less +3 -3
  175. package/src/styles/antd-overload.less +1 -1
@@ -15,16 +15,16 @@
15
15
  cursor: pointer;
16
16
  }
17
17
 
18
- .ant-table-container {
18
+ :global(.ant-table-container) {
19
19
  border-left: none !important;
20
20
  }
21
21
 
22
- .ant-table-thead {
22
+ :global(.ant-table-thead) {
23
23
  tr {
24
- .ant-table-cell {
24
+ :global(.ant-table-cell) {
25
25
  padding: var(--th-padding);
26
26
 
27
- &.ant-table-column-has-sorters {
27
+ &:global(.ant-table-column-has-sorters) {
28
28
  background: var(--cf-subtle);
29
29
 
30
30
  &:hover {
@@ -35,22 +35,22 @@
35
35
  }
36
36
  }
37
37
 
38
- .ant-table-tbody {
39
- .ant-table-placeholder {
38
+ :global(.ant-table-tbody) {
39
+ :global(.ant-table-placeholder) {
40
40
  height: 100%;
41
41
  }
42
42
 
43
- .ant-table-expanded-row {
44
- .ant-table-cell {
43
+ :global(.ant-table-expanded-row) {
44
+ :global(.ant-table-cell) {
45
45
  padding: var(--expanded-cell-padding);
46
46
  }
47
47
  }
48
48
 
49
- .ant-table-row {
50
- .ant-table-cell {
49
+ :global(.ant-table-row) {
50
+ :global(.ant-table-cell) {
51
51
  padding: var(--td-padding);
52
52
 
53
- &:not(.ant-table-cell-ellipsis):not(.noWarp) {
53
+ &:not(:global(.ant-table-cell-ellipsis)):not(.noWarp) {
54
54
  white-space: pre-wrap;
55
55
  word-break: break-all;
56
56
  }
@@ -59,21 +59,21 @@
59
59
  white-space: nowrap;
60
60
  }
61
61
 
62
- &.ant-table-column-sort {
62
+ &:global(.ant-table-column-sort) {
63
63
  background: transparent;
64
64
 
65
- &.ant-table-cell-row-hover {
65
+ &:global(.ant-table-cell-row-hover) {
66
66
  background: var(--cf-subtle);
67
67
  }
68
68
  }
69
69
  }
70
70
 
71
- &.ant-table-row-selected {
72
- .ant-table-cell {
73
- &.ant-table-column-sort {
71
+ &:global(.ant-table-row-selected) {
72
+ :global(.ant-table-cell) {
73
+ &:global(.ant-table-column-sort) {
74
74
  background: rgba(19, 194, 194, 0.12);
75
75
 
76
- &.ant-table-cell-row-hover {
76
+ &:global(.ant-table-cell-row-hover) {
77
77
  background: rgba(19, 194, 194, 0.22);
78
78
  }
79
79
  }
@@ -82,15 +82,15 @@
82
82
  }
83
83
  }
84
84
 
85
- .ant-table-summary {
85
+ :global(.ant-table-summary) {
86
86
  > tr {
87
- .ant-table-cell {
87
+ :global(.ant-table-cell) {
88
88
  padding: var(--td-padding);
89
89
 
90
- &.ant-table-column-sort {
90
+ &:global(.ant-table-column-sort) {
91
91
  background: transparent;
92
92
 
93
- &.ant-table-cell-row-hover {
93
+ &:global(.ant-table-cell-row-hover) {
94
94
  background: var(--cf-subtle);
95
95
  }
96
96
  }
@@ -98,11 +98,11 @@
98
98
  }
99
99
  }
100
100
 
101
- .ant-table-tbody-virtual-scrollbar {
101
+ :global(.ant-table-tbody-virtual-scrollbar) {
102
102
  display: none;
103
103
  }
104
104
 
105
- .ant-table-cell {
105
+ :global(.ant-table-cell) {
106
106
  &.hidden {
107
107
  width: 0px !important;
108
108
  overflow: hidden !important;
@@ -115,7 +115,7 @@
115
115
  }
116
116
  }
117
117
 
118
- .ant-table-row-expand-icon {
118
+ :global(.ant-table-row-expand-icon) {
119
119
  &::before {
120
120
  top: calc(50% - 0.5px);
121
121
  }
@@ -128,9 +128,9 @@
128
128
  content: none !important;
129
129
  }
130
130
 
131
- .ant-checkbox {
132
- &.ant-checkbox-checked {
133
- .ant-checkbox-inner {
131
+ :global(.ant-checkbox) {
132
+ &:global(.ant-checkbox-checked) {
133
+ :global(.ant-checkbox-inner) {
134
134
  &::after {
135
135
  top: 45%;
136
136
  inset-inline-start: 25%;
@@ -147,10 +147,10 @@
147
147
  .antdTable {
148
148
  border-color: var(--cf-border-weak);
149
149
 
150
- *:not(.ant-table-cell *) {
150
+ *:not(:global(.ant-table-cell) *) {
151
151
  border-color: inherit !important;
152
152
 
153
- .ant-table-cell::after {
153
+ :global(.ant-table-cell)::after {
154
154
  border-color: inherit !important;
155
155
  }
156
156
  }
@@ -164,15 +164,15 @@
164
164
  }
165
165
 
166
166
  &.hideEmpty {
167
- .ant-table-placeholder {
167
+ :global(.ant-table-placeholder) {
168
168
  display: none !important;
169
169
  }
170
170
  }
171
171
 
172
172
  &:not(.scroll) {
173
- .ant-table-bordered {
174
- .ant-table-container {
175
- .ant-table-content {
173
+ :global(.ant-table-bordered) {
174
+ :global(.ant-table-container) {
175
+ :global(.ant-table-content) {
176
176
  > table {
177
177
  border-left: 1px solid var(--cf-border-weak);
178
178
  }
@@ -181,12 +181,12 @@
181
181
  }
182
182
  }
183
183
 
184
- .ant-table {
184
+ :global(.ant-table) {
185
185
  line-height: normal;
186
186
  }
187
187
 
188
188
  &.isExpandedCellTable {
189
- .ant-table-tbody {
189
+ :global(.ant-table-tbody) {
190
190
  tr {
191
191
  &:last-child {
192
192
  td {
@@ -196,9 +196,9 @@
196
196
  }
197
197
  }
198
198
 
199
- .ant-table-bordered {
200
- .ant-table-container {
201
- > .ant-table-content {
199
+ :global(.ant-table-bordered) {
200
+ :global(.ant-table-container) {
201
+ > :global(.ant-table-content) {
202
202
  > table {
203
203
  border-radius: 0 !important;
204
204
  border-left: none !important;
@@ -212,7 +212,7 @@
212
212
  }
213
213
  }
214
214
 
215
- .ant-table-thead {
215
+ :global(.ant-table-thead) {
216
216
  tr {
217
217
  th {
218
218
  &:first-child {
@@ -235,23 +235,23 @@
235
235
  width: 100%;
236
236
  min-height: 0px;
237
237
 
238
- .ant-table-bordered {
239
- .ant-table-container {
240
- > .ant-table-header {
238
+ :global(.ant-table-bordered) {
239
+ :global(.ant-table-container) {
240
+ > :global(.ant-table-header) {
241
241
  > table {
242
242
  border-radius: 6px 6px 0 0;
243
243
  border-left: 1px solid var(--cf-border-weak);
244
244
  }
245
245
  }
246
246
 
247
- > .ant-table-body {
247
+ > :global(.ant-table-body) {
248
248
  > table {
249
249
  border-radius: 0px !important;
250
250
  border-left: 1px solid var(--cf-border-weak);
251
251
  }
252
252
  }
253
253
 
254
- > .ant-table-summary {
254
+ > :global(.ant-table-summary) {
255
255
  > table {
256
256
  border-radius: 0px !important;
257
257
  border-left: 1px solid var(--cf-border-weak);
@@ -262,23 +262,23 @@
262
262
  }
263
263
 
264
264
  &.isExpanded {
265
- .ant-table-bordered {
266
- .ant-table-container {
267
- > .ant-table-header {
265
+ :global(.ant-table-bordered) {
266
+ :global(.ant-table-container) {
267
+ > :global(.ant-table-header) {
268
268
  > table {
269
269
  border-radius: 0px !important;
270
270
  border-left: none !important;
271
271
  }
272
272
  }
273
273
 
274
- > .ant-table-body {
274
+ > :global(.ant-table-body) {
275
275
  > table {
276
276
  border-radius: 0px !important;
277
277
  border-left: none !important;
278
278
  }
279
279
  }
280
280
 
281
- > .ant-table-summary {
281
+ > :global(.ant-table-summary) {
282
282
  > table {
283
283
  border-radius: 0px !important;
284
284
  border-left: none !important;
@@ -289,38 +289,38 @@
289
289
  }
290
290
  }
291
291
 
292
- .ant-table-wrapper {
292
+ :global(.ant-table-wrapper) {
293
293
  width: 100%;
294
294
  height: 100%;
295
295
  }
296
296
 
297
- .ant-spin-nested-loading {
297
+ :global(.ant-spin-nested-loading) {
298
298
  width: 100%;
299
299
  height: 100%;
300
300
 
301
- .ant-spin-container {
301
+ :global(.ant-spin-container) {
302
302
  display: flex;
303
303
  flex-direction: column;
304
304
 
305
305
  width: 100%;
306
306
  height: 100%;
307
307
 
308
- .ant-table {
308
+ :global(.ant-table) {
309
309
  width: 100%;
310
310
  height: 100%;
311
311
 
312
- .ant-table-container {
312
+ :global(.ant-table-container) {
313
313
  display: flex;
314
314
  flex-direction: column;
315
315
 
316
316
  width: 100%;
317
317
  height: 100%;
318
318
 
319
- > .ant-table-header {
319
+ > :global(.ant-table-header) {
320
320
  min-height: max-content;
321
321
  }
322
322
 
323
- > .ant-table-body {
323
+ > :global(.ant-table-body) {
324
324
  position: relative;
325
325
 
326
326
  flex: 1;
@@ -344,11 +344,11 @@
344
344
  }
345
345
 
346
346
  &.y-unScroll {
347
- .ant-spin-nested-loading {
348
- .ant-spin-container {
349
- .ant-table {
350
- .ant-table-container {
351
- > .ant-table-body {
347
+ :global(.ant-spin-nested-loading) {
348
+ :global(.ant-spin-container) {
349
+ :global(.ant-table) {
350
+ :global(.ant-table-container) {
351
+ > :global(.ant-table-body) {
352
352
  overflow-y: visible !important;
353
353
  }
354
354
  }
@@ -56,25 +56,25 @@
56
56
  overflow-y: auto;
57
57
  scrollbar-gutter: stable;
58
58
 
59
- .ant-tree-treenode {
59
+ :global(.ant-tree-treenode) {
60
60
  &:hover {
61
61
  background: var(--cf-subtle);
62
62
  }
63
63
 
64
- &:has(> .ant-tree-node-selected) {
64
+ &:has(> :global(.ant-tree-node-selected)) {
65
65
  background-color: #e6f4ff;
66
66
 
67
- .ant-tree-node-selected {
67
+ :global(.ant-tree-node-selected) {
68
68
  background-color: transparent;
69
69
  }
70
70
  }
71
71
  }
72
72
 
73
- .ant-tree-indent-unit {
73
+ :global(.ant-tree-indent-unit) {
74
74
  width: var(--tree-indent-unit-width);
75
75
  }
76
76
 
77
- .ant-tree-switcher {
77
+ :global(.ant-tree-switcher) {
78
78
  display: inline-flex;
79
79
  align-items: center;
80
80
  justify-content: center;
@@ -95,7 +95,7 @@
95
95
  }
96
96
  }
97
97
 
98
- .ant-tree-node-content-wrapper {
98
+ :global(.ant-tree-node-content-wrapper) {
99
99
  display: inline-flex;
100
100
  align-items: center;
101
101
  column-gap: 4px;
@@ -105,7 +105,7 @@
105
105
 
106
106
  padding: 2px 0px;
107
107
 
108
- .ant-tree-title {
108
+ :global(.ant-tree-title) {
109
109
  display: inline-block;
110
110
  }
111
111
 
@@ -113,7 +113,7 @@
113
113
  background: transparent;
114
114
  }
115
115
 
116
- .ant-tree-iconEle {
116
+ :global(.ant-tree-iconEle) {
117
117
  display: inline-flex;
118
118
  align-items: center;
119
119
 
@@ -123,17 +123,17 @@
123
123
  }
124
124
 
125
125
  &.hideLeafExpand {
126
- .ant-tree-switcher-noop {
126
+ :global(.ant-tree-switcher-noop) {
127
127
  display: none;
128
128
  }
129
129
  }
130
130
 
131
131
  &.legacyHasSelectedNodeBackground {
132
132
  .treeContainer {
133
- .ant-tree-treenode.ant-tree-treenode-selected {
133
+ :global(.ant-tree-treenode):global(.ant-tree-treenode-selected) {
134
134
  background-color: #e6f4ff;
135
135
 
136
- .ant-tree-node-selected {
136
+ :global(.ant-tree-node-selected) {
137
137
  background-color: transparent;
138
138
  }
139
139
  }
@@ -4,18 +4,18 @@
4
4
  width: 100%;
5
5
  height: 100%;
6
6
 
7
- span.ant-upload {
7
+ span:global(.ant-upload) {
8
8
  display: inline-flex;
9
9
  }
10
10
 
11
- .ant-upload-list {
11
+ :global(.ant-upload-list) {
12
12
  display: flex;
13
13
  flex-direction: column;
14
14
  row-gap: 5px;
15
15
 
16
16
  width: 100%;
17
17
 
18
- &.ant-upload-list-picture-card {
18
+ &:global(.ant-upload-list-picture-card) {
19
19
  flex-direction: row;
20
20
  flex-wrap: wrap;
21
21
  gap: 5px;
@@ -130,4 +130,4 @@
130
130
  }
131
131
  }
132
132
  }
133
- }
133
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hsu-react/ui",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "一套基于 React + Ant Design 的中后台业务组件库",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -16,15 +16,14 @@ title: Button 按钮
16
16
  import { Button } from "@hsu-react/ui";
17
17
  ```
18
18
 
19
- ## 基础用法
19
+ ## 按钮
20
20
 
21
21
  ```tsx
22
22
  import React from "react";
23
23
  import { Button } from "@hsu-react/ui";
24
- import { Space } from "antd";
25
24
 
26
25
  export default () => (
27
- <Space>
26
+ <div style={{ display: "flex", gap: 12, flexWrap: "wrap", alignItems: "center" }}>
28
27
  <Button type="primary">主要按钮</Button>
29
28
  <Button>默认按钮</Button>
30
29
  <Button type="dashed">虚线按钮</Button>
@@ -32,7 +31,24 @@ export default () => (
32
31
  <Button type="primary" disabled>
33
32
  禁用
34
33
  </Button>
35
- </Space>
34
+ </div>
35
+ );
36
+ ```
37
+
38
+ ## Chakra 按钮
39
+
40
+ 基于 Chakra UI 的按钮,支持 `hasPermi`、`hidden`、`iconPosition`、`icon` 等扩展属性(Chakra system 由文档站全局提供)。
41
+
42
+ ```tsx
43
+ import React from "react";
44
+ import { Button } from "@hsu-react/ui";
45
+
46
+ export default () => (
47
+ <div style={{ display: "flex", gap: 12, alignItems: "center" }}>
48
+ <Button.Chakra colorPalette="blue">主要按钮</Button.Chakra>
49
+ <Button.Chakra variant="outline">描边按钮</Button.Chakra>
50
+ <Button.Chakra disabled>禁用</Button.Chakra>
51
+ </div>
36
52
  );
37
53
  ```
38
54
 
@@ -1,11 +1,17 @@
1
- .select {
1
+ // 定位容器给定 32px 固定高度,Select 通过 height:100% 填满它,
2
+ // 避免 Select 根的 height:100% 直接相对图谱(绝对定位祖先)解析成整图高度而被拉伸。
3
+ .wrapper {
2
4
  position: absolute;
3
5
  top: 20px;
4
6
  left: 20px;
5
7
 
6
8
  width: 240px;
7
9
  height: 32px;
10
+ }
11
+
12
+ .select {
13
+ width: 100%;
14
+ height: 100%;
8
15
 
9
16
  border-radius: 2px;
10
17
  }
11
-
@@ -8,22 +8,24 @@ interface SearchSelectProps {
8
8
 
9
9
  export const SearchSelect: React.FC<SearchSelectProps> = ({ onChange }) => {
10
10
  return (
11
- <Select
12
- className={styles.select}
13
- showSearch
14
- placeholder="请输入关键词进行搜索"
15
- optionFilterProp="children"
16
- filterOption={(input, option) =>
17
- !!(
18
- option?.label &&
19
- option?.label
20
- ?.toString()
21
- .toLowerCase()
22
- .includes(input.toLowerCase())
23
- )
24
- }
25
- onChange={onChange}
26
- />
11
+ <div className={styles.wrapper}>
12
+ <Select
13
+ className={styles.select}
14
+ showSearch
15
+ placeholder="请输入关键词进行搜索"
16
+ optionFilterProp="children"
17
+ filterOption={(input, option) =>
18
+ !!(
19
+ option?.label &&
20
+ option?.label
21
+ ?.toString()
22
+ .toLowerCase()
23
+ .includes(input.toLowerCase())
24
+ )
25
+ }
26
+ onChange={onChange}
27
+ />
28
+ </div>
27
29
  );
28
30
  };
29
31
 
@@ -8,10 +8,76 @@ title: ChainGraph 关系图
8
8
 
9
9
  # ChainGraph 关系图
10
10
 
11
- > `ChainGraph` 组件。完整 API 见源码类型定义,下方为基础用法。
11
+ 基于 `@antv/g6` 封装的树状关系图,支持节点展开/收起、搜索、缩略图、自适应布局与自定义节点渲染。
12
12
 
13
13
  ## 引入
14
14
 
15
15
  ```ts
16
16
  import { ChainGraph } from "@hsu-react/ui";
17
17
  ```
18
+
19
+ ## 关系图
20
+
21
+ ```tsx
22
+ import React from "react";
23
+ import { ChainGraph } from "@hsu-react/ui";
24
+
25
+ // TreeGraphData:每个节点含 id / label / 可选 children;level 用于标记根节点层级
26
+ const data = {
27
+ id: "root",
28
+ label: "根节点",
29
+ level: 1,
30
+ children: [
31
+ { id: "a", label: "节点 A", level: 2 },
32
+ {
33
+ id: "b",
34
+ label: "节点 B",
35
+ level: 2,
36
+ children: [{ id: "b-1", label: "节点 B-1", level: 3 }],
37
+ },
38
+ ],
39
+ };
40
+
41
+ export default () => (
42
+ <div style={{ height: 320, width: "100%" }}>
43
+ <ChainGraph
44
+ data={data}
45
+ showSearch
46
+ showMiniMap
47
+ miniMapSize={[120, 80]}
48
+ showExpandBtn
49
+ onClick={(node) => console.log(node)}
50
+ />
51
+ </div>
52
+ );
53
+ ```
54
+
55
+ ## API
56
+
57
+ | 属性 | 说明 | 类型 | 默认值 |
58
+ | --- | --- | --- | --- |
59
+ | data | 树状图数据(可携带 `origin` 原始数据) | `TreeGraphData` | - |
60
+ | octopus | 是否启用八爪鱼(双向)布局 | `boolean` | - |
61
+ | level | 默认展开层级 | `number` | `1` |
62
+ | rootLevel | 根节点层级 | `number` | `1` |
63
+ | onClick | 节点点击回调 | `(node?: TreeGraphData) => void` | - |
64
+ | styles | 节点样式配置 | `ChainGraphServicesStyles` | - |
65
+ | showPort | 是否显示连接端点 | `boolean` | `true` |
66
+ | showMiniMap | 是否显示缩略图 | `boolean` | `true` |
67
+ | miniMapSize | 缩略图尺寸 | `[number, number]` | `[200, 150]` |
68
+ | getImage | 获取图表快照(base64) | `(img: string) => void` | - |
69
+ | className | 内层容器类名 | `string` | - |
70
+ | wrapperClassName | 外层(Spin)容器类名 | `string` | - |
71
+ | showSearch | 是否显示搜索框 | `boolean` | `true` |
72
+ | showExpandBtn | 是否显示展开/收起按钮 | `boolean` | `true` |
73
+ | expandClassName | 展开按钮类名 | `string` | - |
74
+ | resize | 是否监听容器尺寸自适应 | `boolean` | `true` |
75
+ | offset | 容器宽高偏移 `[x, y]` | `[number, number]` | `[0, 0]` |
76
+ | fitLeft | 是否左对齐布局 | `boolean` | `false` |
77
+ | paddingLeft | 左侧内边距 | `number` | `20` |
78
+ | loading | 是否加载中 | `boolean` | `false` |
79
+ | hasHover | 是否启用 hover 效果 | `boolean` | `true` |
80
+ | hasSelected | 是否启用选中效果 | `boolean` | `true` |
81
+ | minZoom | 最小缩放比例 | `number` | - |
82
+ | labelRender | 自定义节点文本 | `(label: TreeGraphData) => string` | - |
83
+ | addShape | 自定义节点图形绘制 | `(group: IGroup, cfg: ModelConfig & { origin?: Record<string, unknown> }) => void` | - |
@@ -2,7 +2,7 @@
2
2
  width: 100%;
3
3
  height: 100%;
4
4
 
5
- .ant-spin-container {
5
+ :global(.ant-spin-container) {
6
6
  width: 100%;
7
7
  height: 100%;
8
8
  }