-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(experimental):
SwipeActions
add new component (#6526)
Co-authored-by: taiga-family-bot <[email protected]>
- Loading branch information
1 parent
a803d64
commit 63792e7
Showing
35 changed files
with
834 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
projects/demo/src/modules/experimental/swipe-action/examples/1/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<tui-swipe-actions> | ||
<div tuiSurface="elevated"> | ||
<div tuiCell> | ||
<tui-avatar | ||
appearance="primary" | ||
src="tuiIconDollarSignLarge" | ||
></tui-avatar> | ||
<div tuiTitle> | ||
<strong>{{ 10000 | tuiAmount: 'USD' | async }}</strong> | ||
<div tuiSubtitle>Dollar account</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<button | ||
iconLeft="tuiIconEye" | ||
size="m" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
<button | ||
iconLeft="tuiIconEdit3" | ||
size="m" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
<button | ||
appearance="secondary" | ||
iconLeft="tuiIconShare" | ||
size="m" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
</tui-swipe-actions> | ||
|
||
<tui-swipe-actions> | ||
<div tuiSurface="elevated"> | ||
<div tuiCell> | ||
<tui-avatar | ||
appearance="primary" | ||
src="tuiIconGift" | ||
></tui-avatar> | ||
<div tuiTitle> | ||
<strong>{{ 23000 | tuiAmount: 'EUR' | async }}</strong> | ||
<div tuiSubtitle>Goal</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<button | ||
iconLeft="tuiIconEye" | ||
size="m" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
</tui-swipe-actions> | ||
|
||
<tui-swipe-actions | ||
[style.--tui-action-gap]="16" | ||
[style.--tui-item-size]="32" | ||
> | ||
<div tuiSurface="elevated"> | ||
<div tuiCell> | ||
<tui-avatar | ||
appearance="primary" | ||
src="tuiIconBriefcase" | ||
></tui-avatar> | ||
<div tuiTitle> | ||
<strong>{{ 5000 | tuiAmount: 'EUR' | async }}</strong> | ||
<div tuiSubtitle>Vacations</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<button | ||
iconLeft="tuiIconEye" | ||
size="s" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
<button | ||
iconLeft="tuiIconEdit3" | ||
size="s" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
<button | ||
appearance="secondary" | ||
iconLeft="tuiIconShare" | ||
size="s" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
<button | ||
appearance="destructive" | ||
iconLeft="tuiIconTrash" | ||
size="s" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
</tui-swipe-actions> |
19 changes: 19 additions & 0 deletions
19
projects/demo/src/modules/experimental/swipe-action/examples/1/index.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
width: 20rem; | ||
margin: 2rem 0; | ||
} | ||
|
||
[tuiSurface] { | ||
margin: 1.5rem 1rem; | ||
} | ||
|
||
tui-swipe-actions { | ||
margin: -1.5rem -1rem; | ||
} | ||
|
||
button[tuiSwipeAction] { | ||
border-radius: 100%; | ||
} |
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/experimental/swipe-action/examples/1/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
|
||
@Component({ | ||
selector: 'tui-swipe-action-example-1', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
encapsulation, | ||
changeDetection, | ||
}) | ||
export class TuiSwipeActionExample1 {} |
34 changes: 34 additions & 0 deletions
34
projects/demo/src/modules/experimental/swipe-action/examples/2/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<tui-swipe-actions [style.--tui-actions-padding.rem]="0.5"> | ||
<div | ||
tuiMode="onDark" | ||
tuiSurface | ||
class="blur" | ||
> | ||
<tui-avatar src="/assets/images/avatar.jpg"></tui-avatar> | ||
<h3 tuiTitle="m">Alex Inkin</h3> | ||
<button | ||
appearance="glass" | ||
iconLeft="tuiIconMailLarge" | ||
size="m" | ||
tuiIconButton | ||
class="button" | ||
> | ||
Message | ||
</button> | ||
</div> | ||
|
||
<input | ||
tuiSwipeAction | ||
tuiToggle | ||
type="checkbox" | ||
[(ngModel)]="checkbox" | ||
/> | ||
<button | ||
appearance="destructive" | ||
iconLeft="tuiIconTrash" | ||
size="m" | ||
tuiIconButton | ||
tuiSwipeAction | ||
[style.borderRadius.%]="100" | ||
></button> | ||
</tui-swipe-actions> |
17 changes: 17 additions & 0 deletions
17
projects/demo/src/modules/experimental/swipe-action/examples/2/index.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
:host { | ||
width: 20rem; | ||
} | ||
|
||
.blur { | ||
background-image: url('/assets/images/restaurant-2.jpg'); | ||
border-radius: 1rem; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
color: var(--tui-text-01-night); | ||
z-index: 1; | ||
|
||
&:before { | ||
backdrop-filter: blur(1rem); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
projects/demo/src/modules/experimental/swipe-action/examples/2/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
|
||
@Component({ | ||
selector: 'tui-swipe-action-example-2', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
encapsulation, | ||
changeDetection, | ||
}) | ||
export class TuiSwipeActionExample2 { | ||
checkbox = false; | ||
} |
69 changes: 69 additions & 0 deletions
69
projects/demo/src/modules/experimental/swipe-action/examples/3/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<tui-swipe-actions [autoClose]="true"> | ||
<div tuiSurface="elevated"> | ||
<div tuiCell> | ||
<tui-avatar | ||
appearance="primary" | ||
src="tuiIconDollarSignLarge" | ||
></tui-avatar> | ||
<div tuiTitle> | ||
<strong>{{ 10000 | tuiAmount: 'USD' | async }}</strong> | ||
<div tuiSubtitle>Dollar account</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<button | ||
iconLeft="tuiIconEye" | ||
size="m" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
<button | ||
iconLeft="tuiIconEdit3" | ||
size="m" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
<button | ||
appearance="secondary" | ||
iconLeft="tuiIconShare" | ||
size="m" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
</tui-swipe-actions> | ||
|
||
<tui-swipe-actions [autoClose]="true"> | ||
<div tuiSurface="elevated"> | ||
<div tuiCell> | ||
<tui-avatar | ||
appearance="primary" | ||
src="tuiIconGift" | ||
></tui-avatar> | ||
<div tuiTitle> | ||
<strong>{{ 23000 | tuiAmount: 'EUR' | async }}</strong> | ||
<div tuiSubtitle>Goal</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<button | ||
iconLeft="tuiIconEye" | ||
size="m" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
<button | ||
iconLeft="tuiIconEdit3" | ||
size="m" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
<button | ||
appearance="secondary" | ||
iconLeft="tuiIconShare" | ||
size="m" | ||
tuiIconButton | ||
tuiSwipeAction | ||
></button> | ||
</tui-swipe-actions> |
19 changes: 19 additions & 0 deletions
19
projects/demo/src/modules/experimental/swipe-action/examples/3/index.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
width: 20rem; | ||
margin: 1rem 0; | ||
} | ||
|
||
tui-swipe-actions { | ||
margin: -1.5rem -1rem; | ||
} | ||
|
||
[tuiSurface] { | ||
margin: 1.5rem 1rem; | ||
} | ||
|
||
button[tuiSwipeAction] { | ||
border-radius: 100%; | ||
} |
12 changes: 12 additions & 0 deletions
12
projects/demo/src/modules/experimental/swipe-action/examples/3/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
|
||
@Component({ | ||
selector: 'tui-swipe-action-example-3', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
encapsulation, | ||
changeDetection, | ||
}) | ||
export class TuiSwipeActionExample3 {} |
Oops, something went wrong.