-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2073 from zyfra/feat/release-4-4-0
chore: release 4.4.0
- Loading branch information
Showing
96 changed files
with
2,911 additions
and
258 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
35 changes: 35 additions & 0 deletions
35
.../components/input/input-tree-select/examples/i18n/tree-select-i18n-example.component.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,35 @@ | ||
<prizm-input-layout label="Validators"> | ||
<prizm-input-tree-select | ||
#input | ||
[stringify]="stringify" | ||
[searchable]="true" | ||
[searchMatcher]="searchMatcher" | ||
[getChildren]="getChildren" | ||
[formControl]="control" | ||
emptyListTemplate="Ничего не найдено (из переменной)" | ||
> | ||
<prizm-data-list-wrapper *prizmDataList> | ||
<ng-container *ngFor="let arrItem of items"> | ||
<prizm-input-tree-select-item *prizmInputTreeSelectItem="arrItem; let item = item"> | ||
<div class="value"> | ||
{{ item.value }} | ||
</div> | ||
</prizm-input-tree-select-item> | ||
</ng-container> | ||
</prizm-data-list-wrapper> | ||
</prizm-input-tree-select> | ||
</prizm-input-layout> | ||
|
||
<br /> | ||
<br /> | ||
<div> | ||
<button (click)="setDefaultValue()" prizmButton> | ||
Set default value: <b>{{ items[0]?.value }}</b> | ||
</button> | ||
</div> | ||
|
||
<br /> | ||
<br /> | ||
<div>Current value: {{ control.value?.value }}</div> | ||
<div>Touched: {{ control.touched }}</div> | ||
<div>Dirty: {{ control.dirty }}</div> |
87 changes: 87 additions & 0 deletions
87
...pp/components/input/input-tree-select/examples/i18n/tree-select-i18n-example.component.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,87 @@ | ||
import { Component } from '@angular/core'; | ||
import { UntypedFormControl, Validators } from '@angular/forms'; | ||
import { PRIZM_LANGUAGE, PRIZM_RUSSIAN_LANGUAGE } from '@prizm-ui/i18n'; | ||
import { of } from 'rxjs'; | ||
|
||
type TreeSelectItem = { | ||
value: string; | ||
children?: TreeSelectItem[]; | ||
}; | ||
|
||
@Component({ | ||
selector: 'prizm-tree-select-i18n-example', | ||
templateUrl: './tree-select-i18n-example.component.html', | ||
styles: [ | ||
` | ||
.box { | ||
display: flex; | ||
gap: 1rem; | ||
} | ||
`, | ||
], | ||
providers: [ | ||
/** INFO: you can change from dictionary as here | ||
* or also you can pass param | ||
* searchLabel OR emptyListTemplate | ||
* */ | ||
{ | ||
provide: PRIZM_LANGUAGE, | ||
useValue: of({ | ||
...PRIZM_RUSSIAN_LANGUAGE, | ||
search: 'поиск (из словаря)', | ||
}), | ||
}, | ||
], | ||
}) | ||
export class PrizmTreeSelectI18nExampleComponent { | ||
readonly items: TreeSelectItem[] = [ | ||
{ | ||
value: 'One', | ||
}, | ||
{ | ||
value: 'Two', | ||
children: [ | ||
{ | ||
value: 'first in two', | ||
children: [ | ||
{ | ||
value: 'first in first in two', | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 'second in two', | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 'Three', | ||
children: [ | ||
{ | ||
value: 'first in first in Three', | ||
}, | ||
{ | ||
value: 'second in first in Three', | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 'Very long text with a lot of characters and spaces and other stuff and things', | ||
}, | ||
]; | ||
public value = this.items[0]; | ||
readonly control = new UntypedFormControl(this.items[1], [Validators.required]); | ||
|
||
public stringify(item: TreeSelectItem | null): string { | ||
return item?.value ?? ''; | ||
} | ||
public getChildren(item: TreeSelectItem): TreeSelectItem[] { | ||
return item.children ?? []; | ||
} | ||
public searchMatcher(search: string, item: TreeSelectItem): boolean { | ||
return item.value.toLowerCase().includes(search.toLowerCase()); | ||
} | ||
public setDefaultValue(): void { | ||
this.control.setValue(this.items[0], { emitEvent: false }); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...input/input-tree-select/examples/projection/tree-select-projection-example.component.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,31 @@ | ||
<prizm-input-layout label="Projection"> | ||
<prizm-input-tree-select #input [stringify]="stringify" [getChildren]="getChildren" [formControl]="control"> | ||
<prizm-data-list-wrapper *prizmDataList> | ||
<ng-container *ngFor="let arrItem of items"> | ||
<prizm-input-tree-select-item | ||
*prizmInputTreeSelectItem="arrItem; let item = item" | ||
[prizmHintOnOverflow]="item.value" | ||
[prizmHintOnOverflowEl]="host" | ||
> | ||
<div class="value" #host> | ||
{{ item.value }} | ||
</div> | ||
</prizm-input-tree-select-item> | ||
</ng-container> | ||
</prizm-data-list-wrapper> | ||
</prizm-input-tree-select> | ||
</prizm-input-layout> | ||
|
||
<br /> | ||
<br /> | ||
<div> | ||
<button (click)="setDefaultValue()" prizmButton> | ||
Set default value: <b>{{ items[0]?.value }}</b> | ||
</button> | ||
</div> | ||
|
||
<br /> | ||
<br /> | ||
<div>Current value: {{ control.value?.value }}</div> | ||
<div>Touched: {{ control.touched }}</div> | ||
<div>Dirty: {{ control.dirty }}</div> |
76 changes: 76 additions & 0 deletions
76
...s/input/input-tree-select/examples/projection/tree-select-projection-example.component.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,76 @@ | ||
import { Component } from '@angular/core'; | ||
import { UntypedFormControl, Validators } from '@angular/forms'; | ||
|
||
type TreeSelectItem = { | ||
value: string; | ||
children?: TreeSelectItem[]; | ||
}; | ||
|
||
@Component({ | ||
selector: 'prizm-tree-select-projection-example', | ||
templateUrl: './tree-select-projection-example.component.html', | ||
styles: [ | ||
` | ||
.box { | ||
display: flex; | ||
gap: 1rem; | ||
} | ||
.value { | ||
overflow: hidden; | ||
max-width: 100%; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
} | ||
`, | ||
], | ||
}) | ||
export class PrizmTreeSelectProjectionExampleComponent { | ||
readonly items: TreeSelectItem[] = [ | ||
{ | ||
value: 'One', | ||
}, | ||
{ | ||
value: 'Two', | ||
children: [ | ||
{ | ||
value: 'first in two', | ||
children: [ | ||
{ | ||
value: 'first in first in two', | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 'second in two', | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 'Three', | ||
children: [ | ||
{ | ||
value: 'first in first in Three', | ||
}, | ||
{ | ||
value: 'second in first in Three', | ||
}, | ||
], | ||
}, | ||
{ | ||
value: 'Very long text with a lot of characters and spaces and other stuff and things', | ||
}, | ||
]; | ||
public value = this.items[0]; | ||
readonly control = new UntypedFormControl(this.items[1], [Validators.required]); | ||
|
||
public stringify(item: TreeSelectItem | null): string { | ||
return item?.value ?? ''; | ||
} | ||
public getChildren(item: TreeSelectItem): TreeSelectItem[] { | ||
return item.children ?? []; | ||
} | ||
public setDefaultValue(): void { | ||
this.control.setValue(this.items[0], { emitEvent: false }); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...ponents/input/input-tree-select/examples/search/tree-select-search-example.component.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 @@ | ||
<prizm-input-layout label="Validators"> | ||
<prizm-input-tree-select | ||
#input | ||
[stringify]="stringify" | ||
[searchable]="true" | ||
[searchMatcher]="searchMatcher" | ||
[getChildren]="getChildren" | ||
[formControl]="control" | ||
> | ||
<prizm-data-list-wrapper *prizmDataList> | ||
<ng-container *ngFor="let arrItem of items"> | ||
<prizm-input-tree-select-item *prizmInputTreeSelectItem="arrItem; let item = item"> | ||
<div class="value"> | ||
{{ item.value }} | ||
</div> | ||
</prizm-input-tree-select-item> | ||
</ng-container> | ||
</prizm-data-list-wrapper> | ||
</prizm-input-tree-select> | ||
</prizm-input-layout> | ||
|
||
<br /> | ||
<br /> | ||
<div> | ||
<button (click)="setDefaultValue()" prizmButton> | ||
Set default value: <b>{{ items[0]?.value }}</b> | ||
</button> | ||
</div> | ||
|
||
<br /> | ||
<br /> | ||
<div>Current value: {{ control.value?.value }}</div> | ||
<div>Touched: {{ control.touched }}</div> | ||
<div>Dirty: {{ control.dirty }}</div> |
Oops, something went wrong.