Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
Lamarts mobile app angular
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arko Dey Bhowmick
Lamarts mobile app angular
Commits
f8aa8dc8
Commit
f8aa8dc8
authored
Mar 25, 2025
by
Arko Dey Bhowmick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add dd
parent
98cb0590
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
19 deletions
+54
-19
src/app/component-library/drag-n-drop/drag-n-drop-annother/drag-n-drop-annother.component.html
.../drag-n-drop-annother/drag-n-drop-annother.component.html
+27
-19
src/app/component-library/drag-n-drop/drag-n-drop-annother/drag-n-drop-annother.component.ts
...op/drag-n-drop-annother/drag-n-drop-annother.component.ts
+27
-0
No files found.
src/app/component-library/drag-n-drop/drag-n-drop-annother/drag-n-drop-annother.component.html
View file @
f8aa8dc8
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
<!-- Categories (Draggable) -->
<!-- Categories (Draggable) -->
<div
cdkDropList
[cdkDropListData]=
"movies"
class=
"category-list"
(cdkDropListDropped)=
"drop($event)"
>
<div
cdkDropList
[cdkDropListData]=
"movies"
class=
"category-list"
(cdkDropListDropped)=
"drop($event)"
>
<div
*ngFor=
"let category of movies;
trackBy: trackByFn
"
class=
"category-box"
cdkDrag
>
<div
*ngFor=
"let category of movies;
let i = index; trackBy: trackByFn;
"
class=
"category-box"
cdkDrag
>
<div
class=
"example-custom-placeholder"
*cdkDragPlaceholder
></div>
<div
class=
"example-custom-placeholder"
*cdkDragPlaceholder
></div>
<h3
cdkDragHandle
class=
"movie-box"
>
<h3
cdkDragHandle
class=
"movie-box"
>
...
@@ -56,11 +56,13 @@
...
@@ -56,11 +56,13 @@
</svg>
</svg>
</div>
</div>
{{ category.category }}
{{ category.category }}
<button
(click)=
"collapse(movies)"
>
col
</button>
</h3>
</h3>
<!-- Subcategories (Draggable) -->
<!-- Subcategories (Draggable) -->
<div
cdkDropList
[cdkDropListData]=
"category.subcategories"
class=
"subcategory-list"
(cdkDropListDropped)=
"drop($event)"
>
<div
cdkDropList
[cdkDropListData]=
"category.subcategories"
class=
"subcategory-list"
(cdkDropListDropped)=
"drop($event)"
>
<div
*ngFor=
"let subcategory of category.subcategories; trackBy: trackByFn"
class=
"subcategory-box"
cdkDrag
>
<div
*ngFor=
"let subcategory of category.subcategories; trackBy: trackByFn"
class=
"subcategory-box"
cdkDrag
>
<ng-container
*ngIf=
"!category.collapsed"
>
<div
class=
"example-custom-placeholder"
*cdkDragPlaceholder
></div>
<div
class=
"example-custom-placeholder"
*cdkDragPlaceholder
></div>
<h4
cdkDragHandle
class=
"movie-box"
>
<h4
cdkDragHandle
class=
"movie-box"
>
<div
class=
"movie-handle"
cdkDragHandle
>
<div
class=
"movie-handle"
cdkDragHandle
>
...
@@ -70,12 +72,15 @@
...
@@ -70,12 +72,15 @@
</svg>
</svg>
</div>
</div>
{{ subcategory.name }}
{{ subcategory.name }}
<button
(click)=
"collapse(category.subcategories)"
>
col
</button>
</h4>
</h4>
</ng-container>
<!-- Movies (Draggable) -->
<!-- Movies (Draggable) -->
<div
cdkDropList
[cdkDropListData]=
"subcategory.movies"
class=
"movie-list"
(cdkDropListDropped)=
"drop($event)"
>
<div
cdkDropList
[cdkDropListData]=
"subcategory.movies"
class=
"movie-list"
(cdkDropListDropped)=
"drop($event)"
>
<div
*ngFor=
"let movie of subcategory.movies; trackBy: trackByFn"
class=
"movie-box"
cdkDrag
>
<div
*ngFor=
"let movie of subcategory.movies; trackBy: trackByFn"
class=
"movie-box"
cdkDrag
>
<ng-container
*ngIf=
"!subcategory.collapsed"
>
<div
class=
"movie-handle"
cdkDragHandle
>
<div
class=
"movie-handle"
cdkDragHandle
>
<svg
width=
"24px"
fill=
"currentColor"
viewBox=
"0 0 24 24"
>
<svg
width=
"24px"
fill=
"currentColor"
viewBox=
"0 0 24 24"
>
<path
d=
"M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2l-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z"
></path>
<path
d=
"M10 9h4V6h3l-5-5-5 5h3v3zm-1 1H6V7l-5 5 5 5v-3h3v-4zm14 2l-5-5v3h-3v4h3v3l5-5zm-9 3h-4v3H7l5 5 5-5h-3v-3z"
></path>
...
@@ -86,6 +91,9 @@
...
@@ -86,6 +91,9 @@
<div
class=
"example-custom-placeholder"
*cdkDragPlaceholder
></div>
<div
class=
"example-custom-placeholder"
*cdkDragPlaceholder
></div>
{{ movie.title }}
{{ movie.title }}
<!-- <button (click)="collapse()">col</button> -->
</ng-container>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/app/component-library/drag-n-drop/drag-n-drop-annother/drag-n-drop-annother.component.ts
View file @
f8aa8dc8
...
@@ -12,9 +12,11 @@ export class DragNDropAnnotherComponent {
...
@@ -12,9 +12,11 @@ export class DragNDropAnnotherComponent {
movies
=
[
movies
=
[
{
{
category
:
'
Prequel Trilogy
'
,
category
:
'
Prequel Trilogy
'
,
collapsed
:
false
,
subcategories
:
[
subcategories
:
[
{
{
name
:
'
Episodes I-III
'
,
name
:
'
Episodes I-III
'
,
collapsed
:
false
,
movies
:
[
movies
:
[
{
id
:
1
,
title
:
'
Episode I - The Phantom Menace
'
},
{
id
:
1
,
title
:
'
Episode I - The Phantom Menace
'
},
{
id
:
2
,
title
:
'
Episode II - Attack of the Clones
'
},
{
id
:
2
,
title
:
'
Episode II - Attack of the Clones
'
},
...
@@ -23,6 +25,7 @@ export class DragNDropAnnotherComponent {
...
@@ -23,6 +25,7 @@ export class DragNDropAnnotherComponent {
},
},
{
{
name
:
'
Episodes 4-7
'
,
name
:
'
Episodes 4-7
'
,
collapsed
:
false
,
movies
:
[
movies
:
[
{
id
:
1
,
title
:
'
Episode 4 - 4 The Phantom Menace
'
},
{
id
:
1
,
title
:
'
Episode 4 - 4 The Phantom Menace
'
},
{
id
:
2
,
title
:
'
Episode 5 - 5 Attack of the Clones
'
},
{
id
:
2
,
title
:
'
Episode 5 - 5 Attack of the Clones
'
},
...
@@ -33,9 +36,11 @@ export class DragNDropAnnotherComponent {
...
@@ -33,9 +36,11 @@ export class DragNDropAnnotherComponent {
},
},
{
{
category
:
'
Original Trilogy
'
,
category
:
'
Original Trilogy
'
,
collapsed
:
false
,
subcategories
:
[
subcategories
:
[
{
{
name
:
'
Episodes IV-VI
'
,
name
:
'
Episodes IV-VI
'
,
collapsed
:
false
,
movies
:
[
movies
:
[
{
id
:
4
,
title
:
'
Episode IV - A New Hope
'
},
{
id
:
4
,
title
:
'
Episode IV - A New Hope
'
},
{
id
:
5
,
title
:
'
Episode V - The Empire Strikes Back
'
},
{
id
:
5
,
title
:
'
Episode V - The Empire Strikes Back
'
},
...
@@ -46,9 +51,11 @@ export class DragNDropAnnotherComponent {
...
@@ -46,9 +51,11 @@ export class DragNDropAnnotherComponent {
},
},
{
{
category
:
'
Sequel Trilogy
'
,
category
:
'
Sequel Trilogy
'
,
collapsed
:
false
,
subcategories
:
[
subcategories
:
[
{
{
name
:
'
Episodes VII-IX
'
,
name
:
'
Episodes VII-IX
'
,
collapsed
:
false
,
movies
:
[
movies
:
[
{
id
:
7
,
title
:
'
Episode VII - The Force Awakens
'
},
{
id
:
7
,
title
:
'
Episode VII - The Force Awakens
'
},
{
id
:
8
,
title
:
'
Episode VIII - The Last Jedi
'
},
{
id
:
8
,
title
:
'
Episode VIII - The Last Jedi
'
},
...
@@ -77,4 +84,24 @@ export class DragNDropAnnotherComponent {
...
@@ -77,4 +84,24 @@ export class DragNDropAnnotherComponent {
public
trackByFn
(
index
:
number
,
item
:
any
)
{
public
trackByFn
(
index
:
number
,
item
:
any
)
{
return
item
.
id
||
index
;
return
item
.
id
||
index
;
}
}
public
collapse
(
array
:
any
[]):
void
{
array
.
forEach
((
elm
)
=>
{
// Check if the element has the `collapsed` property and toggle it
if
(
elm
.
hasOwnProperty
(
'
collapsed
'
))
{
elm
.
collapsed
=
!
elm
.
collapsed
;
}
// Check for any nested arrays inside the object
Object
.
keys
(
elm
).
forEach
((
key
)
=>
{
if
(
Array
.
isArray
(
elm
[
key
]))
{
// Recursive call to check deeper nested arrays
this
.
collapse
(
elm
[
key
]);
}
});
});
console
.
log
(
array
)
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment