@kris701/ez-ui 1.2.16 → 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';
|
|
@@ -3654,6 +3654,15 @@ class EzUITableFilterService {
|
|
|
3654
3654
|
return i.getTime() > normal.getTime();
|
|
3655
3655
|
}, column)
|
|
3656
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
|
+
},
|
|
3657
3666
|
// Boolean filters
|
|
3658
3667
|
{
|
|
3659
3668
|
key: 'bol',
|
|
@@ -4271,6 +4280,7 @@ class EzUITableDateFilter {
|
|
|
4271
4280
|
filterType = signal({}, /* @ts-ignore */
|
|
4272
4281
|
...(ngDevMode ? [{ debugName: "filterType" }] : /* istanbul ignore next */ []));
|
|
4273
4282
|
filterTypes;
|
|
4283
|
+
rangeItems = tuiCreateDefaultDayRangePeriods();
|
|
4274
4284
|
stringify = (item) => `${item.label}`;
|
|
4275
4285
|
constructor(table) {
|
|
4276
4286
|
this.table = table;
|
|
@@ -4282,6 +4292,10 @@ class EzUITableDateFilter {
|
|
|
4282
4292
|
{
|
|
4283
4293
|
label: 'Before',
|
|
4284
4294
|
expression: 'dat;bef'
|
|
4295
|
+
},
|
|
4296
|
+
{
|
|
4297
|
+
label: 'Within',
|
|
4298
|
+
expression: 'dat;wit'
|
|
4285
4299
|
}
|
|
4286
4300
|
];
|
|
4287
4301
|
this.filterType.set(this.filterTypes[0]);
|
|
@@ -4308,12 +4322,21 @@ class EzUITableDateFilter {
|
|
|
4308
4322
|
}
|
|
4309
4323
|
this.filterType.set(type);
|
|
4310
4324
|
let forceReapply = false;
|
|
4311
|
-
if (
|
|
4312
|
-
|
|
4313
|
-
|
|
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;
|
|
4314
4332
|
}
|
|
4315
4333
|
else {
|
|
4316
|
-
|
|
4334
|
+
if (typeof filter.value == 'string') {
|
|
4335
|
+
this.value = TuiDay.jsonParse(filter.value);
|
|
4336
|
+
forceReapply = true;
|
|
4337
|
+
}
|
|
4338
|
+
else
|
|
4339
|
+
this.value = filter.value;
|
|
4317
4340
|
}
|
|
4318
4341
|
this.filterApplied.set(true);
|
|
4319
4342
|
if (forceReapply) {
|
|
@@ -4355,6 +4378,7 @@ class EzUITableDateFilter {
|
|
|
4355
4378
|
style="opacity:0.72"
|
|
4356
4379
|
[tuiDropdown]="filterPop"
|
|
4357
4380
|
[(tuiDropdownOpen)]="filterVisible"
|
|
4381
|
+
[tuiDropdownMaxHeight]="500"
|
|
4358
4382
|
(click)="filterVisible.set(true)"
|
|
4359
4383
|
></button>
|
|
4360
4384
|
</tui-badged-content>
|
|
@@ -4377,14 +4401,20 @@ class EzUITableDateFilter {
|
|
|
4377
4401
|
/>
|
|
4378
4402
|
</button>
|
|
4379
4403
|
|
|
4380
|
-
|
|
4381
|
-
<
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
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
|
+
|
|
4388
4418
|
<button
|
|
4389
4419
|
tuiButton size="s"
|
|
4390
4420
|
iconStart="funnel"
|
|
@@ -4408,11 +4438,11 @@ class EzUITableDateFilter {
|
|
|
4408
4438
|
</div>
|
|
4409
4439
|
</ng-template>
|
|
4410
4440
|
}
|
|
4411
|
-
`, 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" }] });
|
|
4412
4442
|
}
|
|
4413
4443
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITableDateFilter, decorators: [{
|
|
4414
4444
|
type: Component,
|
|
4415
|
-
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: `
|
|
4416
4446
|
@if(column){
|
|
4417
4447
|
<tui-badged-content>
|
|
4418
4448
|
@if(filterApplied()){
|
|
@@ -4430,6 +4460,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
4430
4460
|
style="opacity:0.72"
|
|
4431
4461
|
[tuiDropdown]="filterPop"
|
|
4432
4462
|
[(tuiDropdownOpen)]="filterVisible"
|
|
4463
|
+
[tuiDropdownMaxHeight]="500"
|
|
4433
4464
|
(click)="filterVisible.set(true)"
|
|
4434
4465
|
></button>
|
|
4435
4466
|
</tui-badged-content>
|
|
@@ -4452,14 +4483,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
4452
4483
|
/>
|
|
4453
4484
|
</button>
|
|
4454
4485
|
|
|
4455
|
-
|
|
4456
|
-
<
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
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
|
+
|
|
4463
4500
|
<button
|
|
4464
4501
|
tuiButton size="s"
|
|
4465
4502
|
iconStart="funnel"
|