@kris701/ez-ui 1.4.11 → 1.4.12
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.
|
@@ -5,7 +5,7 @@ import { EventEmitter, Output, Input, Component, signal, ContentChild, ViewChild
|
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { FormsModule } from '@angular/forms';
|
|
7
7
|
import * as i3$1 from '@taiga-ui/core';
|
|
8
|
-
import { TuiIcon, TuiInput, TuiButton, TuiTitle, TuiLoader, TuiDialog, TuiDropdown, TuiOption, TuiGroup, TuiScrollbar, TuiSelectLike, TuiDataList, TuiTextfield, TuiLink, TuiHint,
|
|
8
|
+
import { TuiIcon, TuiInput, TuiButton, TuiTitle, TuiLoader, TuiDialog, TuiDropdown, TuiOption, TuiGroup, TuiScrollbar, TuiSelectLike, TuiDataList, TuiTextfield, TuiCheckbox, TuiLabel, TuiLink, TuiHint, TUI_DARK_MODE, TuiRoot } from '@taiga-ui/core';
|
|
9
9
|
import * as i4$1 from '@taiga-ui/kit';
|
|
10
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';
|
|
@@ -19,7 +19,7 @@ import * as i2$2 from '@taiga-ui/layout';
|
|
|
19
19
|
import { TuiHeader, TuiBlockStatus, TuiElasticContainer, TuiNavigation, TuiAsideGroupComponent } from '@taiga-ui/layout';
|
|
20
20
|
import { marked } from 'marked';
|
|
21
21
|
import Compressor from 'compressorjs';
|
|
22
|
-
import { TuiAutoFocus } from '@taiga-ui/cdk';
|
|
22
|
+
import { TuiAutoFocus, TuiMapperPipe } from '@taiga-ui/cdk';
|
|
23
23
|
import * as i5 from '@taiga-ui/cdk/directives/item';
|
|
24
24
|
import { moveItemInArray, CdkDropList, CdkDrag, CdkDragHandle } from '@angular/cdk/drag-drop';
|
|
25
25
|
import * as i3$2 from '@taiga-ui/addon-table';
|
|
@@ -3293,9 +3293,15 @@ class EzUITreeMultiSelect {
|
|
|
3293
3293
|
...(ngDevMode ? [{ debugName: "searchValue" }] : /* istanbul ignore next */ []));
|
|
3294
3294
|
showClear = true;
|
|
3295
3295
|
map = new Map();
|
|
3296
|
+
visMap = new Map();
|
|
3296
3297
|
ngOnChanges(changes) {
|
|
3297
3298
|
if (changes['selected'] && changes['selected'].currentValue != changes['selected'].previousValue) {
|
|
3298
3299
|
this.selected = changes['selected'].currentValue;
|
|
3300
|
+
let newMap = new Map();
|
|
3301
|
+
if (this.selected)
|
|
3302
|
+
for (let item of this.selected)
|
|
3303
|
+
newMap.set(item, true);
|
|
3304
|
+
this.map = newMap;
|
|
3299
3305
|
}
|
|
3300
3306
|
}
|
|
3301
3307
|
stringify = (value) => value.label;
|
|
@@ -3304,7 +3310,7 @@ class EzUITreeMultiSelect {
|
|
|
3304
3310
|
this.expandAllRec(option);
|
|
3305
3311
|
}
|
|
3306
3312
|
expandAllRec(from) {
|
|
3307
|
-
this.
|
|
3313
|
+
this.visMap.set(from, true);
|
|
3308
3314
|
if (from.children && from.children.length > 0)
|
|
3309
3315
|
for (let child of from.children)
|
|
3310
3316
|
this.expandAllRec(child);
|
|
@@ -3314,7 +3320,7 @@ class EzUITreeMultiSelect {
|
|
|
3314
3320
|
this.collapseAllRec(option);
|
|
3315
3321
|
}
|
|
3316
3322
|
collapseAllRec(from) {
|
|
3317
|
-
this.
|
|
3323
|
+
this.visMap.set(from, false);
|
|
3318
3324
|
if (from.children && from.children.length > 0)
|
|
3319
3325
|
for (let child of from.children)
|
|
3320
3326
|
this.collapseAllRec(child);
|
|
@@ -3323,7 +3329,7 @@ class EzUITreeMultiSelect {
|
|
|
3323
3329
|
let newMap = new Map();
|
|
3324
3330
|
for (let option of this.options)
|
|
3325
3331
|
this.expandSearchRec(option, newMap);
|
|
3326
|
-
this.
|
|
3332
|
+
this.visMap = newMap;
|
|
3327
3333
|
}
|
|
3328
3334
|
expandSearchRec(from, newMap) {
|
|
3329
3335
|
let expanded = false;
|
|
@@ -3341,15 +3347,52 @@ class EzUITreeMultiSelect {
|
|
|
3341
3347
|
}
|
|
3342
3348
|
return expanded;
|
|
3343
3349
|
}
|
|
3350
|
+
onChecked(node, value) {
|
|
3351
|
+
flatten(node).filter(x => x.selectable != false).forEach((item) => {
|
|
3352
|
+
this.map.set(item, value);
|
|
3353
|
+
});
|
|
3354
|
+
this.map = new Map(this.map.entries());
|
|
3355
|
+
let newSelected = [];
|
|
3356
|
+
for (let key of this.map.keys())
|
|
3357
|
+
if (this.map.get(key) == true)
|
|
3358
|
+
newSelected.push(key);
|
|
3359
|
+
this.selected = newSelected;
|
|
3360
|
+
this.selectedChange.emit(this.selected);
|
|
3361
|
+
}
|
|
3362
|
+
getValue = (item, map) => {
|
|
3363
|
+
let result = null;
|
|
3364
|
+
const flat = flatten(item);
|
|
3365
|
+
const key = flat[0];
|
|
3366
|
+
if (key) {
|
|
3367
|
+
result = !!map.get(key);
|
|
3368
|
+
}
|
|
3369
|
+
for (const item of flat) {
|
|
3370
|
+
if (result !== !!map.get(item)) {
|
|
3371
|
+
return null;
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
return result;
|
|
3375
|
+
};
|
|
3344
3376
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITreeMultiSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3345
3377
|
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", showClear: "showClear" }, outputs: { selectedChange: "selectedChange" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: ["itemTemplate"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
3346
3378
|
<tui-textfield multi tuiChevron [stringify]="stringify" [tuiTextfieldSize]="size" [iconStart]="icon" [tuiTextfieldCleaner]="showClear">
|
|
3347
3379
|
@if(label != '' && size != 's'){
|
|
3348
3380
|
<label tuiLabel>{{label}}</label>
|
|
3349
3381
|
}
|
|
3350
|
-
<input
|
|
3382
|
+
<input
|
|
3383
|
+
tuiInputChip
|
|
3384
|
+
tuiSelectLike
|
|
3385
|
+
[(ngModel)]="selected"
|
|
3386
|
+
[placeholder]="size == 's' ? label : ''"
|
|
3387
|
+
(ngModelChange)="selectedChange.emit(this.selected)"
|
|
3388
|
+
[disabled]="disabled"
|
|
3389
|
+
/>
|
|
3351
3390
|
<tui-input-chip *tuiItem/>
|
|
3352
|
-
<
|
|
3391
|
+
<div
|
|
3392
|
+
*tuiDropdown
|
|
3393
|
+
tuiMultiSelectGroup
|
|
3394
|
+
style="padding:.25rem;"
|
|
3395
|
+
>
|
|
3353
3396
|
@if(enableSearch){
|
|
3354
3397
|
<tui-textfield tuiTextfieldSize="s" iconStart="search" style="margin-bottom:5px">
|
|
3355
3398
|
<input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue" (click)="field.focus()" (ngModelChange)="searchChange()"/>
|
|
@@ -3367,33 +3410,39 @@ class EzUITreeMultiSelect {
|
|
|
3367
3410
|
[content]="treeContent"
|
|
3368
3411
|
[tuiTreeController]="false"
|
|
3369
3412
|
[value]="root"
|
|
3370
|
-
[map]="
|
|
3413
|
+
[map]="visMap"
|
|
3371
3414
|
/>
|
|
3372
3415
|
}
|
|
3373
|
-
</
|
|
3416
|
+
</div>
|
|
3374
3417
|
</tui-textfield>
|
|
3375
3418
|
|
|
3376
|
-
<ng-template #treeContent let-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3419
|
+
<ng-template #treeContent let-item>
|
|
3420
|
+
@let isDisabled = item.selectable === false && (!item.children || item.children.length == 0);
|
|
3421
|
+
<label
|
|
3422
|
+
tuiLabel
|
|
3423
|
+
[class]="{'wrapper':true, 'wrapperActive':!isDisabled}"
|
|
3424
|
+
[style.opacity]="!enableSearch || (searchValue() == '' || item.label.toLowerCase().includes(searchValue().toLowerCase())) ? (isDisabled ? 0.8 : 1) : 0.2"
|
|
3425
|
+
>
|
|
3426
|
+
<input
|
|
3427
|
+
size="s"
|
|
3428
|
+
tuiCheckbox
|
|
3429
|
+
type="checkbox"
|
|
3430
|
+
[disabled]="isDisabled"
|
|
3431
|
+
[ngModel]="item | tuiMapper: getValue : map"
|
|
3432
|
+
(ngModelChange)="onChecked(item, $event)"
|
|
3433
|
+
/>
|
|
3434
|
+
@if(itemTemplate){
|
|
3435
|
+
<ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: item }"></ng-container>
|
|
3436
|
+
}
|
|
3437
|
+
@else {
|
|
3438
|
+
@if (item.icon) {
|
|
3439
|
+
<tui-icon class="t-icon" [icon]="item.icon"/>
|
|
3392
3440
|
}
|
|
3393
|
-
|
|
3394
|
-
|
|
3441
|
+
<small>{{ item.label }}</small>
|
|
3442
|
+
}
|
|
3443
|
+
</label>
|
|
3395
3444
|
</ng-template>
|
|
3396
|
-
`, isInline: true, styles: [".toolbar{display:flex;flex-direction:row;gap:5px}.wrapper{display:flex;align-items:center;width:100
|
|
3445
|
+
`, isInline: true, styles: [".toolbar{display:flex;flex-direction:row;gap:5px}.wrapper{display:flex;flex-direction:row;align-items:center;width:100%!important;margin:3px;padding:2px;border-radius:var(--tui-radius-s)}.wrapper input{line-height:100%!important}.wrapperActive{cursor:pointer}.wrapperActive:hover{background:var(--tui-background-neutral-1)}.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.CheckboxControlValueAccessor, selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]" }, { 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: 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"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "pipe", type: TuiMapperPipe, name: "tuiMapper" }] });
|
|
3397
3446
|
}
|
|
3398
3447
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITreeMultiSelect, decorators: [{
|
|
3399
3448
|
type: Component,
|
|
@@ -3413,15 +3462,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
3413
3462
|
TuiInput,
|
|
3414
3463
|
TuiIcon,
|
|
3415
3464
|
TuiButton,
|
|
3416
|
-
TuiTree
|
|
3465
|
+
TuiTree,
|
|
3466
|
+
TuiLabel,
|
|
3467
|
+
TuiCheckbox,
|
|
3468
|
+
TuiMapperPipe
|
|
3417
3469
|
], template: `
|
|
3418
3470
|
<tui-textfield multi tuiChevron [stringify]="stringify" [tuiTextfieldSize]="size" [iconStart]="icon" [tuiTextfieldCleaner]="showClear">
|
|
3419
3471
|
@if(label != '' && size != 's'){
|
|
3420
3472
|
<label tuiLabel>{{label}}</label>
|
|
3421
3473
|
}
|
|
3422
|
-
<input
|
|
3474
|
+
<input
|
|
3475
|
+
tuiInputChip
|
|
3476
|
+
tuiSelectLike
|
|
3477
|
+
[(ngModel)]="selected"
|
|
3478
|
+
[placeholder]="size == 's' ? label : ''"
|
|
3479
|
+
(ngModelChange)="selectedChange.emit(this.selected)"
|
|
3480
|
+
[disabled]="disabled"
|
|
3481
|
+
/>
|
|
3423
3482
|
<tui-input-chip *tuiItem/>
|
|
3424
|
-
<
|
|
3483
|
+
<div
|
|
3484
|
+
*tuiDropdown
|
|
3485
|
+
tuiMultiSelectGroup
|
|
3486
|
+
style="padding:.25rem;"
|
|
3487
|
+
>
|
|
3425
3488
|
@if(enableSearch){
|
|
3426
3489
|
<tui-textfield tuiTextfieldSize="s" iconStart="search" style="margin-bottom:5px">
|
|
3427
3490
|
<input tuiInput tuiAutoFocus #field [(ngModel)]="searchValue" (click)="field.focus()" (ngModelChange)="searchChange()"/>
|
|
@@ -3439,33 +3502,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
3439
3502
|
[content]="treeContent"
|
|
3440
3503
|
[tuiTreeController]="false"
|
|
3441
3504
|
[value]="root"
|
|
3442
|
-
[map]="
|
|
3505
|
+
[map]="visMap"
|
|
3443
3506
|
/>
|
|
3444
3507
|
}
|
|
3445
|
-
</
|
|
3508
|
+
</div>
|
|
3446
3509
|
</tui-textfield>
|
|
3447
3510
|
|
|
3448
|
-
<ng-template #treeContent let-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3511
|
+
<ng-template #treeContent let-item>
|
|
3512
|
+
@let isDisabled = item.selectable === false && (!item.children || item.children.length == 0);
|
|
3513
|
+
<label
|
|
3514
|
+
tuiLabel
|
|
3515
|
+
[class]="{'wrapper':true, 'wrapperActive':!isDisabled}"
|
|
3516
|
+
[style.opacity]="!enableSearch || (searchValue() == '' || item.label.toLowerCase().includes(searchValue().toLowerCase())) ? (isDisabled ? 0.8 : 1) : 0.2"
|
|
3517
|
+
>
|
|
3518
|
+
<input
|
|
3519
|
+
size="s"
|
|
3520
|
+
tuiCheckbox
|
|
3521
|
+
type="checkbox"
|
|
3522
|
+
[disabled]="isDisabled"
|
|
3523
|
+
[ngModel]="item | tuiMapper: getValue : map"
|
|
3524
|
+
(ngModelChange)="onChecked(item, $event)"
|
|
3525
|
+
/>
|
|
3526
|
+
@if(itemTemplate){
|
|
3527
|
+
<ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: item }"></ng-container>
|
|
3528
|
+
}
|
|
3529
|
+
@else {
|
|
3530
|
+
@if (item.icon) {
|
|
3531
|
+
<tui-icon class="t-icon" [icon]="item.icon"/>
|
|
3464
3532
|
}
|
|
3465
|
-
|
|
3466
|
-
|
|
3533
|
+
<small>{{ item.label }}</small>
|
|
3534
|
+
}
|
|
3535
|
+
</label>
|
|
3467
3536
|
</ng-template>
|
|
3468
|
-
`, styles: [".toolbar{display:flex;flex-direction:row;gap:5px}.wrapper{display:flex;align-items:center;width:100
|
|
3537
|
+
`, styles: [".toolbar{display:flex;flex-direction:row;gap:5px}.wrapper{display:flex;flex-direction:row;align-items:center;width:100%!important;margin:3px;padding:2px;border-radius:var(--tui-radius-s)}.wrapper input{line-height:100%!important}.wrapperActive{cursor:pointer}.wrapperActive:hover{background:var(--tui-background-neutral-1)}.t-icon:before{font-size:1rem}\n"] }]
|
|
3469
3538
|
}], propDecorators: { itemTemplate: [{
|
|
3470
3539
|
type: ContentChild,
|
|
3471
3540
|
args: ['itemTemplate', { static: false }]
|
|
@@ -3488,6 +3557,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
3488
3557
|
}], showClear: [{
|
|
3489
3558
|
type: Input
|
|
3490
3559
|
}] } });
|
|
3560
|
+
function flatten(item) {
|
|
3561
|
+
return item.children
|
|
3562
|
+
? item.children.map(flatten).reduce((arr, item) => [...arr, ...item], [])
|
|
3563
|
+
: [item];
|
|
3564
|
+
}
|
|
3491
3565
|
|
|
3492
3566
|
class EzUINumberInput {
|
|
3493
3567
|
icon = '';
|
|
@@ -4257,11 +4331,12 @@ class EzUITreeSelect {
|
|
|
4257
4331
|
|
|
4258
4332
|
<ng-template #treeContent let-node="node" let-value>
|
|
4259
4333
|
<div class="wrapper">
|
|
4334
|
+
@let isDisabled = value.selectable === false || (value.children && value.children.length > 0);
|
|
4260
4335
|
<button
|
|
4261
4336
|
tuiOption
|
|
4262
4337
|
[value]="value"
|
|
4263
|
-
[disabled]="
|
|
4264
|
-
[style.opacity]="!enableSearch || (searchValue() == '' || value.label.toLowerCase().includes(searchValue().toLowerCase())) ? (
|
|
4338
|
+
[disabled]="isDisabled"
|
|
4339
|
+
[style.opacity]="!enableSearch || (searchValue() == '' || value.label.toLowerCase().includes(searchValue().toLowerCase())) ? (isDisabled ? 0.8 : 1) : 0.2"
|
|
4265
4340
|
>
|
|
4266
4341
|
@if(itemTemplate){
|
|
4267
4342
|
<ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: value }"></ng-container>
|
|
@@ -4334,11 +4409,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
4334
4409
|
|
|
4335
4410
|
<ng-template #treeContent let-node="node" let-value>
|
|
4336
4411
|
<div class="wrapper">
|
|
4412
|
+
@let isDisabled = value.selectable === false || (value.children && value.children.length > 0);
|
|
4337
4413
|
<button
|
|
4338
4414
|
tuiOption
|
|
4339
4415
|
[value]="value"
|
|
4340
|
-
[disabled]="
|
|
4341
|
-
[style.opacity]="!enableSearch || (searchValue() == '' || value.label.toLowerCase().includes(searchValue().toLowerCase())) ? (
|
|
4416
|
+
[disabled]="isDisabled"
|
|
4417
|
+
[style.opacity]="!enableSearch || (searchValue() == '' || value.label.toLowerCase().includes(searchValue().toLowerCase())) ? (isDisabled ? 0.8 : 1) : 0.2"
|
|
4342
4418
|
>
|
|
4343
4419
|
@if(itemTemplate){
|
|
4344
4420
|
<ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: value }"></ng-container>
|