@kris701/ez-ui 1.4.1 → 1.4.3

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.
@@ -407,9 +407,11 @@ class EzUIDialog {
407
407
  </hgroup>
408
408
  </header>
409
409
 
410
- <tui-loader [overlay]="true" [loading]="isLoading()">
411
- <ng-container [ngTemplateOutlet]="content"></ng-container>
412
- </tui-loader>
410
+ @if(showDialog()){
411
+ <tui-loader [overlay]="true" [loading]="isLoading()">
412
+ <ng-container [ngTemplateOutlet]="content"></ng-container>
413
+ </tui-loader>
414
+ }
413
415
 
414
416
  @if(!isLoading() && (showSave || showDelete)){
415
417
  <footer class="dialog-footer">
@@ -447,9 +449,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
447
449
  </hgroup>
448
450
  </header>
449
451
 
450
- <tui-loader [overlay]="true" [loading]="isLoading()">
451
- <ng-container [ngTemplateOutlet]="content"></ng-container>
452
- </tui-loader>
452
+ @if(showDialog()){
453
+ <tui-loader [overlay]="true" [loading]="isLoading()">
454
+ <ng-container [ngTemplateOutlet]="content"></ng-container>
455
+ </tui-loader>
456
+ }
453
457
 
454
458
  @if(!isLoading() && (showSave || showDelete)){
455
459
  <footer class="dialog-footer">
@@ -4810,7 +4814,7 @@ class EzUITable {
4810
4814
  showClearFilters = false;
4811
4815
  expandable = false;
4812
4816
  clickable = false;
4813
- values = [];
4817
+ values = null;
4814
4818
  internalValues = [];
4815
4819
  displayValues = signal([], /* @ts-ignore */
4816
4820
  ...(ngDevMode ? [{ debugName: "displayValues" }] : /* istanbul ignore next */ []));
@@ -4853,16 +4857,18 @@ class EzUITable {
4853
4857
  this.internalValues = sorted;
4854
4858
  }
4855
4859
  applyFilter() {
4856
- let filtered = [...this.values];
4857
- for (const filter of this.filters())
4858
- filtered = this.filterService.filter(filtered, filter);
4859
- this.internalValues = filtered;
4860
- this.applySorts();
4861
- this.state = [];
4862
- this.page.set(0);
4863
- this.pages.set(Math.floor(this.internalValues.length / this.pageSize()) + 1);
4864
- this.processPage();
4865
- this.presetHeader?.saveCurrentPreset();
4860
+ if (this.values) {
4861
+ let filtered = [...this.values];
4862
+ for (const filter of this.filters())
4863
+ filtered = this.filterService.filter(filtered, filter);
4864
+ this.internalValues = filtered;
4865
+ this.applySorts();
4866
+ this.state = [];
4867
+ this.page.set(0);
4868
+ this.pages.set(Math.floor(this.internalValues.length / this.pageSize()) + 1);
4869
+ this.processPage();
4870
+ this.presetHeader?.saveCurrentPreset();
4871
+ }
4866
4872
  }
4867
4873
  state = {};
4868
4874
  setSort(sort) {
@@ -4914,7 +4920,7 @@ class EzUITable {
4914
4920
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUITable, isStandalone: true, selector: "ezui-table", inputs: { disabled: "disabled", isLoading: "isLoading", showAdd: "showAdd", showRefresh: "showRefresh", showClearFilters: "showClearFilters", expandable: "expandable", clickable: "clickable", values: "values", storageKey: "storageKey", allowPresets: "allowPresets", pageSize: "pageSize" }, outputs: { onAddItem: "onAddItem", onLoadItems: "onLoadItems", onRowExpanded: "onRowExpanded", onRowClick: "onRowClick", onPresetChange: "onPresetChange" }, host: { classAttribute: "w-full h-full" }, queries: [{ propertyName: "tableHeader", first: true, predicate: ["tableHeader"], descendants: true }, { propertyName: "tableRows", first: true, predicate: ["tableRows"], descendants: true }, { propertyName: "tableExpandedrow", first: true, predicate: ["tableExpandedrow"], descendants: true }], viewQueries: [{ propertyName: "presetHeader", first: true, predicate: ["presetHeader"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
4915
4921
  <div class="ezui-table">
4916
4922
  <tui-loader [inheritColor]="true" [overlay]="true" size="xxl" [loading]="isLoading()">
4917
- @if(values.length == 0){
4923
+ @if(values === null || values.length == 0){
4918
4924
  @if(showAdd || showRefresh){
4919
4925
  <div class="ezui-table-header">
4920
4926
  @if(showRefresh){
@@ -5032,7 +5038,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
5032
5038
  args: [{ selector: 'ezui-table', imports: [FormsModule, CommonModule, TuiTable, TuiScrollbar, TuiButton, TuiChevron, TuiDropdown, TuiDataListWrapper, TuiTablePagination, TuiLoader, TuiBlockStatus, TuiIcon, TuiInput, EzUITablePresets, TuiHint], template: `
5033
5039
  <div class="ezui-table">
5034
5040
  <tui-loader [inheritColor]="true" [overlay]="true" size="xxl" [loading]="isLoading()">
5035
- @if(values.length == 0){
5041
+ @if(values === null || values.length == 0){
5036
5042
  @if(showAdd || showRefresh){
5037
5043
  <div class="ezui-table-header">
5038
5044
  @if(showRefresh){