x4js 2.2.25 → 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.25",
3
+ "version": "2.2.27",
4
4
  "type": "module",
5
5
  "main": "src/x4.ts",
6
6
  "module": "src/x4.ts",
@@ -30,8 +30,8 @@ import { Label, SimpleText } from '../label/label';
30
30
 
31
31
  import { _tr } from '../../core/core_i18n';
32
32
 
33
- import check_icon from "../checkbox/check.svg";
34
- import empty_icon from "./folder-open.svg";
33
+ const check_icon = `<svg viewBox="0 0 10 7" fill="none" aria-hidden="true"><path d="M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg>`;
34
+ const empty_icon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path opacity=".4" d="M32 96l0 200.6 21.7-54.3C65.9 211.9 95.3 192 128 192l320 0 0-32c0-17.7-14.3-32-32-32l-117.5 0c-25.5 0-49.9-10.1-67.9-28.1L204.1 73.4c-6-6-14.1-9.4-22.6-9.4L64 64C46.3 64 32 78.3 32 96zM49.1 426.1c-2 4.9-1.4 10.5 1.6 14.9s7.9 7 13.2 7l320 0 80 0c6.5 0 12.4-4 14.9-10.1l64-160c2-4.9 1.4-10.5-1.6-14.9s-7.9-7-13.2-7l-400 0c-6.5 0-12.4 4-14.9 10.1l-64 160z"/><path d="M448 160l0 32 32 0 0-32c0-35.3-28.7-64-64-64L298.5 96c-17 0-33.3-6.7-45.3-18.7L226.7 50.7c-12-12-28.3-18.7-45.3-18.7L64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0 80 0c19.6 0 37.3-11.9 44.6-30.2l64-160c5.9-14.8 4.1-31.5-4.8-44.7S543.9 224 528 224l-400 0c-19.6 0-37.3 11.9-44.6 30.2L32 382.8 32 96c0-17.7 14.3-32 32-32l117.5 0c8.5 0 16.6 3.4 22.6 9.4l22.6-22.6L204.1 73.4l26.5 26.5c18 18 42.4 28.1 67.9 28.1L416 128c17.7 0 32 14.3 32 32zM384 448L64 448c-5.3 0-10.3-2.6-13.2-7s-3.6-10-1.6-14.9l64-160c2.4-6.1 8.3-10.1 14.9-10.1l400 0c5.3 0 10.3 2.6 13.2 7s3.6 10 1.6 14.9l-64 160C476.4 444 470.5 448 464 448l-80 0z"/></svg>`;
35
35
 
36
36
  import "./gridview.module.scss"
37
37
 
@@ -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