@complex-suite/component-antd 4.10.12

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 (51) hide show
  1. package/LayoutResizeObserver.ts +104 -0
  2. package/LocalResizeObserver.ts +46 -0
  3. package/README.md +67 -0
  4. package/antdConfig.ts +361 -0
  5. package/format.ts +458 -0
  6. package/history.md +325 -0
  7. package/icon.ts +65 -0
  8. package/index.test.ts +5 -0
  9. package/index.ts +55 -0
  10. package/package.json +39 -0
  11. package/plugin.ts +95 -0
  12. package/quick/QuickCascade.tsx +107 -0
  13. package/quick/QuickEdit.tsx +117 -0
  14. package/quick/QuickFloat.tsx +32 -0
  15. package/quick/QuickFloatModal.tsx +95 -0
  16. package/quick/QuickFloatValue.tsx +103 -0
  17. package/quick/QuickList.tsx +433 -0
  18. package/quick/data/FloatData.ts +77 -0
  19. package/src/AutoSpin.vue +39 -0
  20. package/src/AutoText.vue +101 -0
  21. package/src/ButtonView.tsx +62 -0
  22. package/src/CollapseArea.tsx +88 -0
  23. package/src/EditArea.tsx +205 -0
  24. package/src/EditView.tsx +179 -0
  25. package/src/FlexBox.tsx +74 -0
  26. package/src/FormList.tsx +226 -0
  27. package/src/ImageViewer.tsx +122 -0
  28. package/src/InfoArea.tsx +182 -0
  29. package/src/InfoView.tsx +150 -0
  30. package/src/MenuView.tsx +91 -0
  31. package/src/ModalView.tsx +274 -0
  32. package/src/MultipleImport.tsx +231 -0
  33. package/src/SearchArea.tsx +170 -0
  34. package/src/SelectText.vue +59 -0
  35. package/src/SimpleTable.tsx +256 -0
  36. package/src/SingleImport.tsx +189 -0
  37. package/src/TableView.tsx +415 -0
  38. package/src/components/AutoRender.tsx +19 -0
  39. package/src/components/ChoiceInfo.vue +73 -0
  40. package/src/components/PaginationView.tsx +103 -0
  41. package/src/components/TableMenu.tsx +93 -0
  42. package/src/dictionary/AutoEditItem.tsx +164 -0
  43. package/src/dictionary/AutoInfoItem.tsx +126 -0
  44. package/src/dictionary/AutoItem.tsx +219 -0
  45. package/src/icons/EmptyImage.vue +30 -0
  46. package/src/icons/ErrorImage.vue +30 -0
  47. package/src/style/index.css +304 -0
  48. package/tsconfig.json +8 -0
  49. package/type.ts +4 -0
  50. package/vitest.config.ts +11 -0
  51. package/widthCalculator.ts +20 -0
@@ -0,0 +1,304 @@
1
+ .complex-auto-index{
2
+ color: var(--complex-color-primary);
3
+ }
4
+ .complex-high-text .complex-high-text-is-high{
5
+ color: var(--complex-color-primary);
6
+ }
7
+ /* Import Style */
8
+ .complex-import .complex-import-file{
9
+ display: none !important;
10
+ }
11
+ .complex-menu-file{
12
+ display: none !important;
13
+ }
14
+ .complex-import .complex-import-content{
15
+ line-height: 22px;
16
+ }
17
+ .complex-import .complex-import-content .complex-import-content-delete{
18
+ display: inline-block;
19
+ margin-left: 8px;
20
+ cursor: pointer;
21
+ }
22
+ .complex-import .complex-import-image{
23
+ position: relative;
24
+ margin-top: 12px;
25
+ }
26
+ .complex-import .complex-import-image .complex-import-content-delete{
27
+ cursor: pointer;
28
+ position: absolute;
29
+ top: 0;
30
+ right: 0;
31
+ font-size: 20px;
32
+ line-height: 20px;
33
+ padding: 5px;
34
+ }
35
+ .complex-import .complex-import-image-list{
36
+ display: flex;
37
+ flex-direction: row;
38
+ flex-wrap: wrap;
39
+ justify-content: flex-start;
40
+ align-items: flex-start;
41
+ }
42
+ .complex-import .complex-import-image-list .complex-import-image{
43
+ flex: none;
44
+ margin-right: 12px;
45
+ }
46
+
47
+ /* Table Style */
48
+
49
+ .complex-collapse-area-collapsed{
50
+ overflow: hidden;
51
+ }
52
+
53
+ .complex-table .complex-table-content {
54
+ width: 100%;
55
+ overflow: auto;
56
+ }
57
+ .complex-table .complex-table-footer {
58
+ display: flex;
59
+ flex-direction: row;
60
+ justify-content: space-between;
61
+ align-items: center;
62
+ padding: 0 16px;
63
+ }
64
+ .complex-pagination{
65
+ display: flex;
66
+ flex-direction: row;
67
+ justify-content: flex-end;
68
+ align-items: center;
69
+ }
70
+ .complex-pagination .complex-pagination-info{
71
+ margin-right: 10px;
72
+ }
73
+
74
+ .complex-simple-table-content{
75
+ width: 100%;
76
+ display: flex;
77
+ flex-direction: row;
78
+ justify-content: stretch;
79
+ align-items: stretch;
80
+ }
81
+ .complex-simple-table-content .complex-simple-table-content-column{
82
+ flex-grow: 1;
83
+ flex-shrink: 0;
84
+ font-size: 14px;
85
+ }
86
+ .complex-simple-table-content .complex-simple-table-content-column.complex-simple-table-content-column-left{
87
+ text-align: left;
88
+ }
89
+ .complex-simple-table-content .complex-simple-table-content-column.complex-simple-table-content-column-right{
90
+ text-align: right;
91
+ }
92
+ .complex-simple-table-content .complex-simple-table-content-column.complex-simple-table-content-column-center{
93
+ text-align: center;
94
+ }
95
+ .complex-simple-table-content .complex-simple-table-content-column .complex-simple-table-content-header{
96
+ line-height: 22px;
97
+ white-space: nowrap; /* 不换行 */
98
+ overflow: hidden; /* 隐藏超出部分 */
99
+ text-overflow: ellipsis; /* 显示省略号 */
100
+ word-wrap: break-word;
101
+ word-break: break-all;
102
+ padding: 16px 16px;
103
+ cursor: pointer;
104
+ border-bottom: 1px solid #f0f0f0;
105
+ background-color: #fafafa;
106
+ position: relative;
107
+ }
108
+ .complex-simple-table-content .complex-simple-table-content-column .complex-simple-table-content-header::before{
109
+ position: absolute;
110
+ top: 50%;
111
+ inset-inline-end: 0;
112
+ width: 1px;
113
+ height: 1.6em;
114
+ background-color: #f0f0f0;
115
+ transform: translateY(-50%);
116
+ transition: background-color 0.2s;
117
+ content: "";
118
+ }
119
+ .complex-simple-table-content .complex-simple-table-content-column:last-child .complex-simple-table-content-header::before{
120
+ display: none;
121
+ }
122
+ .complex-simple-table-content .complex-simple-table-content-column .complex-simple-table-content-row{
123
+ padding: 16px 16px;
124
+ border-bottom: 1px solid #f0f0f0;
125
+ }
126
+ .complex-simple-table-content .complex-simple-table-content-column .complex-simple-table-content-row *{
127
+ line-height: 22px;
128
+ white-space: nowrap; /* 不换行 */
129
+ overflow: hidden; /* 隐藏超出部分 */
130
+ text-overflow: ellipsis; /* 显示省略号 */
131
+ word-wrap: break-word;
132
+ word-break: break-all;
133
+ }
134
+
135
+ /* Edit Style */
136
+ .complex-edit-inline .ant-form-item.ant-form-item-with-help{
137
+ margin-bottom: 0;
138
+ }
139
+ .complex-edit-inline .ant-form-item:not(.ant-form-item-with-help){
140
+ margin-bottom: 24px;
141
+ }
142
+ .complex-edit-grid .complex-edit-item.complex-edit-item-input-number{
143
+ width: 100%;
144
+ }
145
+ .complex-edit-grid .complex-edit-item.complex-edit-item-date{
146
+ width: 100%;
147
+ }
148
+ .complex-edit-grid .complex-edit-item.complex-edit-item-date-range{
149
+ width: 100%;
150
+ }
151
+ .complex-edit .complex-edit-item .ant-input-number {
152
+ width: 100%;
153
+ }
154
+ .complex-edit .complex-auto-item-info,.complex-info .complex-auto-item-info {
155
+ margin-bottom: 24px;
156
+ }
157
+ .complex-edit-inline .complex-auto-item-info,.complex-info-inline .complex-auto-item-info {
158
+ margin-inline-end: 16px;
159
+ }
160
+
161
+ .complex-auto-item-label{
162
+ position: relative;
163
+ display: inline-flex;
164
+ }
165
+ .complex-auto-item-left-label{
166
+ text-align: left;
167
+ }
168
+ .complex-auto-item-center-label{
169
+ text-align: center;
170
+ }
171
+ .complex-auto-item-right-label{
172
+ text-align: right;
173
+ }
174
+ .complex-auto-item-colon-label::after{
175
+ display: inline-block;
176
+ content: ":";
177
+ position: relative;
178
+ margin-block: 0;
179
+ margin-inline-start: 2px;
180
+ margin-inline-end: 8px;
181
+ }
182
+ .complex-auto-item.ant-form-item > .ant-row > .ant-col-0{
183
+ display: none;
184
+ }
185
+
186
+ /* Search Style */
187
+ .complex-search-area{
188
+ display: flex;
189
+ flex-direction: row;
190
+ justify-content: stretch;
191
+ align-items: flex-start;
192
+ }
193
+ .complex-search-area .complex-edit{
194
+ flex: auto;
195
+ width: 100%;
196
+ }
197
+ .complex-search-area .complex-collapse-area{
198
+ flex: auto;
199
+ width: 100%;
200
+ }
201
+ .complex-search-area .complex-search-area-collapse-menu{
202
+ flex: none;
203
+ width: auto;
204
+ }
205
+
206
+ .complex-list-edit .complex-list-edit-menu {
207
+ margin-bottom: 16px;
208
+ }
209
+
210
+ .complex-color-link{
211
+ cursor: pointer;
212
+ }
213
+
214
+ .complex-disabled{
215
+ cursor: not-allowed; /* 改变鼠标指针样式 */
216
+ pointer-events: none; /* 防止点击 */
217
+ }
218
+
219
+ .complex-like-form-item{
220
+ display: inline-block;
221
+ font-size: 14px;
222
+ line-height: 30px;
223
+ min-height: 32px;
224
+ border: 1px #d9d9d9 solid;
225
+ border-radius: 6px;
226
+ padding: 0px 11px;
227
+ }
228
+
229
+ /* Image Style */
230
+ .complex-image-viewer .complex-image-viewer-error,.complex-image-viewer .complex-image-viewer-empty{
231
+ display: flex;
232
+ flex-direction: column;
233
+ align-items: center;
234
+ justify-content: center;
235
+ }
236
+ .complex-image-viewer .complex-image-viewer-content{
237
+ display: block;
238
+ width: 100%;
239
+ height: 100%;
240
+ }
241
+ .complex-image-viewer .complex-image-viewer-content-has-modal{
242
+ cursor: pointer;
243
+ }
244
+
245
+ /* Flex Style */
246
+ .complex-flex-box{
247
+ flex: none;
248
+ display: flex;
249
+ flex-direction: row;
250
+ justify-content: space-between;
251
+ align-items: flex-start;
252
+ }
253
+ .complex-flex-box.complex-flex-box-row{
254
+ flex-direction: row;
255
+ }
256
+ .complex-flex-box.complex-flex-box-column{
257
+ flex-direction: column;
258
+ }
259
+
260
+ /* QuickList Style */
261
+ .complex-quick-list{
262
+ padding: 0 16px;
263
+ overflow: auto;
264
+ }
265
+ .complex-quick-list .complex-search-area{
266
+ padding-top: 24px;
267
+ }
268
+ .complex-table-menu .complex-table-menu-item{
269
+ margin-right: 8px;
270
+ cursor: pointer;
271
+ }
272
+ .complex-table-menu .complex-table-menu-item:last-child{
273
+ margin-right: 0px;
274
+ }
275
+
276
+ /* QuickFloat Style */
277
+ .complex-quick-float{
278
+ position: fixed;
279
+ z-index: 1000;
280
+ bottom: 32px;
281
+ display: flex;
282
+ flex-direction: row;
283
+ justify-content: center;
284
+ align-items: center;
285
+ padding-left: 8px;
286
+ display: none;
287
+ }
288
+
289
+ .complex-quick-float .complex-quick-float-item .complex-quick-float-item-label{
290
+ box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
291
+ padding: 8px 8px;
292
+ margin-right: 8px;
293
+ border-radius: 4px;
294
+ cursor: pointer;
295
+ }
296
+
297
+ .complex-quick-float .complex-quick-float-item:last-child{
298
+ margin-right: 0px;
299
+ }
300
+
301
+ /* Ant Style */
302
+ .ant-btn > .complex-icon + span, .ant-btn > span + .complex-icon {
303
+ margin-inline-start: 8px;
304
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "jsx": "preserve",
5
+ "noEmit": true
6
+ },
7
+ "exclude": ["node_modules", "**/*.test.ts", "vitest.config.ts"]
8
+ }
package/type.ts ADDED
@@ -0,0 +1,4 @@
1
+ export interface localIconProps {
2
+ size?: number
3
+ color?: string
4
+ }
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from 'vitest/config'
2
+ import vue from '@vitejs/plugin-vue'
3
+ import vueJsx from '@vitejs/plugin-vue-jsx'
4
+
5
+ export default defineConfig({
6
+ plugins: [vue(), vueJsx()],
7
+ test: {
8
+ globals: true,
9
+ environment: 'jsdom',
10
+ },
11
+ })
@@ -0,0 +1,20 @@
1
+
2
+ // 宽度计算工具
3
+ const widthCalculator = {
4
+ data: {
5
+ char: 14.01,
6
+ number: 8,
7
+ letter: 12.8,
8
+ padding: 16
9
+ },
10
+ getWidth(char: number, number = 0, letter = 0, extra = 0) {
11
+ // 添加误差
12
+ const offset = (char + number + letter) > 4 ? 4 : 4
13
+ return char * widthCalculator.data.char + number * widthCalculator.data.number + letter * widthCalculator.data.letter + widthCalculator.data.padding * 2 + offset + extra
14
+ },
15
+ mergeWidth(width: number, times: number) {
16
+ return width - widthCalculator.data.padding * 2 * (times - 1)
17
+ }
18
+ }
19
+
20
+ export default widthCalculator