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

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Rosenborg committed Apr 27, 2020
2 parents bafdfaa + ab5b37c commit b0b2e74
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 16 deletions.
16 changes: 16 additions & 0 deletions src/Component/Divider/Divider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace BladeComponentLibrary\Component\Divider;

/**
* Class Dropdown
* @package BladeComponentLibrary\Component\Dropdown
*/
class Divider extends \BladeComponentLibrary\Component\BaseController
{

public function init() {
//Extract array for eazy access (fetch only)
extract($this->data);
}
}
2 changes: 2 additions & 0 deletions src/Component/Divider/divider.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<{{$componentElement}} class="{{$class}} {{$class}}--{{$style}} {{$class}}--{{$size}} ">
</{{$componentElement}}>
23 changes: 23 additions & 0 deletions src/Component/Divider/divider.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"slug": "divider",
"default": {
"componentElement": "div",
"style": "dashed",
"size": "md"
},
"description": {
"componentElement": "The tag to use for this component.",
"style": "Either dashed, solid or dotted.",
"size": "The length of the divider. Either sm, md or lg."
},
"view": "dropdown.blade.php",
"dependency": {
"sass": {
"components": [
"divider"
]
}
}
}


27 changes: 27 additions & 0 deletions src/Component/Navbar/Navbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,32 @@ public function init() {

// Extract array for eazy access (fetch only)
extract($this->data);

if($this->data['isDynamic']) {


$this->data['attributeList']['js-is-dynamic'] = '';

if(isset($childItemsUrl)) {


$this->data['attributeList']['js-child-items-url'] = $childItemsUrl;
}
}

if(isset($this->data['multiDimenexpanded_menusional'])) {
foreach($this->data['expanded_menu'] as $key => $value){
$this->data['expanded_menu'][$key]['id'] = isset($this->data['expanded_menu'][$key]['id']) ? $this->data['expanded_menu'][$key]['id'] : null;
}
}

if(isset($this->data['pageID'])) {
$this->data['attributeList']['data-page-id'] = $this->data['pageID'];
}

if(isset($this->data['pageParentID'])) {
$this->data['attributeList']['data-page-parent-id'] = $this->data['pageParentID'];
}

}
}
3 changes: 2 additions & 1 deletion src/Component/Navbar/navbar.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"logo": "",
"items": [],
"sidebar": false,
"expanded_menu": false
"expanded_menu": false,
"isDynamic": false
},

"description":{
Expand Down
6 changes: 5 additions & 1 deletion src/Component/Navbar/sub/expanded_grid.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


@grid([
"classList" => [
$baseClass.'__expanded_grid'
Expand All @@ -8,8 +10,9 @@
"col_gap" => "5",
"row_gap" => "9"
])

@foreach ($expanded_menu as $key => $item)

@grid([
'element' => 'a',
'classList' => [
Expand Down Expand Up @@ -38,4 +41,5 @@
@endgrid
@endforeach


@endgrid
3 changes: 2 additions & 1 deletion src/Component/Navbar/sub/expanded_main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
'color' => 'default',
'size' => 'lg',
'style' => 'basic',
'href' => '#',
'classList' => [
$baseClass.'__prev'
]
])
@endbutton
@endif

@typography([
"element" => "h2",
"variant" => "marketing",
Expand Down
20 changes: 11 additions & 9 deletions src/Component/Navbar/sub/expanded_menu.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
"col_gap" => "4"
])

@foreach ($expanded_menu as $key => $item)
@grid([])
@link([
'href' => $item['href']
])
{{$key}}
@endbutton
@endgrid
@endforeach
@if(!$isDynamic)
@foreach ($expanded_menu as $key => $item)
@grid([])
@link([
'href' => $item['href']
])
{{$key}}
@endbutton
@endgrid
@endforeach
@endif
@endgrid
4 changes: 4 additions & 0 deletions src/Component/Sidebar/Sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ public function init()
{
//Extract array for eazy access (fetch only)
extract($this->data);

if(isset($childItemsUrl)) {
$this->data['attributeList']['child-items-url'] = $childItemsUrl;
}
}
}
12 changes: 8 additions & 4 deletions src/Component/Sidebar/item.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,23 @@
{{$item['label']}}
</a>

@if (isset($item['children']))
@if ($item['children'])
@php
$rndId = uniqid();
@endphp
<div class="{{$baseClass}}__toggle"
js-toggle-trigger="{{$rndId}}"
@if(!isset($childItemsUrl))
js-toggle-trigger="{{$rndId}}"
@endif
aria-label="{{$item['ID']}}"
aria-pressed="false">

<div class="bar"></div>
<div class="bar"></div>
</div>

@include ('Sidebar.item', array('items' => $item['children'], 'appendID' => $rndId, 'top_level' => false))
@if(!isset($childItemsUrl))
@include ('Sidebar.item', array('items' => $item['children'], 'appendID' => $rndId, 'top_level' => false))
@endif
@endif
</div>
@endforeach
Expand Down

0 comments on commit b0b2e74

Please sign in to comment.