@kris701/ez-ui 1.2.19 → 1.3.0

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.
@@ -7,7 +7,7 @@ import { FormsModule } from '@angular/forms';
7
7
  import * as i3$1 from '@taiga-ui/core';
8
8
  import { TuiIcon, TuiInput, TuiButton, TuiTitle, TuiLoader, TuiDialog, TuiDropdown, TuiOption, TuiGroup, TuiScrollbar, TuiSelectLike, TuiDataList, TuiTextfield, TuiLink, TuiHint, TuiCheckbox, TUI_DARK_MODE, TuiRoot } from '@taiga-ui/core';
9
9
  import * as i4$1 from '@taiga-ui/kit';
10
- import { TuiBlock, TuiSwitch, TuiInputDate, TuiInputDateTime, TuiFiles, TuiChevron, TuiTextarea, TuiChip, TuiMultiSelect, TuiInputNumber, TuiInputChip, TuiPassword, TuiSelect, TuiBadge, TuiStatus, TuiDataListWrapper, TuiBadgeNotification, TuiBadgedContent, tuiCreateDefaultDayRangePeriods, TuiButtonSelect, TuiInputDateDirective, TuiCalendarRange, TuiStringifyContentPipe, TUI_CONFIRM } from '@taiga-ui/kit';
10
+ import { TuiBlock, TuiSwitch, TuiInputDate, TuiInputDateTime, TuiFiles, TuiChevron, TuiTextarea, TuiChip, TuiMultiSelect, TuiInputChip, TuiTree, TuiInputNumber, TuiPassword, TuiSelect, TuiBadge, TuiStatus, TuiDataListWrapper, TuiBadgeNotification, TuiBadgedContent, tuiCreateDefaultDayRangePeriods, TuiButtonSelect, TuiInputDateDirective, TuiCalendarRange, TuiStringifyContentPipe, TUI_CONFIRM } from '@taiga-ui/kit';
11
11
  import * as i3$3 from '@taiga-ui/addon-mobile';
12
12
  import { TuiDropdownSheet } from '@taiga-ui/addon-mobile';
13
13
  import { TuiDay, TuiTime, TuiDayRange } from '@taiga-ui/cdk/date-time';
@@ -20,7 +20,7 @@ import { TuiHeader, TuiElasticContainer, TuiBlockStatus, TuiNavigation, TuiAside
20
20
  import { marked } from 'marked';
21
21
  import Compressor from 'compressorjs';
22
22
  import { TuiAutoFocus } from '@taiga-ui/cdk';
23
- import * as i8 from '@taiga-ui/cdk/directives/item';
23
+ import * as i5 from '@taiga-ui/cdk/directives/item';
24
24
  import * as i3$2 from '@taiga-ui/addon-table';
25
25
  import { TuiTablePagination, TuiTable } from '@taiga-ui/addon-table';
26
26
  import { v4 } from 'uuid';
@@ -2994,8 +2994,8 @@ class EzUIMultiSelect {
2994
2994
  [appearance]="appearanceMap[context.item] ? appearanceMap[context.item] : 'neutral'"/>
2995
2995
  <tui-data-list *tuiDropdown tuiMultiSelectGroup >
2996
2996
  @if(enableSearch){
2997
- <tui-textfield tuiTextfieldSize="s" iconStart="search" (click)="field.focus()">
2998
- <input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue"/>
2997
+ <tui-textfield tuiTextfieldSize="s" iconStart="search">
2998
+ <input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue" (click)="field.focus()"/>
2999
2999
  </tui-textfield>
3000
3000
  }
3001
3001
  @for (item of options; track getOptionValue(item)) {
@@ -3014,7 +3014,7 @@ class EzUIMultiSelect {
3014
3014
  }
3015
3015
  </tui-data-list>
3016
3016
  </tui-textfield>
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"] }] });
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: "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: i5.TuiItem, selector: "[tuiItem]" }, { kind: "directive", type: i2.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler", "invalid", "tuiAppearanceFocus", "tuiAppearanceState"] }, { kind: "directive", type: i3$1.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "component", type: i3$1.TuiTextfieldMultiComponent, selector: "tui-textfield[multi]", inputs: ["rows"] }, { kind: "directive", type: i4.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { 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"] }] });
3018
3018
  }
3019
3019
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUIMultiSelect, decorators: [{
3020
3020
  type: Component,
@@ -3022,7 +3022,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
3022
3022
  FormsModule,
3023
3023
  CommonModule,
3024
3024
  TuiMultiSelect,
3025
- TuiInputNumber,
3026
3025
  TuiDataList,
3027
3026
  TuiTextfield,
3028
3027
  TuiInputChip,
@@ -3044,8 +3043,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
3044
3043
  [appearance]="appearanceMap[context.item] ? appearanceMap[context.item] : 'neutral'"/>
3045
3044
  <tui-data-list *tuiDropdown tuiMultiSelectGroup >
3046
3045
  @if(enableSearch){
3047
- <tui-textfield tuiTextfieldSize="s" iconStart="search" (click)="field.focus()">
3048
- <input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue"/>
3046
+ <tui-textfield tuiTextfieldSize="s" iconStart="search">
3047
+ <input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue" (click)="field.focus()"/>
3049
3048
  </tui-textfield>
3050
3049
  }
3051
3050
  @for (item of options; track getOptionValue(item)) {
@@ -3092,6 +3091,214 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
3092
3091
  type: Input
3093
3092
  }] } });
3094
3093
 
3094
+ class EzUITreeMultiSelect {
3095
+ itemTemplate;
3096
+ handler = (item) => item.children || [];
3097
+ icon = '';
3098
+ label = '';
3099
+ size = 'm';
3100
+ options = [];
3101
+ disabled = false;
3102
+ selected = undefined;
3103
+ selectedChange = new EventEmitter();
3104
+ enableSearch = false;
3105
+ searchValue = signal("", /* @ts-ignore */
3106
+ ...(ngDevMode ? [{ debugName: "searchValue" }] : /* istanbul ignore next */ []));
3107
+ map = new Map();
3108
+ ngOnChanges(changes) {
3109
+ if (changes['selected'] && changes['selected'].currentValue != changes['selected'].previousValue) {
3110
+ this.selected = changes['selected'].currentValue;
3111
+ }
3112
+ }
3113
+ stringify = (value) => value.label;
3114
+ expandAll() {
3115
+ for (let option of this.options)
3116
+ this.expandAllRec(option);
3117
+ }
3118
+ expandAllRec(from) {
3119
+ this.map.set(from, true);
3120
+ if (from.children && from.children.length > 0)
3121
+ for (let child of from.children)
3122
+ this.expandAllRec(child);
3123
+ }
3124
+ collapseAll() {
3125
+ for (let option of this.options)
3126
+ this.collapseAllRec(option);
3127
+ }
3128
+ collapseAllRec(from) {
3129
+ this.map.set(from, false);
3130
+ if (from.children && from.children.length > 0)
3131
+ for (let child of from.children)
3132
+ this.collapseAllRec(child);
3133
+ }
3134
+ searchChange() {
3135
+ let newMap = new Map();
3136
+ for (let option of this.options)
3137
+ this.expandSearchRec(option, newMap);
3138
+ this.map = newMap;
3139
+ }
3140
+ expandSearchRec(from, newMap) {
3141
+ let expanded = false;
3142
+ if (from.label.includes(this.searchValue())) {
3143
+ newMap.set(from, true);
3144
+ expanded = true;
3145
+ }
3146
+ if (from.children && from.children.length > 0) {
3147
+ for (let child of from.children) {
3148
+ if (this.expandSearchRec(child, newMap))
3149
+ expanded = true;
3150
+ }
3151
+ if (expanded)
3152
+ newMap.set(from, true);
3153
+ }
3154
+ return expanded;
3155
+ }
3156
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITreeMultiSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
3157
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUITreeMultiSelect, isStandalone: true, selector: "ezui-treemultiselect", inputs: { icon: "icon", label: "label", size: "size", options: "options", disabled: "disabled", selected: "selected", enableSearch: "enableSearch" }, outputs: { selectedChange: "selectedChange" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: ["itemTemplate"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
3158
+ <tui-textfield multi tuiChevron [stringify]="stringify" [tuiTextfieldSize]="size" [iconStart]="icon">
3159
+ @if(label != '' && size != 's'){
3160
+ <label tuiLabel>{{label}}</label>
3161
+ }
3162
+ <input tuiInputChip tuiSelectLike [(ngModel)]="selected" [placeholder]="size == 's' ? label : ''" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
3163
+ <tui-input-chip *tuiItem/>
3164
+ <tui-data-list *tuiDropdown tuiMultiSelectGroup >
3165
+ @if(enableSearch){
3166
+ <tui-textfield tuiTextfieldSize="s" iconStart="search" style="margin-bottom:5px">
3167
+ <input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue" (click)="field.focus()" (ngModelChange)="searchChange()"/>
3168
+ </tui-textfield>
3169
+ }
3170
+
3171
+ <div class="toolbar">
3172
+ <button tuiButton size="xs" appearance="flat" (click)="expandAll()">Expand All</button>
3173
+ <button tuiButton size="xs" appearance="flat" (click)="collapseAll()">Collapse All</button>
3174
+ </div>
3175
+
3176
+ @for(root of options; track root){
3177
+ <tui-tree
3178
+ [childrenHandler]="handler"
3179
+ [content]="treeContent"
3180
+ [tuiTreeController]="false"
3181
+ [value]="root"
3182
+ [map]="map"
3183
+ />
3184
+ }
3185
+ </tui-data-list>
3186
+ </tui-textfield>
3187
+
3188
+ <ng-template #treeContent let-node="node" let-value>
3189
+ <div class="wrapper">
3190
+ <button
3191
+ tuiOption
3192
+ [value]="value"
3193
+ [disabled]="value.selectable === false"
3194
+ [style.opacity]="!enableSearch || (searchValue() == '' || value.label.includes(searchValue())) ? (value.selectable === false ? 0.5 : 1) : 0.2"
3195
+ >
3196
+ @if(itemTemplate){
3197
+ <ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: value }"></ng-container>
3198
+ }
3199
+ @else {
3200
+ @if (value.icon) {
3201
+ <tui-icon class="t-icon" [icon]="value.icon"/>
3202
+ }
3203
+ {{ value.label }}
3204
+ }
3205
+ </button>
3206
+ </div>
3207
+ </ng-template>
3208
+ `, isInline: true, styles: [".toolbar{display:flex;flex-direction:row;gap:5px}.wrapper{display:flex;align-items:center;width:100%}.wrapper button{width:100%}.t-icon:before{font-size:1rem}\n"], 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: "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: i5.TuiItem, selector: "[tuiItem]" }, { kind: "directive", type: i2.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler", "invalid", "tuiAppearanceFocus", "tuiAppearanceState"] }, { kind: "directive", type: i3$1.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "component", type: i3$1.TuiTextfieldMultiComponent, selector: "tui-textfield[multi]", inputs: ["rows"] }, { kind: "directive", type: i4.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { 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: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { kind: "directive", type: i3$1.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "readonly", "invalid", "focused", "state"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],label[tuiButton],a[tuiIconButton],button[tuiIconButton],label[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: i4$1.TuiTreeComponent, selector: "tui-tree", inputs: ["value", "trackBy", "content"] }, { kind: "directive", type: i4$1.TuiTreeChildren, selector: "tui-tree[childrenHandler]", inputs: ["childrenHandler"] }, { kind: "directive", type: i4$1.TuiTreeControllerDirective, selector: "[tuiTreeController][map]", inputs: ["tuiTreeController", "map"], outputs: ["toggled"], exportAs: ["tuiTreeController"] }] });
3209
+ }
3210
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITreeMultiSelect, decorators: [{
3211
+ type: Component,
3212
+ args: [{ selector: 'ezui-treemultiselect', imports: [
3213
+ FormsModule,
3214
+ CommonModule,
3215
+ TuiMultiSelect,
3216
+ TuiDataList,
3217
+ TuiTextfield,
3218
+ TuiInputChip,
3219
+ TuiSelectLike,
3220
+ TuiMultiSelect,
3221
+ TuiDropdown,
3222
+ TuiChevron,
3223
+ TuiChip,
3224
+ TuiAutoFocus,
3225
+ TuiInput,
3226
+ TuiIcon,
3227
+ TuiButton,
3228
+ TuiTree
3229
+ ], template: `
3230
+ <tui-textfield multi tuiChevron [stringify]="stringify" [tuiTextfieldSize]="size" [iconStart]="icon">
3231
+ @if(label != '' && size != 's'){
3232
+ <label tuiLabel>{{label}}</label>
3233
+ }
3234
+ <input tuiInputChip tuiSelectLike [(ngModel)]="selected" [placeholder]="size == 's' ? label : ''" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
3235
+ <tui-input-chip *tuiItem/>
3236
+ <tui-data-list *tuiDropdown tuiMultiSelectGroup >
3237
+ @if(enableSearch){
3238
+ <tui-textfield tuiTextfieldSize="s" iconStart="search" style="margin-bottom:5px">
3239
+ <input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue" (click)="field.focus()" (ngModelChange)="searchChange()"/>
3240
+ </tui-textfield>
3241
+ }
3242
+
3243
+ <div class="toolbar">
3244
+ <button tuiButton size="xs" appearance="flat" (click)="expandAll()">Expand All</button>
3245
+ <button tuiButton size="xs" appearance="flat" (click)="collapseAll()">Collapse All</button>
3246
+ </div>
3247
+
3248
+ @for(root of options; track root){
3249
+ <tui-tree
3250
+ [childrenHandler]="handler"
3251
+ [content]="treeContent"
3252
+ [tuiTreeController]="false"
3253
+ [value]="root"
3254
+ [map]="map"
3255
+ />
3256
+ }
3257
+ </tui-data-list>
3258
+ </tui-textfield>
3259
+
3260
+ <ng-template #treeContent let-node="node" let-value>
3261
+ <div class="wrapper">
3262
+ <button
3263
+ tuiOption
3264
+ [value]="value"
3265
+ [disabled]="value.selectable === false"
3266
+ [style.opacity]="!enableSearch || (searchValue() == '' || value.label.includes(searchValue())) ? (value.selectable === false ? 0.5 : 1) : 0.2"
3267
+ >
3268
+ @if(itemTemplate){
3269
+ <ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: value }"></ng-container>
3270
+ }
3271
+ @else {
3272
+ @if (value.icon) {
3273
+ <tui-icon class="t-icon" [icon]="value.icon"/>
3274
+ }
3275
+ {{ value.label }}
3276
+ }
3277
+ </button>
3278
+ </div>
3279
+ </ng-template>
3280
+ `, styles: [".toolbar{display:flex;flex-direction:row;gap:5px}.wrapper{display:flex;align-items:center;width:100%}.wrapper button{width:100%}.t-icon:before{font-size:1rem}\n"] }]
3281
+ }], propDecorators: { itemTemplate: [{
3282
+ type: ContentChild,
3283
+ args: ['itemTemplate', { static: false }]
3284
+ }], icon: [{
3285
+ type: Input
3286
+ }], label: [{
3287
+ type: Input
3288
+ }], size: [{
3289
+ type: Input
3290
+ }], options: [{
3291
+ type: Input
3292
+ }], disabled: [{
3293
+ type: Input
3294
+ }], selected: [{
3295
+ type: Input
3296
+ }], selectedChange: [{
3297
+ type: Output
3298
+ }], enableSearch: [{
3299
+ type: Input
3300
+ }] } });
3301
+
3095
3302
  class EzUINumberInput {
3096
3303
  icon = '';
3097
3304
  label = '';
@@ -3256,7 +3463,7 @@ class EzUISelect {
3256
3463
  }
3257
3464
  @for (item of options; track getOptionValue(item)) {
3258
3465
  @let label = getOptionLabel(item);
3259
- @if(!enableSearch || (searchValue == '' || label.includes(searchValue))){
3466
+ @if(!enableSearch || (searchValue == '' || label.includes(searchValue))) {
3260
3467
 
3261
3468
  @let value = getOptionValue(item);
3262
3469
  <button tuiOption [value]="value" >
@@ -3309,7 +3516,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
3309
3516
  }
3310
3517
  @for (item of options; track getOptionValue(item)) {
3311
3518
  @let label = getOptionLabel(item);
3312
- @if(!enableSearch || (searchValue == '' || label.includes(searchValue))){
3519
+ @if(!enableSearch || (searchValue == '' || label.includes(searchValue))) {
3313
3520
 
3314
3521
  @let value = getOptionValue(item);
3315
3522
  <button tuiOption [value]="value" >
@@ -3364,6 +3571,229 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
3364
3571
  type: Input
3365
3572
  }] } });
3366
3573
 
3574
+ class EzUITreeSelect {
3575
+ selectedTemplate;
3576
+ itemTemplate;
3577
+ handler = (item) => item.children || [];
3578
+ icon = '';
3579
+ label = '';
3580
+ size = 'm';
3581
+ options = [];
3582
+ disabled = false;
3583
+ selected = undefined;
3584
+ selectedChange = new EventEmitter();
3585
+ enableSearch = false;
3586
+ searchValue = signal("", /* @ts-ignore */
3587
+ ...(ngDevMode ? [{ debugName: "searchValue" }] : /* istanbul ignore next */ []));
3588
+ map = new Map();
3589
+ ngOnChanges(changes) {
3590
+ if (changes['selected'] && changes['selected'].currentValue != changes['selected'].previousValue)
3591
+ this.selected = changes['selected'].currentValue;
3592
+ }
3593
+ expandAll() {
3594
+ for (let option of this.options)
3595
+ this.expandAllRec(option);
3596
+ }
3597
+ expandAllRec(from) {
3598
+ this.map.set(from, true);
3599
+ if (from.children && from.children.length > 0)
3600
+ for (let child of from.children)
3601
+ this.expandAllRec(child);
3602
+ }
3603
+ collapseAll() {
3604
+ for (let option of this.options)
3605
+ this.collapseAllRec(option);
3606
+ }
3607
+ collapseAllRec(from) {
3608
+ this.map.set(from, false);
3609
+ if (from.children && from.children.length > 0)
3610
+ for (let child of from.children)
3611
+ this.collapseAllRec(child);
3612
+ }
3613
+ searchChange() {
3614
+ let newMap = new Map();
3615
+ for (let option of this.options)
3616
+ this.expandSearchRec(option, newMap);
3617
+ this.map = newMap;
3618
+ }
3619
+ expandSearchRec(from, newMap) {
3620
+ let expanded = false;
3621
+ if (from.label.includes(this.searchValue())) {
3622
+ newMap.set(from, true);
3623
+ expanded = true;
3624
+ }
3625
+ if (from.children && from.children.length > 0) {
3626
+ for (let child of from.children) {
3627
+ if (this.expandSearchRec(child, newMap))
3628
+ expanded = true;
3629
+ }
3630
+ if (expanded)
3631
+ newMap.set(from, true);
3632
+ }
3633
+ return expanded;
3634
+ }
3635
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITreeSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
3636
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUITreeSelect, isStandalone: true, selector: "ezui-treeselect", inputs: { icon: "icon", label: "label", size: "size", options: "options", disabled: "disabled", selected: "selected", 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: `
3637
+ <tui-textfield tuiChevron [content]="content" [tuiTextfieldSize]="size" [iconStart]="icon">
3638
+ @if(label != '' && size != 's'){
3639
+ <label tuiLabel>{{label}}</label>
3640
+ }
3641
+ <input tuiSelect [(ngModel)]="selected" [placeholder]="size == 's' ? label : ''" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
3642
+ <tui-data-list *tuiDropdown >
3643
+ @if(enableSearch){
3644
+ <tui-textfield tuiTextfieldSize="s" iconStart="search" style="margin-bottom:5px">
3645
+ <input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue" (click)="field.focus()" (ngModelChange)="searchChange()"/>
3646
+ </tui-textfield>
3647
+ }
3648
+
3649
+ <div class="toolbar">
3650
+ <button tuiButton size="xs" appearance="flat" (click)="expandAll()">Expand All</button>
3651
+ <button tuiButton size="xs" appearance="flat" (click)="collapseAll()">Collapse All</button>
3652
+ </div>
3653
+
3654
+ @for(root of options; track root){
3655
+ <tui-tree
3656
+ [childrenHandler]="handler"
3657
+ [content]="treeContent"
3658
+ [tuiTreeController]="false"
3659
+ [value]="root"
3660
+ [map]="map"
3661
+ />
3662
+ }
3663
+ </tui-data-list>
3664
+ </tui-textfield>
3665
+
3666
+ <ng-template #treeContent let-node="node" let-value>
3667
+ <div class="wrapper">
3668
+ <button
3669
+ tuiOption
3670
+ [value]="value"
3671
+ [disabled]="value.selectable === false"
3672
+ [style.opacity]="!enableSearch || (searchValue() == '' || value.label.includes(searchValue())) ? (value.selectable === false ? 0.5 : 1) : 0.2"
3673
+ >
3674
+ @if(itemTemplate){
3675
+ <ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: value }"></ng-container>
3676
+ }
3677
+ @else {
3678
+ @if (value.icon) {
3679
+ <tui-icon class="t-icon" [icon]="value.icon"/>
3680
+ }
3681
+ {{ value.label }}
3682
+ }
3683
+ </button>
3684
+ </div>
3685
+ </ng-template>
3686
+
3687
+ <ng-template #content>
3688
+ @if(selectedTemplate){
3689
+ <ng-container [ngTemplateOutlet]="selectedTemplate" [ngTemplateOutletContext]="{ $implicit: selected }"></ng-container>
3690
+ }
3691
+ @else if(selected){
3692
+ <span tuiChip [size]="label != '' ? 'xxs' : 'xs'">{{selected.label}}</span>
3693
+ }
3694
+ </ng-template>
3695
+ `, isInline: true, styles: [".toolbar{display:flex;flex-direction:row;gap:5px}.wrapper{display:flex;align-items:center;width:100%}.wrapper button{width:100%}.t-icon:before{font-size:1rem}\n"], 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"] }, { kind: "component", type: i4$1.TuiTreeComponent, selector: "tui-tree", inputs: ["value", "trackBy", "content"] }, { kind: "directive", type: i4$1.TuiTreeChildren, selector: "tui-tree[childrenHandler]", inputs: ["childrenHandler"] }, { kind: "directive", type: i4$1.TuiTreeControllerDirective, selector: "[tuiTreeController][map]", inputs: ["tuiTreeController", "map"], outputs: ["toggled"], exportAs: ["tuiTreeController"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],label[tuiButton],a[tuiIconButton],button[tuiIconButton],label[tuiIconButton]", inputs: ["size"] }] });
3696
+ }
3697
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITreeSelect, decorators: [{
3698
+ type: Component,
3699
+ args: [{ selector: 'ezui-treeselect', imports: [
3700
+ FormsModule,
3701
+ CommonModule,
3702
+ TuiSelect,
3703
+ TuiDataList,
3704
+ TuiTextfield,
3705
+ TuiDropdown,
3706
+ TuiChevron,
3707
+ TuiInput,
3708
+ TuiChip,
3709
+ TuiAutoFocus,
3710
+ TuiTree,
3711
+ TuiIcon,
3712
+ TuiButton
3713
+ ], template: `
3714
+ <tui-textfield tuiChevron [content]="content" [tuiTextfieldSize]="size" [iconStart]="icon">
3715
+ @if(label != '' && size != 's'){
3716
+ <label tuiLabel>{{label}}</label>
3717
+ }
3718
+ <input tuiSelect [(ngModel)]="selected" [placeholder]="size == 's' ? label : ''" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
3719
+ <tui-data-list *tuiDropdown >
3720
+ @if(enableSearch){
3721
+ <tui-textfield tuiTextfieldSize="s" iconStart="search" style="margin-bottom:5px">
3722
+ <input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue" (click)="field.focus()" (ngModelChange)="searchChange()"/>
3723
+ </tui-textfield>
3724
+ }
3725
+
3726
+ <div class="toolbar">
3727
+ <button tuiButton size="xs" appearance="flat" (click)="expandAll()">Expand All</button>
3728
+ <button tuiButton size="xs" appearance="flat" (click)="collapseAll()">Collapse All</button>
3729
+ </div>
3730
+
3731
+ @for(root of options; track root){
3732
+ <tui-tree
3733
+ [childrenHandler]="handler"
3734
+ [content]="treeContent"
3735
+ [tuiTreeController]="false"
3736
+ [value]="root"
3737
+ [map]="map"
3738
+ />
3739
+ }
3740
+ </tui-data-list>
3741
+ </tui-textfield>
3742
+
3743
+ <ng-template #treeContent let-node="node" let-value>
3744
+ <div class="wrapper">
3745
+ <button
3746
+ tuiOption
3747
+ [value]="value"
3748
+ [disabled]="value.selectable === false"
3749
+ [style.opacity]="!enableSearch || (searchValue() == '' || value.label.includes(searchValue())) ? (value.selectable === false ? 0.5 : 1) : 0.2"
3750
+ >
3751
+ @if(itemTemplate){
3752
+ <ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: value }"></ng-container>
3753
+ }
3754
+ @else {
3755
+ @if (value.icon) {
3756
+ <tui-icon class="t-icon" [icon]="value.icon"/>
3757
+ }
3758
+ {{ value.label }}
3759
+ }
3760
+ </button>
3761
+ </div>
3762
+ </ng-template>
3763
+
3764
+ <ng-template #content>
3765
+ @if(selectedTemplate){
3766
+ <ng-container [ngTemplateOutlet]="selectedTemplate" [ngTemplateOutletContext]="{ $implicit: selected }"></ng-container>
3767
+ }
3768
+ @else if(selected){
3769
+ <span tuiChip [size]="label != '' ? 'xxs' : 'xs'">{{selected.label}}</span>
3770
+ }
3771
+ </ng-template>
3772
+ `, styles: [".toolbar{display:flex;flex-direction:row;gap:5px}.wrapper{display:flex;align-items:center;width:100%}.wrapper button{width:100%}.t-icon:before{font-size:1rem}\n"] }]
3773
+ }], propDecorators: { selectedTemplate: [{
3774
+ type: ContentChild,
3775
+ args: ['selectedTemplate', { static: false }]
3776
+ }], itemTemplate: [{
3777
+ type: ContentChild,
3778
+ args: ['itemTemplate', { static: false }]
3779
+ }], icon: [{
3780
+ type: Input
3781
+ }], label: [{
3782
+ type: Input
3783
+ }], size: [{
3784
+ type: Input
3785
+ }], options: [{
3786
+ type: Input
3787
+ }], disabled: [{
3788
+ type: Input
3789
+ }], selected: [{
3790
+ type: Input
3791
+ }], selectedChange: [{
3792
+ type: Output
3793
+ }], enableSearch: [{
3794
+ type: Input
3795
+ }] } });
3796
+
3367
3797
  class EzUIShowMoreText {
3368
3798
  value = "";
3369
3799
  valueSmall = "";
@@ -6287,5 +6717,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
6287
6717
  * Generated bundle index. Do not edit.
6288
6718
  */
6289
6719
 
6290
- export { BaseCRUDInterface, BaseListInterface, EzUIBooleanInput, EzUIDateInput, EzUIDateTimeInput, EzUIDialog, EzUIFileInput, EzUIFilterHelpers, EzUIIconSelector, EzUILayout, EzUILayoutService, EzUIMarkdownEditor, EzUIMenuBar, EzUIMenuBarSubDataList, EzUIMultiSelect, EzUINumberInput, EzUIPasswordInput, EzUISelect, EzUIShowMoreText, EzUITTableSortableColumn, EzUITable, EzUITableBooleanFilter, EzUITableDateFilter, EzUITableDateTimeFilter, EzUITableFilterService, EzUITableNumberFilter, EzUITableSelectFilter, EzUITableTextFilter, EzUITextInput, compressImage };
6720
+ export { BaseCRUDInterface, BaseListInterface, EzUIBooleanInput, EzUIDateInput, EzUIDateTimeInput, EzUIDialog, EzUIFileInput, EzUIFilterHelpers, EzUIIconSelector, EzUILayout, EzUILayoutService, EzUIMarkdownEditor, EzUIMenuBar, EzUIMenuBarSubDataList, EzUIMultiSelect, EzUINumberInput, EzUIPasswordInput, EzUISelect, EzUIShowMoreText, EzUITTableSortableColumn, EzUITable, EzUITableBooleanFilter, EzUITableDateFilter, EzUITableDateTimeFilter, EzUITableFilterService, EzUITableNumberFilter, EzUITableSelectFilter, EzUITableTextFilter, EzUITextInput, EzUITreeMultiSelect, EzUITreeSelect, compressImage };
6291
6721
  //# sourceMappingURL=kris701-ez-ui.mjs.map