Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
b82e3059
Commit
b82e3059
authored
1 year ago
by
Jonathan Weth
Browse files
Options
Downloads
Plain Diff
Merge branch '1006-slideiterator' into 'master'
Resolve "SlideIterator" Closes
#1006
See merge request
!1459
parents
82d73b5a
d65bd0cc
No related branches found
No related tags found
1 merge request
!1459
Resolve "SlideIterator"
Pipeline
#183401
failed
1 year ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/frontend/components/generic/SlideIterator.vue
+121
-0
121 additions, 0 deletions
aleksis/core/frontend/components/generic/SlideIterator.vue
with
121 additions
and
0 deletions
aleksis/core/frontend/components/generic/SlideIterator.vue
0 → 100644
+
121
−
0
View file @
b82e3059
<
script
>
import
SecondaryActionButton
from
"
./buttons/SecondaryActionButton.vue
"
;
export
default
{
name
:
"
SlideIterator
"
,
components
:
{
SecondaryActionButton
},
extends
:
"
v-data-iterator
"
,
data
()
{
return
{
expanded
:
[],
selected
:
[],
};
},
props
:
{
itemKeyGetter
:
{
type
:
Function
,
default
:
(
item
)
=>
item
.
id
,
required
:
false
,
},
},
watch
:
{
/**
* Emits an event when items are expanded or not anymore.
*
* @param newValue new list of expanded items
* @param oldValue previous list of expanded items
*/
expanded
(
newValue
,
oldValue
)
{
const
n
=
newValue
.
length
>
0
;
const
o
=
oldValue
.
length
>
0
;
console
.
log
(
"
Hello
"
,
n
,
o
);
if
(
n
===
o
)
{
// Only emit an event when the length is different
return
;
}
if
(
n
)
{
// At least one item is now expanded and previously there were none
this
.
$emit
(
"
update:isExpanded
"
,
true
);
return
;
}
// no item is expanded anymore
this
.
$emit
(
"
update:isExpanded
"
,
false
);
},
},
};
</
script
>
<
template
>
<v-data-iterator
disable-pagination
hide-default-footer
single-expand
:expanded.sync=
"expanded"
v-model=
"selected"
v-bind=
"$attrs"
v-on=
"$listeners"
>
<template
#default
="
{ items, isExpanded, expand }">
<v-slide-x-transition
leave-absolute
>
<v-list
v-show=
"expanded.length === 0"
>
<v-list-item-group
multiple
v-model=
"selected"
>
<v-list-item
v-for=
"item in items"
:key=
"itemKeyGetter(item)"
:value=
"item"
>
<template
#default
="
{ active }">
<v-list-item-action>
<v-checkbox
:input-value=
"active"
color=
"primary"
></v-checkbox>
</v-list-item-action>
<v-list-item-content>
<slot
name=
"listItemContent"
:item=
"item"
:selected=
"selected"
/>
</v-list-item-content>
<v-list-item-action>
<v-btn
icon
large
>
<v-icon
large
@
click.stop=
"expand(item, true)"
>
$next
</v-icon>
</v-btn>
</v-list-item-action>
</
template
>
</v-list-item>
</v-list-item-group>
</v-list>
</v-slide-x-transition>
<v-slide-x-reverse-transition
leave-absolute
>
<v-card
v-if=
"expanded.length > 0"
>
<slot
name=
"expandedItem"
:item=
"expanded[0]"
:close=
"() => expand(expanded[0], false)"
>
<v-card-title>
{{ $tc("selection.num_items_selected", expanded.length) }}
</v-card-title>
<v-card-text>
<p>
{{ expanded[0] }}
</p>
<secondary-action-button
@
click=
"expand(expanded[0], false)"
i18n-key=
"actions.close"
/>
</v-card-text>
</slot>
</v-card>
</v-slide-x-reverse-transition>
</template>
</v-data-iterator>
</template>
<
style
scoped
></
style
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment