@kris701/ez-ui 1.2.17 → 1.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/kris701-ez-ui.mjs +123 -38
- package/fesm2022/kris701-ez-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/kris701-ez-ui.d.ts +10 -2
|
@@ -19,7 +19,8 @@ import * as i4$2 from '@taiga-ui/layout';
|
|
|
19
19
|
import { TuiHeader, TuiElasticContainer, TuiBlockStatus, TuiNavigation, TuiAsideGroupComponent } from '@taiga-ui/layout';
|
|
20
20
|
import { marked } from 'marked';
|
|
21
21
|
import Compressor from 'compressorjs';
|
|
22
|
-
import
|
|
22
|
+
import { TuiAutoFocus } from '@taiga-ui/cdk';
|
|
23
|
+
import * as i8 from '@taiga-ui/cdk/directives/item';
|
|
23
24
|
import * as i3$2 from '@taiga-ui/addon-table';
|
|
24
25
|
import { TuiTablePagination, TuiTable } from '@taiga-ui/addon-table';
|
|
25
26
|
import { v4 } from 'uuid';
|
|
@@ -2948,6 +2949,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
2948
2949
|
}] } });
|
|
2949
2950
|
|
|
2950
2951
|
class EzUIMultiSelect {
|
|
2952
|
+
itemTemplate;
|
|
2951
2953
|
icon = '';
|
|
2952
2954
|
label = '';
|
|
2953
2955
|
size = 'm';
|
|
@@ -2957,9 +2959,9 @@ class EzUIMultiSelect {
|
|
|
2957
2959
|
disabled = false;
|
|
2958
2960
|
selected = undefined;
|
|
2959
2961
|
selectedChange = new EventEmitter();
|
|
2960
|
-
appearanceMap = {
|
|
2961
|
-
|
|
2962
|
-
|
|
2962
|
+
appearanceMap = {};
|
|
2963
|
+
enableSearch = false;
|
|
2964
|
+
searchValue = "";
|
|
2963
2965
|
ngOnChanges(changes) {
|
|
2964
2966
|
if (changes['selected'] && changes['selected'].currentValue != changes['selected'].previousValue) {
|
|
2965
2967
|
this.selected = changes['selected'].currentValue;
|
|
@@ -2981,26 +2983,38 @@ class EzUIMultiSelect {
|
|
|
2981
2983
|
return item[this.optionValue];
|
|
2982
2984
|
}
|
|
2983
2985
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUIMultiSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2984
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUIMultiSelect, isStandalone: true, selector: "ezui-multiselect", inputs: { icon: "icon", label: "label", size: "size", optionLabel: "optionLabel", optionValue: "optionValue", options: "options", disabled: "disabled", selected: "selected", appearanceMap: "appearanceMap" }, outputs: { selectedChange: "selectedChange" }, usesOnChanges: true, ngImport: i0, template: `
|
|
2986
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUIMultiSelect, isStandalone: true, selector: "ezui-multiselect", inputs: { icon: "icon", label: "label", size: "size", optionLabel: "optionLabel", optionValue: "optionValue", options: "options", disabled: "disabled", selected: "selected", appearanceMap: "appearanceMap", enableSearch: "enableSearch" }, outputs: { selectedChange: "selectedChange" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: ["itemTemplate"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
2985
2987
|
<tui-textfield multi tuiChevron [stringify]="stringify" [tuiTextfieldSize]="size" [iconStart]="icon">
|
|
2986
|
-
@if(label != ''){
|
|
2988
|
+
@if(label != '' && size != 's'){
|
|
2987
2989
|
<label tuiLabel>{{label}}</label>
|
|
2988
2990
|
}
|
|
2989
|
-
<input tuiInputChip tuiSelectLike [(ngModel)]="selected" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
|
|
2991
|
+
<input tuiInputChip tuiSelectLike [(ngModel)]="selected" [placeholder]="size == 's' ? label : ''" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
|
|
2990
2992
|
<tui-input-chip
|
|
2991
2993
|
*tuiItem="let context"
|
|
2992
2994
|
[appearance]="appearanceMap[context.item] ? appearanceMap[context.item] : 'neutral'"/>
|
|
2993
2995
|
<tui-data-list *tuiDropdown tuiMultiSelectGroup >
|
|
2996
|
+
@if(enableSearch){
|
|
2997
|
+
<tui-textfield tuiTextfieldSize="s" iconStart="search" (click)="field.focus()">
|
|
2998
|
+
<input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue"/>
|
|
2999
|
+
</tui-textfield>
|
|
3000
|
+
}
|
|
2994
3001
|
@for (item of options; track getOptionValue(item)) {
|
|
2995
|
-
@let value = getOptionValue(item);
|
|
2996
3002
|
@let label = getOptionLabel(item);
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3003
|
+
@if(!enableSearch || (searchValue == '' || label.includes(searchValue))){
|
|
3004
|
+
@let value = getOptionValue(item);
|
|
3005
|
+
<button tuiOption [value]="value" >
|
|
3006
|
+
@if(itemTemplate){
|
|
3007
|
+
<ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: item }"></ng-container>
|
|
3008
|
+
}
|
|
3009
|
+
@else {
|
|
3010
|
+
<span tuiChip size="xs" [appearance]="appearanceMap[value] ? appearanceMap[value] : 'neutral'">{{label}}</span>
|
|
3011
|
+
}
|
|
3012
|
+
</button>
|
|
3013
|
+
}
|
|
3000
3014
|
}
|
|
3001
3015
|
</tui-data-list>
|
|
3002
3016
|
</tui-textfield>
|
|
3003
|
-
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4$1.TuiMultiSelectGroupDirective, selector: "[tuiMultiSelectGroup]" }, { kind: "directive", type: i2.TuiLabel, selector: "label[tuiLabel]" }, { kind: "directive", type: i3.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: i4.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "component", type: i3$1.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i3$1.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i3$1.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "directive", type:
|
|
3017
|
+
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4$1.TuiMultiSelectGroupDirective, selector: "[tuiMultiSelectGroup]" }, { kind: "directive", type: i2.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler", "invalid", "tuiAppearanceFocus", "tuiAppearanceState"] }, { kind: "directive", type: i3.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: i4.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "component", type: i3$1.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i3$1.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i3$1.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "directive", type: i8.TuiItem, selector: "[tuiItem]" }, { kind: "component", type: i3$1.TuiTextfieldMultiComponent, selector: "tui-textfield[multi]", inputs: ["rows"] }, { kind: "directive", type: i4$1.TuiInputChipDirective, selector: "input[tuiInputChip]", inputs: ["separator", "unique"] }, { kind: "component", type: i4$1.TuiInputChipComponent, selector: "tui-input-chip", inputs: ["editable"] }, { kind: "directive", type: TuiSelectLike, selector: "[tuiSelectLike]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: TuiChip, selector: "[tuiChip]", inputs: ["size"] }, { kind: "directive", type: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { kind: "directive", type: i3$1.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "readonly", "invalid", "focused", "state"] }] });
|
|
3004
3018
|
}
|
|
3005
3019
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUIMultiSelect, decorators: [{
|
|
3006
3020
|
type: Component,
|
|
@@ -3016,28 +3030,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
3016
3030
|
TuiMultiSelect,
|
|
3017
3031
|
TuiDropdown,
|
|
3018
3032
|
TuiChevron,
|
|
3019
|
-
TuiChip
|
|
3033
|
+
TuiChip,
|
|
3034
|
+
TuiAutoFocus,
|
|
3035
|
+
TuiInput
|
|
3020
3036
|
], template: `
|
|
3021
3037
|
<tui-textfield multi tuiChevron [stringify]="stringify" [tuiTextfieldSize]="size" [iconStart]="icon">
|
|
3022
|
-
@if(label != ''){
|
|
3038
|
+
@if(label != '' && size != 's'){
|
|
3023
3039
|
<label tuiLabel>{{label}}</label>
|
|
3024
3040
|
}
|
|
3025
|
-
<input tuiInputChip tuiSelectLike [(ngModel)]="selected" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
|
|
3041
|
+
<input tuiInputChip tuiSelectLike [(ngModel)]="selected" [placeholder]="size == 's' ? label : ''" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
|
|
3026
3042
|
<tui-input-chip
|
|
3027
3043
|
*tuiItem="let context"
|
|
3028
3044
|
[appearance]="appearanceMap[context.item] ? appearanceMap[context.item] : 'neutral'"/>
|
|
3029
3045
|
<tui-data-list *tuiDropdown tuiMultiSelectGroup >
|
|
3046
|
+
@if(enableSearch){
|
|
3047
|
+
<tui-textfield tuiTextfieldSize="s" iconStart="search" (click)="field.focus()">
|
|
3048
|
+
<input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue"/>
|
|
3049
|
+
</tui-textfield>
|
|
3050
|
+
}
|
|
3030
3051
|
@for (item of options; track getOptionValue(item)) {
|
|
3031
|
-
@let value = getOptionValue(item);
|
|
3032
3052
|
@let label = getOptionLabel(item);
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3053
|
+
@if(!enableSearch || (searchValue == '' || label.includes(searchValue))){
|
|
3054
|
+
@let value = getOptionValue(item);
|
|
3055
|
+
<button tuiOption [value]="value" >
|
|
3056
|
+
@if(itemTemplate){
|
|
3057
|
+
<ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: item }"></ng-container>
|
|
3058
|
+
}
|
|
3059
|
+
@else {
|
|
3060
|
+
<span tuiChip size="xs" [appearance]="appearanceMap[value] ? appearanceMap[value] : 'neutral'">{{label}}</span>
|
|
3061
|
+
}
|
|
3062
|
+
</button>
|
|
3063
|
+
}
|
|
3036
3064
|
}
|
|
3037
3065
|
</tui-data-list>
|
|
3038
3066
|
</tui-textfield>
|
|
3039
3067
|
` }]
|
|
3040
|
-
}], propDecorators: {
|
|
3068
|
+
}], propDecorators: { itemTemplate: [{
|
|
3069
|
+
type: ContentChild,
|
|
3070
|
+
args: ['itemTemplate', { static: false }]
|
|
3071
|
+
}], icon: [{
|
|
3041
3072
|
type: Input
|
|
3042
3073
|
}], label: [{
|
|
3043
3074
|
type: Input
|
|
@@ -3057,6 +3088,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
3057
3088
|
type: Output
|
|
3058
3089
|
}], appearanceMap: [{
|
|
3059
3090
|
type: Input
|
|
3091
|
+
}], enableSearch: [{
|
|
3092
|
+
type: Input
|
|
3060
3093
|
}] } });
|
|
3061
3094
|
|
|
3062
3095
|
class EzUINumberInput {
|
|
@@ -3171,6 +3204,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
3171
3204
|
}] } });
|
|
3172
3205
|
|
|
3173
3206
|
class EzUISelect {
|
|
3207
|
+
selectedTemplate;
|
|
3208
|
+
itemTemplate;
|
|
3174
3209
|
icon = '';
|
|
3175
3210
|
label = '';
|
|
3176
3211
|
size = 'm';
|
|
@@ -3181,11 +3216,16 @@ class EzUISelect {
|
|
|
3181
3216
|
selected = undefined;
|
|
3182
3217
|
selectedChange = new EventEmitter();
|
|
3183
3218
|
appearanceMap = {};
|
|
3219
|
+
enableSearch = false;
|
|
3220
|
+
searchValue = "";
|
|
3184
3221
|
ngOnChanges(changes) {
|
|
3185
3222
|
if (changes['selected'] && changes['selected'].currentValue != changes['selected'].previousValue) {
|
|
3186
3223
|
this.selected = changes['selected'].currentValue;
|
|
3187
3224
|
}
|
|
3188
3225
|
}
|
|
3226
|
+
getSelectedItem(value) {
|
|
3227
|
+
return this.options.find((item) => this.getOptionValue(item) === value);
|
|
3228
|
+
}
|
|
3189
3229
|
stringify = (value) => this.getOptionLabel(this.options.find((item) => this.getOptionValue(item) === value));
|
|
3190
3230
|
getOptionLabel(item) {
|
|
3191
3231
|
if (!item)
|
|
@@ -3202,27 +3242,45 @@ class EzUISelect {
|
|
|
3202
3242
|
return item[this.optionValue];
|
|
3203
3243
|
}
|
|
3204
3244
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUISelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3205
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUISelect, isStandalone: true, selector: "ezui-select", inputs: { icon: "icon", label: "label", size: "size", optionLabel: "optionLabel", optionValue: "optionValue", options: "options", disabled: "disabled", selected: "selected", appearanceMap: "appearanceMap" }, outputs: { selectedChange: "selectedChange" }, usesOnChanges: true, ngImport: i0, template: `
|
|
3245
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUISelect, isStandalone: true, selector: "ezui-select", inputs: { icon: "icon", label: "label", size: "size", optionLabel: "optionLabel", optionValue: "optionValue", options: "options", disabled: "disabled", selected: "selected", appearanceMap: "appearanceMap", enableSearch: "enableSearch" }, outputs: { selectedChange: "selectedChange" }, queries: [{ propertyName: "selectedTemplate", first: true, predicate: ["selectedTemplate"], descendants: true }, { propertyName: "itemTemplate", first: true, predicate: ["itemTemplate"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
3206
3246
|
<tui-textfield tuiChevron [content]="content" [tuiTextfieldSize]="size" [iconStart]="icon">
|
|
3207
|
-
@if(label != ''){
|
|
3247
|
+
@if(label != '' && size != 's'){
|
|
3208
3248
|
<label tuiLabel>{{label}}</label>
|
|
3209
3249
|
}
|
|
3210
|
-
<input tuiSelect [(ngModel)]="selected" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
|
|
3250
|
+
<input tuiSelect [(ngModel)]="selected" [placeholder]="size == 's' ? label : ''" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
|
|
3211
3251
|
<tui-data-list *tuiDropdown >
|
|
3252
|
+
@if(enableSearch){
|
|
3253
|
+
<tui-textfield tuiTextfieldSize="s" iconStart="search">
|
|
3254
|
+
<input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue" (click)="field.focus()"/>
|
|
3255
|
+
</tui-textfield>
|
|
3256
|
+
}
|
|
3212
3257
|
@for (item of options; track getOptionValue(item)) {
|
|
3213
|
-
@let value = getOptionValue(item);
|
|
3214
3258
|
@let label = getOptionLabel(item);
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3259
|
+
@if(!enableSearch || (searchValue == '' || label.includes(searchValue))){
|
|
3260
|
+
|
|
3261
|
+
@let value = getOptionValue(item);
|
|
3262
|
+
<button tuiOption [value]="value" >
|
|
3263
|
+
@if(itemTemplate){
|
|
3264
|
+
<ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: item }"></ng-container>
|
|
3265
|
+
}
|
|
3266
|
+
@else {
|
|
3267
|
+
<span tuiChip size="xs" [appearance]="appearanceMap[value]">{{label}}</span>
|
|
3268
|
+
}
|
|
3269
|
+
</button>
|
|
3270
|
+
}
|
|
3218
3271
|
}
|
|
3219
3272
|
</tui-data-list>
|
|
3220
3273
|
</tui-textfield>
|
|
3221
3274
|
|
|
3222
3275
|
<ng-template #content>
|
|
3223
|
-
|
|
3276
|
+
@if(selectedTemplate){
|
|
3277
|
+
<ng-container [ngTemplateOutlet]="selectedTemplate" [ngTemplateOutletContext]="{ $implicit: getSelectedItem(selected) }"></ng-container>
|
|
3278
|
+
}
|
|
3279
|
+
@else {
|
|
3280
|
+
<span tuiChip [size]="label != '' ? 'xxs' : 'xs'" [appearance]="appearanceMap[selected]">{{stringify(selected)}}</span>
|
|
3281
|
+
}
|
|
3224
3282
|
</ng-template>
|
|
3225
|
-
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "directive", type: i2.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler", "invalid", "tuiAppearanceFocus", "tuiAppearanceState"] }, { kind: "directive", type: i3.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: i4.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "component", type: i3$1.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i3$1.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i3$1.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: TuiChip, selector: "[tuiChip]", inputs: ["size"] }] });
|
|
3283
|
+
`, isInline: true, styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i4$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "directive", type: i2.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler", "invalid", "tuiAppearanceFocus", "tuiAppearanceState"] }, { kind: "directive", type: i3.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: i4.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "component", type: i3$1.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i3$1.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i3$1.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: i3$1.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "readonly", "invalid", "focused", "state"] }, { kind: "directive", type: TuiChip, selector: "[tuiChip]", inputs: ["size"] }, { kind: "directive", type: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }] });
|
|
3226
3284
|
}
|
|
3227
3285
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUISelect, decorators: [{
|
|
3228
3286
|
type: Component,
|
|
@@ -3235,29 +3293,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
3235
3293
|
TuiDropdown,
|
|
3236
3294
|
TuiChevron,
|
|
3237
3295
|
TuiInput,
|
|
3238
|
-
TuiChip
|
|
3296
|
+
TuiChip,
|
|
3297
|
+
TuiAutoFocus
|
|
3239
3298
|
], template: `
|
|
3240
3299
|
<tui-textfield tuiChevron [content]="content" [tuiTextfieldSize]="size" [iconStart]="icon">
|
|
3241
|
-
@if(label != ''){
|
|
3300
|
+
@if(label != '' && size != 's'){
|
|
3242
3301
|
<label tuiLabel>{{label}}</label>
|
|
3243
3302
|
}
|
|
3244
|
-
<input tuiSelect [(ngModel)]="selected" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
|
|
3303
|
+
<input tuiSelect [(ngModel)]="selected" [placeholder]="size == 's' ? label : ''" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
|
|
3245
3304
|
<tui-data-list *tuiDropdown >
|
|
3305
|
+
@if(enableSearch){
|
|
3306
|
+
<tui-textfield tuiTextfieldSize="s" iconStart="search">
|
|
3307
|
+
<input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue" (click)="field.focus()"/>
|
|
3308
|
+
</tui-textfield>
|
|
3309
|
+
}
|
|
3246
3310
|
@for (item of options; track getOptionValue(item)) {
|
|
3247
|
-
@let value = getOptionValue(item);
|
|
3248
3311
|
@let label = getOptionLabel(item);
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3312
|
+
@if(!enableSearch || (searchValue == '' || label.includes(searchValue))){
|
|
3313
|
+
|
|
3314
|
+
@let value = getOptionValue(item);
|
|
3315
|
+
<button tuiOption [value]="value" >
|
|
3316
|
+
@if(itemTemplate){
|
|
3317
|
+
<ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: item }"></ng-container>
|
|
3318
|
+
}
|
|
3319
|
+
@else {
|
|
3320
|
+
<span tuiChip size="xs" [appearance]="appearanceMap[value]">{{label}}</span>
|
|
3321
|
+
}
|
|
3322
|
+
</button>
|
|
3323
|
+
}
|
|
3252
3324
|
}
|
|
3253
3325
|
</tui-data-list>
|
|
3254
3326
|
</tui-textfield>
|
|
3255
3327
|
|
|
3256
3328
|
<ng-template #content>
|
|
3257
|
-
|
|
3329
|
+
@if(selectedTemplate){
|
|
3330
|
+
<ng-container [ngTemplateOutlet]="selectedTemplate" [ngTemplateOutletContext]="{ $implicit: getSelectedItem(selected) }"></ng-container>
|
|
3331
|
+
}
|
|
3332
|
+
@else {
|
|
3333
|
+
<span tuiChip [size]="label != '' ? 'xxs' : 'xs'" [appearance]="appearanceMap[selected]">{{stringify(selected)}}</span>
|
|
3334
|
+
}
|
|
3258
3335
|
</ng-template>
|
|
3259
3336
|
` }]
|
|
3260
|
-
}], propDecorators: {
|
|
3337
|
+
}], propDecorators: { selectedTemplate: [{
|
|
3338
|
+
type: ContentChild,
|
|
3339
|
+
args: ['selectedTemplate', { static: false }]
|
|
3340
|
+
}], itemTemplate: [{
|
|
3341
|
+
type: ContentChild,
|
|
3342
|
+
args: ['itemTemplate', { static: false }]
|
|
3343
|
+
}], icon: [{
|
|
3261
3344
|
type: Input
|
|
3262
3345
|
}], label: [{
|
|
3263
3346
|
type: Input
|
|
@@ -3277,6 +3360,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
3277
3360
|
type: Output
|
|
3278
3361
|
}], appearanceMap: [{
|
|
3279
3362
|
type: Input
|
|
3363
|
+
}], enableSearch: [{
|
|
3364
|
+
type: Input
|
|
3280
3365
|
}] } });
|
|
3281
3366
|
|
|
3282
3367
|
class EzUIShowMoreText {
|