@kris701/ez-ui 1.2.15 → 1.2.17
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,10 +7,10 @@ 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, TuiButtonSelect, TuiInputDateDirective, TuiStringifyContentPipe, TUI_CONFIRM } 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';
|
|
11
11
|
import * as i3$3 from '@taiga-ui/addon-mobile';
|
|
12
12
|
import { TuiDropdownSheet } from '@taiga-ui/addon-mobile';
|
|
13
|
-
import { TuiDay, TuiTime } from '@taiga-ui/cdk/date-time';
|
|
13
|
+
import { TuiDay, TuiTime, TuiDayRange } from '@taiga-ui/cdk/date-time';
|
|
14
14
|
import * as i2 from '@taiga-ui/core/components/label';
|
|
15
15
|
import * as i3 from '@taiga-ui/core/components/textfield';
|
|
16
16
|
import * as i4 from '@taiga-ui/core/portals/dropdown';
|
|
@@ -3421,8 +3421,7 @@ class EzUITablePresets {
|
|
|
3421
3421
|
const current = this.currentPreset();
|
|
3422
3422
|
if (current?.id == id) {
|
|
3423
3423
|
if (presets.length > 0) {
|
|
3424
|
-
this.
|
|
3425
|
-
this.onPresetChange.emit(presets[0]);
|
|
3424
|
+
this.selectPreset(presets[0].id);
|
|
3426
3425
|
}
|
|
3427
3426
|
else {
|
|
3428
3427
|
this.currentPreset.set(null);
|
|
@@ -3430,6 +3429,8 @@ class EzUITablePresets {
|
|
|
3430
3429
|
}
|
|
3431
3430
|
}
|
|
3432
3431
|
this.savePresets();
|
|
3432
|
+
if (presets.length == 0)
|
|
3433
|
+
this.table.clearFilters();
|
|
3433
3434
|
}
|
|
3434
3435
|
savePresets() {
|
|
3435
3436
|
if (this.storageKey) {
|
|
@@ -3653,6 +3654,15 @@ class EzUITableFilterService {
|
|
|
3653
3654
|
return i.getTime() > normal.getTime();
|
|
3654
3655
|
}, column)
|
|
3655
3656
|
},
|
|
3657
|
+
{
|
|
3658
|
+
key: 'dat',
|
|
3659
|
+
action: 'wit',
|
|
3660
|
+
filter: (values, column, value) => EzUIFilterHelpers.dateFilter(values, (i) => {
|
|
3661
|
+
let from = value.from.toLocalNativeDate();
|
|
3662
|
+
let to = value.to.toLocalNativeDate();
|
|
3663
|
+
return i.getTime() >= from.getTime() && i.getTime() < to.getTime();
|
|
3664
|
+
}, column)
|
|
3665
|
+
},
|
|
3656
3666
|
// Boolean filters
|
|
3657
3667
|
{
|
|
3658
3668
|
key: 'bol',
|
|
@@ -4270,6 +4280,7 @@ class EzUITableDateFilter {
|
|
|
4270
4280
|
filterType = signal({}, /* @ts-ignore */
|
|
4271
4281
|
...(ngDevMode ? [{ debugName: "filterType" }] : /* istanbul ignore next */ []));
|
|
4272
4282
|
filterTypes;
|
|
4283
|
+
rangeItems = tuiCreateDefaultDayRangePeriods();
|
|
4273
4284
|
stringify = (item) => `${item.label}`;
|
|
4274
4285
|
constructor(table) {
|
|
4275
4286
|
this.table = table;
|
|
@@ -4281,6 +4292,10 @@ class EzUITableDateFilter {
|
|
|
4281
4292
|
{
|
|
4282
4293
|
label: 'Before',
|
|
4283
4294
|
expression: 'dat;bef'
|
|
4295
|
+
},
|
|
4296
|
+
{
|
|
4297
|
+
label: 'Within',
|
|
4298
|
+
expression: 'dat;wit'
|
|
4284
4299
|
}
|
|
4285
4300
|
];
|
|
4286
4301
|
this.filterType.set(this.filterTypes[0]);
|
|
@@ -4307,12 +4322,21 @@ class EzUITableDateFilter {
|
|
|
4307
4322
|
}
|
|
4308
4323
|
this.filterType.set(type);
|
|
4309
4324
|
let forceReapply = false;
|
|
4310
|
-
if (
|
|
4311
|
-
|
|
4312
|
-
|
|
4325
|
+
if (type.expression == "dat;wit") {
|
|
4326
|
+
if (typeof filter.value.from == 'string') {
|
|
4327
|
+
this.value = new TuiDayRange(TuiDay.jsonParse(filter.value.from), TuiDay.jsonParse(filter.value.to));
|
|
4328
|
+
forceReapply = true;
|
|
4329
|
+
}
|
|
4330
|
+
else
|
|
4331
|
+
this.value = filter.value;
|
|
4313
4332
|
}
|
|
4314
4333
|
else {
|
|
4315
|
-
|
|
4334
|
+
if (typeof filter.value == 'string') {
|
|
4335
|
+
this.value = TuiDay.jsonParse(filter.value);
|
|
4336
|
+
forceReapply = true;
|
|
4337
|
+
}
|
|
4338
|
+
else
|
|
4339
|
+
this.value = filter.value;
|
|
4316
4340
|
}
|
|
4317
4341
|
this.filterApplied.set(true);
|
|
4318
4342
|
if (forceReapply) {
|
|
@@ -4354,6 +4378,7 @@ class EzUITableDateFilter {
|
|
|
4354
4378
|
style="opacity:0.72"
|
|
4355
4379
|
[tuiDropdown]="filterPop"
|
|
4356
4380
|
[(tuiDropdownOpen)]="filterVisible"
|
|
4381
|
+
[tuiDropdownMaxHeight]="500"
|
|
4357
4382
|
(click)="filterVisible.set(true)"
|
|
4358
4383
|
></button>
|
|
4359
4384
|
</tui-badged-content>
|
|
@@ -4376,14 +4401,20 @@ class EzUITableDateFilter {
|
|
|
4376
4401
|
/>
|
|
4377
4402
|
</button>
|
|
4378
4403
|
|
|
4379
|
-
|
|
4380
|
-
<
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4404
|
+
@if(filter.expression == 'dat;wit'){
|
|
4405
|
+
<tui-calendar-range [items]="rangeItems" [(value)]="value" />
|
|
4406
|
+
}
|
|
4407
|
+
@else {
|
|
4408
|
+
<tui-textfield (keydown.enter)="applyFilter(filter.expression)">
|
|
4409
|
+
<label tuiLabel>Choose a date</label>
|
|
4410
|
+
<input
|
|
4411
|
+
tuiInputDate
|
|
4412
|
+
[(ngModel)]="value"
|
|
4413
|
+
/>
|
|
4414
|
+
<tui-calendar *tuiDropdown />
|
|
4415
|
+
</tui-textfield>
|
|
4416
|
+
}
|
|
4417
|
+
|
|
4387
4418
|
<button
|
|
4388
4419
|
tuiButton size="s"
|
|
4389
4420
|
iconStart="funnel"
|
|
@@ -4407,11 +4438,11 @@ class EzUITableDateFilter {
|
|
|
4407
4438
|
</div>
|
|
4408
4439
|
</ng-template>
|
|
4409
4440
|
}
|
|
4410
|
-
`, isInline: true, styles: [".filterPopContainer{display:flex;flex-direction:column;gap:10px;padding:10px;min-width:20rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: "directive", type: i3$1.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container):not(ng-template)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { kind: "directive", type: i3$1.TuiDropdownOpen, selector: "[tuiDropdown][tuiDropdownAuto],[tuiDropdown][tuiDropdownOpen],[tuiDropdown][tuiDropdownOpenChange]", inputs: ["tuiDropdownEnabled", "tuiDropdownOpen"], outputs: ["tuiDropdownOpenChange"] }, { kind: "directive", type: i3$1.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "component", type: i4$1.TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels])", inputs: ["items", "emptyContent", "size", "itemContent"], outputs: ["itemClick"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],label[tuiButton],a[tuiIconButton],button[tuiIconButton],label[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiButtonSelect, selector: "button[tuiButtonSelect]" }, { kind: "component", type: TuiBadgeNotification, selector: "tui-badge-notification", inputs: ["size"] }, { kind: "directive", type: i4$1.TuiBadgedContentDirective, selector: "[tuiSlot]", inputs: ["tuiSlot"] }, { kind: "component", type: i4$1.TuiBadgedContentComponent, selector: "tui-badged-content" }, { 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: "component", type: i6.TuiCalendar, selector: "tui-calendar:not([new]):not([months])", inputs: ["minViewedMonth", "maxViewedMonth", "showAdjacent", "markerHandler", "initialView", "hoveredItem"], outputs: ["hoveredItemChange", "dayClick"] }, { kind: "directive", type: TuiInputDateDirective, selector: "input[tuiInputDate]", inputs: ["max", "min"] }, { kind: "pipe", type: TuiStringifyContentPipe, name: "tuiStringifyContent" }] });
|
|
4441
|
+
`, isInline: true, styles: [".filterPopContainer{display:flex;flex-direction:column;gap:10px;padding:10px;min-width:20rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: "directive", type: i3$1.TuiDropdownOptionsDirective, selector: "[tuiDropdownAlign], [tuiDropdownAppearance], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight], [tuiDropdownOffset]", inputs: ["tuiDropdownAlign", "tuiDropdownAppearance", "tuiDropdownDirection", "tuiDropdownLimitWidth", "tuiDropdownMinHeight", "tuiDropdownMaxHeight", "tuiDropdownOffset"] }, { kind: "directive", type: i3$1.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container):not(ng-template)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { kind: "directive", type: i3$1.TuiDropdownOpen, selector: "[tuiDropdown][tuiDropdownAuto],[tuiDropdown][tuiDropdownOpen],[tuiDropdown][tuiDropdownOpenChange]", inputs: ["tuiDropdownEnabled", "tuiDropdownOpen"], outputs: ["tuiDropdownOpenChange"] }, { kind: "directive", type: i3$1.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "component", type: i4$1.TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels])", inputs: ["items", "emptyContent", "size", "itemContent"], outputs: ["itemClick"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],label[tuiButton],a[tuiIconButton],button[tuiIconButton],label[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiButtonSelect, selector: "button[tuiButtonSelect]" }, { kind: "component", type: TuiBadgeNotification, selector: "tui-badge-notification", inputs: ["size"] }, { kind: "directive", type: i4$1.TuiBadgedContentDirective, selector: "[tuiSlot]", inputs: ["tuiSlot"] }, { kind: "component", type: i4$1.TuiBadgedContentComponent, selector: "tui-badged-content" }, { 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: "component", type: i6.TuiCalendar, selector: "tui-calendar:not([new]):not([months])", inputs: ["minViewedMonth", "maxViewedMonth", "showAdjacent", "markerHandler", "initialView", "hoveredItem"], outputs: ["hoveredItemChange", "dayClick"] }, { kind: "directive", type: TuiInputDateDirective, selector: "input[tuiInputDate]", inputs: ["max", "min"] }, { kind: "component", type: TuiCalendarRange, selector: "tui-calendar-range", inputs: ["minLength", "maxLength", "items", "listSize", "defaultViewedMonth", "markerHandler", "item"], outputs: ["itemChange"] }, { kind: "pipe", type: TuiStringifyContentPipe, name: "tuiStringifyContent" }] });
|
|
4411
4442
|
}
|
|
4412
4443
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITableDateFilter, decorators: [{
|
|
4413
4444
|
type: Component,
|
|
4414
|
-
args: [{ selector: 'ezui-table-datefilter', imports: [CommonModule, FormsModule, TuiDropdown, TuiDataListWrapper, TuiButton, TuiButtonSelect, TuiStringifyContentPipe, TuiBadgeNotification, TuiBadgedContent, TuiInput, TuiInputDateTime, TuiInputDateDirective], template: `
|
|
4445
|
+
args: [{ selector: 'ezui-table-datefilter', imports: [CommonModule, FormsModule, TuiDropdown, TuiDataListWrapper, TuiButton, TuiButtonSelect, TuiStringifyContentPipe, TuiBadgeNotification, TuiBadgedContent, TuiInput, TuiInputDateTime, TuiInputDateDirective, TuiCalendarRange], template: `
|
|
4415
4446
|
@if(column){
|
|
4416
4447
|
<tui-badged-content>
|
|
4417
4448
|
@if(filterApplied()){
|
|
@@ -4429,6 +4460,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
4429
4460
|
style="opacity:0.72"
|
|
4430
4461
|
[tuiDropdown]="filterPop"
|
|
4431
4462
|
[(tuiDropdownOpen)]="filterVisible"
|
|
4463
|
+
[tuiDropdownMaxHeight]="500"
|
|
4432
4464
|
(click)="filterVisible.set(true)"
|
|
4433
4465
|
></button>
|
|
4434
4466
|
</tui-badged-content>
|
|
@@ -4451,14 +4483,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
4451
4483
|
/>
|
|
4452
4484
|
</button>
|
|
4453
4485
|
|
|
4454
|
-
|
|
4455
|
-
<
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4486
|
+
@if(filter.expression == 'dat;wit'){
|
|
4487
|
+
<tui-calendar-range [items]="rangeItems" [(value)]="value" />
|
|
4488
|
+
}
|
|
4489
|
+
@else {
|
|
4490
|
+
<tui-textfield (keydown.enter)="applyFilter(filter.expression)">
|
|
4491
|
+
<label tuiLabel>Choose a date</label>
|
|
4492
|
+
<input
|
|
4493
|
+
tuiInputDate
|
|
4494
|
+
[(ngModel)]="value"
|
|
4495
|
+
/>
|
|
4496
|
+
<tui-calendar *tuiDropdown />
|
|
4497
|
+
</tui-textfield>
|
|
4498
|
+
}
|
|
4499
|
+
|
|
4462
4500
|
<button
|
|
4463
4501
|
tuiButton size="s"
|
|
4464
4502
|
iconStart="funnel"
|