@composy/kanban-core 0.0.1

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 (145) hide show
  1. package/README.md +37 -0
  2. package/dist/index.css +307 -0
  3. package/dist/index.js +1279 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.min.css +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/es/core/ColumnManager.d.ts +99 -0
  8. package/es/core/ColumnManager.d.ts.map +1 -0
  9. package/es/core/ColumnManager.js +285 -0
  10. package/es/core/ColumnManager.js.map +1 -0
  11. package/es/core/DragController.d.ts +55 -0
  12. package/es/core/DragController.d.ts.map +1 -0
  13. package/es/core/DragController.js +225 -0
  14. package/es/core/DragController.js.map +1 -0
  15. package/es/core/EventEmitter.d.ts +35 -0
  16. package/es/core/EventEmitter.d.ts.map +1 -0
  17. package/es/core/EventEmitter.js +68 -0
  18. package/es/core/EventEmitter.js.map +1 -0
  19. package/es/core/FilterEngine.d.ts +45 -0
  20. package/es/core/FilterEngine.d.ts.map +1 -0
  21. package/es/core/FilterEngine.js +127 -0
  22. package/es/core/FilterEngine.js.map +1 -0
  23. package/es/core/KanbanBoard.d.ts +152 -0
  24. package/es/core/KanbanBoard.d.ts.map +1 -0
  25. package/es/core/KanbanBoard.js +332 -0
  26. package/es/core/KanbanBoard.js.map +1 -0
  27. package/es/core/Renderer.d.ts +59 -0
  28. package/es/core/Renderer.d.ts.map +1 -0
  29. package/es/core/Renderer.js +247 -0
  30. package/es/core/Renderer.js.map +1 -0
  31. package/es/core/index.d.ts +11 -0
  32. package/es/core/index.d.ts.map +1 -0
  33. package/es/core/index.js +17 -0
  34. package/es/index.d.ts +15 -0
  35. package/es/index.d.ts.map +1 -0
  36. package/es/index.js +21 -0
  37. package/es/styles/kanban.css +306 -0
  38. package/es/types/index.d.ts +209 -0
  39. package/es/types/index.d.ts.map +1 -0
  40. package/es/types/index.js +10 -0
  41. package/es/utils/dom.d.ts +24 -0
  42. package/es/utils/dom.d.ts.map +1 -0
  43. package/es/utils/dom.js +37 -0
  44. package/es/utils/dom.js.map +1 -0
  45. package/es/utils/id.d.ts +9 -0
  46. package/es/utils/id.d.ts.map +1 -0
  47. package/es/utils/id.js +22 -0
  48. package/es/utils/id.js.map +1 -0
  49. package/es/utils/index.d.ts +25 -0
  50. package/es/utils/index.d.ts.map +1 -0
  51. package/es/utils/index.js +20 -0
  52. package/es/utils/index.js.map +1 -0
  53. package/es/version.d.ts +6 -0
  54. package/es/version.d.ts.map +1 -0
  55. package/es/version.js +15 -0
  56. package/es/version.js.map +1 -0
  57. package/esm/core/ColumnManager.d.ts +99 -0
  58. package/esm/core/ColumnManager.d.ts.map +1 -0
  59. package/esm/core/ColumnManager.js +285 -0
  60. package/esm/core/ColumnManager.js.map +1 -0
  61. package/esm/core/DragController.d.ts +55 -0
  62. package/esm/core/DragController.d.ts.map +1 -0
  63. package/esm/core/DragController.js +225 -0
  64. package/esm/core/DragController.js.map +1 -0
  65. package/esm/core/EventEmitter.d.ts +35 -0
  66. package/esm/core/EventEmitter.d.ts.map +1 -0
  67. package/esm/core/EventEmitter.js +68 -0
  68. package/esm/core/EventEmitter.js.map +1 -0
  69. package/esm/core/FilterEngine.d.ts +45 -0
  70. package/esm/core/FilterEngine.d.ts.map +1 -0
  71. package/esm/core/FilterEngine.js +127 -0
  72. package/esm/core/FilterEngine.js.map +1 -0
  73. package/esm/core/KanbanBoard.d.ts +152 -0
  74. package/esm/core/KanbanBoard.d.ts.map +1 -0
  75. package/esm/core/KanbanBoard.js +332 -0
  76. package/esm/core/KanbanBoard.js.map +1 -0
  77. package/esm/core/Renderer.d.ts +59 -0
  78. package/esm/core/Renderer.d.ts.map +1 -0
  79. package/esm/core/Renderer.js +247 -0
  80. package/esm/core/Renderer.js.map +1 -0
  81. package/esm/core/index.d.ts +11 -0
  82. package/esm/core/index.d.ts.map +1 -0
  83. package/esm/core/index.js +17 -0
  84. package/esm/index.d.ts +15 -0
  85. package/esm/index.d.ts.map +1 -0
  86. package/esm/index.js +21 -0
  87. package/esm/styles/kanban.less +339 -0
  88. package/esm/types/index.d.ts +209 -0
  89. package/esm/types/index.d.ts.map +1 -0
  90. package/esm/types/index.js +10 -0
  91. package/esm/utils/dom.d.ts +24 -0
  92. package/esm/utils/dom.d.ts.map +1 -0
  93. package/esm/utils/dom.js +37 -0
  94. package/esm/utils/dom.js.map +1 -0
  95. package/esm/utils/id.d.ts +9 -0
  96. package/esm/utils/id.d.ts.map +1 -0
  97. package/esm/utils/id.js +22 -0
  98. package/esm/utils/id.js.map +1 -0
  99. package/esm/utils/index.d.ts +25 -0
  100. package/esm/utils/index.d.ts.map +1 -0
  101. package/esm/utils/index.js +20 -0
  102. package/esm/utils/index.js.map +1 -0
  103. package/esm/version.d.ts +6 -0
  104. package/esm/version.d.ts.map +1 -0
  105. package/esm/version.js +15 -0
  106. package/esm/version.js.map +1 -0
  107. package/lib/core/ColumnManager.cjs +286 -0
  108. package/lib/core/ColumnManager.cjs.map +1 -0
  109. package/lib/core/ColumnManager.d.ts +99 -0
  110. package/lib/core/DragController.cjs +226 -0
  111. package/lib/core/DragController.cjs.map +1 -0
  112. package/lib/core/DragController.d.ts +55 -0
  113. package/lib/core/EventEmitter.cjs +69 -0
  114. package/lib/core/EventEmitter.cjs.map +1 -0
  115. package/lib/core/EventEmitter.d.ts +35 -0
  116. package/lib/core/FilterEngine.cjs +128 -0
  117. package/lib/core/FilterEngine.cjs.map +1 -0
  118. package/lib/core/FilterEngine.d.ts +45 -0
  119. package/lib/core/KanbanBoard.cjs +334 -0
  120. package/lib/core/KanbanBoard.cjs.map +1 -0
  121. package/lib/core/KanbanBoard.d.ts +152 -0
  122. package/lib/core/Renderer.cjs +248 -0
  123. package/lib/core/Renderer.cjs.map +1 -0
  124. package/lib/core/Renderer.d.ts +59 -0
  125. package/lib/core/index.cjs +24 -0
  126. package/lib/core/index.d.ts +11 -0
  127. package/lib/index.cjs +37 -0
  128. package/lib/index.d.ts +15 -0
  129. package/lib/package.json +3 -0
  130. package/lib/styles/kanban.css +306 -0
  131. package/lib/types/index.cjs +11 -0
  132. package/lib/types/index.d.ts +209 -0
  133. package/lib/utils/dom.cjs +42 -0
  134. package/lib/utils/dom.cjs.map +1 -0
  135. package/lib/utils/dom.d.ts +24 -0
  136. package/lib/utils/id.cjs +24 -0
  137. package/lib/utils/id.cjs.map +1 -0
  138. package/lib/utils/id.d.ts +9 -0
  139. package/lib/utils/index.cjs +28 -0
  140. package/lib/utils/index.cjs.map +1 -0
  141. package/lib/utils/index.d.ts +25 -0
  142. package/lib/version.cjs +16 -0
  143. package/lib/version.cjs.map +1 -0
  144. package/lib/version.d.ts +6 -0
  145. package/package.json +105 -0
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # @composy/kanban-core
2
+
3
+ 鐪嬫澘瑙嗗浘搴擄紝鏀寔鎷栨嫿鍗$墖涓庡垪绠$悊
4
+
5
+ ## 功能特性
6
+
7
+ - 🚀 高性能核心引擎
8
+ - 🎨 TypeScript 类型完整
9
+ - 📦 支持 ESM / CJS 双格式输出
10
+
11
+ ## 安装
12
+
13
+ ```bash
14
+ npm install @composy/kanban-core
15
+ ```
16
+
17
+ ## 快速开始
18
+
19
+ ```typescript
20
+ import { /* 需要的导出 */ } from '@composy/kanban-core'
21
+
22
+ // 根据实际 API 使用
23
+ ```
24
+
25
+ ## 目录结构
26
+
27
+ ```
28
+ packages/core/
29
+ ├── src/ # 源码
30
+ ├── package.json
31
+ ├── tsconfig.json # ESM 构建配置
32
+ └── tsconfig.cjs.json # CJS 构建配置
33
+ ```
34
+
35
+ ## License
36
+
37
+ MIT
package/dist/index.css ADDED
@@ -0,0 +1,307 @@
1
+ /* styles/kanban.less */
2
+ /* @composy/kanban-core - Default Styles */
3
+ .kanban-board {
4
+ width: 100%;
5
+ min-height: 400px;
6
+ overflow-x: auto;
7
+ overflow-y: hidden;
8
+ max-width: 100%;
9
+ }
10
+ .kanban-columns {
11
+ display: flex;
12
+ gap: 16px;
13
+ padding: 8px;
14
+ min-height: 100%;
15
+ align-items: flex-start;
16
+ }
17
+ /* Column */
18
+ .kanban-column {
19
+ flex: 0 0 280px;
20
+ max-width: 280px;
21
+ background: #f4f5f7;
22
+ border-radius: 8px;
23
+ display: flex;
24
+ flex-direction: column;
25
+ max-height: calc(100vh - 200px);
26
+ transition: opacity 0.2s, box-shadow 0.2s;
27
+ }
28
+ .kanban-column--collapsed {
29
+ flex: 0 0 48px;
30
+ max-width: 48px;
31
+ min-height: 200px;
32
+ }
33
+ .kanban-column--dragging {
34
+ opacity: 0.5;
35
+ }
36
+ .kanban-column--drag-over {
37
+ box-shadow: 0 0 0 2px #4c9aff;
38
+ }
39
+ /* Column Header */
40
+ .kanban-column-header {
41
+ display: flex;
42
+ align-items: center;
43
+ gap: 6px;
44
+ padding: 10px 12px;
45
+ border-bottom: 1px solid #e1e4e8;
46
+ -webkit-user-select: none;
47
+ -moz-user-select: none;
48
+ user-select: none;
49
+ }
50
+ .kanban-column-drag-handle {
51
+ cursor: grab;
52
+ color: #a0a0a0;
53
+ font-size: 12px;
54
+ letter-spacing: -3px;
55
+ line-height: 1;
56
+ padding: 2px 0;
57
+ }
58
+ .kanban-column-drag-handle:active {
59
+ cursor: grabbing;
60
+ }
61
+ .kanban-column-color {
62
+ width: 12px;
63
+ height: 12px;
64
+ border-radius: 3px;
65
+ flex-shrink: 0;
66
+ }
67
+ .kanban-column-title {
68
+ font-size: 14px;
69
+ font-weight: 600;
70
+ color: #172b4d;
71
+ flex: 1;
72
+ overflow: hidden;
73
+ text-overflow: ellipsis;
74
+ white-space: nowrap;
75
+ }
76
+ .kanban-column-count {
77
+ font-size: 12px;
78
+ color: #6b778c;
79
+ background: #dfe1e6;
80
+ border-radius: 10px;
81
+ padding: 1px 8px;
82
+ flex-shrink: 0;
83
+ }
84
+ .kanban-column-count--limit {
85
+ background: #ffebe6;
86
+ color: #bf2600;
87
+ }
88
+ .kanban-column-collapse-btn,
89
+ .kanban-column-actions-btn {
90
+ background: none;
91
+ border: none;
92
+ cursor: pointer;
93
+ color: #6b778c;
94
+ font-size: 12px;
95
+ padding: 2px 4px;
96
+ border-radius: 3px;
97
+ line-height: 1;
98
+ }
99
+ .kanban-column-collapse-btn:hover,
100
+ .kanban-column-actions-btn:hover {
101
+ background: #dfe1e6;
102
+ color: #172b4d;
103
+ }
104
+ /* Column Body */
105
+ .kanban-column-body {
106
+ flex: 1;
107
+ overflow-y: auto;
108
+ padding: 8px;
109
+ min-height: 40px;
110
+ }
111
+ .kanban-column-body--drag-over {
112
+ background: #e3f2fd;
113
+ border-radius: 0 0 8px 8px;
114
+ }
115
+ /* Placeholder */
116
+ .kanban-placeholder {
117
+ background: #e3f2fd;
118
+ border: 2px dashed #90caf9;
119
+ border-radius: 6px;
120
+ margin-bottom: 8px;
121
+ min-height: 40px;
122
+ transition: height 0.15s ease;
123
+ }
124
+ /* Card */
125
+ .kanban-card {
126
+ background: #fff;
127
+ border-radius: 6px;
128
+ padding: 10px 12px;
129
+ margin-bottom: 8px;
130
+ cursor: pointer;
131
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
132
+ transition: box-shadow 0.2s, transform 0.15s, opacity 0.2s;
133
+ border: 1px solid transparent;
134
+ position: relative;
135
+ }
136
+ .kanban-card:hover {
137
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
138
+ border-color: #e1e4e8;
139
+ }
140
+ .kanban-card--dragging {
141
+ opacity: 0.4;
142
+ transform: rotate(2deg);
143
+ }
144
+ /* Card Priority */
145
+ .kanban-card-priority {
146
+ position: absolute;
147
+ left: 0;
148
+ top: 0;
149
+ bottom: 0;
150
+ width: 3px;
151
+ border-radius: 6px 0 0 6px;
152
+ }
153
+ .kanban-card-priority--low {
154
+ background: #36b37e;
155
+ }
156
+ .kanban-card-priority--medium {
157
+ background: #ffab00;
158
+ }
159
+ .kanban-card-priority--high {
160
+ background: #ff5630;
161
+ }
162
+ .kanban-card-priority--urgent {
163
+ background: #bf2600;
164
+ }
165
+ /* Card Labels */
166
+ .kanban-card-labels {
167
+ display: flex;
168
+ flex-wrap: wrap;
169
+ gap: 4px;
170
+ margin-bottom: 6px;
171
+ }
172
+ .kanban-card-label {
173
+ display: inline-block;
174
+ padding: 1px 8px;
175
+ border-radius: 3px;
176
+ font-size: 11px;
177
+ color: #fff;
178
+ font-weight: 500;
179
+ line-height: 1.6;
180
+ }
181
+ /* Card Title */
182
+ .kanban-card-title {
183
+ font-size: 14px;
184
+ font-weight: 500;
185
+ color: #172b4d;
186
+ line-height: 1.4;
187
+ word-break: break-word;
188
+ }
189
+ /* Card Description */
190
+ .kanban-card-desc {
191
+ font-size: 12px;
192
+ color: #6b778c;
193
+ margin-top: 4px;
194
+ line-height: 1.4;
195
+ display: -webkit-box;
196
+ -webkit-line-clamp: 2;
197
+ -webkit-box-orient: vertical;
198
+ overflow: hidden;
199
+ }
200
+ /* Card Footer */
201
+ .kanban-card-footer {
202
+ display: flex;
203
+ align-items: center;
204
+ justify-content: space-between;
205
+ margin-top: 8px;
206
+ gap: 8px;
207
+ }
208
+ .kanban-card-assignees {
209
+ display: flex;
210
+ gap: -4px;
211
+ }
212
+ .kanban-card-avatar {
213
+ display: inline-flex;
214
+ align-items: center;
215
+ justify-content: center;
216
+ width: 24px;
217
+ height: 24px;
218
+ border-radius: 50%;
219
+ background: #dfe1e6;
220
+ color: #42526e;
221
+ font-size: 11px;
222
+ font-weight: 600;
223
+ border: 2px solid #fff;
224
+ margin-left: -4px;
225
+ }
226
+ .kanban-card-avatar:first-child {
227
+ margin-left: 0;
228
+ }
229
+ .kanban-card-avatar-more {
230
+ display: inline-flex;
231
+ align-items: center;
232
+ justify-content: center;
233
+ width: 24px;
234
+ height: 24px;
235
+ border-radius: 50%;
236
+ background: #c1c7d0;
237
+ color: #42526e;
238
+ font-size: 10px;
239
+ font-weight: 600;
240
+ border: 2px solid #fff;
241
+ margin-left: -4px;
242
+ }
243
+ .kanban-card-due {
244
+ font-size: 12px;
245
+ color: #6b778c;
246
+ display: flex;
247
+ align-items: center;
248
+ gap: 4px;
249
+ }
250
+ .kanban-card-due--overdue {
251
+ color: #ff5630;
252
+ font-weight: 600;
253
+ }
254
+ /* Add Buttons */
255
+ .kanban-add-card {
256
+ padding: 0 4px;
257
+ }
258
+ .kanban-add-card-btn {
259
+ width: 100%;
260
+ padding: 6px 8px;
261
+ background: none;
262
+ border: none;
263
+ border-radius: 6px;
264
+ color: #6b778c;
265
+ font-size: 13px;
266
+ cursor: pointer;
267
+ text-align: left;
268
+ transition: background 0.15s, color 0.15s;
269
+ }
270
+ .kanban-add-card-btn:hover {
271
+ background: #dfe1e6;
272
+ color: #172b4d;
273
+ }
274
+ .kanban-add-column {
275
+ flex: 0 0 280px;
276
+ }
277
+ .kanban-add-column-btn {
278
+ width: 100%;
279
+ padding: 10px;
280
+ background: rgba(0, 0, 0, 0.04);
281
+ border: 2px dashed #d0d4d9;
282
+ border-radius: 8px;
283
+ color: #6b778c;
284
+ font-size: 14px;
285
+ cursor: pointer;
286
+ transition: background 0.15s, border-color 0.15s, color 0.15s;
287
+ }
288
+ .kanban-add-column-btn:hover {
289
+ background: rgba(0, 0, 0, 0.08);
290
+ border-color: #a5adba;
291
+ color: #172b4d;
292
+ }
293
+ /* Scrollbar */
294
+ .kanban-column-body::-webkit-scrollbar {
295
+ width: 6px;
296
+ }
297
+ .kanban-column-body::-webkit-scrollbar-track {
298
+ background: transparent;
299
+ }
300
+ .kanban-column-body::-webkit-scrollbar-thumb {
301
+ background: #c1c7d0;
302
+ border-radius: 3px;
303
+ }
304
+ .kanban-column-body::-webkit-scrollbar-thumb:hover {
305
+ background: #a5adba;
306
+ }
307
+ /*# sourceMappingURL=src/styles/kanban.less.map */