@kris701/ez-ui 1.1.12 → 1.1.13

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.
@@ -3059,6 +3059,100 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
3059
3059
  type: Output
3060
3060
  }] } });
3061
3061
 
3062
+ class EzUISelect {
3063
+ icon = '';
3064
+ label = '';
3065
+ size = 'm';
3066
+ optionLabel = undefined;
3067
+ optionValue = undefined;
3068
+ options = [];
3069
+ disabled = false;
3070
+ selected = undefined;
3071
+ selectedChange = new EventEmitter();
3072
+ ngOnChanges(changes) {
3073
+ if (changes['selected'] && changes['selected'].currentValue != changes['selected'].previousValue) {
3074
+ this.selected = changes['selected'].currentValue;
3075
+ }
3076
+ }
3077
+ stringify = (value) => this.getOptionLabel(this.options.find((item) => this.getOptionValue(item) === value));
3078
+ getOptionLabel(item) {
3079
+ if (!item)
3080
+ return "";
3081
+ if (this.optionLabel == undefined || this.optionLabel == '')
3082
+ return item;
3083
+ return item[this.optionLabel];
3084
+ }
3085
+ getOptionValue(item) {
3086
+ if (!item)
3087
+ return "";
3088
+ if (this.optionValue == undefined || this.optionValue == '')
3089
+ return item;
3090
+ return item[this.optionValue];
3091
+ }
3092
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUISelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
3093
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: EzUISelect, isStandalone: true, selector: "ezui-select", inputs: { icon: "icon", label: "label", size: "size", optionLabel: "optionLabel", optionValue: "optionValue", options: "options", disabled: "disabled", selected: "selected" }, outputs: { selectedChange: "selectedChange" }, usesOnChanges: true, ngImport: i0, template: `
3094
+ <tui-textfield tuiChevron [stringify]="stringify" [tuiTextfieldSize]="size" [iconStart]="icon">
3095
+ @if(label != ''){
3096
+ <label tuiLabel>{{label}}</label>
3097
+ }
3098
+ <input tuiInput tuiSelectLike [(ngModel)]="selected" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
3099
+ <tui-data-list *tuiDropdown >
3100
+ @for (item of options; track getOptionValue(item)) {
3101
+ <button tuiOption [value]="getOptionValue(item)">
3102
+ {{ getOptionLabel(item) }}
3103
+ </button>
3104
+ }
3105
+ </tui-data-list>
3106
+ </tui-textfield>
3107
+ `, isInline: true, styles: [""], 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: i2.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: i4.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { 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: TuiSelectLike, selector: "[tuiSelectLike]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "directive", type: i3$1.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }] });
3108
+ }
3109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: EzUISelect, decorators: [{
3110
+ type: Component,
3111
+ args: [{ selector: 'ezui-select', imports: [
3112
+ FormsModule,
3113
+ CommonModule,
3114
+ TuiInputNumber,
3115
+ TuiDataList,
3116
+ TuiTextfield,
3117
+ TuiSelectLike,
3118
+ TuiDropdown,
3119
+ TuiChevron,
3120
+ TuiInput
3121
+ ], template: `
3122
+ <tui-textfield tuiChevron [stringify]="stringify" [tuiTextfieldSize]="size" [iconStart]="icon">
3123
+ @if(label != ''){
3124
+ <label tuiLabel>{{label}}</label>
3125
+ }
3126
+ <input tuiInput tuiSelectLike [(ngModel)]="selected" (ngModelChange)="selectedChange.emit(this.selected)" [disabled]="disabled"/>
3127
+ <tui-data-list *tuiDropdown >
3128
+ @for (item of options; track getOptionValue(item)) {
3129
+ <button tuiOption [value]="getOptionValue(item)">
3130
+ {{ getOptionLabel(item) }}
3131
+ </button>
3132
+ }
3133
+ </tui-data-list>
3134
+ </tui-textfield>
3135
+ ` }]
3136
+ }], propDecorators: { icon: [{
3137
+ type: Input
3138
+ }], label: [{
3139
+ type: Input
3140
+ }], size: [{
3141
+ type: Input
3142
+ }], optionLabel: [{
3143
+ type: Input
3144
+ }], optionValue: [{
3145
+ type: Input
3146
+ }], options: [{
3147
+ type: Input
3148
+ }], disabled: [{
3149
+ type: Input
3150
+ }], selected: [{
3151
+ type: Input
3152
+ }], selectedChange: [{
3153
+ type: Output
3154
+ }] } });
3155
+
3062
3156
  class EzUITablePresets {
3063
3157
  table;
3064
3158
  storageKey = null;
@@ -5295,5 +5389,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
5295
5389
  * Generated bundle index. Do not edit.
5296
5390
  */
5297
5391
 
5298
- export { BaseCRUDInterface, BaseListInterface, EzUIBooleanInput, EzUIDateInput, EzUIDateTimeInput, EzUIFileInput, EzUIFilterHelpers, EzUIIconSelector, EzUILayout, EzUILayoutService, EzUIMarkdownEditor, EzUIMenuBar, EzUIMenuBarSubDataList, EzUIMultiSelect, EzUINumberInput, EzUIPasswordInput, EzUITTableSortableColumn, EzUITable, EzUITableBooleanFilter, EzUITableDateFilter, EzUITableFilterService, EzUITableSelectFilter, EzUITableTextFilter, EzUITextInput, compressImage };
5392
+ export { BaseCRUDInterface, BaseListInterface, EzUIBooleanInput, EzUIDateInput, EzUIDateTimeInput, EzUIFileInput, EzUIFilterHelpers, EzUIIconSelector, EzUILayout, EzUILayoutService, EzUIMarkdownEditor, EzUIMenuBar, EzUIMenuBarSubDataList, EzUIMultiSelect, EzUINumberInput, EzUIPasswordInput, EzUISelect, EzUITTableSortableColumn, EzUITable, EzUITableBooleanFilter, EzUITableDateFilter, EzUITableFilterService, EzUITableSelectFilter, EzUITableTextFilter, EzUITextInput, compressImage };
5299
5393
  //# sourceMappingURL=kris701-ez-ui.mjs.map