@xpyjs/gantt-core 0.0.1-rc.3 → 0.0.1-rc.5

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xpyjs/gantt-core",
3
3
  "private": false,
4
- "version": "0.0.1-rc.3",
4
+ "version": "0.0.1-rc.5",
5
5
  "description": "A powerful and flexible Gantt chart component library for modern web applications with TypeScript support",
6
6
  "type": "module",
7
7
  "main": "./dist/x-gantt.umd.cjs",
package/types/XGantt.d.ts CHANGED
@@ -339,4 +339,15 @@ export declare class XGantt {
339
339
  * 获取当前数据量总数。该数量为所有数据展开后的数据条数
340
340
  */
341
341
  getDataSize(): number;
342
+ /**
343
+ * 移除指定 ID 的数据。该操作会直接修改当前数据源,并且不可逆,请谨慎使用
344
+ * @param id 数据 ID
345
+ * @returns 是否成功移除
346
+ *
347
+ * @example
348
+ * ```typescript
349
+ * const success = gantt.removeDataById('task-1');
350
+ * ```
351
+ */
352
+ removeDataById(id: string): boolean;
342
353
  }
@@ -15,6 +15,7 @@ export declare class Renderer {
15
15
  private width;
16
16
  private height;
17
17
  private isInitialized;
18
+ private resizeObserver?;
18
19
  getScrollbar(): Scrollbar;
19
20
  constructor(context: IContext, // 渲染器上下文
20
21
  container: HTMLElement);
@@ -64,6 +64,10 @@ export declare class DataManager {
64
64
  * 通过 ID 获取任务
65
65
  */
66
66
  getTaskById(id: string): Task | undefined;
67
+ /**
68
+ * 删除某个任务数据
69
+ */
70
+ deleteTaskById(id: string): boolean;
67
71
  /**
68
72
  * 移动任务位置
69
73
  */
@@ -11,6 +11,12 @@ export interface IGanttOptions {
11
11
  /** 日志 level。 默认 info */
12
12
  logLevel?: "debug" | "info" | "warn" | "error" | "none";
13
13
 
14
+ /** 配置 resize 规则 */
15
+ resize?: {
16
+ /** 是否启用自适应 */
17
+ enabled: boolean;
18
+ };
19
+
14
20
  /** 源数据 */
15
21
  data: any[];
16
22
 
@@ -287,7 +293,7 @@ export interface IGanttOptions {
287
293
  /** 差异显示模式 */
288
294
  mode: 'highlight' | 'indicator' | 'both';
289
295
  /** 以何种基准展示对比。基线高亮只会以一种(起始/结束)基线进行对比。默认以结束时间为基准('end') */
290
- target: 'start' | 'end'
296
+ target: 'start' | 'end';
291
297
 
292
298
  /** 超期任务的高亮配置 */
293
299
  delayed: {