@stonecrop/stonecrop 0.4.33 → 0.4.35

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 (2) hide show
  1. package/dist/stonecrop.d.ts +169 -32
  2. package/package.json +4 -4
@@ -41,6 +41,30 @@ export declare type BaseSchema = {
41
41
  value?: any;
42
42
  };
43
43
 
44
+ /**
45
+ * Base table configuration properties shared across all view types.
46
+ * @public
47
+ */
48
+ export declare interface BaseTableConfig {
49
+ /**
50
+ * Control whether the table should be allowed to use the full width of its container.
51
+ *
52
+ * @defaultValue false
53
+ */
54
+ fullWidth?: boolean;
55
+ }
56
+
57
+ /**
58
+ * Table configuration for basic view types (uncounted, list, list-expansion).
59
+ * @public
60
+ */
61
+ export declare interface BasicTableConfig extends BaseTableConfig {
62
+ /**
63
+ * The type of view to display the table in.
64
+ */
65
+ view?: 'uncounted' | 'list' | 'list-expansion';
66
+ }
67
+
44
68
  /**
45
69
  * Table cell context definition.
46
70
  * @public
@@ -247,13 +271,37 @@ colspan?: number | undefined;
247
271
  originalIndex?: number | undefined;
248
272
  }[]>;
249
273
  config: Ref< {
250
- view?: "uncounted" | "list" | "list-expansion" | "tree" | "gantt" | "tree-gantt" | undefined;
274
+ view?: "uncounted" | "list" | "list-expansion" | undefined;
275
+ fullWidth?: boolean | undefined;
276
+ } | {
277
+ view: "tree";
278
+ defaultTreeExpansion?: "root" | "branch" | "leaf" | undefined;
251
279
  fullWidth?: boolean | undefined;
280
+ } | {
281
+ view: "gantt";
252
282
  dependencyGraph?: boolean | undefined;
283
+ fullWidth?: boolean | undefined;
284
+ } | {
285
+ view: "tree-gantt";
286
+ defaultTreeExpansion?: "root" | "branch" | "leaf" | undefined;
287
+ dependencyGraph?: boolean | undefined;
288
+ fullWidth?: boolean | undefined;
253
289
  }, TableConfig | {
254
- view?: "uncounted" | "list" | "list-expansion" | "tree" | "gantt" | "tree-gantt" | undefined;
290
+ view?: "uncounted" | "list" | "list-expansion" | undefined;
291
+ fullWidth?: boolean | undefined;
292
+ } | {
293
+ view: "tree";
294
+ defaultTreeExpansion?: "root" | "branch" | "leaf" | undefined;
255
295
  fullWidth?: boolean | undefined;
296
+ } | {
297
+ view: "gantt";
256
298
  dependencyGraph?: boolean | undefined;
299
+ fullWidth?: boolean | undefined;
300
+ } | {
301
+ view: "tree-gantt";
302
+ defaultTreeExpansion?: "root" | "branch" | "leaf" | undefined;
303
+ dependencyGraph?: boolean | undefined;
304
+ fullWidth?: boolean | undefined;
257
305
  }>;
258
306
  connectionHandles: Ref< {
259
307
  id: string;
@@ -482,13 +530,37 @@ colspan?: number | undefined;
482
530
  originalIndex?: number | undefined;
483
531
  }[]>;
484
532
  config: Ref< {
485
- view?: "uncounted" | "list" | "list-expansion" | "tree" | "gantt" | "tree-gantt" | undefined;
533
+ view?: "uncounted" | "list" | "list-expansion" | undefined;
534
+ fullWidth?: boolean | undefined;
535
+ } | {
536
+ view: "tree";
537
+ defaultTreeExpansion?: "root" | "branch" | "leaf" | undefined;
486
538
  fullWidth?: boolean | undefined;
539
+ } | {
540
+ view: "gantt";
541
+ dependencyGraph?: boolean | undefined;
542
+ fullWidth?: boolean | undefined;
543
+ } | {
544
+ view: "tree-gantt";
545
+ defaultTreeExpansion?: "root" | "branch" | "leaf" | undefined;
487
546
  dependencyGraph?: boolean | undefined;
547
+ fullWidth?: boolean | undefined;
488
548
  }, TableConfig | {
489
- view?: "uncounted" | "list" | "list-expansion" | "tree" | "gantt" | "tree-gantt" | undefined;
549
+ view?: "uncounted" | "list" | "list-expansion" | undefined;
550
+ fullWidth?: boolean | undefined;
551
+ } | {
552
+ view: "tree";
553
+ defaultTreeExpansion?: "root" | "branch" | "leaf" | undefined;
490
554
  fullWidth?: boolean | undefined;
555
+ } | {
556
+ view: "gantt";
557
+ dependencyGraph?: boolean | undefined;
558
+ fullWidth?: boolean | undefined;
559
+ } | {
560
+ view: "tree-gantt";
561
+ defaultTreeExpansion?: "root" | "branch" | "leaf" | undefined;
491
562
  dependencyGraph?: boolean | undefined;
563
+ fullWidth?: boolean | undefined;
492
564
  }>;
493
565
  connectionHandles: Ref< {
494
566
  id: string;
@@ -717,13 +789,37 @@ colspan?: number | undefined;
717
789
  originalIndex?: number | undefined;
718
790
  }[]>;
719
791
  config: Ref< {
720
- view?: "uncounted" | "list" | "list-expansion" | "tree" | "gantt" | "tree-gantt" | undefined;
792
+ view?: "uncounted" | "list" | "list-expansion" | undefined;
793
+ fullWidth?: boolean | undefined;
794
+ } | {
795
+ view: "tree";
796
+ defaultTreeExpansion?: "root" | "branch" | "leaf" | undefined;
721
797
  fullWidth?: boolean | undefined;
798
+ } | {
799
+ view: "gantt";
800
+ dependencyGraph?: boolean | undefined;
801
+ fullWidth?: boolean | undefined;
802
+ } | {
803
+ view: "tree-gantt";
804
+ defaultTreeExpansion?: "root" | "branch" | "leaf" | undefined;
722
805
  dependencyGraph?: boolean | undefined;
806
+ fullWidth?: boolean | undefined;
723
807
  }, TableConfig | {
724
- view?: "uncounted" | "list" | "list-expansion" | "tree" | "gantt" | "tree-gantt" | undefined;
808
+ view?: "uncounted" | "list" | "list-expansion" | undefined;
809
+ fullWidth?: boolean | undefined;
810
+ } | {
811
+ view: "tree";
812
+ defaultTreeExpansion?: "root" | "branch" | "leaf" | undefined;
725
813
  fullWidth?: boolean | undefined;
814
+ } | {
815
+ view: "gantt";
816
+ dependencyGraph?: boolean | undefined;
817
+ fullWidth?: boolean | undefined;
818
+ } | {
819
+ view: "tree-gantt";
820
+ defaultTreeExpansion?: "root" | "branch" | "leaf" | undefined;
726
821
  dependencyGraph?: boolean | undefined;
822
+ fullWidth?: boolean | undefined;
727
823
  }>;
728
824
  connectionHandles: Ref< {
729
825
  id: string;
@@ -1147,6 +1243,24 @@ export declare interface GanttOptions {
1147
1243
  colspan?: number;
1148
1244
  }
1149
1245
 
1246
+ /**
1247
+ * Table configuration for gantt view types.
1248
+ * @public
1249
+ */
1250
+ export declare interface GanttTableConfig extends BaseTableConfig {
1251
+ /**
1252
+ * The type of view to display the table in.
1253
+ */
1254
+ view: 'gantt';
1255
+ /**
1256
+ * Control whether dependency graph connections should be enabled for Gantt views.
1257
+ * When false, connection handles and dependency lines will be hidden.
1258
+ *
1259
+ * @defaultValue true
1260
+ */
1261
+ dependencyGraph?: boolean;
1262
+ }
1263
+
1150
1264
  /**
1151
1265
  * Immutable Doctype type for Stonecrop instances
1152
1266
  * @public
@@ -1537,34 +1651,10 @@ export declare interface TableColumn {
1537
1651
  }
1538
1652
 
1539
1653
  /**
1540
- * Table configuration definition.
1654
+ * Table configuration definition using discriminated unions for type safety.
1541
1655
  * @public
1542
1656
  */
1543
- export declare interface TableConfig {
1544
- /**
1545
- * The type of view to display the table in. Possible values:
1546
- * - `uncounted` - row numbers are not displayed in the table
1547
- * - `list` - row numbers are displayed in the table
1548
- * - `list-expansion` - carets are displayed in the number column that expand/collapse the row inline
1549
- * - `tree` - carets are displayed in the number column that expand/collapse grouped rows
1550
- * - `gantt` - view that allows specific rows to be displayed with Gantt functionality
1551
- * - `tree-gantt` - similar to `gantt`, but allows for tree functionality as well
1552
- */
1553
- view?: 'uncounted' | 'list' | 'list-expansion' | 'tree' | 'gantt' | 'tree-gantt';
1554
- /**
1555
- * Control whether the table should be allowed to use the full width of its container.
1556
- *
1557
- * @defaultValue false
1558
- */
1559
- fullWidth?: boolean;
1560
- /**
1561
- * Control whether dependency graph connections should be enabled for Gantt views.
1562
- * When false, connection handles and dependency lines will be hidden.
1563
- *
1564
- * @defaultValue true
1565
- */
1566
- dependencyGraph?: boolean;
1567
- }
1657
+ export declare type TableConfig = BasicTableConfig | TreeTableConfig | GanttTableConfig | TreeGanttTableConfig;
1568
1658
 
1569
1659
  /**
1570
1660
  * Table display definition.
@@ -1772,6 +1862,53 @@ export declare type TableSchema = BaseSchema & {
1772
1862
  rows?: TableRow[];
1773
1863
  };
1774
1864
 
1865
+ /**
1866
+ * Table configuration for tree-gantt view types.
1867
+ * @public
1868
+ */
1869
+ export declare interface TreeGanttTableConfig extends BaseTableConfig {
1870
+ /**
1871
+ * The type of view to display the table in.
1872
+ */
1873
+ view: 'tree-gantt';
1874
+ /**
1875
+ * Default expansion state for tree views. Possible values:
1876
+ * - `root` - Only top-level nodes are visible (fully collapsed)
1877
+ * - `branch` - Shows minimal tree to display all gantt nodes. Expands only the necessary paths to gantt nodes, stops at gantt nodes with no gantt descendants
1878
+ * - `leaf` - All nodes are visible (fully expanded)
1879
+ *
1880
+ * @defaultValue undefined (default behavior is 'leaf' mode)
1881
+ */
1882
+ defaultTreeExpansion?: 'root' | 'branch' | 'leaf';
1883
+ /**
1884
+ * Control whether dependency graph connections should be enabled for Gantt views.
1885
+ * When false, connection handles and dependency lines will be hidden.
1886
+ *
1887
+ * @defaultValue true
1888
+ */
1889
+ dependencyGraph?: boolean;
1890
+ }
1891
+
1892
+ /**
1893
+ * Table configuration for tree view types.
1894
+ * @public
1895
+ */
1896
+ export declare interface TreeTableConfig extends BaseTableConfig {
1897
+ /**
1898
+ * The type of view to display the table in.
1899
+ */
1900
+ view: 'tree';
1901
+ /**
1902
+ * Default expansion state for tree views. Possible values:
1903
+ * - `root` - Only top-level nodes are visible (fully collapsed)
1904
+ * - `branch` - Shows minimal tree to display all gantt nodes. Expands only the necessary paths to gantt nodes, stops at gantt nodes with no gantt descendants
1905
+ * - `leaf` - All nodes are visible (fully expanded)
1906
+ *
1907
+ * @defaultValue undefined (default behavior is 'leaf' mode)
1908
+ */
1909
+ defaultTreeExpansion?: 'root' | 'branch' | 'leaf';
1910
+ }
1911
+
1775
1912
  declare const useDataStore: StoreDefinition<"data", Pick<{
1776
1913
  records: Ref<Record<string, any>[], Record<string, any>[]>;
1777
1914
  record: Ref<Record<string, any>, Record<string, any>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stonecrop/stonecrop",
3
- "version": "0.4.33",
3
+ "version": "0.4.35",
4
4
  "description": "schema helper",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -58,9 +58,9 @@
58
58
  "typescript": "^5.8.3",
59
59
  "vite": "^7.0.6",
60
60
  "vitest": "^3.2.4",
61
- "@stonecrop/aform": "0.4.33",
62
- "@stonecrop/atable": "0.4.33",
63
- "stonecrop-rig": "0.2.22"
61
+ "@stonecrop/aform": "0.4.35",
62
+ "stonecrop-rig": "0.2.22",
63
+ "@stonecrop/atable": "0.4.35"
64
64
  },
65
65
  "publishConfig": {
66
66
  "access": "public"