@kris701/ez-ui 1.2.14 → 1.2.16

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.
@@ -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.currentPreset.set(presets[0]);
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) {
@@ -3449,71 +3450,67 @@ class EzUITablePresets {
3449
3450
  this.table.applyFilter();
3450
3451
  }
3451
3452
  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%" }, usesOnChanges: true, ngImport: i0, template: `
3453
+ 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
3454
  <button tuiButton iconStart="plus" size="s" appearance="secondary" (click)="createPreset()" tuiHint="Create new preset from current filters"></button>
3454
3455
 
3455
- <tui-scrollbar>
3456
- @let current = currentPreset();
3457
- @for(preset of presets(); track preset.id){
3458
- <div tuiGroup [collapsed]="true" [rounded]="true">
3459
- @let isActive = current?.id == preset.id;
3460
- @if(isActive){
3461
- @if(preset.edit){
3462
- <tui-textfield style="width:10rem" tuiTextfieldSize="s" (keydown.enter)="preset.edit = false;saveCurrentPreset()">
3463
- <input tuiInput [(ngModel)]="preset.name"/>
3464
- </tui-textfield>
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>
3456
+ @let current = currentPreset();
3457
+ @for(preset of presets(); track preset.id){
3458
+ <div tuiGroup class="preset-group" [collapsed]="true" [rounded]="true">
3459
+ @let isActive = current?.id == preset.id;
3460
+ @if(isActive){
3461
+ @if(preset.edit){
3462
+ <tui-textfield style="width:10rem" tuiTextfieldSize="s" (keydown.enter)="preset.edit = false;saveCurrentPreset()">
3463
+ <input tuiInput [(ngModel)]="preset.name"/>
3464
+ </tui-textfield>
3465
+ <button style="flex: 0 0 auto;" tuiButton iconStart="save" size="s" appearance="info" (click)="preset.edit = false;saveCurrentPreset()" tuiHint="Save"></button>
3474
3466
  }
3475
3467
  @else {
3476
- <button style="flex: 0 0 auto;" tuiButton appearance="secondary" size="s" (click)="selectPreset(preset.id)">{{preset.name}}</button>
3468
+ <button style="flex: 0 0 auto;" tuiButton iconStart="square-pen" size="s" appearance="info" (click)="preset.edit = true" tuiHint="Edit"></button>
3469
+ <div class="preset-name" appearance="positive" tuiBadge tuiStatus>
3470
+ {{preset.name}}
3471
+ </div>
3472
+ <button style="flex: 0 0 auto;" tuiButton iconStart="x" size="s" appearance="negative" (click)="removePreset(preset.id)" tuiHint="Delete"></button>
3477
3473
  }
3478
- </div>
3479
- }
3480
- </tui-scrollbar>
3481
- `, isInline: true, styles: ["tui-scrollbar{width:100%!important}tui-scrollbar ::ng-deep>.t-content{display:flex;gap:10px;width:0px}\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: "component", type: TuiScrollbar, selector: "tui-scrollbar" }, { 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"] }] });
3474
+ }
3475
+ @else {
3476
+ <button style="flex: 0 0 auto;" class="preset-name" tuiButton appearance="secondary" size="s" (click)="selectPreset(preset.id)">{{preset.name}}</button>
3477
+ }
3478
+ </div>
3479
+ }
3480
+ `, 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
3481
  }
3483
3482
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITablePresets, decorators: [{
3484
3483
  type: Component,
3485
- args: [{ selector: 'ezui-table-presets', imports: [FormsModule, CommonModule, TuiScrollbar, TuiButton, TuiGroup, TuiBadge, TuiStatus, TuiInput, TuiHint], template: `
3484
+ args: [{ selector: 'ezui-table-presets', imports: [FormsModule, CommonModule, TuiButton, TuiGroup, TuiBadge, TuiStatus, TuiInput, TuiHint], template: `
3486
3485
  <button tuiButton iconStart="plus" size="s" appearance="secondary" (click)="createPreset()" tuiHint="Create new preset from current filters"></button>
3487
3486
 
3488
- <tui-scrollbar>
3489
- @let current = currentPreset();
3490
- @for(preset of presets(); track preset.id){
3491
- <div tuiGroup [collapsed]="true" [rounded]="true">
3492
- @let isActive = current?.id == preset.id;
3493
- @if(isActive){
3494
- @if(preset.edit){
3495
- <tui-textfield style="width:10rem" tuiTextfieldSize="s" (keydown.enter)="preset.edit = false;saveCurrentPreset()">
3496
- <input tuiInput [(ngModel)]="preset.name"/>
3497
- </tui-textfield>
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>
3487
+ @let current = currentPreset();
3488
+ @for(preset of presets(); track preset.id){
3489
+ <div tuiGroup class="preset-group" [collapsed]="true" [rounded]="true">
3490
+ @let isActive = current?.id == preset.id;
3491
+ @if(isActive){
3492
+ @if(preset.edit){
3493
+ <tui-textfield style="width:10rem" tuiTextfieldSize="s" (keydown.enter)="preset.edit = false;saveCurrentPreset()">
3494
+ <input tuiInput [(ngModel)]="preset.name"/>
3495
+ </tui-textfield>
3496
+ <button style="flex: 0 0 auto;" tuiButton iconStart="save" size="s" appearance="info" (click)="preset.edit = false;saveCurrentPreset()" tuiHint="Save"></button>
3507
3497
  }
3508
3498
  @else {
3509
- <button style="flex: 0 0 auto;" tuiButton appearance="secondary" size="s" (click)="selectPreset(preset.id)">{{preset.name}}</button>
3499
+ <button style="flex: 0 0 auto;" tuiButton iconStart="square-pen" size="s" appearance="info" (click)="preset.edit = true" tuiHint="Edit"></button>
3500
+ <div class="preset-name" appearance="positive" tuiBadge tuiStatus>
3501
+ {{preset.name}}
3502
+ </div>
3503
+ <button style="flex: 0 0 auto;" tuiButton iconStart="x" size="s" appearance="negative" (click)="removePreset(preset.id)" tuiHint="Delete"></button>
3510
3504
  }
3511
- </div>
3512
- }
3513
- </tui-scrollbar>
3505
+ }
3506
+ @else {
3507
+ <button style="flex: 0 0 auto;" class="preset-name" tuiButton appearance="secondary" size="s" (click)="selectPreset(preset.id)">{{preset.name}}</button>
3508
+ }
3509
+ </div>
3510
+ }
3514
3511
  `, host: {
3515
- style: 'display:flex;flex-direction: row;gap:10px;width:100%'
3516
- }, styles: ["tui-scrollbar{width:100%!important}tui-scrollbar ::ng-deep>.t-content{display:flex;gap:10px;width:0px}\n"] }]
3512
+ style: 'display:flex;flex-direction: row;gap:10px;width:100%;flex-wrap:wrap;'
3513
+ }, styles: [".preset-group{max-width:25vw}.preset-group .preset-name{height:100%;display:inline;text-overflow:ellipsis;align-content:center}\n"] }]
3517
3514
  }], ctorParameters: () => [{ type: EzUITable }], propDecorators: { storageKey: [{
3518
3515
  type: Input
3519
3516
  }], onPresetChange: [{
@@ -4311,8 +4308,8 @@ class EzUITableDateFilter {
4311
4308
  }
4312
4309
  this.filterType.set(type);
4313
4310
  let forceReapply = false;
4314
- if (typeof filter.value[0] == 'string') {
4315
- this.value = TuiDay.jsonParse(filter.value[0]);
4311
+ if (typeof filter.value == 'string') {
4312
+ this.value = TuiDay.jsonParse(filter.value);
4316
4313
  forceReapply = true;
4317
4314
  }
4318
4315
  else {