lexgui 0.5.9 → 0.5.10

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.
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  var LX = {
9
- version: "0.5.9",
9
+ version: "0.5.10",
10
10
  ready: false,
11
11
  components: [], // Specific pre-build components
12
12
  signals: {}, // Events and triggers
@@ -1239,7 +1239,7 @@ function _createCommandbar( root )
1239
1239
  if( LX.has('CodeEditor') )
1240
1240
  {
1241
1241
  const instances = LX.CodeEditor.getInstances();
1242
- if( !instances.length ) return;
1242
+ if( !instances.length || !instances[ 0 ].area.root.offsetHeight ) return;
1243
1243
 
1244
1244
  const languages = instances[ 0 ].languages;
1245
1245
 
@@ -4997,14 +4997,14 @@ class SideBar {
4997
4997
  this.root.appendChild( this.footer );
4998
4998
  }
4999
4999
 
5000
- // Set width depending on header/footer
5001
- doAsync( () => {
5002
- // This account for header, footer and all inner margins
5003
- const contentOffset = ( parseInt( this.header?.getComputedSize().height ) ?? 0 ) +
5004
- ( parseInt( this.filter?.getComputedSize().height ) ?? 0 ) +
5005
- ( parseInt( this.footer?.getComputedSize().height ) ?? 0 );
5000
+ const resizeObserver = new ResizeObserver( entries => {
5001
+ const contentOffset = ( this.header?.offsetHeight ?? 0 ) +
5002
+ ( this.filter?.offsetHeight ?? 0 ) +
5003
+ ( this.footer?.offsetHeight ?? 0 );
5006
5004
  this.content.style.height = `calc(100% - ${ contentOffset }px)`;
5007
- }, 10 );
5005
+ } );
5006
+
5007
+ resizeObserver.observe( this.root );
5008
5008
 
5009
5009
  this.items = [ ];
5010
5010
  this.icons = { };
@@ -10544,9 +10544,7 @@ class DatePicker extends Widget {
10544
10544
  container.innerHTML = "";
10545
10545
  const calendarIcon = LX.makeIcon( "calendar" );
10546
10546
  const calendarButton = new Button( null, currentDate ?? "Pick a date", () => {
10547
- this._popover = new Popover( calendarButton.root, ( popoverRoot ) => {
10548
- popoverRoot.appendChild( this.calendar.root );
10549
- } );
10547
+ this._popover = new Popover( calendarButton.root, [ this.calendar ] );
10550
10548
  }, { buttonClass: `flex flex-row px-3 ${ currentDate ? "" : "fg-tertiary" } justify-between` } );
10551
10549
 
10552
10550
  calendarButton.root.querySelector( "button" ).appendChild( calendarIcon );
@@ -12050,7 +12048,6 @@ class Footer {
12050
12048
  parent.appendChild( root );
12051
12049
 
12052
12050
  // Set always at bottom
12053
- root.previousElementSibling.style.height = "unset";
12054
12051
  root.previousElementSibling.style.flexGrow = "1";
12055
12052
 
12056
12053
  this.root = root;
@@ -13446,8 +13443,8 @@ class AssetView {
13446
13443
  div.className = 'lexassetbrowser';
13447
13444
  this.root = div;
13448
13445
 
13449
- let area = new LX.Area({height: "100%"});
13450
- div.appendChild(area.root);
13446
+ let area = new LX.Area( { width: "100%", height: "100%" } );
13447
+ div.appendChild( area.root );
13451
13448
 
13452
13449
  let left, right, contentArea = area;
13453
13450
 
@@ -13460,6 +13457,9 @@ class AssetView {
13460
13457
  this.contextMenu = options.contextMenu ?? [];
13461
13458
  this.onRefreshContent = options.onRefreshContent;
13462
13459
 
13460
+ // Append temporarily to the dom
13461
+ document.body.appendChild( this.root );
13462
+
13463
13463
  if( !this.skipBrowser )
13464
13464
  {
13465
13465
  [left, right] = area.split({ type: "horizontal", sizes: ["15%", "85%"]});
@@ -13497,6 +13497,9 @@ class AssetView {
13497
13497
  {
13498
13498
  this.previewPanel = right.addPanel( {className: 'lexassetcontentpanel', style: { overflow: 'scroll' }} );
13499
13499
  }
13500
+
13501
+ // Clean up
13502
+ document.body.removeChild( this.root );
13500
13503
  }
13501
13504
 
13502
13505
  /**