kempo-ui 0.3.4 → 0.3.5

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.
@@ -90,6 +90,8 @@ import ShadowComponent from"./ShadowComponent.js";import{html,css,nothing}from".
90
90
  left: var(--spacer_h);
91
91
  }
92
92
  aside {
93
+ display: flex;
94
+ flex-direction: column;
93
95
  position: fixed;
94
96
  top: 0;
95
97
  left: 0;
@@ -90,6 +90,8 @@ import ShadowComponent from"./ShadowComponent.js";import{html,css,nothing}from".
90
90
  left: var(--spacer_h);
91
91
  }
92
92
  aside {
93
+ display: flex;
94
+ flex-direction: column;
93
95
  position: fixed;
94
96
  top: 0;
95
97
  left: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kempo-ui",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "type": "module",
5
5
  "description": "A Lit based web-component library",
6
6
  "main": "index.js",
@@ -198,6 +198,8 @@ export default class Aside extends ShadowComponent {
198
198
  left: var(--spacer_h);
199
199
  }
200
200
  aside {
201
+ display: flex;
202
+ flex-direction: column;
201
203
  position: fixed;
202
204
  top: 0;
203
205
  left: 0;
@@ -756,6 +756,41 @@ export default {
756
756
  pass('AsideSpacer has flex-grow 1');
757
757
  },
758
758
 
759
+ 'AsideSpacer: aside should be a flex column so spacer pushes items down': async ({pass, fail}) => {
760
+ const aside = await createAside({ main: 'push', state: 'expanded' });
761
+ const item1 = document.createElement('k-aside-item');
762
+ item1.icon = 'cards';
763
+ item1.textContent = 'Top';
764
+ const spacer = document.createElement('k-aside-spacer');
765
+ const item2 = document.createElement('k-aside-item');
766
+ item2.icon = 'settings';
767
+ item2.textContent = 'Bottom';
768
+ aside.appendChild(item1);
769
+ aside.appendChild(spacer);
770
+ aside.appendChild(item2);
771
+ await item1.updateComplete;
772
+ await spacer.updateComplete;
773
+ await item2.updateComplete;
774
+ await new Promise(r => requestAnimationFrame(r));
775
+ const asideEl = aside.shadowRoot.querySelector('aside');
776
+ const asideStyle = getComputedStyle(asideEl);
777
+ if(asideStyle.display !== 'flex') {
778
+ cleanup(aside);
779
+ return fail(`Expected aside display flex, got ${asideStyle.display}`);
780
+ }
781
+ if(asideStyle.flexDirection !== 'column') {
782
+ cleanup(aside);
783
+ return fail(`Expected aside flex-direction column, got ${asideStyle.flexDirection}`);
784
+ }
785
+ const spacerRect = spacer.getBoundingClientRect();
786
+ if(spacerRect.height < 1) {
787
+ cleanup(aside);
788
+ return fail(`Spacer should have height > 0 to push items, got ${spacerRect.height}`);
789
+ }
790
+ cleanup(aside);
791
+ pass('Aside is a flex column and spacer pushes items down');
792
+ },
793
+
759
794
  /*
760
795
  Cleanup
761
796
  */