Skip to content

Commit

Permalink
feat(abc:ellipsis): support standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Jan 11, 2024
1 parent 9a2323d commit 3fefbc3
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/abc/cell/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Cell formatting is supported for multiple data types, and supports widget mode.

## API

### cell
### cell:standalone

| Property | Description | Type | Default |
|----------|-------------|------|---------|
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/cell/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module: import { CellModule } from '@delon/abc/cell';

## API

### cell
### cell:standalone

| 成员 | 说明 | 类型 | 默认值 |
|----|----|----|-----|
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/count-down/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ npm i -S ngx-countdown

## API

### count-down
### count-down:standalone

| Property | Description | Type | Default |
|----------|-------------|------|---------|
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/count-down/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ npm i -S ngx-countdown

## API

### count-down
### count-down:standalone

| 成员 | 说明 | 类型 | 默认值 |
|----|----|----|-----|
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/date-picker/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Based on the `nz-range-picker` further optimization, better service to start and

## API

### [extend]
### [extend]:standalone

It needs to be used with [nz-range-picker](https://ng.ant.design/components/date-picker/zh#nz-range-picker), for example:

Expand Down
2 changes: 1 addition & 1 deletion packages/abc/date-picker/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module: import { DatePickerModule } from '@delon/abc/date-picker';

## API

### [extend]
### [extend]:standalone

需要配合 [nz-range-picker](https://ng.ant.design/components/date-picker/zh#nz-range-picker) 一起使用,例如:

Expand Down
2 changes: 1 addition & 1 deletion packages/abc/down-file/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A file download based on `blob`.

## API

### [down-file]
### [down-file]:standalone

| Property | Description | Type | Default |
|----------|-------------|------|---------|
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/down-file/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module: import { DownFileModule } from '@delon/abc/down-file';

## API

### [down-file]
### [down-file]:standalone

| 成员 | 说明 | 类型 | 默认值 |
|----|----|----|-----|
Expand Down
4 changes: 2 additions & 2 deletions packages/abc/ellipsis/demo/line.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Also note that, in this mode, the outer container needs to have a specified widt
```ts
import { Component } from '@angular/core';

import { EllipsisModule } from '@delon/abc/ellipsis';
import { EllipsisComponent } from '@delon/abc/ellipsis';

@Component({
selector: 'app-demo',
Expand All @@ -34,7 +34,7 @@ import { EllipsisModule } from '@delon/abc/ellipsis';
</ellipsis>
`,
standalone: true,
imports: [EllipsisModule]
imports: [EllipsisComponent]
})
export class DemoComponent {}
```
4 changes: 2 additions & 2 deletions packages/abc/ellipsis/demo/number.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ title:
```ts
import { Component } from '@angular/core';

import { EllipsisModule } from '@delon/abc/ellipsis';
import { EllipsisComponent } from '@delon/abc/ellipsis';

@Component({
selector: 'app-demo',
Expand All @@ -26,7 +26,7 @@ import { EllipsisModule } from '@delon/abc/ellipsis';
<ellipsis length="100" tooltip>{{ article }}</ellipsis>
`,
standalone: true,
imports: [EllipsisModule]
imports: [EllipsisComponent]
})
export class DemoComponent {
article =
Expand Down
9 changes: 7 additions & 2 deletions packages/abc/ellipsis/ellipsis.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DOCUMENT } from '@angular/common';
import { ObserversModule } from '@angular/cdk/observers';
import { DOCUMENT, NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';
import {
AfterViewInit,
ChangeDetectionStrategy,
Expand All @@ -17,14 +18,18 @@ import { take } from 'rxjs';

import { BooleanInput, InputBoolean, InputNumber, NumberInput } from '@delon/util/decorator';
import type { NzSafeAny } from 'ng-zorro-antd/core/types';
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';

@Component({
selector: 'ellipsis',
exportAs: 'ellipsis',
templateUrl: './ellipsis.component.html',
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
encapsulation: ViewEncapsulation.None,
standalone: true,
// TODO: can't use CdkObserveContent
imports: [ObserversModule, NzToolTipModule, NgTemplateOutlet, NgClass, NgStyle]
})
export class EllipsisComponent implements AfterViewInit, OnChanges {
static ngAcceptInputType_tooltip: BooleanInput;
Expand Down
3 changes: 1 addition & 2 deletions packages/abc/ellipsis/ellipsis.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { EllipsisComponent } from './ellipsis.component';
const COMPONENTS = [EllipsisComponent];

@NgModule({
imports: [CommonModule, ObserversModule, NzToolTipModule],
declarations: COMPONENTS,
imports: [CommonModule, ObserversModule, NzToolTipModule, ...COMPONENTS],
exports: COMPONENTS
})
export class EllipsisModule {}
2 changes: 1 addition & 1 deletion packages/abc/ellipsis/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ When the text is too long, the Ellipsis automatically shortens it according to i

## API

### ellipsis
### ellipsis:standalone

| Property | Description | Type | Default |
|----------|-------------|------|---------|
Expand Down
2 changes: 1 addition & 1 deletion packages/abc/ellipsis/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module: import { EllipsisModule } from '@delon/abc/ellipsis';

## API

### ellipsis
### ellipsis:standalone

| 成员 | 说明 | 类型 | 默认值 |
|----|----|----|-----|
Expand Down

0 comments on commit 3fefbc3

Please sign in to comment.