@masterteam/components 0.0.159 → 0.0.161

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.
@@ -184,8 +184,9 @@ class TableValueResolver {
184
184
  return 'boolean';
185
185
  case 'Status':
186
186
  case 'Lookup':
187
- case 'User':
188
187
  return 'select';
188
+ case 'User':
189
+ return 'userSelect';
189
190
  case 'Text':
190
191
  case 'LongText':
191
192
  case 'Currency':
@@ -204,7 +205,8 @@ class TableValueResolver {
204
205
  static buildFilterableColumn(column, data) {
205
206
  const sampleRow = data[0];
206
207
  const filterType = TableValueResolver.getColumnFilterType(column, sampleRow);
207
- if (filterType === 'select' && !column.filterConfig?.options?.length) {
208
+ if ((filterType === 'select' || filterType === 'userSelect') &&
209
+ !column.filterConfig?.options?.length) {
208
210
  const uniqueOptions = Array.from(data.reduce((options, row) => {
209
211
  const value = TableValueResolver.getColumnFilterValue(row, column);
210
212
  if (value === null || value === undefined || value === '') {
@@ -370,7 +372,9 @@ class TableValueResolver {
370
372
  if (filterType === 'boolean') {
371
373
  return TableValueResolver.resolveBooleanValue(normalized);
372
374
  }
373
- if (filterType === 'select' || filterType === 'text') {
375
+ if (filterType === 'select' ||
376
+ filterType === 'userSelect' ||
377
+ filterType === 'text') {
374
378
  if (column.type === 'entity') {
375
379
  return String(normalized);
376
380
  }
@@ -632,7 +636,7 @@ class TableFilterField {
632
636
  this.value.set({ ...current, [part]: next });
633
637
  }
634
638
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableFilterField, deps: [], target: i0.ɵɵFactoryTarget.Component });
635
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableFilterField, isStandalone: true, selector: "mt-table-filter-field", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "@switch (getFilterType()) {\n @case (\"text\") {\n <mt-text-field\n [ngModel]=\"getScalarValue()\"\n (ngModelChange)=\"updateScalar($event)\"\n [placeholder]=\"\n ('components.table.select' | transloco) +\n ' ' +\n (column().filterConfig?.label || column().label)\n \"\n />\n }\n @case (\"select\") {\n <mt-select-field\n [ngModel]=\"getScalarValue()\"\n (ngModelChange)=\"updateScalar($event)\"\n [options]=\"column().filterConfig?.options ?? []\"\n [placeholder]=\"\n ('components.table.select' | transloco) +\n ' ' +\n (column().filterConfig?.label || column().label)\n \"\n [hasPlaceholderPrefix]=\"false\"\n showClear\n />\n }\n @case (\"date\") {\n <div class=\"space-y-3\">\n <div class=\"space-y-1\">\n <label\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\n >\n {{ \"components.table.from\" | transloco }}\n </label>\n <mt-date-field\n [ngModel]=\"getDateRangeValue('from')\"\n (ngModelChange)=\"updateDate('from', $event)\"\n [placeholder]=\"'components.table.from' | transloco\"\n />\n </div>\n <div class=\"space-y-1\">\n <label\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\n >\n {{ \"components.table.to\" | transloco }}\n </label>\n <mt-date-field\n [ngModel]=\"getDateRangeValue('to')\"\n (ngModelChange)=\"updateDate('to', $event)\"\n [placeholder]=\"'components.table.to' | transloco\"\n />\n </div>\n </div>\n }\n @case (\"boolean\") {\n <mt-select-field\n [ngModel]=\"getScalarValue()\"\n (ngModelChange)=\"updateScalar($event)\"\n [options]=\"booleanOptions\"\n [placeholder]=\"'components.table.select' | transloco\"\n [hasPlaceholderPrefix]=\"false\"\n showClear\n />\n }\n @case (\"user\") {\n <mt-user-search-field\n [ngModel]=\"getScalarValue()\"\n (ngModelChange)=\"updateScalar($event)\"\n [placeholder]=\"column().filterConfig?.label || column().label\"\n [apiUrl]=\"column().filterConfig?.apiUrl ?? ''\"\n [context]=\"column().filterConfig?.context\"\n />\n }\n}\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "icon", "iconPosition"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape"], outputs: ["onChange"] }, { kind: "component", type: DateField, selector: "mt-date-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "showIcon", "showClear", "showTime", "pInputs", "required"] }, { kind: "component", type: UserSearchField, selector: "mt-user-search-field", inputs: ["hint", "label", "placeholder", "class", "readonly", "required", "isMultiple", "apiUrl", "dataKey", "paramName", "context", "size"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
639
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: TableFilterField, isStandalone: true, selector: "mt-table-filter-field", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "@switch (getFilterType()) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"column().filterConfig?.options ?? []\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [hasPlaceholderPrefix]=\"false\"\r\n showClear\r\n />\r\n }\r\n @case (\"userSelect\") {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"column().filterConfig?.options ?? []\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [hasPlaceholderPrefix]=\"false\"\r\n [markCurrentUser]=\"true\"\r\n showClear\r\n />\r\n }\r\n @case (\"date\") {\r\n <div class=\"space-y-3\">\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.from\" | transloco }}\r\n </label>\r\n <mt-date-field\r\n [ngModel]=\"getDateRangeValue('from')\"\r\n (ngModelChange)=\"updateDate('from', $event)\"\r\n [placeholder]=\"'components.table.from' | transloco\"\r\n />\r\n </div>\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.to\" | transloco }}\r\n </label>\r\n <mt-date-field\r\n [ngModel]=\"getDateRangeValue('to')\"\r\n (ngModelChange)=\"updateDate('to', $event)\"\r\n [placeholder]=\"'components.table.to' | transloco\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n @case (\"boolean\") {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"booleanOptions\"\r\n [placeholder]=\"'components.table.select' | transloco\"\r\n [hasPlaceholderPrefix]=\"false\"\r\n showClear\r\n />\r\n }\r\n @case (\"user\") {\r\n <mt-user-search-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [placeholder]=\"column().filterConfig?.label || column().label\"\r\n [apiUrl]=\"column().filterConfig?.apiUrl ?? ''\"\r\n [context]=\"column().filterConfig?.context\"\r\n />\r\n }\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "icon", "iconPosition"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: DateField, selector: "mt-date-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "showIcon", "showClear", "showTime", "pInputs", "required"] }, { kind: "component", type: UserSearchField, selector: "mt-user-search-field", inputs: ["hint", "label", "placeholder", "class", "readonly", "required", "isMultiple", "apiUrl", "dataKey", "paramName", "context", "size"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
636
640
  }
637
641
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: TableFilterField, decorators: [{
638
642
  type: Component,
@@ -643,7 +647,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
643
647
  DateField,
644
648
  UserSearchField,
645
649
  TranslocoModule,
646
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@switch (getFilterType()) {\n @case (\"text\") {\n <mt-text-field\n [ngModel]=\"getScalarValue()\"\n (ngModelChange)=\"updateScalar($event)\"\n [placeholder]=\"\n ('components.table.select' | transloco) +\n ' ' +\n (column().filterConfig?.label || column().label)\n \"\n />\n }\n @case (\"select\") {\n <mt-select-field\n [ngModel]=\"getScalarValue()\"\n (ngModelChange)=\"updateScalar($event)\"\n [options]=\"column().filterConfig?.options ?? []\"\n [placeholder]=\"\n ('components.table.select' | transloco) +\n ' ' +\n (column().filterConfig?.label || column().label)\n \"\n [hasPlaceholderPrefix]=\"false\"\n showClear\n />\n }\n @case (\"date\") {\n <div class=\"space-y-3\">\n <div class=\"space-y-1\">\n <label\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\n >\n {{ \"components.table.from\" | transloco }}\n </label>\n <mt-date-field\n [ngModel]=\"getDateRangeValue('from')\"\n (ngModelChange)=\"updateDate('from', $event)\"\n [placeholder]=\"'components.table.from' | transloco\"\n />\n </div>\n <div class=\"space-y-1\">\n <label\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\n >\n {{ \"components.table.to\" | transloco }}\n </label>\n <mt-date-field\n [ngModel]=\"getDateRangeValue('to')\"\n (ngModelChange)=\"updateDate('to', $event)\"\n [placeholder]=\"'components.table.to' | transloco\"\n />\n </div>\n </div>\n }\n @case (\"boolean\") {\n <mt-select-field\n [ngModel]=\"getScalarValue()\"\n (ngModelChange)=\"updateScalar($event)\"\n [options]=\"booleanOptions\"\n [placeholder]=\"'components.table.select' | transloco\"\n [hasPlaceholderPrefix]=\"false\"\n showClear\n />\n }\n @case (\"user\") {\n <mt-user-search-field\n [ngModel]=\"getScalarValue()\"\n (ngModelChange)=\"updateScalar($event)\"\n [placeholder]=\"column().filterConfig?.label || column().label\"\n [apiUrl]=\"column().filterConfig?.apiUrl ?? ''\"\n [context]=\"column().filterConfig?.context\"\n />\n }\n}\n" }]
650
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@switch (getFilterType()) {\r\n @case (\"text\") {\r\n <mt-text-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n />\r\n }\r\n @case (\"select\") {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"column().filterConfig?.options ?? []\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [hasPlaceholderPrefix]=\"false\"\r\n showClear\r\n />\r\n }\r\n @case (\"userSelect\") {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"column().filterConfig?.options ?? []\"\r\n [placeholder]=\"\r\n ('components.table.select' | transloco) +\r\n ' ' +\r\n (column().filterConfig?.label || column().label)\r\n \"\r\n [hasPlaceholderPrefix]=\"false\"\r\n [markCurrentUser]=\"true\"\r\n showClear\r\n />\r\n }\r\n @case (\"date\") {\r\n <div class=\"space-y-3\">\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.from\" | transloco }}\r\n </label>\r\n <mt-date-field\r\n [ngModel]=\"getDateRangeValue('from')\"\r\n (ngModelChange)=\"updateDate('from', $event)\"\r\n [placeholder]=\"'components.table.from' | transloco\"\r\n />\r\n </div>\r\n <div class=\"space-y-1\">\r\n <label\r\n class=\"block text-sm font-medium text-gray-700 dark:text-gray-300\"\r\n >\r\n {{ \"components.table.to\" | transloco }}\r\n </label>\r\n <mt-date-field\r\n [ngModel]=\"getDateRangeValue('to')\"\r\n (ngModelChange)=\"updateDate('to', $event)\"\r\n [placeholder]=\"'components.table.to' | transloco\"\r\n />\r\n </div>\r\n </div>\r\n }\r\n @case (\"boolean\") {\r\n <mt-select-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [options]=\"booleanOptions\"\r\n [placeholder]=\"'components.table.select' | transloco\"\r\n [hasPlaceholderPrefix]=\"false\"\r\n showClear\r\n />\r\n }\r\n @case (\"user\") {\r\n <mt-user-search-field\r\n [ngModel]=\"getScalarValue()\"\r\n (ngModelChange)=\"updateScalar($event)\"\r\n [placeholder]=\"column().filterConfig?.label || column().label\"\r\n [apiUrl]=\"column().filterConfig?.apiUrl ?? ''\"\r\n [context]=\"column().filterConfig?.context\"\r\n />\r\n }\r\n}\r\n" }]
647
651
  }], propDecorators: { column: [{ type: i0.Input, args: [{ isSignal: true, alias: "column", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
648
652
 
649
653
  class TableFilter {