-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEATURE: implements @private #158
base: 8.3
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
prototype(Neos.Demo:Presentation.Slider) < prototype(Neos.Fusion:Component) { | ||
// This is used for the living styleguide (Monocle) | ||
// Read more about this in the README.md | ||
@styleguide.props.items = Neos.Fusion:Map { | ||
@styleguide.props.items = Neos.Fusion:Map { | ||
items = ${Array.range(1, 10)} | ||
itemRenderer = afx` | ||
<img class="w-full" src={"https://picsum.photos/800/400?random=" + item} alt="placeholder image" /> | ||
<img class="w-full" src={"https://picsum.photos/800/400?random=" + item} alt="placeholder image"/> | ||
` | ||
} | ||
|
||
//todo rework this component, to verify what is used and/or needed | ||
tagName = 'section' | ||
sliderIsDecoration = false | ||
class = null | ||
|
@@ -18,37 +19,36 @@ prototype(Neos.Demo:Presentation.Slider) < prototype(Neos.Fusion:Component) { | |
gap = 12 | ||
} | ||
|
||
attributes = Neos.Fusion:DataStructure | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you notice that with removing this and the following changes for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't change the interface in such a PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we actually dont need the so this was only exposed so possibly other people could use the slider component themselves? This seems like an odd concept - as for me the neos demo is just a demo without any contract and any expectations any guarantees -> Otherwise our refactor and redesign from 8.2 to 8.3 would have been breaking and illegal. So i disagree. Imo we are allowed to change it, and in our case it makes the component easier to maintain and migrate to private props. |
||
|
||
i18n = Neos.Fusion:Map { | ||
items = ${['prev', 'next', 'first', 'last', 'slideX', 'pageX', 'play', 'pause', 'carousel', 'select', 'slide', 'slideLabel', 'playVideo']} | ||
keyRenderer = ${item} | ||
itemRenderer = ${I18n.translate('Neos.Demo:Main:splide.' + item)} | ||
} | ||
|
||
_hasItems = ${Type.isArray(this.items) && Array.length(this.items)} | ||
@if.hasItemsOrContent = ${this._hasItems || this.content} | ||
|
||
renderer = Neos.Fusion:Tag { | ||
tagName = ${props.tagName} | ||
attributes { | ||
@private { | ||
hasItems = ${Type.isArray(props.items) && Array.length(props.items)} | ||
attributes = Neos.Fusion:DataStructure { | ||
x-data = 'slider' | ||
data-splide = ${Json.stringify(Array.concat({i18n:props.i18n}, props.options))} | ||
aria-label = ${props.label} | ||
role = ${props.sliderIsDecoration ? 'group' : null} | ||
class = ${Array.push('splide', props.class)} | ||
@apply.attributes = ${props.attributes} | ||
} | ||
content = afx` | ||
} | ||
|
||
[email protected] = ${private.hasItems || props.content} | ||
|
||
renderer = afx` | ||
<Neos.Fusion:Tag tagName={props.tagName} attributes={private.attributes}> | ||
<div class="splide__track"> | ||
<ul class="splide__list" @if={props._hasItems && !props.content}> | ||
<ul class="splide__list" @if={private.hasItems && !props.content}> | ||
<Neos.Fusion:Loop items={props.items}> | ||
<Neos.Demo:Presentation.Slider.Fragment.Item class={props.slideItemClass} content={item} /> | ||
<Neos.Demo:Presentation.Slider.Fragment.Item class={props.slideItemClass} content={item}/> | ||
</Neos.Fusion:Loop> | ||
</ul> | ||
<!-- content is used as entry for contentcollections --> | ||
<!-- content is used as entry for content-collections --> | ||
{props.content} | ||
</div> | ||
` | ||
} | ||
</Neos.Fusion:Tag> | ||
` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhsdesign and/or @Jan3k3y do you still want to work on this todo?