Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dataforsyningen/designsystem

Package Overview
Dependencies
Maintainers
2
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dataforsyningen/designsystem - npm Package Compare versions

Comparing version 7.7.1 to 7.7.2

22

assets/designsystem.js

@@ -655,2 +655,3 @@ // src/js/toast.js

hiddenNavElements;
debounceTimer;
constructor() {

@@ -743,5 +744,5 @@ super();

this.render();
this.updateMenu();
window.addEventListener("resize", this.updateMenu.bind(this));
window.addEventListener("click", this.toggleMenu.bind(this));
this.updateMenu();
}

@@ -773,16 +774,15 @@ disconnectedCallback() {

updateMenu() {
if (this.debounceTimer) {
clearTimeout(this.debounceTimer);
}
this.debounceTimer = setTimeout(this.setClassBySize.bind(this), 100);
}
setClassBySize() {
const container = this.shadowRoot.querySelector(".menu-container");
const items = this.shadowRoot.querySelector(".menu-items");
const menuWidth = container.scrollWidth;
const containerWidth = this.offsetWidth;
console.log("widths");
console.log(this.offsetWidth, this.scrollWidth);
console.log(container.offsetWidth, container.scrollWidth);
console.log(items.offsetWidth, items.scrollWidth);
if (menuWidth > containerWidth) {
this.classList.remove("compact");
container.classList.remove("compact");
if (items.scrollWidth > items.clientWidth) {
this.classList.add("compact");
container.classList.add("compact");
} else {
this.classList.remove("compact");
container.classList.remove("compact");
}

@@ -789,0 +789,0 @@ }

{
"name": "@dataforsyningen/designsystem",
"version": "7.7.1",
"version": "7.7.2",
"description": "Common design system for Klimadatastyrelsen with CSS, icons, UI components, and logo images.",

@@ -5,0 +5,0 @@ "type": "module",

@@ -8,2 +8,3 @@ import { DSTogglePanel } from './togglePanel.js'

hiddenNavElements
debounceTimer

@@ -109,5 +110,6 @@ constructor() {

this.render()
this.updateMenu()
window.addEventListener('resize', this.updateMenu.bind(this))
window.addEventListener('click', this.toggleMenu.bind(this))
this.updateMenu();
}

@@ -144,23 +146,21 @@

updateMenu() {
if (this.debounceTimer) {
clearTimeout(this.debounceTimer)
}
this.debounceTimer = setTimeout(this.setClassBySize.bind(this), 100)
}
setClassBySize() {
const container = this.shadowRoot.querySelector('.menu-container')
const items = this.shadowRoot.querySelector('.menu-items')
this.classList.remove('compact')
container.classList.remove('compact')
const menuWidth = container.scrollWidth
const containerWidth = this.offsetWidth
// offsetWidth, clientWidth, scrollWidth
console.log('widths')
console.log(this.offsetWidth, this.scrollWidth)
console.log(container.offsetWidth, container.scrollWidth)
console.log(items.offsetWidth, items.scrollWidth)
if (menuWidth > containerWidth) {
if (items.scrollWidth > items.clientWidth) {
this.classList.add('compact')
container.classList.add('compact')
} else {
this.classList.remove('compact')
container.classList.remove('compact')
}
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc