Skip to content

Commit

Permalink
fix(experimental): fix problem with tuiCell
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Feb 5, 2024
1 parent 6a25d26 commit e7e1639
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 43 deletions.
2 changes: 1 addition & 1 deletion projects/demo/src/modules/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export const ROUTES: Routes = [
path: 'experimental/card-medium',
loadChildren: async () =>
(await import('../experimental/card-medium/card-medium.module'))
.ExampleTuiCardModule,
.ExampleTuiCardMediumModule,
data: {
title: 'CardMedium',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import {changeDetection} from '@demo/emulate/change-detection';
import {TuiDocExample, TuiRawLoaderContent} from '@taiga-ui/addon-doc';

@Component({
selector: 'example-card',
selector: 'example-card-medium',
templateUrl: './card-medium.template.html',
changeDetection,
})
export class ExampleTuiCardComponent {
export class ExampleTuiCardMediumComponent {
readonly exampleModule: TuiRawLoaderContent = import(
'./examples/import/import-module.md?raw'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ import {
TuiTitleModule,
} from '@taiga-ui/experimental';

import {ExampleTuiCardComponent} from './card-medium.component';
import {ExampleTuiCardMediumComponent} from './card-medium.component';
import {TuiCardMediumExample1} from './examples/1';
import {TuiCardMediumExample2} from './examples/2';
import {TuiCardMediumExample3} from './examples/3';
import {TuiCardExample4} from './examples/4';
import {TuiCardMediumExample4} from './examples/4';
import {TuiCardMediumExample5} from './examples/5';
import {TuiCardMediumExample6} from './examples/6';
import {TuiCardMediumExample7} from './examples/7';
Expand Down Expand Up @@ -66,7 +66,7 @@ import {TuiCardMediumExample7} from './examples/7';
TuiButtonModule,
TuiHeaderModule,
TuiCellModule,
tuiGetDocModules(ExampleTuiCardComponent),
tuiGetDocModules(ExampleTuiCardMediumComponent),
TuiRepeatTimesModule,
TuiDataListModule,
TuiHostedDropdownModule,
Expand All @@ -76,15 +76,15 @@ import {TuiCardMediumExample7} from './examples/7';
TuiAppearanceModule,
],
declarations: [
ExampleTuiCardComponent,
ExampleTuiCardMediumComponent,
TuiCardMediumExample1,
TuiCardMediumExample2,
TuiCardMediumExample3,
TuiCardExample4,
TuiCardMediumExample4,
TuiCardMediumExample5,
TuiCardMediumExample6,
TuiCardMediumExample7,
],
exports: [ExampleTuiCardComponent],
exports: [ExampleTuiCardMediumComponent],
})
export class ExampleTuiCardModule {}
export class ExampleTuiCardMediumModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package="EXPERIMENTAL"
type="components"
>
<ng-template pageTab="Medium">
<ng-template pageTab>
<tui-notification status="warning">
This code is
<strong>experimental</strong>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {encapsulation} from '@demo/emulate/encapsulation';
encapsulation,
changeDetection,
})
export class TuiCardExample4 {
export class TuiCardMediumExample4 {
readonly urls = [
'https://avatars.githubusercontent.com/u/11832552',
'https://avatars.githubusercontent.com/u/10106368',
Expand Down
2 changes: 2 additions & 0 deletions projects/demo/src/modules/experimental/cell/cell.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
TuiBadgeModule,
TuiBadgeNotificationModule,
TuiButtonModule,
TuiCardModule,
TuiCellModule,
TuiCheckboxModule,
TuiFadeModule,
Expand Down Expand Up @@ -75,6 +76,7 @@ import {TuiCellExample7} from './examples/7';
TuiHostedDropdownModule,
TuiGroupModule,
tuiGetDocModules(ExampleTuiCellComponent),
TuiCardModule,
],
declarations: [
ExampleTuiCellComponent,
Expand Down
34 changes: 17 additions & 17 deletions projects/demo/src/modules/experimental/cell/examples/7/index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<div tuiSurface="elevated">
<div
tuiCardLarge
tuiSurface="elevated"
>
<h3 tuiTitle="m">Inside a block</h3>
<div class="actions">
<button
*ngFor="let item of items"
tuiCell
class="action"
>
<tui-avatar
appearance="accent"
[src]="item.icon"
></tui-avatar>
<span tuiTitle>
{{ item.title }}
<span tuiSubtitle>{{ item.subtitle }}</span>
</span>
</button>
</div>
<button
*ngFor="let item of items"
tuiCell
>
<tui-avatar
appearance="accent"
[src]="item.icon"
></tui-avatar>
<span tuiTitle>
{{ item.title }}
<span tuiSubtitle>{{ item.subtitle }}</span>
</span>
</button>
</div>

<label tuiLabel="Inside a dropdown">
Expand Down
13 changes: 0 additions & 13 deletions projects/demo/src/modules/experimental/cell/examples/7/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,3 @@
max-width: 20rem;
gap: 1rem;
}

.actions {
display: flex;
flex-direction: column;
gap: 0.25rem;
margin: 1rem -0.5rem -0.5rem;
}

.action {
padding-left: 0.5rem;
padding-right: 0.5rem;
border-radius: 0.75rem;
}
2 changes: 1 addition & 1 deletion projects/experimental/directives/card/card.styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
gap: var(--t-gap);
align-items: stretch;

> :last-child {
> :last-child:not([tuiCell]) {
margin-top: auto;
}
}
Expand Down

0 comments on commit e7e1639

Please sign in to comment.