@ecl/mega-menu 5.0.0-alpha.14 → 5.0.0-alpha.16

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.
@@ -134,6 +134,7 @@
134
134
  {% include '@ecl/button/button.html.twig' with _toggle|merge({
135
135
  type: 'button',
136
136
  variant: 'tertiary',
137
+ style: 'neutral',
137
138
  icon_position: 'before',
138
139
  icon: _toggle_icon,
139
140
  hide_label: true,
package/mega-menu.js CHANGED
@@ -136,7 +136,7 @@ export class MegaMenu {
136
136
  this.menuOverlay = null;
137
137
  this.currentItem = null;
138
138
  this.totalItemsWidth = 0;
139
- this.breakpointL = 996;
139
+ this.breakpointL = 1140;
140
140
  this.openPanel = { num: 0, item: {} };
141
141
  this.infoLinks = null;
142
142
  this.seeAllLinks = null;
@@ -610,10 +610,10 @@ export class MegaMenu {
610
610
 
611
611
  if (viewport === 'desktop' && this.header) {
612
612
  if (this.headerBanner) {
613
- this.headerBanner.style.display = 'flex';
613
+ this.headerBanner.style.display = '';
614
614
  }
615
615
  if (this.headerNotification) {
616
- this.headerNotification.style.display = 'flex';
616
+ this.headerNotification.style.display = '';
617
617
  }
618
618
  }
619
619
  }
@@ -639,12 +639,12 @@ export class MegaMenu {
639
639
  screenWidth > this.breakpointL ? 'desktop' : 'mobile',
640
640
  );
641
641
  }
642
- if (this.prevScreenWidth >= 1140 && screenWidth >= 996) {
642
+ if (this.prevScreenWidth >= 1368 && screenWidth >= 1140) {
643
643
  this.resetStyles('desktop', true);
644
644
  }
645
645
  }
646
646
  this.isDesktop = this.useDesktopDisplay();
647
- this.isLarge = window.innerWidth >= 1140;
647
+ this.isLarge = window.innerWidth >= 1368;
648
648
  // Update previous screen width
649
649
  this.prevScreenWidth = screenWidth;
650
650
  this.element.classList.remove('ecl-mega-menu--forced-mobile');
@@ -895,7 +895,6 @@ export class MegaMenu {
895
895
  } else {
896
896
  const subList = queryOne('.ecl-mega-menu__sublist', item);
897
897
  if (subList && this.openPanel.num === 1) {
898
- console.log('dovrei...');
899
898
  const subListRect = subList.getBoundingClientRect();
900
899
  const subListRectTop = subListRect.top;
901
900
  subList.classList.add('ecl-mega-menu__sublist--scrollable');
@@ -1333,10 +1332,10 @@ export class MegaMenu {
1333
1332
  } else {
1334
1333
  if (this.header) {
1335
1334
  if (this.headerBanner) {
1336
- this.headerBanner.style.display = 'flex';
1335
+ this.headerBanner.style.display = '';
1337
1336
  }
1338
1337
  if (this.headerNotification) {
1339
- this.headerNotification.style.display = 'flex';
1338
+ this.headerNotification.style.display = '';
1340
1339
  }
1341
1340
  }
1342
1341
  // Remove expanded class from inner menu
@@ -1361,9 +1360,9 @@ export class MegaMenu {
1361
1360
  if (this.header) {
1362
1361
  this.header.classList.add('ecl-site-header--open-menu-start');
1363
1362
  }
1364
- this.positionMenuOverlay();
1365
1363
  }
1366
1364
 
1365
+ this.positionMenuOverlay();
1367
1366
  this.trigger('onBack', { level: level2 ? 2 : 1 });
1368
1367
  }
1369
1368
 
@@ -1642,10 +1641,10 @@ export class MegaMenu {
1642
1641
  'ecl-site-header--open-menu-start',
1643
1642
  );
1644
1643
  if (this.headerBanner) {
1645
- this.headerBanner.style.display = 'flex';
1644
+ this.headerBanner.style.display = '';
1646
1645
  }
1647
1646
  if (this.headerNotification) {
1648
- this.headerNotification.style.display = 'flex';
1647
+ this.headerNotification.style.display = '';
1649
1648
  }
1650
1649
  }
1651
1650
  this.enableScroll();
package/mega-menu.scss CHANGED
@@ -93,7 +93,7 @@ $mega-menu: null !default;
93
93
  display: flex;
94
94
  flex-direction: column;
95
95
  font: var(--f-xs);
96
- margin-inline-start: var(--s-xs);
96
+ margin-inline-start: map.get($mega-menu, 'mobile', 'open-button-margin');
97
97
  order: 2;
98
98
  padding: map.get($mega-menu, 'mobile', 'open-padding');
99
99
  text-decoration: none;
@@ -112,7 +112,7 @@ $mega-menu: null !default;
112
112
  }
113
113
 
114
114
  &:focus-visible {
115
- outline-offset: -2px;
115
+ outline-offset: map.get($mega-menu, 'mobile', 'open-button-offset');
116
116
  }
117
117
 
118
118
  .ecl-icon:last-of-type {
@@ -151,7 +151,7 @@ $mega-menu: null !default;
151
151
  }
152
152
 
153
153
  /* stylelint-disable-next-line order/order */
154
- @include breakpoints.up('l') {
154
+ @include breakpoints.up('xl') {
155
155
  .ecl-mega-menu:not(.ecl-menu--forced-mobile) {
156
156
  background: map.get($mega-menu, 'desktop', 'menu-background');
157
157
  padding-bottom: 0;
@@ -334,7 +334,7 @@ $mega-menu: null !default;
334
334
  }
335
335
 
336
336
  /* stylelint-disable-next-line order/order */
337
- @include breakpoints.up('l') {
337
+ @include breakpoints.up('xl') {
338
338
  .ecl-mega-menu:not(.ecl-menu--forced-mobile) {
339
339
  .ecl-mega-menu__overlay {
340
340
  background-color: map.get($mega-menu, 'desktop', 'overlay-background');
@@ -345,7 +345,6 @@ $mega-menu: null !default;
345
345
  background-color: transparent;
346
346
  box-shadow: none;
347
347
  display: block;
348
- margin-inline-start: calc(-1 * var(--s-m));
349
348
  overflow-y: visible;
350
349
  position: static;
351
350
  transition: none;
@@ -495,9 +494,14 @@ $mega-menu: null !default;
495
494
  }
496
495
 
497
496
  .ecl-mega-menu__featured-list__item-description {
498
- font: map.get($mega-menu, 'global', 'featured-description-font');
499
497
  margin-inline-start: var(--s-l);
500
498
  }
499
+
500
+ .ecl-mega-menu__featured-list__item-description,
501
+ .ecl-mega-menu__featured-list__item-description p {
502
+ font: map.get($mega-menu, 'global', 'featured-description-font');
503
+ margin-block: 0;
504
+ }
501
505
  }
502
506
 
503
507
  .ecl-mega-menu--rtl .ecl-icon--flip-horizontal {
@@ -572,12 +576,13 @@ $mega-menu: null !default;
572
576
  }
573
577
 
574
578
  /* stylelint-disable-next-line order/order */
575
- @include breakpoints.up('l') {
579
+ @include breakpoints.up('xl') {
576
580
  .ecl-mega-menu:not(.ecl-menu--forced-mobile) {
577
581
  border-top: map.get($mega-menu, 'desktop', 'menu-border');
578
582
 
579
583
  .ecl-mega-menu__inner {
580
584
  border-top: none;
585
+ margin-inline-start: calc(-1 * var(--s-xs));
581
586
  }
582
587
 
583
588
  .ecl-mega-menu__list {
@@ -722,9 +727,9 @@ $mega-menu: null !default;
722
727
  }
723
728
 
724
729
  .ecl-mega-menu:not(
725
- .ecl-mega-menu--forced-mobile,
726
- .ecl-mega-menu--forced-close
727
- ) {
730
+ .ecl-mega-menu--forced-mobile,
731
+ .ecl-mega-menu--forced-close
732
+ ) {
728
733
  .ecl-mega-menu__item {
729
734
  &.ecl-mega-menu__item--expanded > .ecl-button .ecl-icon {
730
735
  transform: rotate(0);
@@ -779,7 +784,7 @@ $mega-menu: null !default;
779
784
  display: none;
780
785
  }
781
786
 
782
- @include breakpoints.down('m') {
787
+ @include breakpoints.down('l') {
783
788
  .ecl-mega-menu--one-panel {
784
789
  .ecl-mega-menu__item--expanded > .ecl-mega-menu__link {
785
790
  font: var(--f-l);
@@ -981,6 +986,10 @@ $mega-menu: null !default;
981
986
  @include with-scrollbar;
982
987
  }
983
988
 
989
+ .ecl-mega-menu__sublist--scrollable {
990
+ @include with-scrollbar;
991
+ }
992
+
984
993
  .ecl-mega-menu__mega--level-2 {
985
994
  margin-top: map.get($mega-menu, 'mobile', 'spacing-top-level-2');
986
995
 
@@ -1100,11 +1109,11 @@ $mega-menu: null !default;
1100
1109
  }
1101
1110
  }
1102
1111
 
1103
- @include breakpoints.up('l') {
1112
+ @include breakpoints.up('xl') {
1104
1113
  .ecl-mega-menu:not(
1105
- .ecl-mega-menu--forced-mobile,
1106
- .ecl-mega-menu--forced-close
1107
- ) {
1114
+ .ecl-mega-menu--forced-mobile,
1115
+ .ecl-mega-menu--forced-close
1116
+ ) {
1108
1117
  .ecl-mega-menu__wrapper {
1109
1118
  padding-top: var(--s-m);
1110
1119
  min-height: 200px !important;
@@ -1510,11 +1519,11 @@ $mega-menu: null !default;
1510
1519
  }
1511
1520
  }
1512
1521
 
1513
- @include breakpoints.up('xl') {
1522
+ @media (width >= 1368px) {
1514
1523
  .ecl-mega-menu:not(
1515
- .ecl-mega-menu--forced-mobile,
1516
- .ecl-mega-menu--forced-close
1517
- ) {
1524
+ .ecl-mega-menu--forced-mobile,
1525
+ .ecl-mega-menu--forced-close
1526
+ ) {
1518
1527
  .ecl-container {
1519
1528
  padding-inline: map.get(
1520
1529
  $mega-menu,
@@ -1523,12 +1532,17 @@ $mega-menu: null !default;
1523
1532
  );
1524
1533
  }
1525
1534
 
1535
+ .ecl-mega-menu__inner {
1536
+ margin-inline-start: calc(-1 * var(--s-m));
1537
+ }
1538
+
1526
1539
  .ecl-mega-menu__item.ecl-mega-menu__item--expanded
1527
1540
  > .ecl-mega-menu__wrapper
1528
1541
  > .ecl-container {
1529
1542
  > .ecl-mega-menu__info {
1530
1543
  box-shadow: none;
1531
- border-radius: 0px 4px 4px 0px;
1544
+ border-radius: 0px map.get($theme, 'border-radius', 's')
1545
+ map.get($theme, 'border-radius', 's') 0px;
1532
1546
  left: map.get(
1533
1547
  $mega-menu,
1534
1548
  'desktop',
@@ -1599,9 +1613,9 @@ $mega-menu: null !default;
1599
1613
 
1600
1614
  @include breakpoints.up('xl') {
1601
1615
  .ecl-mega-menu:not(
1602
- .ecl-mega-menu--forced-mobile,
1603
- .ecl-mega-menu--forced-close
1604
- ) {
1616
+ .ecl-mega-menu--forced-mobile,
1617
+ .ecl-mega-menu--forced-close
1618
+ ) {
1605
1619
  .ecl-container {
1606
1620
  padding-inline: map.get(
1607
1621
  $mega-menu,
@@ -1622,11 +1636,11 @@ $mega-menu: null !default;
1622
1636
  }
1623
1637
  }
1624
1638
 
1625
- @include breakpoints.up('xxl') {
1639
+ @media (width >= 1368px) {
1626
1640
  .ecl-mega-menu:not(
1627
- .ecl-mega-menu--forced-mobile,
1628
- .ecl-mega-menu--forced-close
1629
- ) {
1641
+ .ecl-mega-menu--forced-mobile,
1642
+ .ecl-mega-menu--forced-close
1643
+ ) {
1630
1644
  .ecl-mega-menu__mega:not(.ecl-mega-menu__mega--level-2)
1631
1645
  > .ecl-mega-menu__featured {
1632
1646
  margin-inline-start: 20.68rem !important;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@ecl/mega-menu",
3
3
  "author": "European Commission",
4
4
  "license": "EUPL-1.2",
5
- "version": "5.0.0-alpha.14",
5
+ "version": "5.0.0-alpha.16",
6
6
  "description": "ECL Mega Menu",
7
7
  "publishConfig": {
8
8
  "access": "public"
@@ -11,13 +11,13 @@
11
11
  "module": "mega-menu.js",
12
12
  "style": "mega-menu.scss",
13
13
  "dependencies": {
14
- "@ecl/button": "5.0.0-alpha.14",
15
- "@ecl/dom-utils": "5.0.0-alpha.14",
16
- "@ecl/event-manager": "5.0.0-alpha.14",
17
- "@ecl/link": "5.0.0-alpha.14",
18
- "@ecl/picture": "5.0.0-alpha.14",
19
- "bowser": "2.11.0",
20
- "focus-trap": "7.6.4"
14
+ "@ecl/button": "5.0.0-alpha.16",
15
+ "@ecl/dom-utils": "5.0.0-alpha.16",
16
+ "@ecl/event-manager": "5.0.0-alpha.16",
17
+ "@ecl/link": "5.0.0-alpha.16",
18
+ "@ecl/picture": "5.0.0-alpha.16",
19
+ "bowser": "2.12.1",
20
+ "focus-trap": "7.6.5"
21
21
  },
22
22
  "repository": {
23
23
  "type": "git",
@@ -33,5 +33,5 @@
33
33
  "design-system",
34
34
  "twig"
35
35
  ],
36
- "gitHead": "5f790fa1e567483d23464f81405996c9e1c4f4f5"
36
+ "gitHead": "0842ff3b72ce9099c13e5407ad2b5eda9d06ba69"
37
37
  }