@kris701/ez-ui 1.2.13 → 1.2.15
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 +304 -63
- package/fesm2022/kris701-ez-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/kris701-ez-ui.d.ts +18 -2
|
@@ -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, TuiButtonSelect, 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, TuiButtonSelect, TuiInputDateDirective, 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 } from '@taiga-ui/cdk/date-time';
|
|
@@ -3449,71 +3449,67 @@ class EzUITablePresets {
|
|
|
3449
3449
|
this.table.applyFilter();
|
|
3450
3450
|
}
|
|
3451
3451
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITablePresets, deps: [{ token: EzUITable }], target: i0.ɵɵFactoryTarget.Component });
|
|
3452
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUITablePresets, isStandalone: true, selector: "ezui-table-presets", inputs: { storageKey: "storageKey" }, outputs: { onPresetChange: "onPresetChange" }, host: { styleAttribute: "display:flex;flex-direction: row;gap:10px;width:100
|
|
3452
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUITablePresets, isStandalone: true, selector: "ezui-table-presets", inputs: { storageKey: "storageKey" }, outputs: { onPresetChange: "onPresetChange" }, host: { styleAttribute: "display:flex;flex-direction: row;gap:10px;width:100%;flex-wrap:wrap;" }, usesOnChanges: true, ngImport: i0, template: `
|
|
3453
3453
|
<button tuiButton iconStart="plus" size="s" appearance="secondary" (click)="createPreset()" tuiHint="Create new preset from current filters"></button>
|
|
3454
3454
|
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
@if(
|
|
3461
|
-
|
|
3462
|
-
<
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
<button style="flex: 0 0 auto;" tuiButton iconStart="save" size="s" appearance="info" (click)="preset.edit = false;saveCurrentPreset()" tuiHint="Save"></button>
|
|
3466
|
-
}
|
|
3467
|
-
@else {
|
|
3468
|
-
<div style="height:100%" appearance="positive" tuiBadge tuiStatus>
|
|
3469
|
-
{{preset.name}}
|
|
3470
|
-
</div>
|
|
3471
|
-
<button style="flex: 0 0 auto;" tuiButton iconStart="square-pen" size="s" appearance="info" (click)="preset.edit = true" tuiHint="Edit"></button>
|
|
3472
|
-
}
|
|
3473
|
-
<button style="flex: 0 0 auto;" tuiButton iconStart="x" size="s" appearance="negative" (click)="removePreset(preset.id)" tuiHint="Delete"></button>
|
|
3455
|
+
@let current = currentPreset();
|
|
3456
|
+
@for(preset of presets(); track preset.id){
|
|
3457
|
+
<div tuiGroup class="preset-group" [collapsed]="true" [rounded]="true">
|
|
3458
|
+
@let isActive = current?.id == preset.id;
|
|
3459
|
+
@if(isActive){
|
|
3460
|
+
@if(preset.edit){
|
|
3461
|
+
<tui-textfield style="width:10rem" tuiTextfieldSize="s" (keydown.enter)="preset.edit = false;saveCurrentPreset()">
|
|
3462
|
+
<input tuiInput [(ngModel)]="preset.name"/>
|
|
3463
|
+
</tui-textfield>
|
|
3464
|
+
<button style="flex: 0 0 auto;" tuiButton iconStart="save" size="s" appearance="info" (click)="preset.edit = false;saveCurrentPreset()" tuiHint="Save"></button>
|
|
3474
3465
|
}
|
|
3475
3466
|
@else {
|
|
3476
|
-
<button style="flex: 0 0 auto;" tuiButton
|
|
3467
|
+
<button style="flex: 0 0 auto;" tuiButton iconStart="square-pen" size="s" appearance="info" (click)="preset.edit = true" tuiHint="Edit"></button>
|
|
3468
|
+
<div class="preset-name" appearance="positive" tuiBadge tuiStatus>
|
|
3469
|
+
{{preset.name}}
|
|
3470
|
+
</div>
|
|
3471
|
+
<button style="flex: 0 0 auto;" tuiButton iconStart="x" size="s" appearance="negative" (click)="removePreset(preset.id)" tuiHint="Delete"></button>
|
|
3477
3472
|
}
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3473
|
+
}
|
|
3474
|
+
@else {
|
|
3475
|
+
<button style="flex: 0 0 auto;" class="preset-name" tuiButton appearance="secondary" size="s" (click)="selectPreset(preset.id)">{{preset.name}}</button>
|
|
3476
|
+
}
|
|
3477
|
+
</div>
|
|
3478
|
+
}
|
|
3479
|
+
`, isInline: true, styles: [".preset-group{max-width:25vw}.preset-group .preset-name{height:100%;display:inline;text-overflow:ellipsis;align-content:center}\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: TuiButton, selector: "a[tuiButton],button[tuiButton],label[tuiButton],a[tuiIconButton],button[tuiIconButton],label[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiGroup, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "collapsed", "rounded", "size"] }, { kind: "directive", type: TuiBadge, selector: "[tuiBadge],tui-icon[tuiBadge]", inputs: ["size"] }, { kind: "directive", type: TuiStatus, selector: "[tuiStatus]", inputs: ["tuiStatus"] }, { 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: i3$1.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "readonly", "invalid", "focused", "state"] }, { kind: "directive", type: i3$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHint", "tuiHintContext", "tuiHintAppearance"], outputs: ["tuiHintVisible"] }] });
|
|
3482
3480
|
}
|
|
3483
3481
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITablePresets, decorators: [{
|
|
3484
3482
|
type: Component,
|
|
3485
|
-
args: [{ selector: 'ezui-table-presets', imports: [FormsModule, CommonModule,
|
|
3483
|
+
args: [{ selector: 'ezui-table-presets', imports: [FormsModule, CommonModule, TuiButton, TuiGroup, TuiBadge, TuiStatus, TuiInput, TuiHint], template: `
|
|
3486
3484
|
<button tuiButton iconStart="plus" size="s" appearance="secondary" (click)="createPreset()" tuiHint="Create new preset from current filters"></button>
|
|
3487
3485
|
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
@if(
|
|
3494
|
-
|
|
3495
|
-
<
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
<button style="flex: 0 0 auto;" tuiButton iconStart="save" size="s" appearance="info" (click)="preset.edit = false;saveCurrentPreset()" tuiHint="Save"></button>
|
|
3499
|
-
}
|
|
3500
|
-
@else {
|
|
3501
|
-
<div style="height:100%" appearance="positive" tuiBadge tuiStatus>
|
|
3502
|
-
{{preset.name}}
|
|
3503
|
-
</div>
|
|
3504
|
-
<button style="flex: 0 0 auto;" tuiButton iconStart="square-pen" size="s" appearance="info" (click)="preset.edit = true" tuiHint="Edit"></button>
|
|
3505
|
-
}
|
|
3506
|
-
<button style="flex: 0 0 auto;" tuiButton iconStart="x" size="s" appearance="negative" (click)="removePreset(preset.id)" tuiHint="Delete"></button>
|
|
3486
|
+
@let current = currentPreset();
|
|
3487
|
+
@for(preset of presets(); track preset.id){
|
|
3488
|
+
<div tuiGroup class="preset-group" [collapsed]="true" [rounded]="true">
|
|
3489
|
+
@let isActive = current?.id == preset.id;
|
|
3490
|
+
@if(isActive){
|
|
3491
|
+
@if(preset.edit){
|
|
3492
|
+
<tui-textfield style="width:10rem" tuiTextfieldSize="s" (keydown.enter)="preset.edit = false;saveCurrentPreset()">
|
|
3493
|
+
<input tuiInput [(ngModel)]="preset.name"/>
|
|
3494
|
+
</tui-textfield>
|
|
3495
|
+
<button style="flex: 0 0 auto;" tuiButton iconStart="save" size="s" appearance="info" (click)="preset.edit = false;saveCurrentPreset()" tuiHint="Save"></button>
|
|
3507
3496
|
}
|
|
3508
3497
|
@else {
|
|
3509
|
-
<button style="flex: 0 0 auto;" tuiButton
|
|
3498
|
+
<button style="flex: 0 0 auto;" tuiButton iconStart="square-pen" size="s" appearance="info" (click)="preset.edit = true" tuiHint="Edit"></button>
|
|
3499
|
+
<div class="preset-name" appearance="positive" tuiBadge tuiStatus>
|
|
3500
|
+
{{preset.name}}
|
|
3501
|
+
</div>
|
|
3502
|
+
<button style="flex: 0 0 auto;" tuiButton iconStart="x" size="s" appearance="negative" (click)="removePreset(preset.id)" tuiHint="Delete"></button>
|
|
3510
3503
|
}
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3504
|
+
}
|
|
3505
|
+
@else {
|
|
3506
|
+
<button style="flex: 0 0 auto;" class="preset-name" tuiButton appearance="secondary" size="s" (click)="selectPreset(preset.id)">{{preset.name}}</button>
|
|
3507
|
+
}
|
|
3508
|
+
</div>
|
|
3509
|
+
}
|
|
3514
3510
|
`, host: {
|
|
3515
|
-
style: 'display:flex;flex-direction: row;gap:10px;width:100
|
|
3516
|
-
}, styles: ["
|
|
3511
|
+
style: 'display:flex;flex-direction: row;gap:10px;width:100%;flex-wrap:wrap;'
|
|
3512
|
+
}, styles: [".preset-group{max-width:25vw}.preset-group .preset-name{height:100%;display:inline;text-overflow:ellipsis;align-content:center}\n"] }]
|
|
3517
3513
|
}], ctorParameters: () => [{ type: EzUITable }], propDecorators: { storageKey: [{
|
|
3518
3514
|
type: Input
|
|
3519
3515
|
}], onPresetChange: [{
|
|
@@ -3621,9 +3617,9 @@ class EzUITableFilterService {
|
|
|
3621
3617
|
action: 'ncon',
|
|
3622
3618
|
filter: (values, column, value) => EzUIFilterHelpers.genericFilter(values, (i) => !value.includes(i), column)
|
|
3623
3619
|
},
|
|
3624
|
-
// Date filters
|
|
3620
|
+
// Date Time filters
|
|
3625
3621
|
{
|
|
3626
|
-
key: '
|
|
3622
|
+
key: 'datt',
|
|
3627
3623
|
action: 'bef',
|
|
3628
3624
|
filter: (values, column, value) => EzUIFilterHelpers.dateFilter(values, (i) => {
|
|
3629
3625
|
var normal = value[0].toLocalNativeDate();
|
|
@@ -3632,7 +3628,7 @@ class EzUITableFilterService {
|
|
|
3632
3628
|
}, column)
|
|
3633
3629
|
},
|
|
3634
3630
|
{
|
|
3635
|
-
key: '
|
|
3631
|
+
key: 'datt',
|
|
3636
3632
|
action: 'aft',
|
|
3637
3633
|
filter: (values, column, value) => EzUIFilterHelpers.dateFilter(values, (i) => {
|
|
3638
3634
|
var normal = value[0].toLocalNativeDate();
|
|
@@ -3640,6 +3636,23 @@ class EzUITableFilterService {
|
|
|
3640
3636
|
return i.getTime() > normal.getTime();
|
|
3641
3637
|
}, column)
|
|
3642
3638
|
},
|
|
3639
|
+
// Date filters
|
|
3640
|
+
{
|
|
3641
|
+
key: 'dat',
|
|
3642
|
+
action: 'bef',
|
|
3643
|
+
filter: (values, column, value) => EzUIFilterHelpers.dateFilter(values, (i) => {
|
|
3644
|
+
var normal = value.toLocalNativeDate();
|
|
3645
|
+
return i.getTime() < normal.getTime();
|
|
3646
|
+
}, column)
|
|
3647
|
+
},
|
|
3648
|
+
{
|
|
3649
|
+
key: 'dat',
|
|
3650
|
+
action: 'aft',
|
|
3651
|
+
filter: (values, column, value) => EzUIFilterHelpers.dateFilter(values, (i) => {
|
|
3652
|
+
var normal = value.toLocalNativeDate();
|
|
3653
|
+
return i.getTime() > normal.getTime();
|
|
3654
|
+
}, column)
|
|
3655
|
+
},
|
|
3643
3656
|
// Boolean filters
|
|
3644
3657
|
{
|
|
3645
3658
|
key: 'bol',
|
|
@@ -4253,7 +4266,7 @@ class EzUITableDateFilter {
|
|
|
4253
4266
|
filterVisible = signal(false, /* @ts-ignore */
|
|
4254
4267
|
...(ngDevMode ? [{ debugName: "filterVisible" }] : /* istanbul ignore next */ []));
|
|
4255
4268
|
table;
|
|
4256
|
-
value =
|
|
4269
|
+
value = TuiDay.currentLocal();
|
|
4257
4270
|
filterType = signal({}, /* @ts-ignore */
|
|
4258
4271
|
...(ngDevMode ? [{ debugName: "filterType" }] : /* istanbul ignore next */ []));
|
|
4259
4272
|
filterTypes;
|
|
@@ -4271,6 +4284,234 @@ class EzUITableDateFilter {
|
|
|
4271
4284
|
}
|
|
4272
4285
|
];
|
|
4273
4286
|
this.filterType.set(this.filterTypes[0]);
|
|
4287
|
+
this.table.onPresetChange.subscribe(x => {
|
|
4288
|
+
if (!x) {
|
|
4289
|
+
this.filterType.set(this.filterTypes[0]);
|
|
4290
|
+
this.value = TuiDay.currentLocal();
|
|
4291
|
+
this.filterApplied.set(false);
|
|
4292
|
+
return;
|
|
4293
|
+
}
|
|
4294
|
+
const filter = x.filters.find(x => x.column == this.column);
|
|
4295
|
+
if (!filter) {
|
|
4296
|
+
this.filterType.set(this.filterTypes[0]);
|
|
4297
|
+
this.value = TuiDay.currentLocal();
|
|
4298
|
+
this.filterApplied.set(false);
|
|
4299
|
+
return;
|
|
4300
|
+
}
|
|
4301
|
+
const type = this.filterTypes.find(x => x.expression == filter.expression);
|
|
4302
|
+
if (!type) {
|
|
4303
|
+
this.filterType.set(this.filterTypes[0]);
|
|
4304
|
+
this.value = TuiDay.currentLocal();
|
|
4305
|
+
this.filterApplied.set(false);
|
|
4306
|
+
return;
|
|
4307
|
+
}
|
|
4308
|
+
this.filterType.set(type);
|
|
4309
|
+
let forceReapply = false;
|
|
4310
|
+
if (typeof filter.value[0] == 'string') {
|
|
4311
|
+
this.value = TuiDay.jsonParse(filter.value[0]);
|
|
4312
|
+
forceReapply = true;
|
|
4313
|
+
}
|
|
4314
|
+
else {
|
|
4315
|
+
this.value = filter.value;
|
|
4316
|
+
}
|
|
4317
|
+
this.filterApplied.set(true);
|
|
4318
|
+
if (forceReapply) {
|
|
4319
|
+
// Force reapply filter, to fix local storage parsing issue
|
|
4320
|
+
this.applyFilter(type.expression);
|
|
4321
|
+
}
|
|
4322
|
+
});
|
|
4323
|
+
}
|
|
4324
|
+
applyFilter(expression) {
|
|
4325
|
+
this.table.setFilter({
|
|
4326
|
+
column: this.column,
|
|
4327
|
+
value: this.value,
|
|
4328
|
+
expression: expression,
|
|
4329
|
+
});
|
|
4330
|
+
this.filterVisible.set(false);
|
|
4331
|
+
this.filterApplied.set(true);
|
|
4332
|
+
}
|
|
4333
|
+
clearFilter() {
|
|
4334
|
+
this.table.clearFilter(this.column);
|
|
4335
|
+
this.filterVisible.set(false);
|
|
4336
|
+
this.filterApplied.set(false);
|
|
4337
|
+
}
|
|
4338
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITableDateFilter, deps: [{ token: EzUITable }], target: i0.ɵɵFactoryTarget.Component });
|
|
4339
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUITableDateFilter, isStandalone: true, selector: "ezui-table-datefilter", inputs: { column: "column" }, ngImport: i0, template: `
|
|
4340
|
+
@if(column){
|
|
4341
|
+
<tui-badged-content>
|
|
4342
|
+
@if(filterApplied()){
|
|
4343
|
+
<tui-badge-notification
|
|
4344
|
+
size="s"
|
|
4345
|
+
tuiSlot="top"
|
|
4346
|
+
>
|
|
4347
|
+
1
|
|
4348
|
+
</tui-badge-notification>
|
|
4349
|
+
}
|
|
4350
|
+
<button
|
|
4351
|
+
tuiButton size="s"
|
|
4352
|
+
iconStart="funnel"
|
|
4353
|
+
appearance="flat-grayscale"
|
|
4354
|
+
style="opacity:0.72"
|
|
4355
|
+
[tuiDropdown]="filterPop"
|
|
4356
|
+
[(tuiDropdownOpen)]="filterVisible"
|
|
4357
|
+
(click)="filterVisible.set(true)"
|
|
4358
|
+
></button>
|
|
4359
|
+
</tui-badged-content>
|
|
4360
|
+
|
|
4361
|
+
<ng-template #filterPop>
|
|
4362
|
+
<div class="filterPopContainer">
|
|
4363
|
+
@let filter = filterType();
|
|
4364
|
+
<button
|
|
4365
|
+
appearance="outline-grayscale"
|
|
4366
|
+
size="s"
|
|
4367
|
+
tuiButton
|
|
4368
|
+
tuiButtonSelect
|
|
4369
|
+
[(ngModel)]="filterType"
|
|
4370
|
+
>
|
|
4371
|
+
{{ filter.label }}
|
|
4372
|
+
<tui-data-list-wrapper
|
|
4373
|
+
*tuiDropdown
|
|
4374
|
+
[itemContent]="stringify | tuiStringifyContent"
|
|
4375
|
+
[items]="filterTypes"
|
|
4376
|
+
/>
|
|
4377
|
+
</button>
|
|
4378
|
+
|
|
4379
|
+
<tui-textfield (keydown.enter)="applyFilter(filter.expression)">
|
|
4380
|
+
<label tuiLabel>Choose a date</label>
|
|
4381
|
+
<input
|
|
4382
|
+
tuiInputDate
|
|
4383
|
+
[(ngModel)]="value"
|
|
4384
|
+
/>
|
|
4385
|
+
<tui-calendar *tuiDropdown />
|
|
4386
|
+
</tui-textfield>
|
|
4387
|
+
<button
|
|
4388
|
+
tuiButton size="s"
|
|
4389
|
+
iconStart="funnel"
|
|
4390
|
+
tuiButton
|
|
4391
|
+
(click)="applyFilter(filter.expression)"
|
|
4392
|
+
>
|
|
4393
|
+
Apply
|
|
4394
|
+
</button>
|
|
4395
|
+
|
|
4396
|
+
@if(filterApplied()){
|
|
4397
|
+
<button
|
|
4398
|
+
tuiButton size="s"
|
|
4399
|
+
iconStart="circle-x"
|
|
4400
|
+
appearance="secondary"
|
|
4401
|
+
tuiButton
|
|
4402
|
+
(click)="clearFilter()"
|
|
4403
|
+
>
|
|
4404
|
+
Clear
|
|
4405
|
+
</button>
|
|
4406
|
+
}
|
|
4407
|
+
</div>
|
|
4408
|
+
</ng-template>
|
|
4409
|
+
}
|
|
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" }] });
|
|
4411
|
+
}
|
|
4412
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITableDateFilter, decorators: [{
|
|
4413
|
+
type: Component,
|
|
4414
|
+
args: [{ selector: 'ezui-table-datefilter', imports: [CommonModule, FormsModule, TuiDropdown, TuiDataListWrapper, TuiButton, TuiButtonSelect, TuiStringifyContentPipe, TuiBadgeNotification, TuiBadgedContent, TuiInput, TuiInputDateTime, TuiInputDateDirective], template: `
|
|
4415
|
+
@if(column){
|
|
4416
|
+
<tui-badged-content>
|
|
4417
|
+
@if(filterApplied()){
|
|
4418
|
+
<tui-badge-notification
|
|
4419
|
+
size="s"
|
|
4420
|
+
tuiSlot="top"
|
|
4421
|
+
>
|
|
4422
|
+
1
|
|
4423
|
+
</tui-badge-notification>
|
|
4424
|
+
}
|
|
4425
|
+
<button
|
|
4426
|
+
tuiButton size="s"
|
|
4427
|
+
iconStart="funnel"
|
|
4428
|
+
appearance="flat-grayscale"
|
|
4429
|
+
style="opacity:0.72"
|
|
4430
|
+
[tuiDropdown]="filterPop"
|
|
4431
|
+
[(tuiDropdownOpen)]="filterVisible"
|
|
4432
|
+
(click)="filterVisible.set(true)"
|
|
4433
|
+
></button>
|
|
4434
|
+
</tui-badged-content>
|
|
4435
|
+
|
|
4436
|
+
<ng-template #filterPop>
|
|
4437
|
+
<div class="filterPopContainer">
|
|
4438
|
+
@let filter = filterType();
|
|
4439
|
+
<button
|
|
4440
|
+
appearance="outline-grayscale"
|
|
4441
|
+
size="s"
|
|
4442
|
+
tuiButton
|
|
4443
|
+
tuiButtonSelect
|
|
4444
|
+
[(ngModel)]="filterType"
|
|
4445
|
+
>
|
|
4446
|
+
{{ filter.label }}
|
|
4447
|
+
<tui-data-list-wrapper
|
|
4448
|
+
*tuiDropdown
|
|
4449
|
+
[itemContent]="stringify | tuiStringifyContent"
|
|
4450
|
+
[items]="filterTypes"
|
|
4451
|
+
/>
|
|
4452
|
+
</button>
|
|
4453
|
+
|
|
4454
|
+
<tui-textfield (keydown.enter)="applyFilter(filter.expression)">
|
|
4455
|
+
<label tuiLabel>Choose a date</label>
|
|
4456
|
+
<input
|
|
4457
|
+
tuiInputDate
|
|
4458
|
+
[(ngModel)]="value"
|
|
4459
|
+
/>
|
|
4460
|
+
<tui-calendar *tuiDropdown />
|
|
4461
|
+
</tui-textfield>
|
|
4462
|
+
<button
|
|
4463
|
+
tuiButton size="s"
|
|
4464
|
+
iconStart="funnel"
|
|
4465
|
+
tuiButton
|
|
4466
|
+
(click)="applyFilter(filter.expression)"
|
|
4467
|
+
>
|
|
4468
|
+
Apply
|
|
4469
|
+
</button>
|
|
4470
|
+
|
|
4471
|
+
@if(filterApplied()){
|
|
4472
|
+
<button
|
|
4473
|
+
tuiButton size="s"
|
|
4474
|
+
iconStart="circle-x"
|
|
4475
|
+
appearance="secondary"
|
|
4476
|
+
tuiButton
|
|
4477
|
+
(click)="clearFilter()"
|
|
4478
|
+
>
|
|
4479
|
+
Clear
|
|
4480
|
+
</button>
|
|
4481
|
+
}
|
|
4482
|
+
</div>
|
|
4483
|
+
</ng-template>
|
|
4484
|
+
}
|
|
4485
|
+
`, styles: [".filterPopContainer{display:flex;flex-direction:column;gap:10px;padding:10px;min-width:20rem}\n"] }]
|
|
4486
|
+
}], ctorParameters: () => [{ type: EzUITable }], propDecorators: { column: [{
|
|
4487
|
+
type: Input
|
|
4488
|
+
}] } });
|
|
4489
|
+
|
|
4490
|
+
class EzUITableDateTimeFilter {
|
|
4491
|
+
column;
|
|
4492
|
+
filterApplied = signal(false, /* @ts-ignore */
|
|
4493
|
+
...(ngDevMode ? [{ debugName: "filterApplied" }] : /* istanbul ignore next */ []));
|
|
4494
|
+
filterVisible = signal(false, /* @ts-ignore */
|
|
4495
|
+
...(ngDevMode ? [{ debugName: "filterVisible" }] : /* istanbul ignore next */ []));
|
|
4496
|
+
table;
|
|
4497
|
+
value = [TuiDay.currentLocal(), TuiTime.currentLocal()];
|
|
4498
|
+
filterType = signal({}, /* @ts-ignore */
|
|
4499
|
+
...(ngDevMode ? [{ debugName: "filterType" }] : /* istanbul ignore next */ []));
|
|
4500
|
+
filterTypes;
|
|
4501
|
+
stringify = (item) => `${item.label}`;
|
|
4502
|
+
constructor(table) {
|
|
4503
|
+
this.table = table;
|
|
4504
|
+
this.filterTypes = [
|
|
4505
|
+
{
|
|
4506
|
+
label: 'After',
|
|
4507
|
+
expression: 'datt;aft'
|
|
4508
|
+
},
|
|
4509
|
+
{
|
|
4510
|
+
label: 'Before',
|
|
4511
|
+
expression: 'datt;bef'
|
|
4512
|
+
}
|
|
4513
|
+
];
|
|
4514
|
+
this.filterType.set(this.filterTypes[0]);
|
|
4274
4515
|
this.table.onPresetChange.subscribe(x => {
|
|
4275
4516
|
if (!x) {
|
|
4276
4517
|
this.filterType.set(this.filterTypes[0]);
|
|
@@ -4322,8 +4563,8 @@ class EzUITableDateFilter {
|
|
|
4322
4563
|
this.filterVisible.set(false);
|
|
4323
4564
|
this.filterApplied.set(false);
|
|
4324
4565
|
}
|
|
4325
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type:
|
|
4326
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type:
|
|
4566
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITableDateTimeFilter, deps: [{ token: EzUITable }], target: i0.ɵɵFactoryTarget.Component });
|
|
4567
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUITableDateTimeFilter, isStandalone: true, selector: "ezui-table-datetimefilter", inputs: { column: "column" }, ngImport: i0, template: `
|
|
4327
4568
|
@if(column){
|
|
4328
4569
|
<tui-badged-content>
|
|
4329
4570
|
@if(filterApplied()){
|
|
@@ -4364,7 +4605,7 @@ class EzUITableDateFilter {
|
|
|
4364
4605
|
</button>
|
|
4365
4606
|
|
|
4366
4607
|
<tui-textfield (keydown.enter)="applyFilter(filter.expression)">
|
|
4367
|
-
<label tuiLabel>Choose a date</label>
|
|
4608
|
+
<label tuiLabel>Choose a date and time</label>
|
|
4368
4609
|
<input
|
|
4369
4610
|
tuiInputDateTime
|
|
4370
4611
|
[(ngModel)]="value"
|
|
@@ -4396,9 +4637,9 @@ class EzUITableDateFilter {
|
|
|
4396
4637
|
}
|
|
4397
4638
|
`, 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: "directive", type: i4$1.TuiInputDateTimeDirective, selector: "input[tuiInputDateTime]", inputs: ["timeMode", "min", "max"] }, { kind: "component", type: i6.TuiCalendar, selector: "tui-calendar:not([new]):not([months])", inputs: ["minViewedMonth", "maxViewedMonth", "showAdjacent", "markerHandler", "initialView", "hoveredItem"], outputs: ["hoveredItemChange", "dayClick"] }, { kind: "pipe", type: TuiStringifyContentPipe, name: "tuiStringifyContent" }] });
|
|
4398
4639
|
}
|
|
4399
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type:
|
|
4640
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITableDateTimeFilter, decorators: [{
|
|
4400
4641
|
type: Component,
|
|
4401
|
-
args: [{ selector: 'ezui-table-
|
|
4642
|
+
args: [{ selector: 'ezui-table-datetimefilter', imports: [CommonModule, FormsModule, TuiDropdown, TuiDataListWrapper, TuiButton, TuiButtonSelect, TuiStringifyContentPipe, TuiBadgeNotification, TuiBadgedContent, TuiInput, TuiInputDateTime], template: `
|
|
4402
4643
|
@if(column){
|
|
4403
4644
|
<tui-badged-content>
|
|
4404
4645
|
@if(filterApplied()){
|
|
@@ -4439,7 +4680,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
4439
4680
|
</button>
|
|
4440
4681
|
|
|
4441
4682
|
<tui-textfield (keydown.enter)="applyFilter(filter.expression)">
|
|
4442
|
-
<label tuiLabel>Choose a date</label>
|
|
4683
|
+
<label tuiLabel>Choose a date and time</label>
|
|
4443
4684
|
<input
|
|
4444
4685
|
tuiInputDateTime
|
|
4445
4686
|
[(ngModel)]="value"
|
|
@@ -5923,5 +6164,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
5923
6164
|
* Generated bundle index. Do not edit.
|
|
5924
6165
|
*/
|
|
5925
6166
|
|
|
5926
|
-
export { BaseCRUDInterface, BaseListInterface, EzUIBooleanInput, EzUIDateInput, EzUIDateTimeInput, EzUIDialog, EzUIFileInput, EzUIFilterHelpers, EzUIIconSelector, EzUILayout, EzUILayoutService, EzUIMarkdownEditor, EzUIMenuBar, EzUIMenuBarSubDataList, EzUIMultiSelect, EzUINumberInput, EzUIPasswordInput, EzUISelect, EzUIShowMoreText, EzUITTableSortableColumn, EzUITable, EzUITableBooleanFilter, EzUITableDateFilter, EzUITableFilterService, EzUITableNumberFilter, EzUITableSelectFilter, EzUITableTextFilter, EzUITextInput, compressImage };
|
|
6167
|
+
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 };
|
|
5927
6168
|
//# sourceMappingURL=kris701-ez-ui.mjs.map
|