Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit b0b2e74

Browse files
author
Eric Rosenborg
committed
Merge branch 'develop'
2 parents bafdfaa + ab5b37c commit b0b2e74

File tree

10 files changed

+100
-16
lines changed

10 files changed

+100
-16
lines changed

src/Component/Divider/Divider.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace BladeComponentLibrary\Component\Divider;
4+
5+
/**
6+
* Class Dropdown
7+
* @package BladeComponentLibrary\Component\Dropdown
8+
*/
9+
class Divider extends \BladeComponentLibrary\Component\BaseController
10+
{
11+
12+
public function init() {
13+
//Extract array for eazy access (fetch only)
14+
extract($this->data);
15+
}
16+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<{{$componentElement}} class="{{$class}} {{$class}}--{{$style}} {{$class}}--{{$size}} ">
2+
</{{$componentElement}}>

src/Component/Divider/divider.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"slug": "divider",
3+
"default": {
4+
"componentElement": "div",
5+
"style": "dashed",
6+
"size": "md"
7+
},
8+
"description": {
9+
"componentElement": "The tag to use for this component.",
10+
"style": "Either dashed, solid or dotted.",
11+
"size": "The length of the divider. Either sm, md or lg."
12+
},
13+
"view": "dropdown.blade.php",
14+
"dependency": {
15+
"sass": {
16+
"components": [
17+
"divider"
18+
]
19+
}
20+
}
21+
}
22+
23+

src/Component/Navbar/Navbar.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,32 @@ public function init() {
1212

1313
// Extract array for eazy access (fetch only)
1414
extract($this->data);
15+
16+
if($this->data['isDynamic']) {
17+
18+
19+
$this->data['attributeList']['js-is-dynamic'] = '';
20+
21+
if(isset($childItemsUrl)) {
22+
23+
24+
$this->data['attributeList']['js-child-items-url'] = $childItemsUrl;
25+
}
26+
}
27+
28+
if(isset($this->data['multiDimenexpanded_menusional'])) {
29+
foreach($this->data['expanded_menu'] as $key => $value){
30+
$this->data['expanded_menu'][$key]['id'] = isset($this->data['expanded_menu'][$key]['id']) ? $this->data['expanded_menu'][$key]['id'] : null;
31+
}
32+
}
33+
34+
if(isset($this->data['pageID'])) {
35+
$this->data['attributeList']['data-page-id'] = $this->data['pageID'];
36+
}
37+
38+
if(isset($this->data['pageParentID'])) {
39+
$this->data['attributeList']['data-page-parent-id'] = $this->data['pageParentID'];
40+
}
41+
1542
}
1643
}

src/Component/Navbar/navbar.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"logo": "",
55
"items": [],
66
"sidebar": false,
7-
"expanded_menu": false
7+
"expanded_menu": false,
8+
"isDynamic": false
89
},
910

1011
"description":{

src/Component/Navbar/sub/expanded_grid.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
13
@grid([
24
"classList" => [
35
$baseClass.'__expanded_grid'
@@ -8,8 +10,9 @@
810
"col_gap" => "5",
911
"row_gap" => "9"
1012
])
11-
13+
1214
@foreach ($expanded_menu as $key => $item)
15+
1316
@grid([
1417
'element' => 'a',
1518
'classList' => [
@@ -38,4 +41,5 @@
3841
@endgrid
3942
@endforeach
4043

44+
4145
@endgrid

src/Component/Navbar/sub/expanded_main.blade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
'color' => 'default',
88
'size' => 'lg',
99
'style' => 'basic',
10+
'href' => '#',
1011
'classList' => [
1112
$baseClass.'__prev'
1213
]
1314
])
1415
@endbutton
1516
@endif
16-
17+
1718
@typography([
1819
"element" => "h2",
1920
"variant" => "marketing",

src/Component/Navbar/sub/expanded_menu.blade.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
"col_gap" => "4"
88
])
99

10-
@foreach ($expanded_menu as $key => $item)
11-
@grid([])
12-
@link([
13-
'href' => $item['href']
14-
])
15-
{{$key}}
16-
@endbutton
17-
@endgrid
18-
@endforeach
10+
@if(!$isDynamic)
11+
@foreach ($expanded_menu as $key => $item)
12+
@grid([])
13+
@link([
14+
'href' => $item['href']
15+
])
16+
{{$key}}
17+
@endbutton
18+
@endgrid
19+
@endforeach
20+
@endif
1921
@endgrid

src/Component/Sidebar/Sidebar.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ public function init()
99
{
1010
//Extract array for eazy access (fetch only)
1111
extract($this->data);
12+
13+
if(isset($childItemsUrl)) {
14+
$this->data['attributeList']['child-items-url'] = $childItemsUrl;
15+
}
1216
}
1317
}

src/Component/Sidebar/item.blade.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,23 @@
1313
{{$item['label']}}
1414
</a>
1515

16-
@if (isset($item['children']))
16+
@if ($item['children'])
1717
@php
1818
$rndId = uniqid();
1919
@endphp
2020
<div class="{{$baseClass}}__toggle"
21-
js-toggle-trigger="{{$rndId}}"
21+
@if(!isset($childItemsUrl))
22+
js-toggle-trigger="{{$rndId}}"
23+
@endif
24+
aria-label="{{$item['ID']}}"
2225
aria-pressed="false">
2326

2427
<div class="bar"></div>
2528
<div class="bar"></div>
2629
</div>
27-
28-
@include ('Sidebar.item', array('items' => $item['children'], 'appendID' => $rndId, 'top_level' => false))
30+
@if(!isset($childItemsUrl))
31+
@include ('Sidebar.item', array('items' => $item['children'], 'appendID' => $rndId, 'top_level' => false))
32+
@endif
2933
@endif
3034
</div>
3135
@endforeach

0 commit comments

Comments
 (0)