@stonecrop/stonecrop 0.4.22 → 0.4.24

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.
@@ -1,5 +1,5 @@
1
1
  export type { BaseSchema, FieldsetSchema, FormSchema, SchemaTypes, TableSchema } from '@stonecrop/aform';
2
- export type { CellContext, GanttOptions, TableColumn, TableConfig, TableRow } from '@stonecrop/atable';
2
+ export type { CellContext, ConnectionEvent, ConnectionHandle, ConnectionPath, GanttBarInfo, GanttDragEvent, GanttOptions, TableColumn, TableConfig, TableRow, } from '@stonecrop/atable';
3
3
  import { type StonecropReturn, useStonecrop } from './composable';
4
4
  import DoctypeMeta from './doctype';
5
5
  import Registry from './registry';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACxG,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEtG,OAAO,EAAE,KAAK,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,WAAW,MAAM,WAAW,CAAA;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,SAAS,MAAM,WAAW,CAAA;AACjC,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEvF,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACxG,YAAY,EACX,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,WAAW,EACX,WAAW,EACX,QAAQ,GACR,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,KAAK,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,WAAW,MAAM,WAAW,CAAA;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,SAAS,MAAM,WAAW,CAAA;AACjC,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEvF,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,CAAA"}
@@ -5,6 +5,7 @@ import { Map as Map_2 } from 'immutable';
5
5
  import { Plugin as Plugin_2 } from 'vue';
6
6
  import { Ref } from 'vue';
7
7
  import { Router } from 'vue-router';
8
+ import type { ShallowRef } from 'vue';
8
9
  import type { StateMachine } from 'xstate';
9
10
  import { StoreDefinition } from 'pinia';
10
11
 
@@ -56,6 +57,89 @@ export declare interface CellContext {
56
57
  };
57
58
  }
58
59
 
60
+ /**
61
+ * Connection event for handling connection creation/deletion.
62
+ * @public
63
+ */
64
+ export declare type ConnectionEvent = {
65
+ type: 'create' | 'delete';
66
+ connection: ConnectionPath;
67
+ };
68
+
69
+ /**
70
+ * Connection handle information for gantt bar connections.
71
+ * @public
72
+ */
73
+ export declare interface ConnectionHandle {
74
+ /**
75
+ * Unique identifier for the connection handle.
76
+ */
77
+ id: string;
78
+ /**
79
+ * The row index of the gantt bar this handle belongs to.
80
+ */
81
+ rowIndex: number;
82
+ /**
83
+ * The column index of the gantt bar this handle belongs to.
84
+ */
85
+ colIndex: number;
86
+ /**
87
+ * The side of the gantt bar where this handle is located.
88
+ */
89
+ side: 'left' | 'right';
90
+ /**
91
+ * The position of the connection handle.
92
+ */
93
+ position: {
94
+ x: ShallowRef<number>;
95
+ y: ShallowRef<number>;
96
+ };
97
+ /**
98
+ * Whether the handle is currently visible (on hover).
99
+ */
100
+ visible: Ref<boolean>;
101
+ /**
102
+ * Reference to the gantt bar this handle belongs to.
103
+ */
104
+ barId: string;
105
+ }
106
+
107
+ /**
108
+ * Connection path between two gantt bars.
109
+ * @public
110
+ */
111
+ export declare interface ConnectionPath {
112
+ /**
113
+ * Unique identifier for the connection path.
114
+ */
115
+ id: string;
116
+ /**
117
+ * The source connection handle.
118
+ */
119
+ from: {
120
+ barId: string;
121
+ side: 'left' | 'right';
122
+ };
123
+ /**
124
+ * The target connection handle.
125
+ */
126
+ to: {
127
+ barId: string;
128
+ side: 'left' | 'right';
129
+ };
130
+ /**
131
+ * Optional styling for the connection path.
132
+ */
133
+ style?: {
134
+ color?: string;
135
+ width?: number;
136
+ };
137
+ /**
138
+ * Optional label for the connection.
139
+ */
140
+ label?: string;
141
+ }
142
+
59
143
  /**
60
144
  * Doctype Meta class
61
145
  * @public
@@ -176,26 +260,105 @@ export declare type FormSchema = BaseSchema & {
176
260
  };
177
261
 
178
262
  /**
179
- * This interface defines the options for a row when it is being viewed as a Gantt chart.
263
+ * Gantt bar information for VueFlow integration.
264
+ * @public
265
+ */
266
+ export declare interface GanttBarInfo {
267
+ /**
268
+ * Unique identifier for the gantt bar.
269
+ */
270
+ id: string;
271
+ /**
272
+ * The row index of the gantt bar.
273
+ */
274
+ rowIndex: number;
275
+ /**
276
+ * The primary column index of the gantt bar (typically the start index).
277
+ */
278
+ colIndex: number;
279
+ /**
280
+ * Starting column index of the gantt bar.
281
+ */
282
+ startIndex: Ref<number>;
283
+ /**
284
+ * Ending column index of the gantt bar.
285
+ */
286
+ endIndex: Ref<number>;
287
+ /**
288
+ * Color of the gantt bar.
289
+ */
290
+ color: Ref<string>;
291
+ /**
292
+ * The position of the gantt bar in the ATable component.
293
+ */
294
+ position: {
295
+ x: ShallowRef<number>;
296
+ y: ShallowRef<number>;
297
+ };
298
+ /**
299
+ * Display label for the gantt bar.
300
+ */
301
+ label?: string;
302
+ }
303
+
304
+ /**
305
+ * Gantt table drag event definition.
306
+ * @public
307
+ */
308
+ export declare type GanttDragEvent = {
309
+ rowIndex: number;
310
+ colIndex: number;
311
+ delta: number;
312
+ } & ({
313
+ type: 'bar';
314
+ oldStart: number;
315
+ oldEnd: number;
316
+ newStart: number;
317
+ newEnd: number;
318
+ colspan: number;
319
+ } | {
320
+ type: 'resize';
321
+ edge: 'start';
322
+ oldStart: number;
323
+ newStart: number;
324
+ end: number;
325
+ oldColspan: number;
326
+ newColspan: number;
327
+ } | {
328
+ type: 'resize';
329
+ edge: 'end';
330
+ oldEnd: number;
331
+ newEnd: number;
332
+ start: number;
333
+ oldColspan: number;
334
+ newColspan: number;
335
+ });
336
+
337
+ /**
338
+ * Gantt chart options for table rows.
180
339
  * @public
181
340
  */
182
341
  export declare interface GanttOptions {
183
342
  /**
184
- * The colour to be applied to the row's gantt bar.
343
+ * The color to be applied to the row's gantt bar.
344
+ *
345
+ * @defaultValue '#cccccc'
185
346
  */
186
347
  color?: string;
187
348
  /**
188
349
  * The starting column index for the gantt bar.
350
+ *
351
+ * @defaultValue 0
189
352
  */
190
353
  startIndex?: number;
191
354
  /**
192
- * The ending column index for the gantt bar. If the endIndex and colspan are not provided,
355
+ * The ending column index for the gantt bar. If endIndex and colspan are not provided,
193
356
  * the bar will stretch to the end of the table.
194
357
  */
195
358
  endIndex?: number;
196
359
  /**
197
- * The length of the gantt bar. Useful when only the start index is provided. If the
198
- * colspan and endIndex are not provided, the bar will stretch to the end of the table.
360
+ * The length of the gantt bar in columns. Useful when only the start index is provided.
361
+ * If colspan and endIndex are not provided, the bar will stretch to the end of the table.
199
362
  */
200
363
  colspan?: number;
201
364
  }
@@ -619,8 +782,8 @@ export declare interface TableColumn {
619
782
  */
620
783
  ganttComponent?: string;
621
784
  /**
622
- * The colspan of the Gantt-bar for the column. This is used to determine how many columns
623
- * the Gantt-bar should span.
785
+ * The colspan of the Gantt bar for the column. This determines how many columns
786
+ * the Gantt bar should span across.
624
787
  *
625
788
  * Only applicable for Gantt tables.
626
789
  *
@@ -628,8 +791,8 @@ export declare interface TableColumn {
628
791
  */
629
792
  colspan?: number;
630
793
  /**
631
- * The starting column index for the Gantt-bar, excluding any pinned columns. This is
632
- * evaluated automatically while rendering the table.
794
+ * The original column index for the Gantt bar, excluding any pinned columns.
795
+ * This is evaluated automatically while rendering the table.
633
796
  *
634
797
  * Only applicable for Gantt tables.
635
798
  *
@@ -649,8 +812,10 @@ export declare interface TableConfig {
649
812
  * - `list` - row numbers are displayed in the table
650
813
  * - `list-expansion` - carets are displayed in the number column that expand/collapse the row inline
651
814
  * - `tree` - carets are displayed in the number column that expand/collapse grouped rows
815
+ * - `gantt` - view that allows specific rows to be displayed with Gantt functionality
816
+ * - `tree-gantt` - similar to `gantt`, but allows for tree functionality as well
652
817
  */
653
- view?: 'uncounted' | 'list' | 'list-expansion' | 'tree' | 'gantt';
818
+ view?: 'uncounted' | 'list' | 'list-expansion' | 'tree' | 'gantt' | 'tree-gantt';
654
819
  /**
655
820
  * Control whether the table should be allowed to use the full width of its container.
656
821
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stonecrop/stonecrop",
3
- "version": "0.4.22",
3
+ "version": "0.4.24",
4
4
  "description": "schema helper",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -52,8 +52,8 @@
52
52
  "eslint-plugin-vue": "^9.33.0",
53
53
  "typescript": "^5.8.3",
54
54
  "vite": "^6.3.5",
55
- "@stonecrop/atable": "0.4.22",
56
- "@stonecrop/aform": "0.4.22",
55
+ "@stonecrop/aform": "0.4.24",
56
+ "@stonecrop/atable": "0.4.24",
57
57
  "stonecrop-rig": "0.2.22"
58
58
  },
59
59
  "publishConfig": {
package/src/index.ts CHANGED
@@ -1,5 +1,16 @@
1
1
  export type { BaseSchema, FieldsetSchema, FormSchema, SchemaTypes, TableSchema } from '@stonecrop/aform'
2
- export type { CellContext, GanttOptions, TableColumn, TableConfig, TableRow } from '@stonecrop/atable'
2
+ export type {
3
+ CellContext,
4
+ ConnectionEvent,
5
+ ConnectionHandle,
6
+ ConnectionPath,
7
+ GanttBarInfo,
8
+ GanttDragEvent,
9
+ GanttOptions,
10
+ TableColumn,
11
+ TableConfig,
12
+ TableRow,
13
+ } from '@stonecrop/atable'
3
14
 
4
15
  import { type StonecropReturn, useStonecrop } from './composable'
5
16
  import DoctypeMeta from './doctype'