@kris701/ez-ui 1.3.15 → 1.3.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.
@@ -6047,6 +6047,7 @@ class EzUITableSelectFilter {
6047
6047
  selected = [];
6048
6048
  filterType;
6049
6049
  filterTypes;
6050
+ appearanceMap = new Map();
6050
6051
  stringifyOption = (item) => `${item.label}`;
6051
6052
  stringifyValue = (value) => this.getOptionLabel(this.options.find((item) => this.getOptionValue(item) === value));
6052
6053
  getOptionLabel(item) {
@@ -6117,7 +6118,7 @@ class EzUITableSelectFilter {
6117
6118
  this.filterApplied.set(false);
6118
6119
  }
6119
6120
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITableSelectFilter, deps: [{ token: EzUITable }], target: i0.ɵɵFactoryTarget.Component });
6120
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUITableSelectFilter, isStandalone: true, selector: "ezui-table-selectfilter", inputs: { column: "column", optionLabel: "optionLabel", optionValue: "optionValue", options: "options" }, ngImport: i0, template: `
6121
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUITableSelectFilter, isStandalone: true, selector: "ezui-table-selectfilter", inputs: { column: "column", optionLabel: "optionLabel", optionValue: "optionValue", options: "options", appearanceMap: "appearanceMap" }, ngImport: i0, template: `
6121
6122
  @if(column){
6122
6123
  <tui-badged-content>
6123
6124
  @if(filterApplied()){
@@ -6163,20 +6164,31 @@ class EzUITableSelectFilter {
6163
6164
  tuiButtonSelect
6164
6165
  [(ngModel)]="selected"
6165
6166
  >
6166
- {{selected.length === 1 ? stringifyValue(selected[0]) : 'Selected ' + selected.length}}
6167
+ @if(selected.length == 0){
6168
+ <span style="opacity:0.7">No items selected</span>
6169
+ }
6170
+ @else {
6171
+ @for(select of selected; track select){
6172
+ @let appearance = appearanceMap.get(select);
6173
+ <span tuiChip size="xs" [appearance]="appearance ? appearance : ''">{{ stringifyValue(select) }}</span>
6174
+ }
6175
+ }
6167
6176
 
6168
- <tui-data-list *tuiDropdown>
6177
+ <tui-data-list *tuiDropdown style="min-width:20vw">
6169
6178
  <tui-opt-group
6170
6179
  label="Options"
6171
6180
  tuiMultiSelectGroup
6172
6181
  >
6173
6182
  @for (option of options; track getOptionValue(option)) {
6183
+ @let value = getOptionValue(option);
6184
+ @let label = getOptionLabel(option);
6185
+ @let appearance = appearanceMap.get(value);
6174
6186
  <button
6175
6187
  tuiOption
6176
6188
  type="button"
6177
- [value]="getOptionValue(option)"
6189
+ [value]="value"
6178
6190
  >
6179
- {{ getOptionLabel(option) }}
6191
+ <span tuiChip size="xs" [appearance]="appearance ? appearance : ''">{{ label }}</span>
6180
6192
  </button>
6181
6193
  }
6182
6194
  </tui-opt-group>
@@ -6206,11 +6218,11 @@ class EzUITableSelectFilter {
6206
6218
  </div>
6207
6219
  </ng-template>
6208
6220
  }
6209
- `, 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.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: "component", type: i4$1.TuiMultiSelectGroupComponent, selector: "tui-opt-group[tuiMultiSelectGroup]", inputs: ["label"] }, { kind: "directive", type: i4$1.TuiMultiSelectGroupDirective, selector: "[tuiMultiSelectGroup]" }, { kind: "component", type: i3$1.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i3$1.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i3$1.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "directive", type: i3$1.TuiOptGroup, selector: "tui-opt-group", inputs: ["label"] }, { kind: "pipe", type: TuiStringifyContentPipe, name: "tuiStringifyContent" }] });
6221
+ `, 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.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: "component", type: i4$1.TuiMultiSelectGroupComponent, selector: "tui-opt-group[tuiMultiSelectGroup]", inputs: ["label"] }, { kind: "directive", type: i4$1.TuiMultiSelectGroupDirective, selector: "[tuiMultiSelectGroup]" }, { kind: "component", type: i3$1.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i3$1.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i3$1.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "directive", type: i3$1.TuiOptGroup, selector: "tui-opt-group", inputs: ["label"] }, { kind: "directive", type: TuiChip, selector: "[tuiChip]", inputs: ["size"] }, { kind: "pipe", type: TuiStringifyContentPipe, name: "tuiStringifyContent" }] });
6210
6222
  }
6211
6223
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUITableSelectFilter, decorators: [{
6212
6224
  type: Component,
6213
- args: [{ selector: 'ezui-table-selectfilter', imports: [CommonModule, FormsModule, TuiDropdown, TuiDataListWrapper, TuiButton, TuiButtonSelect, TuiStringifyContentPipe, TuiBadgeNotification, TuiBadgedContent, TuiInput, TuiMultiSelect, TuiDataList], template: `
6225
+ args: [{ selector: 'ezui-table-selectfilter', imports: [CommonModule, FormsModule, TuiDropdown, TuiDataListWrapper, TuiButton, TuiButtonSelect, TuiStringifyContentPipe, TuiBadgeNotification, TuiBadgedContent, TuiInput, TuiMultiSelect, TuiDataList, TuiChip], template: `
6214
6226
  @if(column){
6215
6227
  <tui-badged-content>
6216
6228
  @if(filterApplied()){
@@ -6256,20 +6268,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
6256
6268
  tuiButtonSelect
6257
6269
  [(ngModel)]="selected"
6258
6270
  >
6259
- {{selected.length === 1 ? stringifyValue(selected[0]) : 'Selected ' + selected.length}}
6271
+ @if(selected.length == 0){
6272
+ <span style="opacity:0.7">No items selected</span>
6273
+ }
6274
+ @else {
6275
+ @for(select of selected; track select){
6276
+ @let appearance = appearanceMap.get(select);
6277
+ <span tuiChip size="xs" [appearance]="appearance ? appearance : ''">{{ stringifyValue(select) }}</span>
6278
+ }
6279
+ }
6260
6280
 
6261
- <tui-data-list *tuiDropdown>
6281
+ <tui-data-list *tuiDropdown style="min-width:20vw">
6262
6282
  <tui-opt-group
6263
6283
  label="Options"
6264
6284
  tuiMultiSelectGroup
6265
6285
  >
6266
6286
  @for (option of options; track getOptionValue(option)) {
6287
+ @let value = getOptionValue(option);
6288
+ @let label = getOptionLabel(option);
6289
+ @let appearance = appearanceMap.get(value);
6267
6290
  <button
6268
6291
  tuiOption
6269
6292
  type="button"
6270
- [value]="getOptionValue(option)"
6293
+ [value]="value"
6271
6294
  >
6272
- {{ getOptionLabel(option) }}
6295
+ <span tuiChip size="xs" [appearance]="appearance ? appearance : ''">{{ label }}</span>
6273
6296
  </button>
6274
6297
  }
6275
6298
  </tui-opt-group>
@@ -6308,6 +6331,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
6308
6331
  type: Input
6309
6332
  }], options: [{
6310
6333
  type: Input
6334
+ }], appearanceMap: [{
6335
+ type: Input
6311
6336
  }] } });
6312
6337
 
6313
6338
  class EzUITableTextFilter {