Skip to content

Commit 0667ab2

Browse files
sebastianthulinSebastian Thulin
andauthored
feat: add scope component (#631)
Co-authored-by: Sebastian Thulin <sebastian.thulin@helsingborg.se>
1 parent 3c891a4 commit 0667ab2

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace ComponentLibrary\Component\Scope;
4+
5+
class Scope extends \ComponentLibrary\Component\BaseController
6+
{
7+
public function init() {
8+
if(!empty($this->data['name'])) {
9+
$this->data['attributeList']['data-scope'] = 's-' . $this->data['name'] ;
10+
}
11+
}
12+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<{{$componentElement}} class="{{$class}}" {!! $attribute !!}>
2+
{!! $slot !!}
3+
</{{$componentElement}}>
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+
"name": ""
6+
},
7+
"description": {
8+
"componentElement": "The tag to use for this component.",
9+
"name": "The name of the scope."
10+
},
11+
"types":{
12+
"componentElement": "string",
13+
"name": "string"
14+
},
15+
"view": "scope.blade.php",
16+
"dependency": {
17+
"sass": {
18+
"components": [
19+
"scope"
20+
]
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)