@stonecrop/stonecrop 0.4.31 → 0.4.32

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,10 +1,10 @@
1
- export type { BaseSchema, FieldsetSchema, FormSchema, SchemaTypes, TableSchema } from '@stonecrop/aform';
2
- export type { CellContext, ConnectionEvent, ConnectionHandle, ConnectionPath, GanttBarInfo, GanttDragEvent, GanttOptions, TableColumn, TableConfig, TableRow, } from '@stonecrop/atable';
1
+ export type * from '@stonecrop/aform/types';
2
+ export type * from '@stonecrop/atable/types';
3
3
  import { type StonecropReturn, useStonecrop } from './composable';
4
4
  import DoctypeMeta from './doctype';
5
5
  import Registry from './registry';
6
6
  import Stonecrop from './plugins';
7
7
  import { Stonecrop as StonecropClass } from './stonecrop';
8
- export type { ImmutableDoctype, MutableDoctype, Schema, InstallOptions } from './types';
8
+ export type * from './types';
9
9
  export { DoctypeMeta, Registry, Stonecrop, StonecropClass, StonecropReturn, useStonecrop };
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -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,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,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,aAAa,CAAA;AACzD,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEvF,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,wBAAwB,CAAA;AAC3C,mBAAmB,yBAAyB,CAAA;AAE5C,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,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,aAAa,CAAA;AACzD,mBAAmB,SAAS,CAAA;AAE5B,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,CAAA"}
@@ -1,13 +1,18 @@
1
1
  import type { AnyStateNodeConfig } from 'xstate';
2
2
  import { Component } from 'vue';
3
+ import { ComputedRef } from 'vue';
4
+ import { CSSProperties } from 'vue';
3
5
  import { List } from 'immutable';
4
6
  import { Map as Map_2 } from 'immutable';
5
7
  import { Plugin as Plugin_2 } from 'vue';
6
8
  import { Ref } from 'vue';
7
9
  import { Router } from 'vue-router';
8
10
  import type { ShallowRef } from 'vue';
11
+ import { Store } from 'pinia';
9
12
  import { StoreDefinition } from 'pinia';
10
13
  import type { UnknownMachineConfig } from 'xstate';
14
+ import { useElementBounding } from '@vueuse/core';
15
+ import { WritableComputedRef } from 'vue';
11
16
 
12
17
  /**
13
18
  * Basic field structure for AForm schemas
@@ -57,6 +62,55 @@ export declare interface CellContext {
57
62
  };
58
63
  }
59
64
 
65
+ /**
66
+ * Defined props for AForm components
67
+ * @public
68
+ */
69
+ export declare type ComponentProps = {
70
+ /**
71
+ * The schema object to pass to the component
72
+ * @public
73
+ */
74
+ schema?: SchemaTypes;
75
+ /**
76
+ * The label to display in the component
77
+ * @public
78
+ */
79
+ label?: string;
80
+ /**
81
+ * The masking string to apply to inputs inside the component
82
+ * @public
83
+ */
84
+ mask?: string;
85
+ /**
86
+ * Indicate whether input is required for text and/or select elements inside the component
87
+ * @public
88
+ */
89
+ required?: boolean;
90
+ /**
91
+ * Indicate whether elements inside the component are read-only
92
+ * @public
93
+ */
94
+ readonly?: boolean;
95
+ /**
96
+ * Set a unique identifier for elements inside the component
97
+ * @public
98
+ */
99
+ uuid?: string;
100
+ /**
101
+ * Validation options for elements inside the component
102
+ * @public
103
+ */
104
+ validation?: {
105
+ /**
106
+ * The error message to display when validation fails
107
+ * @public
108
+ */
109
+ errorMessage: string;
110
+ [key: string]: any;
111
+ };
112
+ };
113
+
60
114
  /**
61
115
  * Connection event for handling connection creation/deletion.
62
116
  * @public
@@ -140,6 +194,725 @@ export declare interface ConnectionPath {
140
194
  label?: string;
141
195
  }
142
196
 
197
+ /**
198
+ * Create a table store
199
+ * @param initData - Initial data for the table store
200
+ * @returns table store instance
201
+ * @public
202
+ */
203
+ declare const createTableStore: (initData: {
204
+ columns: TableColumn[];
205
+ rows: TableRow[];
206
+ id?: string;
207
+ config?: TableConfig;
208
+ modal?: TableModal;
209
+ }) => Store<`table-${string}`, Pick<{
210
+ columns: Ref< {
211
+ name: string;
212
+ align?: CanvasTextAlign | undefined;
213
+ edit?: boolean | undefined;
214
+ label?: string | undefined;
215
+ type?: string | undefined;
216
+ width?: string | undefined;
217
+ pinned?: boolean | undefined;
218
+ resizable?: boolean | undefined;
219
+ cellComponent?: string | undefined;
220
+ cellComponentProps?: Record<string, any> | undefined;
221
+ modalComponent?: string | ((context: CellContext) => string) | undefined;
222
+ modalComponentExtraProps?: Record<string, any> | undefined;
223
+ format?: string | ((value: any, context: CellContext) => string) | undefined;
224
+ mask?: ((value: any) => any) | undefined;
225
+ isGantt?: boolean | undefined;
226
+ ganttComponent?: string | undefined;
227
+ colspan?: number | undefined;
228
+ originalIndex?: number | undefined;
229
+ }[], TableColumn[] | {
230
+ name: string;
231
+ align?: CanvasTextAlign | undefined;
232
+ edit?: boolean | undefined;
233
+ label?: string | undefined;
234
+ type?: string | undefined;
235
+ width?: string | undefined;
236
+ pinned?: boolean | undefined;
237
+ resizable?: boolean | undefined;
238
+ cellComponent?: string | undefined;
239
+ cellComponentProps?: Record<string, any> | undefined;
240
+ modalComponent?: string | ((context: CellContext) => string) | undefined;
241
+ modalComponentExtraProps?: Record<string, any> | undefined;
242
+ format?: string | ((value: any, context: CellContext) => string) | undefined;
243
+ mask?: ((value: any) => any) | undefined;
244
+ isGantt?: boolean | undefined;
245
+ ganttComponent?: string | undefined;
246
+ colspan?: number | undefined;
247
+ originalIndex?: number | undefined;
248
+ }[]>;
249
+ config: Ref< {
250
+ view?: "uncounted" | "list" | "list-expansion" | "tree" | "gantt" | "tree-gantt" | undefined;
251
+ fullWidth?: boolean | undefined;
252
+ dependencyGraph?: boolean | undefined;
253
+ }, TableConfig | {
254
+ view?: "uncounted" | "list" | "list-expansion" | "tree" | "gantt" | "tree-gantt" | undefined;
255
+ fullWidth?: boolean | undefined;
256
+ dependencyGraph?: boolean | undefined;
257
+ }>;
258
+ connectionHandles: Ref< {
259
+ id: string;
260
+ rowIndex: number;
261
+ colIndex: number;
262
+ side: "left" | "right";
263
+ position: {
264
+ x: number;
265
+ y: number;
266
+ };
267
+ visible: boolean;
268
+ barId: string;
269
+ }[], ConnectionHandle[] | {
270
+ id: string;
271
+ rowIndex: number;
272
+ colIndex: number;
273
+ side: "left" | "right";
274
+ position: {
275
+ x: number;
276
+ y: number;
277
+ };
278
+ visible: boolean;
279
+ barId: string;
280
+ }[]>;
281
+ connectionPaths: Ref< {
282
+ id: string;
283
+ from: {
284
+ barId: string;
285
+ side: "left" | "right";
286
+ };
287
+ to: {
288
+ barId: string;
289
+ side: "left" | "right";
290
+ };
291
+ style?: {
292
+ color?: string | undefined;
293
+ width?: number | undefined;
294
+ } | undefined;
295
+ label?: string | undefined;
296
+ }[], ConnectionPath[] | {
297
+ id: string;
298
+ from: {
299
+ barId: string;
300
+ side: "left" | "right";
301
+ };
302
+ to: {
303
+ barId: string;
304
+ side: "left" | "right";
305
+ };
306
+ style?: {
307
+ color?: string | undefined;
308
+ width?: number | undefined;
309
+ } | undefined;
310
+ label?: string | undefined;
311
+ }[]>;
312
+ display: WritableComputedRef<TableDisplay[], TableDisplay[]>;
313
+ ganttBars: Ref< {
314
+ id: string;
315
+ rowIndex: number;
316
+ colIndex: number;
317
+ startIndex: number;
318
+ endIndex: number;
319
+ color: string;
320
+ position: {
321
+ x: number;
322
+ y: number;
323
+ };
324
+ label?: string | undefined;
325
+ }[], GanttBarInfo[] | {
326
+ id: string;
327
+ rowIndex: number;
328
+ colIndex: number;
329
+ startIndex: number;
330
+ endIndex: number;
331
+ color: string;
332
+ position: {
333
+ x: number;
334
+ y: number;
335
+ };
336
+ label?: string | undefined;
337
+ }[]>;
338
+ modal: Ref< {
339
+ visible?: boolean | undefined;
340
+ cell?: (HTMLTableCellElement | null) | undefined;
341
+ parent?: HTMLElement | undefined;
342
+ colIndex?: number | undefined;
343
+ rowIndex?: number | undefined;
344
+ component?: string | undefined;
345
+ componentProps?: Record<string, any> | undefined;
346
+ bottom?: number | undefined;
347
+ height?: number | undefined;
348
+ left?: number | undefined;
349
+ width?: number | undefined;
350
+ }, TableModal | {
351
+ visible?: boolean | undefined;
352
+ cell?: (HTMLTableCellElement | null) | undefined;
353
+ parent?: HTMLElement | undefined;
354
+ colIndex?: number | undefined;
355
+ rowIndex?: number | undefined;
356
+ component?: string | undefined;
357
+ componentProps?: Record<string, any> | undefined;
358
+ bottom?: number | undefined;
359
+ height?: number | undefined;
360
+ left?: number | undefined;
361
+ width?: number | undefined;
362
+ }>;
363
+ rows: Ref< {
364
+ [x: string]: any;
365
+ indent?: number | undefined;
366
+ parent?: number | undefined;
367
+ gantt?: {
368
+ color?: string | undefined;
369
+ startIndex?: number | undefined;
370
+ endIndex?: number | undefined;
371
+ colspan?: number | undefined;
372
+ } | undefined;
373
+ }[], TableRow[] | {
374
+ [x: string]: any;
375
+ indent?: number | undefined;
376
+ parent?: number | undefined;
377
+ gantt?: {
378
+ color?: string | undefined;
379
+ startIndex?: number | undefined;
380
+ endIndex?: number | undefined;
381
+ colspan?: number | undefined;
382
+ } | undefined;
383
+ }[]>;
384
+ table: ComputedRef< {}>;
385
+ updates: Ref<Record<string, string>, Record<string, string>>;
386
+ hasPinnedColumns: ComputedRef<boolean>;
387
+ isGanttView: ComputedRef<boolean>;
388
+ isTreeView: ComputedRef<boolean>;
389
+ isDependencyGraphEnabled: ComputedRef<boolean>;
390
+ numberedRowWidth: ComputedRef<string>;
391
+ zeroColumn: ComputedRef<boolean>;
392
+ closeModal: (event: MouseEvent) => void;
393
+ createConnection: (fromHandleId: string, toHandleId: string, options?: {
394
+ style?: ConnectionPath["style"];
395
+ label?: string;
396
+ }) => ConnectionPath | null;
397
+ deleteConnection: (connectionId: string) => boolean;
398
+ getCellData: <T = any>(colIndex: number, rowIndex: number) => T;
399
+ getCellDisplayValue: (colIndex: number, rowIndex: number) => any;
400
+ getConnectionsForBar: (barId: string) => {
401
+ id: string;
402
+ from: {
403
+ barId: string;
404
+ side: "left" | "right";
405
+ };
406
+ to: {
407
+ barId: string;
408
+ side: "left" | "right";
409
+ };
410
+ style?: {
411
+ color?: string | undefined;
412
+ width?: number | undefined;
413
+ } | undefined;
414
+ label?: string | undefined;
415
+ }[];
416
+ getFormattedValue: (colIndex: number, rowIndex: number, value: any) => any;
417
+ getHandlesForBar: (barId: string) => {
418
+ id: string;
419
+ rowIndex: number;
420
+ colIndex: number;
421
+ side: "left" | "right";
422
+ position: {
423
+ x: number;
424
+ y: number;
425
+ };
426
+ visible: boolean;
427
+ barId: string;
428
+ }[];
429
+ getHeaderCellStyle: (column: TableColumn) => CSSProperties;
430
+ getIndent: (colIndex: number, indentLevel?: number) => string;
431
+ getRowExpandSymbol: (rowIndex: number) => "" | "▼" | "►";
432
+ isRowGantt: (rowIndex: number) => boolean;
433
+ isRowVisible: (rowIndex: number) => boolean | undefined;
434
+ registerConnectionHandle: (handleInfo: ConnectionHandle) => void;
435
+ registerGanttBar: (barInfo: GanttBarInfo) => void;
436
+ resizeColumn: (colIndex: number, newWidth: number) => void;
437
+ setCellData: (colIndex: number, rowIndex: number, value: any) => void;
438
+ setCellText: (colIndex: number, rowIndex: number, value: string) => void;
439
+ toggleRowExpand: (rowIndex: number) => void;
440
+ unregisterConnectionHandle: (handleId: string) => void;
441
+ unregisterGanttBar: (barId: string) => void;
442
+ updateGanttBar: (event: GanttDragEvent) => void;
443
+ updateRows: (newRows: TableRow[]) => void;
444
+ }, "columns" | "config" | "connectionHandles" | "connectionPaths" | "ganttBars" | "modal" | "rows" | "updates">, Pick<{
445
+ columns: Ref< {
446
+ name: string;
447
+ align?: CanvasTextAlign | undefined;
448
+ edit?: boolean | undefined;
449
+ label?: string | undefined;
450
+ type?: string | undefined;
451
+ width?: string | undefined;
452
+ pinned?: boolean | undefined;
453
+ resizable?: boolean | undefined;
454
+ cellComponent?: string | undefined;
455
+ cellComponentProps?: Record<string, any> | undefined;
456
+ modalComponent?: string | ((context: CellContext) => string) | undefined;
457
+ modalComponentExtraProps?: Record<string, any> | undefined;
458
+ format?: string | ((value: any, context: CellContext) => string) | undefined;
459
+ mask?: ((value: any) => any) | undefined;
460
+ isGantt?: boolean | undefined;
461
+ ganttComponent?: string | undefined;
462
+ colspan?: number | undefined;
463
+ originalIndex?: number | undefined;
464
+ }[], TableColumn[] | {
465
+ name: string;
466
+ align?: CanvasTextAlign | undefined;
467
+ edit?: boolean | undefined;
468
+ label?: string | undefined;
469
+ type?: string | undefined;
470
+ width?: string | undefined;
471
+ pinned?: boolean | undefined;
472
+ resizable?: boolean | undefined;
473
+ cellComponent?: string | undefined;
474
+ cellComponentProps?: Record<string, any> | undefined;
475
+ modalComponent?: string | ((context: CellContext) => string) | undefined;
476
+ modalComponentExtraProps?: Record<string, any> | undefined;
477
+ format?: string | ((value: any, context: CellContext) => string) | undefined;
478
+ mask?: ((value: any) => any) | undefined;
479
+ isGantt?: boolean | undefined;
480
+ ganttComponent?: string | undefined;
481
+ colspan?: number | undefined;
482
+ originalIndex?: number | undefined;
483
+ }[]>;
484
+ config: Ref< {
485
+ view?: "uncounted" | "list" | "list-expansion" | "tree" | "gantt" | "tree-gantt" | undefined;
486
+ fullWidth?: boolean | undefined;
487
+ dependencyGraph?: boolean | undefined;
488
+ }, TableConfig | {
489
+ view?: "uncounted" | "list" | "list-expansion" | "tree" | "gantt" | "tree-gantt" | undefined;
490
+ fullWidth?: boolean | undefined;
491
+ dependencyGraph?: boolean | undefined;
492
+ }>;
493
+ connectionHandles: Ref< {
494
+ id: string;
495
+ rowIndex: number;
496
+ colIndex: number;
497
+ side: "left" | "right";
498
+ position: {
499
+ x: number;
500
+ y: number;
501
+ };
502
+ visible: boolean;
503
+ barId: string;
504
+ }[], ConnectionHandle[] | {
505
+ id: string;
506
+ rowIndex: number;
507
+ colIndex: number;
508
+ side: "left" | "right";
509
+ position: {
510
+ x: number;
511
+ y: number;
512
+ };
513
+ visible: boolean;
514
+ barId: string;
515
+ }[]>;
516
+ connectionPaths: Ref< {
517
+ id: string;
518
+ from: {
519
+ barId: string;
520
+ side: "left" | "right";
521
+ };
522
+ to: {
523
+ barId: string;
524
+ side: "left" | "right";
525
+ };
526
+ style?: {
527
+ color?: string | undefined;
528
+ width?: number | undefined;
529
+ } | undefined;
530
+ label?: string | undefined;
531
+ }[], ConnectionPath[] | {
532
+ id: string;
533
+ from: {
534
+ barId: string;
535
+ side: "left" | "right";
536
+ };
537
+ to: {
538
+ barId: string;
539
+ side: "left" | "right";
540
+ };
541
+ style?: {
542
+ color?: string | undefined;
543
+ width?: number | undefined;
544
+ } | undefined;
545
+ label?: string | undefined;
546
+ }[]>;
547
+ display: WritableComputedRef<TableDisplay[], TableDisplay[]>;
548
+ ganttBars: Ref< {
549
+ id: string;
550
+ rowIndex: number;
551
+ colIndex: number;
552
+ startIndex: number;
553
+ endIndex: number;
554
+ color: string;
555
+ position: {
556
+ x: number;
557
+ y: number;
558
+ };
559
+ label?: string | undefined;
560
+ }[], GanttBarInfo[] | {
561
+ id: string;
562
+ rowIndex: number;
563
+ colIndex: number;
564
+ startIndex: number;
565
+ endIndex: number;
566
+ color: string;
567
+ position: {
568
+ x: number;
569
+ y: number;
570
+ };
571
+ label?: string | undefined;
572
+ }[]>;
573
+ modal: Ref< {
574
+ visible?: boolean | undefined;
575
+ cell?: (HTMLTableCellElement | null) | undefined;
576
+ parent?: HTMLElement | undefined;
577
+ colIndex?: number | undefined;
578
+ rowIndex?: number | undefined;
579
+ component?: string | undefined;
580
+ componentProps?: Record<string, any> | undefined;
581
+ bottom?: number | undefined;
582
+ height?: number | undefined;
583
+ left?: number | undefined;
584
+ width?: number | undefined;
585
+ }, TableModal | {
586
+ visible?: boolean | undefined;
587
+ cell?: (HTMLTableCellElement | null) | undefined;
588
+ parent?: HTMLElement | undefined;
589
+ colIndex?: number | undefined;
590
+ rowIndex?: number | undefined;
591
+ component?: string | undefined;
592
+ componentProps?: Record<string, any> | undefined;
593
+ bottom?: number | undefined;
594
+ height?: number | undefined;
595
+ left?: number | undefined;
596
+ width?: number | undefined;
597
+ }>;
598
+ rows: Ref< {
599
+ [x: string]: any;
600
+ indent?: number | undefined;
601
+ parent?: number | undefined;
602
+ gantt?: {
603
+ color?: string | undefined;
604
+ startIndex?: number | undefined;
605
+ endIndex?: number | undefined;
606
+ colspan?: number | undefined;
607
+ } | undefined;
608
+ }[], TableRow[] | {
609
+ [x: string]: any;
610
+ indent?: number | undefined;
611
+ parent?: number | undefined;
612
+ gantt?: {
613
+ color?: string | undefined;
614
+ startIndex?: number | undefined;
615
+ endIndex?: number | undefined;
616
+ colspan?: number | undefined;
617
+ } | undefined;
618
+ }[]>;
619
+ table: ComputedRef< {}>;
620
+ updates: Ref<Record<string, string>, Record<string, string>>;
621
+ hasPinnedColumns: ComputedRef<boolean>;
622
+ isGanttView: ComputedRef<boolean>;
623
+ isTreeView: ComputedRef<boolean>;
624
+ isDependencyGraphEnabled: ComputedRef<boolean>;
625
+ numberedRowWidth: ComputedRef<string>;
626
+ zeroColumn: ComputedRef<boolean>;
627
+ closeModal: (event: MouseEvent) => void;
628
+ createConnection: (fromHandleId: string, toHandleId: string, options?: {
629
+ style?: ConnectionPath["style"];
630
+ label?: string;
631
+ }) => ConnectionPath | null;
632
+ deleteConnection: (connectionId: string) => boolean;
633
+ getCellData: <T = any>(colIndex: number, rowIndex: number) => T;
634
+ getCellDisplayValue: (colIndex: number, rowIndex: number) => any;
635
+ getConnectionsForBar: (barId: string) => {
636
+ id: string;
637
+ from: {
638
+ barId: string;
639
+ side: "left" | "right";
640
+ };
641
+ to: {
642
+ barId: string;
643
+ side: "left" | "right";
644
+ };
645
+ style?: {
646
+ color?: string | undefined;
647
+ width?: number | undefined;
648
+ } | undefined;
649
+ label?: string | undefined;
650
+ }[];
651
+ getFormattedValue: (colIndex: number, rowIndex: number, value: any) => any;
652
+ getHandlesForBar: (barId: string) => {
653
+ id: string;
654
+ rowIndex: number;
655
+ colIndex: number;
656
+ side: "left" | "right";
657
+ position: {
658
+ x: number;
659
+ y: number;
660
+ };
661
+ visible: boolean;
662
+ barId: string;
663
+ }[];
664
+ getHeaderCellStyle: (column: TableColumn) => CSSProperties;
665
+ getIndent: (colIndex: number, indentLevel?: number) => string;
666
+ getRowExpandSymbol: (rowIndex: number) => "" | "▼" | "►";
667
+ isRowGantt: (rowIndex: number) => boolean;
668
+ isRowVisible: (rowIndex: number) => boolean | undefined;
669
+ registerConnectionHandle: (handleInfo: ConnectionHandle) => void;
670
+ registerGanttBar: (barInfo: GanttBarInfo) => void;
671
+ resizeColumn: (colIndex: number, newWidth: number) => void;
672
+ setCellData: (colIndex: number, rowIndex: number, value: any) => void;
673
+ setCellText: (colIndex: number, rowIndex: number, value: string) => void;
674
+ toggleRowExpand: (rowIndex: number) => void;
675
+ unregisterConnectionHandle: (handleId: string) => void;
676
+ unregisterGanttBar: (barId: string) => void;
677
+ updateGanttBar: (event: GanttDragEvent) => void;
678
+ updateRows: (newRows: TableRow[]) => void;
679
+ }, "display" | "table" | "hasPinnedColumns" | "isGanttView" | "isTreeView" | "isDependencyGraphEnabled" | "numberedRowWidth" | "zeroColumn">, Pick<{
680
+ columns: Ref< {
681
+ name: string;
682
+ align?: CanvasTextAlign | undefined;
683
+ edit?: boolean | undefined;
684
+ label?: string | undefined;
685
+ type?: string | undefined;
686
+ width?: string | undefined;
687
+ pinned?: boolean | undefined;
688
+ resizable?: boolean | undefined;
689
+ cellComponent?: string | undefined;
690
+ cellComponentProps?: Record<string, any> | undefined;
691
+ modalComponent?: string | ((context: CellContext) => string) | undefined;
692
+ modalComponentExtraProps?: Record<string, any> | undefined;
693
+ format?: string | ((value: any, context: CellContext) => string) | undefined;
694
+ mask?: ((value: any) => any) | undefined;
695
+ isGantt?: boolean | undefined;
696
+ ganttComponent?: string | undefined;
697
+ colspan?: number | undefined;
698
+ originalIndex?: number | undefined;
699
+ }[], TableColumn[] | {
700
+ name: string;
701
+ align?: CanvasTextAlign | undefined;
702
+ edit?: boolean | undefined;
703
+ label?: string | undefined;
704
+ type?: string | undefined;
705
+ width?: string | undefined;
706
+ pinned?: boolean | undefined;
707
+ resizable?: boolean | undefined;
708
+ cellComponent?: string | undefined;
709
+ cellComponentProps?: Record<string, any> | undefined;
710
+ modalComponent?: string | ((context: CellContext) => string) | undefined;
711
+ modalComponentExtraProps?: Record<string, any> | undefined;
712
+ format?: string | ((value: any, context: CellContext) => string) | undefined;
713
+ mask?: ((value: any) => any) | undefined;
714
+ isGantt?: boolean | undefined;
715
+ ganttComponent?: string | undefined;
716
+ colspan?: number | undefined;
717
+ originalIndex?: number | undefined;
718
+ }[]>;
719
+ config: Ref< {
720
+ view?: "uncounted" | "list" | "list-expansion" | "tree" | "gantt" | "tree-gantt" | undefined;
721
+ fullWidth?: boolean | undefined;
722
+ dependencyGraph?: boolean | undefined;
723
+ }, TableConfig | {
724
+ view?: "uncounted" | "list" | "list-expansion" | "tree" | "gantt" | "tree-gantt" | undefined;
725
+ fullWidth?: boolean | undefined;
726
+ dependencyGraph?: boolean | undefined;
727
+ }>;
728
+ connectionHandles: Ref< {
729
+ id: string;
730
+ rowIndex: number;
731
+ colIndex: number;
732
+ side: "left" | "right";
733
+ position: {
734
+ x: number;
735
+ y: number;
736
+ };
737
+ visible: boolean;
738
+ barId: string;
739
+ }[], ConnectionHandle[] | {
740
+ id: string;
741
+ rowIndex: number;
742
+ colIndex: number;
743
+ side: "left" | "right";
744
+ position: {
745
+ x: number;
746
+ y: number;
747
+ };
748
+ visible: boolean;
749
+ barId: string;
750
+ }[]>;
751
+ connectionPaths: Ref< {
752
+ id: string;
753
+ from: {
754
+ barId: string;
755
+ side: "left" | "right";
756
+ };
757
+ to: {
758
+ barId: string;
759
+ side: "left" | "right";
760
+ };
761
+ style?: {
762
+ color?: string | undefined;
763
+ width?: number | undefined;
764
+ } | undefined;
765
+ label?: string | undefined;
766
+ }[], ConnectionPath[] | {
767
+ id: string;
768
+ from: {
769
+ barId: string;
770
+ side: "left" | "right";
771
+ };
772
+ to: {
773
+ barId: string;
774
+ side: "left" | "right";
775
+ };
776
+ style?: {
777
+ color?: string | undefined;
778
+ width?: number | undefined;
779
+ } | undefined;
780
+ label?: string | undefined;
781
+ }[]>;
782
+ display: WritableComputedRef<TableDisplay[], TableDisplay[]>;
783
+ ganttBars: Ref< {
784
+ id: string;
785
+ rowIndex: number;
786
+ colIndex: number;
787
+ startIndex: number;
788
+ endIndex: number;
789
+ color: string;
790
+ position: {
791
+ x: number;
792
+ y: number;
793
+ };
794
+ label?: string | undefined;
795
+ }[], GanttBarInfo[] | {
796
+ id: string;
797
+ rowIndex: number;
798
+ colIndex: number;
799
+ startIndex: number;
800
+ endIndex: number;
801
+ color: string;
802
+ position: {
803
+ x: number;
804
+ y: number;
805
+ };
806
+ label?: string | undefined;
807
+ }[]>;
808
+ modal: Ref< {
809
+ visible?: boolean | undefined;
810
+ cell?: (HTMLTableCellElement | null) | undefined;
811
+ parent?: HTMLElement | undefined;
812
+ colIndex?: number | undefined;
813
+ rowIndex?: number | undefined;
814
+ component?: string | undefined;
815
+ componentProps?: Record<string, any> | undefined;
816
+ bottom?: number | undefined;
817
+ height?: number | undefined;
818
+ left?: number | undefined;
819
+ width?: number | undefined;
820
+ }, TableModal | {
821
+ visible?: boolean | undefined;
822
+ cell?: (HTMLTableCellElement | null) | undefined;
823
+ parent?: HTMLElement | undefined;
824
+ colIndex?: number | undefined;
825
+ rowIndex?: number | undefined;
826
+ component?: string | undefined;
827
+ componentProps?: Record<string, any> | undefined;
828
+ bottom?: number | undefined;
829
+ height?: number | undefined;
830
+ left?: number | undefined;
831
+ width?: number | undefined;
832
+ }>;
833
+ rows: Ref< {
834
+ [x: string]: any;
835
+ indent?: number | undefined;
836
+ parent?: number | undefined;
837
+ gantt?: {
838
+ color?: string | undefined;
839
+ startIndex?: number | undefined;
840
+ endIndex?: number | undefined;
841
+ colspan?: number | undefined;
842
+ } | undefined;
843
+ }[], TableRow[] | {
844
+ [x: string]: any;
845
+ indent?: number | undefined;
846
+ parent?: number | undefined;
847
+ gantt?: {
848
+ color?: string | undefined;
849
+ startIndex?: number | undefined;
850
+ endIndex?: number | undefined;
851
+ colspan?: number | undefined;
852
+ } | undefined;
853
+ }[]>;
854
+ table: ComputedRef< {}>;
855
+ updates: Ref<Record<string, string>, Record<string, string>>;
856
+ hasPinnedColumns: ComputedRef<boolean>;
857
+ isGanttView: ComputedRef<boolean>;
858
+ isTreeView: ComputedRef<boolean>;
859
+ isDependencyGraphEnabled: ComputedRef<boolean>;
860
+ numberedRowWidth: ComputedRef<string>;
861
+ zeroColumn: ComputedRef<boolean>;
862
+ closeModal: (event: MouseEvent) => void;
863
+ createConnection: (fromHandleId: string, toHandleId: string, options?: {
864
+ style?: ConnectionPath["style"];
865
+ label?: string;
866
+ }) => ConnectionPath | null;
867
+ deleteConnection: (connectionId: string) => boolean;
868
+ getCellData: <T = any>(colIndex: number, rowIndex: number) => T;
869
+ getCellDisplayValue: (colIndex: number, rowIndex: number) => any;
870
+ getConnectionsForBar: (barId: string) => {
871
+ id: string;
872
+ from: {
873
+ barId: string;
874
+ side: "left" | "right";
875
+ };
876
+ to: {
877
+ barId: string;
878
+ side: "left" | "right";
879
+ };
880
+ style?: {
881
+ color?: string | undefined;
882
+ width?: number | undefined;
883
+ } | undefined;
884
+ label?: string | undefined;
885
+ }[];
886
+ getFormattedValue: (colIndex: number, rowIndex: number, value: any) => any;
887
+ getHandlesForBar: (barId: string) => {
888
+ id: string;
889
+ rowIndex: number;
890
+ colIndex: number;
891
+ side: "left" | "right";
892
+ position: {
893
+ x: number;
894
+ y: number;
895
+ };
896
+ visible: boolean;
897
+ barId: string;
898
+ }[];
899
+ getHeaderCellStyle: (column: TableColumn) => CSSProperties;
900
+ getIndent: (colIndex: number, indentLevel?: number) => string;
901
+ getRowExpandSymbol: (rowIndex: number) => "" | "▼" | "►";
902
+ isRowGantt: (rowIndex: number) => boolean;
903
+ isRowVisible: (rowIndex: number) => boolean | undefined;
904
+ registerConnectionHandle: (handleInfo: ConnectionHandle) => void;
905
+ registerGanttBar: (barInfo: GanttBarInfo) => void;
906
+ resizeColumn: (colIndex: number, newWidth: number) => void;
907
+ setCellData: (colIndex: number, rowIndex: number, value: any) => void;
908
+ setCellText: (colIndex: number, rowIndex: number, value: string) => void;
909
+ toggleRowExpand: (rowIndex: number) => void;
910
+ unregisterConnectionHandle: (handleId: string) => void;
911
+ unregisterGanttBar: (barId: string) => void;
912
+ updateGanttBar: (event: GanttDragEvent) => void;
913
+ updateRows: (newRows: TableRow[]) => void;
914
+ }, "closeModal" | "createConnection" | "deleteConnection" | "getCellData" | "getCellDisplayValue" | "getConnectionsForBar" | "getFormattedValue" | "getHandlesForBar" | "getHeaderCellStyle" | "getIndent" | "getRowExpandSymbol" | "isRowGantt" | "isRowVisible" | "registerConnectionHandle" | "registerGanttBar" | "resizeColumn" | "setCellData" | "setCellText" | "toggleRowExpand" | "unregisterConnectionHandle" | "unregisterGanttBar" | "updateGanttBar" | "updateRows">>;
915
+
143
916
  /**
144
917
  * Doctype Meta class
145
918
  * @public
@@ -793,6 +1566,160 @@ export declare interface TableConfig {
793
1566
  dependencyGraph?: boolean;
794
1567
  }
795
1568
 
1569
+ /**
1570
+ * Table display definition.
1571
+ * @public
1572
+ */
1573
+ export declare interface TableDisplay {
1574
+ /**
1575
+ * Indicates whether a row node is expanded or collapsed.
1576
+ *
1577
+ * Only applicable for list-expansion views.
1578
+ *
1579
+ * @defaultValue false
1580
+ */
1581
+ expanded?: boolean;
1582
+ /**
1583
+ * Indicates whether a row node's child nodes are open or closed.
1584
+ *
1585
+ * Only applicable for tree views.
1586
+ *
1587
+ * @defaultValue false
1588
+ */
1589
+ childrenOpen?: boolean;
1590
+ /**
1591
+ * Indicates whether a row node is a parent node. This is evaluated automatically
1592
+ * while rendering the table.
1593
+ *
1594
+ * Only applicable for tree views.
1595
+ */
1596
+ isParent?: boolean;
1597
+ /**
1598
+ * Indicates whether a row node is a root node. This is evaluated automatically
1599
+ * while rendering the table.
1600
+ *
1601
+ * Only applicable for tree views.
1602
+ */
1603
+ isRoot?: boolean;
1604
+ /**
1605
+ * Indicates whether a row node is visible. This is evaluated automatically
1606
+ * while rendering the table.
1607
+ *
1608
+ * Only applicable for tree views.
1609
+ */
1610
+ open?: boolean;
1611
+ /**
1612
+ * The indentation level of the row node.
1613
+ *
1614
+ * Only applicable for tree and gantt views.
1615
+ *
1616
+ * @defaultValue 0
1617
+ */
1618
+ indent?: number;
1619
+ /**
1620
+ * The HTML parent element for the row node. This is evaluated automatically while rendering
1621
+ * the table.
1622
+ *
1623
+ * Only applicable for tree and gantt views.
1624
+ */
1625
+ parent?: number;
1626
+ /**
1627
+ * Indicates whether a row node has been modified. This is evaluated automatically when a cell
1628
+ * is edited.
1629
+ *
1630
+ * @defaultValue false
1631
+ */
1632
+ rowModified?: boolean;
1633
+ }
1634
+
1635
+ /**
1636
+ * Table modal definition.
1637
+ * @public
1638
+ */
1639
+ export declare interface TableModal {
1640
+ /**
1641
+ * Indicates whether the table modal is currently visible.
1642
+ *
1643
+ * @defaultValue false
1644
+ */
1645
+ visible?: boolean;
1646
+ /**
1647
+ * The HTML cell element that the modal is currently being displayed for. The field is unset
1648
+ * when the modal is not being displayed.
1649
+ */
1650
+ cell?: HTMLTableCellElement | null;
1651
+ /**
1652
+ * The HTML parent element that the modal is currently being displayed for. The field is unset
1653
+ * when the modal is not being displayed.
1654
+ */
1655
+ parent?: HTMLElement;
1656
+ /**
1657
+ * The index of the column that the modal is currently being displayed for. The field is
1658
+ * unset when the modal is not being displayed.
1659
+ */
1660
+ colIndex?: number;
1661
+ /**
1662
+ * The index of the row that the modal is currently being displayed for. The field is
1663
+ * unset when the modal is not being displayed.
1664
+ */
1665
+ rowIndex?: number;
1666
+ /**
1667
+ * The component to use to render the modal. If not provided, the table will
1668
+ * try to use the column's `modalComponent` property, if set. If that is not set,
1669
+ * the table will not display a modal.
1670
+ *
1671
+ * @see {@link TableColumn.modalComponent}
1672
+ */
1673
+ component?: string;
1674
+ /**
1675
+ * Additional properties to pass to the table's modal component.
1676
+ */
1677
+ componentProps?: Record<string, any>;
1678
+ /**
1679
+ * Reactive bottom value for the modal's bounding box. The field is unset when the modal
1680
+ * is not being displayed.
1681
+ */
1682
+ bottom?: ReturnType<typeof useElementBounding>['bottom'];
1683
+ /**
1684
+ * Reactive height value for the modal's bounding box. The field is unset when the modal
1685
+ * is not being displayed.
1686
+ */
1687
+ height?: ReturnType<typeof useElementBounding>['height'];
1688
+ /**
1689
+ * Reactive left value for the modal's bounding box. The field is unset when the modal
1690
+ * is not being displayed.
1691
+ */
1692
+ left?: ReturnType<typeof useElementBounding>['left'];
1693
+ /**
1694
+ * Reactive width value for the modal's bounding box. The field is unset when the modal
1695
+ * is not being displayed.
1696
+ */
1697
+ width?: ReturnType<typeof useElementBounding>['width'];
1698
+ }
1699
+
1700
+ /**
1701
+ * Table modal component props definition.
1702
+ * @public
1703
+ */
1704
+ export declare interface TableModalProps {
1705
+ /**
1706
+ * Additional arbitrary properties that can be passed to the modal component.
1707
+ */
1708
+ [key: string]: any;
1709
+ /**
1710
+ * The index of the column that the modal is currently being displayed for.
1711
+ */
1712
+ colIndex: number;
1713
+ /**
1714
+ * The index of the row that the modal is currently being displayed for.
1715
+ */
1716
+ rowIndex: number;
1717
+ /**
1718
+ * The store for managing the current table's state.
1719
+ */
1720
+ store: ReturnType<typeof createTableStore>;
1721
+ }
1722
+
796
1723
  /**
797
1724
  * Table row definition.
798
1725
  * @public
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stonecrop/stonecrop",
3
- "version": "0.4.31",
3
+ "version": "0.4.32",
4
4
  "description": "schema helper",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,6 +23,10 @@
23
23
  "default": "./dist/stonecrop.js"
24
24
  },
25
25
  "require": "./dist/stonecrop.umd.cjs"
26
+ },
27
+ "./types": {
28
+ "import": "./dist/src/types/index.d.ts",
29
+ "require": "./dist/src/types/index.d.ts"
26
30
  }
27
31
  },
28
32
  "typings": "./dist/src/index.d.ts",
@@ -54,8 +58,8 @@
54
58
  "typescript": "^5.8.3",
55
59
  "vite": "^7.0.6",
56
60
  "vitest": "^3.2.4",
57
- "@stonecrop/aform": "0.4.31",
58
- "@stonecrop/atable": "0.4.31",
61
+ "@stonecrop/aform": "0.4.32",
62
+ "@stonecrop/atable": "0.4.32",
59
63
  "stonecrop-rig": "0.2.22"
60
64
  },
61
65
  "publishConfig": {
package/src/index.ts CHANGED
@@ -1,22 +1,11 @@
1
- export type { BaseSchema, FieldsetSchema, FormSchema, SchemaTypes, TableSchema } from '@stonecrop/aform'
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'
1
+ export type * from '@stonecrop/aform/types'
2
+ export type * from '@stonecrop/atable/types'
14
3
 
15
4
  import { type StonecropReturn, useStonecrop } from './composable'
16
5
  import DoctypeMeta from './doctype'
17
6
  import Registry from './registry'
18
7
  import Stonecrop from './plugins'
19
8
  import { Stonecrop as StonecropClass } from './stonecrop'
20
- export type { ImmutableDoctype, MutableDoctype, Schema, InstallOptions } from './types'
9
+ export type * from './types'
21
10
 
22
11
  export { DoctypeMeta, Registry, Stonecrop, StonecropClass, StonecropReturn, useStonecrop }