@webilix/ngx-table-m3 0.0.21 → 0.0.22

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.
@@ -929,27 +929,40 @@ class ViewService {
929
929
  const iconFn = ngxTable.rows?.icon;
930
930
  if (!iconFn)
931
931
  return [];
932
- return data.map((item) => {
933
- const icon = iconFn(item);
934
- return typeof icon === 'string' ? { icon } : { icon: icon.icon, color: icon.color || undefined };
932
+ return data.map((item, index) => {
933
+ const icon = iconFn(item, index);
934
+ return typeof icon === 'string'
935
+ ? { icon }
936
+ : 'emoji' in icon
937
+ ? { icon: '' }
938
+ : { icon: icon.icon, color: icon.color || undefined };
939
+ });
940
+ }
941
+ getEmojis(ngxTable, data) {
942
+ const iconFn = ngxTable.rows?.icon;
943
+ if (!iconFn)
944
+ return [];
945
+ return data.map((item, index) => {
946
+ const icon = iconFn(item, index);
947
+ return typeof icon === 'string' ? '' : 'emoji' in icon ? icon.emoji : '';
935
948
  });
936
949
  }
937
950
  getColors(ngxTable, data) {
938
951
  const colorFn = ngxTable.rows?.color;
939
952
  if (!colorFn)
940
953
  return [];
941
- return data.map((item) => colorFn(item) || '');
954
+ return data.map((item, index) => colorFn(item, index) || '');
942
955
  }
943
956
  getDescriptions(ngxTable, data) {
944
957
  const descriptionFn = ngxTable.rows?.description;
945
958
  if (!descriptionFn)
946
959
  return [];
947
- return data.map((item) => descriptionFn(item) || undefined);
960
+ return data.map((item, index) => descriptionFn(item, index) || undefined);
948
961
  }
949
962
  getDeactives(ngxTable, data) {
950
963
  const deactives = [];
951
964
  data.forEach((item, index) => {
952
- if (ngxTable.rows?.isDeactive?.(item))
965
+ if (ngxTable.rows?.isDeactive?.(item, index))
953
966
  deactives.push(index);
954
967
  });
955
968
  return deactives;
@@ -1092,6 +1105,7 @@ class ViewCardComponent {
1092
1105
  titleIndex;
1093
1106
  subTitleIndex;
1094
1107
  icons = [];
1108
+ emojis = [];
1095
1109
  colors = [];
1096
1110
  descriptions = [];
1097
1111
  deactives = [];
@@ -1110,6 +1124,7 @@ class ViewCardComponent {
1110
1124
  this.titleIndex = this.viewService.getTitleIndex(this.ngxTable);
1111
1125
  this.subTitleIndex = this.viewService.getSubTitleIndex(this.ngxTable);
1112
1126
  this.icons = this.viewService.getIcons(this.ngxTable, this.data);
1127
+ this.emojis = this.viewService.getEmojis(this.ngxTable, this.data);
1113
1128
  this.colors = this.viewService.getColors(this.ngxTable, this.data);
1114
1129
  this.descriptions = this.viewService.getDescriptions(this.ngxTable, this.data);
1115
1130
  this.deactives = this.viewService.getDeactives(this.ngxTable, this.data);
@@ -1132,11 +1147,11 @@ class ViewCardComponent {
1132
1147
  });
1133
1148
  }
1134
1149
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ViewCardComponent, deps: [{ token: FilterService }, { token: ViewService }], target: i0.ɵɵFactoryTarget.Component });
1135
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: ViewCardComponent, isStandalone: true, selector: "view-card", inputs: { ngxTable: "ngxTable", data: "data", viewConfig: "viewConfig" }, outputs: { orderChanged: "orderChanged", filterChanged: "filterChanged", filterCleared: "filterCleared" }, host: { properties: { "className": "this.className" } }, providers: [FilterService, ViewService], usesOnChanges: true, ngImport: i0, template: "<!-- TOOLBAR -->\n@if (hasToolbar) {\n<view-card-toolbar\n [orders]=\"orders\"\n [filters]=\"filters\"\n [viewConfig]=\"viewConfig\"\n (orderChanged)=\"orderChanged.next($event)\"\n (updateFilter)=\"updateFilter($event)\"\n (clearFilter)=\"filterCleared.next()\"\n></view-card-toolbar>\n}\n\n<!-- DATA -->\n<div class=\"card-container\">\n @for (item of data; track $index; let dataIndex = $index) {\n <div class=\"card\">\n <div class=\"card-header\" [style.position]=\"viewConfig.stickyView?.top ? 'sticky' : 'static'\" [style.top]=\"top\">\n <!-- ICON -->\n @if (hasIcon) {\n <mat-icon class=\"icon\" [style.color]=\"icons[$index].color\" [style.font-size]=\"viewConfig.iconSize\">\n {{ icons[$index].icon }}\n </mat-icon>\n }\n\n <!-- TITLE -->\n <div class=\"title\" [style.color]=\"colors[dataIndex]\">\n <view-value\n [column]=\"ngxTable.columns[this.titleIndex]\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isDeactive]=\"deactives.includes(dataIndex)\"\n [isCard]=\"true\"\n [isCardTitle]=\"true\"\n ></view-value>\n <!-- SUB TITLE -->\n @if (subTitleIndex !== undefined) {\n <view-value\n [column]=\"ngxTable.columns[this.subTitleIndex]\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isCard]=\"true\"\n [isCardSubTitle]=\"true\"\n ></view-value>\n }\n </div>\n\n <!-- ACTION -->\n @if (hasAction) {\n <view-action\n [actions]=\"ngxTable.actions || []\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isMobile]=\"true\"\n ></view-action>\n }\n </div>\n\n <!-- CONTENT -->\n @if (hasContent) {\n <div class=\"card-content\" [style.color]=\"colors[dataIndex]\">\n @for (column of ngxTable.columns; track $index; let columnIndex = $index) {\n <!-- CHECK TITLE AND SUBTITLE -->\n @if (columnIndex !== titleIndex && columnIndex !== subTitleIndex) {\n <div class=\"item\">\n <div class=\"title\">{{ column.title }}{{ !!column.title ? ' :' : '' }}</div>\n <div class=\"value\">\n <view-value [column]=\"column\" [item]=\"item\" [viewConfig]=\"viewConfig\" [isCard]=\"true\"></view-value>\n </div>\n </div>\n } }\n\n <!-- DESCRIPTION -->\n @if (descriptions[dataIndex]) {\n <div class=\"description\" [innerHTML]=\"descriptions[dataIndex] || '' | ngxHelperMultiLine\"></div>\n }\n </div>\n }\n </div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: NgxHelperMultiLinePipe, name: "ngxHelperMultiLine" }, { kind: "component", type: ViewActionComponent, selector: "view-action", inputs: ["actions", "item", "viewConfig", "isMobile"] }, { kind: "component", type: ViewValueComponent, selector: "view-value", inputs: ["column", "item", "viewConfig", "isDeactive", "isCard", "isCardTitle", "isCardSubTitle"] }, { kind: "component", type: ViewCardToolbarComponent, selector: "view-card-toolbar", inputs: ["orders", "filters", "viewConfig"], outputs: ["orderChanged", "updateFilter", "clearFilter"] }] });
1150
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: ViewCardComponent, isStandalone: true, selector: "view-card", inputs: { ngxTable: "ngxTable", data: "data", viewConfig: "viewConfig" }, outputs: { orderChanged: "orderChanged", filterChanged: "filterChanged", filterCleared: "filterCleared" }, host: { properties: { "className": "this.className" } }, providers: [FilterService, ViewService], usesOnChanges: true, ngImport: i0, template: "<!-- TOOLBAR -->\n@if (hasToolbar) {\n<view-card-toolbar\n [orders]=\"orders\"\n [filters]=\"filters\"\n [viewConfig]=\"viewConfig\"\n (orderChanged)=\"orderChanged.next($event)\"\n (updateFilter)=\"updateFilter($event)\"\n (clearFilter)=\"filterCleared.next()\"\n></view-card-toolbar>\n}\n\n<!-- DATA -->\n<div class=\"card-container\">\n @for (item of data; track $index; let dataIndex = $index) {\n <div class=\"card\">\n <div class=\"card-header\" [style.position]=\"viewConfig.stickyView?.top ? 'sticky' : 'static'\" [style.top]=\"top\">\n <!-- ICON -->\n @if (hasIcon) {\n <!-- MATERIAL ICON -->\n @if (icons[$index].icon) {\n <mat-icon class=\"icon\" [style.color]=\"icons[$index].color\" [style.font-size]=\"viewConfig.iconSize\">\n {{ icons[$index].icon }}\n </mat-icon>\n }\n <!-- EMOJI -->\n @else {\n <td class=\"emoji\" [style.font-size]=\"viewConfig.emojiSize\">{{ emojis[$index] || '' }}</td>\n } }\n\n <!-- TITLE -->\n <div class=\"title\" [style.color]=\"colors[dataIndex]\">\n <view-value\n [column]=\"ngxTable.columns[this.titleIndex]\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isDeactive]=\"deactives.includes(dataIndex)\"\n [isCard]=\"true\"\n [isCardTitle]=\"true\"\n ></view-value>\n <!-- SUB TITLE -->\n @if (subTitleIndex !== undefined) {\n <view-value\n [column]=\"ngxTable.columns[this.subTitleIndex]\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isCard]=\"true\"\n [isCardSubTitle]=\"true\"\n ></view-value>\n }\n </div>\n\n <!-- ACTION -->\n @if (hasAction) {\n <view-action\n [actions]=\"ngxTable.actions || []\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isMobile]=\"true\"\n ></view-action>\n }\n </div>\n\n <!-- CONTENT -->\n @if (hasContent) {\n <div class=\"card-content\" [style.color]=\"colors[dataIndex]\">\n @for (column of ngxTable.columns; track $index; let columnIndex = $index) {\n <!-- CHECK TITLE AND SUBTITLE -->\n @if (columnIndex !== titleIndex && columnIndex !== subTitleIndex) {\n <div class=\"item\">\n <div class=\"title\">{{ column.title }}{{ !!column.title ? ' :' : '' }}</div>\n <div class=\"value\">\n <view-value [column]=\"column\" [item]=\"item\" [viewConfig]=\"viewConfig\" [isCard]=\"true\"></view-value>\n </div>\n </div>\n } }\n\n <!-- DESCRIPTION -->\n @if (descriptions[dataIndex]) {\n <div class=\"description\" [innerHTML]=\"descriptions[dataIndex] || '' | ngxHelperMultiLine\"></div>\n }\n </div>\n }\n </div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: NgxHelperMultiLinePipe, name: "ngxHelperMultiLine" }, { kind: "component", type: ViewActionComponent, selector: "view-action", inputs: ["actions", "item", "viewConfig", "isMobile"] }, { kind: "component", type: ViewValueComponent, selector: "view-value", inputs: ["column", "item", "viewConfig", "isDeactive", "isCard", "isCardTitle", "isCardSubTitle"] }, { kind: "component", type: ViewCardToolbarComponent, selector: "view-card-toolbar", inputs: ["orders", "filters", "viewConfig"], outputs: ["orderChanged", "updateFilter", "clearFilter"] }] });
1136
1151
  }
1137
1152
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ViewCardComponent, decorators: [{
1138
1153
  type: Component,
1139
- args: [{ selector: 'view-card', imports: [MatIcon, NgxHelperMultiLinePipe, ViewActionComponent, ViewValueComponent, ViewCardToolbarComponent], providers: [FilterService, ViewService], template: "<!-- TOOLBAR -->\n@if (hasToolbar) {\n<view-card-toolbar\n [orders]=\"orders\"\n [filters]=\"filters\"\n [viewConfig]=\"viewConfig\"\n (orderChanged)=\"orderChanged.next($event)\"\n (updateFilter)=\"updateFilter($event)\"\n (clearFilter)=\"filterCleared.next()\"\n></view-card-toolbar>\n}\n\n<!-- DATA -->\n<div class=\"card-container\">\n @for (item of data; track $index; let dataIndex = $index) {\n <div class=\"card\">\n <div class=\"card-header\" [style.position]=\"viewConfig.stickyView?.top ? 'sticky' : 'static'\" [style.top]=\"top\">\n <!-- ICON -->\n @if (hasIcon) {\n <mat-icon class=\"icon\" [style.color]=\"icons[$index].color\" [style.font-size]=\"viewConfig.iconSize\">\n {{ icons[$index].icon }}\n </mat-icon>\n }\n\n <!-- TITLE -->\n <div class=\"title\" [style.color]=\"colors[dataIndex]\">\n <view-value\n [column]=\"ngxTable.columns[this.titleIndex]\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isDeactive]=\"deactives.includes(dataIndex)\"\n [isCard]=\"true\"\n [isCardTitle]=\"true\"\n ></view-value>\n <!-- SUB TITLE -->\n @if (subTitleIndex !== undefined) {\n <view-value\n [column]=\"ngxTable.columns[this.subTitleIndex]\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isCard]=\"true\"\n [isCardSubTitle]=\"true\"\n ></view-value>\n }\n </div>\n\n <!-- ACTION -->\n @if (hasAction) {\n <view-action\n [actions]=\"ngxTable.actions || []\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isMobile]=\"true\"\n ></view-action>\n }\n </div>\n\n <!-- CONTENT -->\n @if (hasContent) {\n <div class=\"card-content\" [style.color]=\"colors[dataIndex]\">\n @for (column of ngxTable.columns; track $index; let columnIndex = $index) {\n <!-- CHECK TITLE AND SUBTITLE -->\n @if (columnIndex !== titleIndex && columnIndex !== subTitleIndex) {\n <div class=\"item\">\n <div class=\"title\">{{ column.title }}{{ !!column.title ? ' :' : '' }}</div>\n <div class=\"value\">\n <view-value [column]=\"column\" [item]=\"item\" [viewConfig]=\"viewConfig\" [isCard]=\"true\"></view-value>\n </div>\n </div>\n } }\n\n <!-- DESCRIPTION -->\n @if (descriptions[dataIndex]) {\n <div class=\"description\" [innerHTML]=\"descriptions[dataIndex] || '' | ngxHelperMultiLine\"></div>\n }\n </div>\n }\n </div>\n }\n</div>\n" }]
1154
+ args: [{ selector: 'view-card', imports: [MatIcon, NgxHelperMultiLinePipe, ViewActionComponent, ViewValueComponent, ViewCardToolbarComponent], providers: [FilterService, ViewService], template: "<!-- TOOLBAR -->\n@if (hasToolbar) {\n<view-card-toolbar\n [orders]=\"orders\"\n [filters]=\"filters\"\n [viewConfig]=\"viewConfig\"\n (orderChanged)=\"orderChanged.next($event)\"\n (updateFilter)=\"updateFilter($event)\"\n (clearFilter)=\"filterCleared.next()\"\n></view-card-toolbar>\n}\n\n<!-- DATA -->\n<div class=\"card-container\">\n @for (item of data; track $index; let dataIndex = $index) {\n <div class=\"card\">\n <div class=\"card-header\" [style.position]=\"viewConfig.stickyView?.top ? 'sticky' : 'static'\" [style.top]=\"top\">\n <!-- ICON -->\n @if (hasIcon) {\n <!-- MATERIAL ICON -->\n @if (icons[$index].icon) {\n <mat-icon class=\"icon\" [style.color]=\"icons[$index].color\" [style.font-size]=\"viewConfig.iconSize\">\n {{ icons[$index].icon }}\n </mat-icon>\n }\n <!-- EMOJI -->\n @else {\n <td class=\"emoji\" [style.font-size]=\"viewConfig.emojiSize\">{{ emojis[$index] || '' }}</td>\n } }\n\n <!-- TITLE -->\n <div class=\"title\" [style.color]=\"colors[dataIndex]\">\n <view-value\n [column]=\"ngxTable.columns[this.titleIndex]\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isDeactive]=\"deactives.includes(dataIndex)\"\n [isCard]=\"true\"\n [isCardTitle]=\"true\"\n ></view-value>\n <!-- SUB TITLE -->\n @if (subTitleIndex !== undefined) {\n <view-value\n [column]=\"ngxTable.columns[this.subTitleIndex]\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isCard]=\"true\"\n [isCardSubTitle]=\"true\"\n ></view-value>\n }\n </div>\n\n <!-- ACTION -->\n @if (hasAction) {\n <view-action\n [actions]=\"ngxTable.actions || []\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isMobile]=\"true\"\n ></view-action>\n }\n </div>\n\n <!-- CONTENT -->\n @if (hasContent) {\n <div class=\"card-content\" [style.color]=\"colors[dataIndex]\">\n @for (column of ngxTable.columns; track $index; let columnIndex = $index) {\n <!-- CHECK TITLE AND SUBTITLE -->\n @if (columnIndex !== titleIndex && columnIndex !== subTitleIndex) {\n <div class=\"item\">\n <div class=\"title\">{{ column.title }}{{ !!column.title ? ' :' : '' }}</div>\n <div class=\"value\">\n <view-value [column]=\"column\" [item]=\"item\" [viewConfig]=\"viewConfig\" [isCard]=\"true\"></view-value>\n </div>\n </div>\n } }\n\n <!-- DESCRIPTION -->\n @if (descriptions[dataIndex]) {\n <div class=\"description\" [innerHTML]=\"descriptions[dataIndex] || '' | ngxHelperMultiLine\"></div>\n }\n </div>\n }\n </div>\n }\n</div>\n" }]
1140
1155
  }], ctorParameters: () => [{ type: FilterService }, { type: ViewService }], propDecorators: { className: [{
1141
1156
  type: HostBinding,
1142
1157
  args: ['className']
@@ -1250,6 +1265,7 @@ class ViewTableComponent {
1250
1265
  titleIndex;
1251
1266
  subTitleIndex;
1252
1267
  icons = [];
1268
+ emojis = [];
1253
1269
  colors = [];
1254
1270
  descriptions = [];
1255
1271
  deactives = [];
@@ -1266,6 +1282,7 @@ class ViewTableComponent {
1266
1282
  this.titleIndex = this.viewService.getTitleIndex(this.ngxTable);
1267
1283
  this.subTitleIndex = this.viewService.getSubTitleIndex(this.ngxTable);
1268
1284
  this.icons = this.viewService.getIcons(this.ngxTable, this.data);
1285
+ this.emojis = this.viewService.getEmojis(this.ngxTable, this.data);
1269
1286
  this.colors = this.viewService.getColors(this.ngxTable, this.data);
1270
1287
  this.descriptions = this.viewService.getDescriptions(this.ngxTable, this.data);
1271
1288
  this.deactives = this.viewService.getDeactives(this.ngxTable, this.data);
@@ -1305,7 +1322,7 @@ class ViewTableComponent {
1305
1322
  this.filterChanged.next({ id, value: undefined });
1306
1323
  }
1307
1324
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: ViewTableComponent, deps: [{ token: ViewService }, { token: FilterService }], target: i0.ɵɵFactoryTarget.Component });
1308
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: ViewTableComponent, isStandalone: true, selector: "view-table", inputs: { ngxTable: "ngxTable", data: "data", viewConfig: "viewConfig" }, outputs: { orderChanged: "orderChanged", filterChanged: "filterChanged", filterCleared: "filterCleared" }, host: { properties: { "className": "this.className" } }, providers: [FilterService, ViewService], usesOnChanges: true, ngImport: i0, template: "<table [cellPadding]=\"0\" [cellSpacing]=\"0\" [width]=\"'100%'\" [border]=\"0\">\n <!-- HEADER -->\n\n <thead\n [style.position]=\"viewConfig.stickyView?.top ? 'sticky' : 'static'\"\n [style.top]=\"viewConfig.stickyView?.top?.desktopView || undefined\"\n >\n <!-- ACTIVE FILTERS -->\n @if (activeFilters.length > 0) {\n <tr>\n <!-- ICON -->\n @if (hasIcon) {\n <th class=\"active-filters\"></th>\n }\n\n <!-- TOOLBAR -->\n <th class=\"active-filters\" [colSpan]=\"ngxTable.columns.length + (this.hasAction ? 1 : 0)\">\n <div class=\"toolbar\" [@toolbar]>\n @for (item of activeFilters; track $index) {\n <div class=\"item\">\n <div class=\"title\" (click)=\"updateFilter(item.id)\">{{ item.title }}:</div>\n <div class=\"value\" (click)=\"updateFilter(item.id)\" [class.ngx-table-m3-en]=\"item.english\">\n {{ item.value }}\n </div>\n <div class=\"icon\" (click)=\"clearFilter(item.id)\">\n <mat-icon>close</mat-icon>\n </div>\n </div>\n }\n\n <!-- CLEAR ALL -->\n @if (activeFilters.length > 2) {\n <div class=\"item clear\" (click)=\"filterCleared.next()\">\n <div class=\"title\">\u0644\u063A\u0648 \u0641\u06CC\u0644\u062A\u0631\u0647\u0627</div>\n <div class=\"icon\"><mat-icon>filter_alt_off</mat-icon></div>\n </div>\n }\n </div>\n </th>\n </tr>\n }\n\n <tr>\n <!-- ICON -->\n @if (hasIcon) {\n <th></th>\n }\n\n <!-- COLUMNS -->\n @for (column of ngxTable.columns; track $index) {\n <th [style.text-align]=\"(column.textAlign || 'RIGHT').toLowerCase()\">\n <div\n class=\"column\"\n [class.flex-end]=\"column.textAlign === 'LEFT'\"\n [class.flex-center]=\"column.textAlign === 'CENTER'\"\n >\n <div class=\"title\">{{ column.title }}</div>\n\n <!-- ORDER -->\n @if (column.tools && orders[column.tools.id]) {\n <mat-icon\n (click)=\"updateOrder(column.tools.id)\"\n [style.cursor]=\"\n orders[column.tools.id].type === 'ORDER' || !orders[column.tools.id].current\n ? 'pointer'\n : 'default'\n \"\n >\n {{\n orders[column.tools.id].current === 'ASC'\n ? 'north'\n : orders[column.tools.id].current === 'DESC'\n ? 'south'\n : 'swap_vert'\n }}\n </mat-icon>\n }\n\n <!-- FILTER -->\n @if (column.tools && filters[column.tools.id]) {\n <mat-icon [style.cursor]=\"'pointer'\" (click)=\"updateFilter(column.tools.id)\">filter_alt</mat-icon>\n }\n </div>\n </th>\n }\n\n <!-- ACTION -->\n @if (hasAction) {\n <th></th>\n }\n </tr>\n </thead>\n\n <!-- BODY -->\n <tbody>\n @for (item of data; track $index; let dataIndex = $index) {\n <tr\n [style.color]=\"colors[dataIndex]\"\n [class.odd-row]=\"viewConfig.alternateRows && dataIndex % 2 === 1\"\n [class.even-row]=\"viewConfig.alternateRows && dataIndex % 2 === 0\"\n >\n <!-- ICON -->\n @if (hasIcon) {\n <td class=\"icon\">\n <mat-icon [style.color]=\"icons[$index].color\" [style.font-size]=\"viewConfig.iconSize\">\n {{ icons[$index].icon }}\n </mat-icon>\n </td>\n }\n\n <!-- DATA -->\n @for (column of ngxTable.columns; track $index; let columnIndex = $index) {\n <td>\n <view-value\n [column]=\"column\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isDeactive]=\"columnIndex === titleIndex && deactives.includes(dataIndex)\"\n ></view-value>\n </td>\n }\n\n <!-- ACTION -->\n @if (hasAction) {\n <td class=\"action\">\n <view-action\n [actions]=\"ngxTable.actions || []\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isMobile]=\"false\"\n ></view-action>\n </td>\n }\n </tr>\n\n <!-- DESCRIPTION -->\n @if (descriptions[dataIndex]) {\n <tr\n [style.color]=\"colors[dataIndex]\"\n [class.odd-row]=\"viewConfig.alternateRows && dataIndex % 2 === 1\"\n [class.even-row]=\"viewConfig.alternateRows && dataIndex % 2 === 0\"\n >\n @if (hasIcon) {\n <td class=\"description\"></td>\n }\n <td\n class=\"description\"\n [colSpan]=\"ngxTable.columns.length + (hasAction ? 1 : 0)\"\n [innerHTML]=\"descriptions[dataIndex] || '' | ngxHelperMultiLine\"\n ></td>\n </tr>\n } }\n </tbody>\n</table>\n", styles: [""], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: NgxHelperMultiLinePipe, name: "ngxHelperMultiLine" }, { kind: "component", type: ViewActionComponent, selector: "view-action", inputs: ["actions", "item", "viewConfig", "isMobile"] }, { kind: "component", type: ViewValueComponent, selector: "view-value", inputs: ["column", "item", "viewConfig", "isDeactive", "isCard", "isCardTitle", "isCardSubTitle"] }], animations: [
1325
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: ViewTableComponent, isStandalone: true, selector: "view-table", inputs: { ngxTable: "ngxTable", data: "data", viewConfig: "viewConfig" }, outputs: { orderChanged: "orderChanged", filterChanged: "filterChanged", filterCleared: "filterCleared" }, host: { properties: { "className": "this.className" } }, providers: [FilterService, ViewService], usesOnChanges: true, ngImport: i0, template: "<table [cellPadding]=\"0\" [cellSpacing]=\"0\" [width]=\"'100%'\" [border]=\"0\">\n <!-- HEADER -->\n\n <thead\n [style.position]=\"viewConfig.stickyView?.top ? 'sticky' : 'static'\"\n [style.top]=\"viewConfig.stickyView?.top?.desktopView || undefined\"\n >\n <!-- ACTIVE FILTERS -->\n @if (activeFilters.length > 0) {\n <tr>\n <!-- ICON -->\n @if (hasIcon) {\n <th class=\"active-filters\"></th>\n }\n\n <!-- TOOLBAR -->\n <th class=\"active-filters\" [colSpan]=\"ngxTable.columns.length + (this.hasAction ? 1 : 0)\">\n <div class=\"toolbar\" [@toolbar]>\n @for (item of activeFilters; track $index) {\n <div class=\"item\">\n <div class=\"title\" (click)=\"updateFilter(item.id)\">{{ item.title }}:</div>\n <div class=\"value\" (click)=\"updateFilter(item.id)\" [class.ngx-table-m3-en]=\"item.english\">\n {{ item.value }}\n </div>\n <div class=\"icon\" (click)=\"clearFilter(item.id)\">\n <mat-icon>close</mat-icon>\n </div>\n </div>\n }\n\n <!-- CLEAR ALL -->\n @if (activeFilters.length > 2) {\n <div class=\"item clear\" (click)=\"filterCleared.next()\">\n <div class=\"title\">\u0644\u063A\u0648 \u0641\u06CC\u0644\u062A\u0631\u0647\u0627</div>\n <div class=\"icon\"><mat-icon>filter_alt_off</mat-icon></div>\n </div>\n }\n </div>\n </th>\n </tr>\n }\n\n <tr>\n <!-- ICON -->\n @if (hasIcon) {\n <th></th>\n }\n\n <!-- COLUMNS -->\n @for (column of ngxTable.columns; track $index) {\n <th [style.text-align]=\"(column.textAlign || 'RIGHT').toLowerCase()\">\n <div\n class=\"column\"\n [class.flex-end]=\"column.textAlign === 'LEFT'\"\n [class.flex-center]=\"column.textAlign === 'CENTER'\"\n >\n <div class=\"title\">{{ column.title }}</div>\n\n <!-- ORDER -->\n @if (column.tools && orders[column.tools.id]) {\n <mat-icon\n (click)=\"updateOrder(column.tools.id)\"\n [style.cursor]=\"\n orders[column.tools.id].type === 'ORDER' || !orders[column.tools.id].current\n ? 'pointer'\n : 'default'\n \"\n >\n {{\n orders[column.tools.id].current === 'ASC'\n ? 'north'\n : orders[column.tools.id].current === 'DESC'\n ? 'south'\n : 'swap_vert'\n }}\n </mat-icon>\n }\n\n <!-- FILTER -->\n @if (column.tools && filters[column.tools.id]) {\n <mat-icon [style.cursor]=\"'pointer'\" (click)=\"updateFilter(column.tools.id)\">filter_alt</mat-icon>\n }\n </div>\n </th>\n }\n\n <!-- ACTION -->\n @if (hasAction) {\n <th></th>\n }\n </tr>\n </thead>\n\n <!-- BODY -->\n <tbody>\n @for (item of data; track $index; let dataIndex = $index) {\n <tr\n [style.color]=\"colors[dataIndex]\"\n [class.odd-row]=\"viewConfig.alternateRows && dataIndex % 2 === 1\"\n [class.even-row]=\"viewConfig.alternateRows && dataIndex % 2 === 0\"\n >\n <!-- ICON -->\n @if (hasIcon) {\n <!-- MATERIAL ICON -->\n @if (icons[$index].icon) {\n <td class=\"icon\">\n <mat-icon [style.color]=\"icons[$index].color\" [style.font-size]=\"viewConfig.iconSize\">\n {{ icons[$index].icon }}\n </mat-icon>\n </td>\n }\n <!-- EMOJI -->\n @else {\n <td class=\"emoji\" [style.font-size]=\"viewConfig.emojiSize\">{{ emojis[$index] || '' }}</td>\n } }\n\n <!-- DATA -->\n @for (column of ngxTable.columns; track $index; let columnIndex = $index) {\n <td>\n <view-value\n [column]=\"column\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isDeactive]=\"columnIndex === titleIndex && deactives.includes(dataIndex)\"\n ></view-value>\n </td>\n }\n\n <!-- ACTION -->\n @if (hasAction) {\n <td class=\"action\">\n <view-action\n [actions]=\"ngxTable.actions || []\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isMobile]=\"false\"\n ></view-action>\n </td>\n }\n </tr>\n\n <!-- DESCRIPTION -->\n @if (descriptions[dataIndex]) {\n <tr\n [style.color]=\"colors[dataIndex]\"\n [class.odd-row]=\"viewConfig.alternateRows && dataIndex % 2 === 1\"\n [class.even-row]=\"viewConfig.alternateRows && dataIndex % 2 === 0\"\n >\n @if (hasIcon) {\n <td class=\"description\"></td>\n }\n <td\n class=\"description\"\n [colSpan]=\"ngxTable.columns.length + (hasAction ? 1 : 0)\"\n [innerHTML]=\"descriptions[dataIndex] || '' | ngxHelperMultiLine\"\n ></td>\n </tr>\n } }\n </tbody>\n</table>\n", styles: [""], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: NgxHelperMultiLinePipe, name: "ngxHelperMultiLine" }, { kind: "component", type: ViewActionComponent, selector: "view-action", inputs: ["actions", "item", "viewConfig", "isMobile"] }, { kind: "component", type: ViewValueComponent, selector: "view-value", inputs: ["column", "item", "viewConfig", "isDeactive", "isCard", "isCardTitle", "isCardSubTitle"] }], animations: [
1309
1326
  trigger('toolbar', [
1310
1327
  transition(':enter', [style({ opacity: 0, height: 0 }), animate('150ms', style({ opacity: 1, height: '*' }))]),
1311
1328
  ]),
@@ -1317,7 +1334,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
1317
1334
  trigger('toolbar', [
1318
1335
  transition(':enter', [style({ opacity: 0, height: 0 }), animate('150ms', style({ opacity: 1, height: '*' }))]),
1319
1336
  ]),
1320
- ], template: "<table [cellPadding]=\"0\" [cellSpacing]=\"0\" [width]=\"'100%'\" [border]=\"0\">\n <!-- HEADER -->\n\n <thead\n [style.position]=\"viewConfig.stickyView?.top ? 'sticky' : 'static'\"\n [style.top]=\"viewConfig.stickyView?.top?.desktopView || undefined\"\n >\n <!-- ACTIVE FILTERS -->\n @if (activeFilters.length > 0) {\n <tr>\n <!-- ICON -->\n @if (hasIcon) {\n <th class=\"active-filters\"></th>\n }\n\n <!-- TOOLBAR -->\n <th class=\"active-filters\" [colSpan]=\"ngxTable.columns.length + (this.hasAction ? 1 : 0)\">\n <div class=\"toolbar\" [@toolbar]>\n @for (item of activeFilters; track $index) {\n <div class=\"item\">\n <div class=\"title\" (click)=\"updateFilter(item.id)\">{{ item.title }}:</div>\n <div class=\"value\" (click)=\"updateFilter(item.id)\" [class.ngx-table-m3-en]=\"item.english\">\n {{ item.value }}\n </div>\n <div class=\"icon\" (click)=\"clearFilter(item.id)\">\n <mat-icon>close</mat-icon>\n </div>\n </div>\n }\n\n <!-- CLEAR ALL -->\n @if (activeFilters.length > 2) {\n <div class=\"item clear\" (click)=\"filterCleared.next()\">\n <div class=\"title\">\u0644\u063A\u0648 \u0641\u06CC\u0644\u062A\u0631\u0647\u0627</div>\n <div class=\"icon\"><mat-icon>filter_alt_off</mat-icon></div>\n </div>\n }\n </div>\n </th>\n </tr>\n }\n\n <tr>\n <!-- ICON -->\n @if (hasIcon) {\n <th></th>\n }\n\n <!-- COLUMNS -->\n @for (column of ngxTable.columns; track $index) {\n <th [style.text-align]=\"(column.textAlign || 'RIGHT').toLowerCase()\">\n <div\n class=\"column\"\n [class.flex-end]=\"column.textAlign === 'LEFT'\"\n [class.flex-center]=\"column.textAlign === 'CENTER'\"\n >\n <div class=\"title\">{{ column.title }}</div>\n\n <!-- ORDER -->\n @if (column.tools && orders[column.tools.id]) {\n <mat-icon\n (click)=\"updateOrder(column.tools.id)\"\n [style.cursor]=\"\n orders[column.tools.id].type === 'ORDER' || !orders[column.tools.id].current\n ? 'pointer'\n : 'default'\n \"\n >\n {{\n orders[column.tools.id].current === 'ASC'\n ? 'north'\n : orders[column.tools.id].current === 'DESC'\n ? 'south'\n : 'swap_vert'\n }}\n </mat-icon>\n }\n\n <!-- FILTER -->\n @if (column.tools && filters[column.tools.id]) {\n <mat-icon [style.cursor]=\"'pointer'\" (click)=\"updateFilter(column.tools.id)\">filter_alt</mat-icon>\n }\n </div>\n </th>\n }\n\n <!-- ACTION -->\n @if (hasAction) {\n <th></th>\n }\n </tr>\n </thead>\n\n <!-- BODY -->\n <tbody>\n @for (item of data; track $index; let dataIndex = $index) {\n <tr\n [style.color]=\"colors[dataIndex]\"\n [class.odd-row]=\"viewConfig.alternateRows && dataIndex % 2 === 1\"\n [class.even-row]=\"viewConfig.alternateRows && dataIndex % 2 === 0\"\n >\n <!-- ICON -->\n @if (hasIcon) {\n <td class=\"icon\">\n <mat-icon [style.color]=\"icons[$index].color\" [style.font-size]=\"viewConfig.iconSize\">\n {{ icons[$index].icon }}\n </mat-icon>\n </td>\n }\n\n <!-- DATA -->\n @for (column of ngxTable.columns; track $index; let columnIndex = $index) {\n <td>\n <view-value\n [column]=\"column\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isDeactive]=\"columnIndex === titleIndex && deactives.includes(dataIndex)\"\n ></view-value>\n </td>\n }\n\n <!-- ACTION -->\n @if (hasAction) {\n <td class=\"action\">\n <view-action\n [actions]=\"ngxTable.actions || []\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isMobile]=\"false\"\n ></view-action>\n </td>\n }\n </tr>\n\n <!-- DESCRIPTION -->\n @if (descriptions[dataIndex]) {\n <tr\n [style.color]=\"colors[dataIndex]\"\n [class.odd-row]=\"viewConfig.alternateRows && dataIndex % 2 === 1\"\n [class.even-row]=\"viewConfig.alternateRows && dataIndex % 2 === 0\"\n >\n @if (hasIcon) {\n <td class=\"description\"></td>\n }\n <td\n class=\"description\"\n [colSpan]=\"ngxTable.columns.length + (hasAction ? 1 : 0)\"\n [innerHTML]=\"descriptions[dataIndex] || '' | ngxHelperMultiLine\"\n ></td>\n </tr>\n } }\n </tbody>\n</table>\n" }]
1337
+ ], template: "<table [cellPadding]=\"0\" [cellSpacing]=\"0\" [width]=\"'100%'\" [border]=\"0\">\n <!-- HEADER -->\n\n <thead\n [style.position]=\"viewConfig.stickyView?.top ? 'sticky' : 'static'\"\n [style.top]=\"viewConfig.stickyView?.top?.desktopView || undefined\"\n >\n <!-- ACTIVE FILTERS -->\n @if (activeFilters.length > 0) {\n <tr>\n <!-- ICON -->\n @if (hasIcon) {\n <th class=\"active-filters\"></th>\n }\n\n <!-- TOOLBAR -->\n <th class=\"active-filters\" [colSpan]=\"ngxTable.columns.length + (this.hasAction ? 1 : 0)\">\n <div class=\"toolbar\" [@toolbar]>\n @for (item of activeFilters; track $index) {\n <div class=\"item\">\n <div class=\"title\" (click)=\"updateFilter(item.id)\">{{ item.title }}:</div>\n <div class=\"value\" (click)=\"updateFilter(item.id)\" [class.ngx-table-m3-en]=\"item.english\">\n {{ item.value }}\n </div>\n <div class=\"icon\" (click)=\"clearFilter(item.id)\">\n <mat-icon>close</mat-icon>\n </div>\n </div>\n }\n\n <!-- CLEAR ALL -->\n @if (activeFilters.length > 2) {\n <div class=\"item clear\" (click)=\"filterCleared.next()\">\n <div class=\"title\">\u0644\u063A\u0648 \u0641\u06CC\u0644\u062A\u0631\u0647\u0627</div>\n <div class=\"icon\"><mat-icon>filter_alt_off</mat-icon></div>\n </div>\n }\n </div>\n </th>\n </tr>\n }\n\n <tr>\n <!-- ICON -->\n @if (hasIcon) {\n <th></th>\n }\n\n <!-- COLUMNS -->\n @for (column of ngxTable.columns; track $index) {\n <th [style.text-align]=\"(column.textAlign || 'RIGHT').toLowerCase()\">\n <div\n class=\"column\"\n [class.flex-end]=\"column.textAlign === 'LEFT'\"\n [class.flex-center]=\"column.textAlign === 'CENTER'\"\n >\n <div class=\"title\">{{ column.title }}</div>\n\n <!-- ORDER -->\n @if (column.tools && orders[column.tools.id]) {\n <mat-icon\n (click)=\"updateOrder(column.tools.id)\"\n [style.cursor]=\"\n orders[column.tools.id].type === 'ORDER' || !orders[column.tools.id].current\n ? 'pointer'\n : 'default'\n \"\n >\n {{\n orders[column.tools.id].current === 'ASC'\n ? 'north'\n : orders[column.tools.id].current === 'DESC'\n ? 'south'\n : 'swap_vert'\n }}\n </mat-icon>\n }\n\n <!-- FILTER -->\n @if (column.tools && filters[column.tools.id]) {\n <mat-icon [style.cursor]=\"'pointer'\" (click)=\"updateFilter(column.tools.id)\">filter_alt</mat-icon>\n }\n </div>\n </th>\n }\n\n <!-- ACTION -->\n @if (hasAction) {\n <th></th>\n }\n </tr>\n </thead>\n\n <!-- BODY -->\n <tbody>\n @for (item of data; track $index; let dataIndex = $index) {\n <tr\n [style.color]=\"colors[dataIndex]\"\n [class.odd-row]=\"viewConfig.alternateRows && dataIndex % 2 === 1\"\n [class.even-row]=\"viewConfig.alternateRows && dataIndex % 2 === 0\"\n >\n <!-- ICON -->\n @if (hasIcon) {\n <!-- MATERIAL ICON -->\n @if (icons[$index].icon) {\n <td class=\"icon\">\n <mat-icon [style.color]=\"icons[$index].color\" [style.font-size]=\"viewConfig.iconSize\">\n {{ icons[$index].icon }}\n </mat-icon>\n </td>\n }\n <!-- EMOJI -->\n @else {\n <td class=\"emoji\" [style.font-size]=\"viewConfig.emojiSize\">{{ emojis[$index] || '' }}</td>\n } }\n\n <!-- DATA -->\n @for (column of ngxTable.columns; track $index; let columnIndex = $index) {\n <td>\n <view-value\n [column]=\"column\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isDeactive]=\"columnIndex === titleIndex && deactives.includes(dataIndex)\"\n ></view-value>\n </td>\n }\n\n <!-- ACTION -->\n @if (hasAction) {\n <td class=\"action\">\n <view-action\n [actions]=\"ngxTable.actions || []\"\n [item]=\"item\"\n [viewConfig]=\"viewConfig\"\n [isMobile]=\"false\"\n ></view-action>\n </td>\n }\n </tr>\n\n <!-- DESCRIPTION -->\n @if (descriptions[dataIndex]) {\n <tr\n [style.color]=\"colors[dataIndex]\"\n [class.odd-row]=\"viewConfig.alternateRows && dataIndex % 2 === 1\"\n [class.even-row]=\"viewConfig.alternateRows && dataIndex % 2 === 0\"\n >\n @if (hasIcon) {\n <td class=\"description\"></td>\n }\n <td\n class=\"description\"\n [colSpan]=\"ngxTable.columns.length + (hasAction ? 1 : 0)\"\n [innerHTML]=\"descriptions[dataIndex] || '' | ngxHelperMultiLine\"\n ></td>\n </tr>\n } }\n </tbody>\n</table>\n" }]
1321
1338
  }], ctorParameters: () => [{ type: ViewService }, { type: FilterService }], propDecorators: { className: [{
1322
1339
  type: HostBinding,
1323
1340
  args: ['className']
@@ -1410,6 +1427,7 @@ class NgxTableComponent {
1410
1427
  this.viewConfig = {
1411
1428
  alternateRows: !!this.config?.alternateRows,
1412
1429
  iconSize: `${this.config?.iconSize || 24}px`,
1430
+ emojiSize: `${this.config?.emojiSize || 19}px`,
1413
1431
  actionMenuTitle: this.config?.actionMenuTitle || 'امکانات',
1414
1432
  stickyView: this.config?.stickyView
1415
1433
  ? {