x4js 2.2.26 → 2.2.27

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/README.md CHANGED
@@ -23,4 +23,5 @@ see [AI](./aicontext.md)
23
23
  [ ] finish StateManager
24
24
  [ ] review core_data
25
25
  [ ] doc doc and doc
26
- [ ] demo with all best practices
26
+ [ ] demo with all best practices
27
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x4js",
3
- "version": "2.2.26",
3
+ "version": "2.2.27",
4
4
  "type": "module",
5
5
  "main": "src/x4.ts",
6
6
  "module": "src/x4.ts",
@@ -18,10 +18,10 @@ import { Select } from "../select/select"
18
18
  import { Button } from "../button/button"
19
19
  import { Component, ComponentProps, EvChange, EvFocus } from "../../core/component"
20
20
  import { HBox, VBox } from "../boxes/boxes"
21
- import { Input, InputProps } from "../input/input"
21
+ import { Input } from "../input/input"
22
22
  import { ListboxID, ListItem } from "../listbox/listbox"
23
23
  import { Label, SimpleText } from "../label/label"
24
- import { class_ns, isFunction } from '../../core/core_tools';
24
+ import { asap, class_ns, isFunction, isNumber } from '../../core/core_tools';
25
25
  import { Icon } from '../components'
26
26
 
27
27
  import "./progrid.module.scss"
@@ -49,8 +49,7 @@ export interface PropertyGroup {
49
49
  desc?: string;
50
50
  icon?: string;
51
51
  cls?: string;
52
- collapsible?: boolean;
53
-
52
+ collapsible?: boolean | number; // -1 for collapsible+collapsed
54
53
  items: PropertyValue[];
55
54
  }
56
55
 
@@ -92,7 +91,7 @@ export class PropertyGrid extends VBox {
92
91
  if( i ) {
93
92
  const row = this.makePropertyRow(i);
94
93
  if( idx&1 ) {
95
- row.addClass( "event" )
94
+ row.addClass( "even" )
96
95
  }
97
96
 
98
97
  items.push( row );
@@ -151,7 +150,10 @@ export class PropertyGrid extends VBox {
151
150
  ]
152
151
  });
153
152
 
154
- tr.setClass("collapsible", g.collapsible );
153
+ tr.setClass("collapsible", !!g.collapsible );
154
+ if( isNumber(g.collapsible) && g.collapsible<0 ) {
155
+ asap( () => toggle( tr ) );
156
+ }
155
157
  return tr;
156
158
  }
157
159