@colijnit/corecomponents_v12 12.1.1 → 12.1.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.
- package/bundles/colijnit-corecomponents_v12.umd.js +104 -41
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/lib/components/co-dialog/co-dialog.component.js +2 -2
- package/esm2015/lib/components/input-date-range-picker/input-date-range-picker.component.js +6 -1
- package/esm2015/lib/components/input-number-picker/input-number-picker.component.js +6 -2
- package/esm2015/lib/components/list-of-values/list-of-values-popup.component.js +75 -34
- package/esm2015/lib/components/list-of-values/list-of-values.component.js +25 -9
- package/fesm2015/colijnit-corecomponents_v12.js +108 -43
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/co-dialog/style/_layout.scss +28 -11
- package/lib/components/co-dialog/style/_material-definition.scss +4 -1
- package/lib/components/input-date-range-picker/input-date-range-picker.component.d.ts +1 -0
- package/lib/components/input-number-picker/input-number-picker.component.d.ts +1 -0
- package/lib/components/list-of-values/list-of-values-popup.component.d.ts +6 -5
- package/lib/components/list-of-values/list-of-values.component.d.ts +1 -0
- package/lib/components/list-of-values/style/_layout.scss +12 -3
- package/lib/components/simple-grid/style/_layout.scss +4 -0
- package/lib/components/simple-grid/style/_material-definition.scss +1 -0
- package/package.json +1 -1
|
@@ -4926,7 +4926,7 @@
|
|
|
4926
4926
|
CoDialogComponent.decorators = [
|
|
4927
4927
|
{ type: i0.Component, args: [{
|
|
4928
4928
|
selector: 'co-dialog',
|
|
4929
|
-
template: "\n <div class=\"co-dialog-overlay\" (click)=\"handleOverlayClick($event)\"></div>\n <div class=\"co-dialog-wrapper\" [ngClass]=\"customCssClass ? customCssClass : undefined\" @showHideDialog>\n <div class=\"dialog-header\" *ngIf=\"!borderless\">\n <div class=\"dialog-header-caption\" *ngIf=\"headerTemplate\">\n <ng-container [ngTemplateOutlet]=\"headerTemplate\"></ng-container>\n </div>\n <div class=\"dialog-close-button\" *ngIf=\"showCloseIcon\" (click)=\"handleCloseDialog($event)\">\n <co-icon [icon]=\"icons.
|
|
4929
|
+
template: "\n <div class=\"co-dialog-overlay\" (click)=\"handleOverlayClick($event)\"></div>\n <div class=\"co-dialog-wrapper\" [ngClass]=\"customCssClass ? customCssClass : undefined\" @showHideDialog>\n <div class=\"dialog-header\" *ngIf=\"!borderless\">\n <div class=\"dialog-header-caption\" *ngIf=\"headerTemplate\">\n <ng-container [ngTemplateOutlet]=\"headerTemplate\"></ng-container>\n </div>\n <div class=\"dialog-close-button\" *ngIf=\"showCloseIcon\" (click)=\"handleCloseDialog($event)\">\n <co-icon [icon]=\"icons.CrossSkinny\"></co-icon>\n </div>\n </div>\n <div class=\"dialog-content\" [ngClass]=\"customCssClass ? customCssClass : undefined\">\n <ng-content></ng-content>\n </div>\n <div class=\"dialog-footer\" *ngIf=\"footerTemplate\">\n <ng-container [ngTemplateOutlet]=\"footerTemplate\"></ng-container>\n </div>\n </div>\n ",
|
|
4930
4930
|
animations: [
|
|
4931
4931
|
animations.trigger('showHideCoDialog', [
|
|
4932
4932
|
animations.transition('void => *', [
|
|
@@ -7094,6 +7094,9 @@
|
|
|
7094
7094
|
this.toggleCalendar();
|
|
7095
7095
|
}
|
|
7096
7096
|
};
|
|
7097
|
+
InputDateRangePickerComponent.prototype.clearDate = function (index) {
|
|
7098
|
+
this.model[index] = undefined;
|
|
7099
|
+
};
|
|
7097
7100
|
InputDateRangePickerComponent.prototype.toggleCalendar = function () {
|
|
7098
7101
|
var _this = this;
|
|
7099
7102
|
if (this.readonly) {
|
|
@@ -7152,7 +7155,7 @@
|
|
|
7152
7155
|
InputDateRangePickerComponent.decorators = [
|
|
7153
7156
|
{ type: i0.Component, args: [{
|
|
7154
7157
|
selector: 'co-input-date-range',
|
|
7155
|
-
template: "\n <div class=\"inputs-wrapper\" overlayParent #parentForOverlay=\"overlayParent\">\n <co-input-text class=\"no-focus-line custom-height\"\n [(model)]=\"firstDateAsString\"\n [noClickFocus]=\"true\"\n [pattern]=\"'yyyy-MM-dd'\"\n [type]=\"'date'\"\n [leftIcon]=\"leftIcon\"\n [leftIconData]=\"leftIconData\"\n [placeholder]=\"placeholder\"\n (blur)=\"handleFirstDateChanged(firstDateAsString)\"\n ></co-input-text>\n <co-input-text class=\"no-focus-line custom-height\"\n [(model)]= \"secondDateAsString\"\n [noClickFocus]=\"true\"\n [pattern]=\"'yyyy-MM-dd'\"\n [type]=\"'date'\"\n [rightIcon]=\"rightIcon\"\n (rightIconClick)=\"toggleCalendar()\"\n (blur)=\"handleSecondDateChanged(secondDateAsString)\"\n ></co-input-text>\n </div>\n ",
|
|
7158
|
+
template: "\n <div class=\"inputs-wrapper\" overlayParent #parentForOverlay=\"overlayParent\">\n <co-input-text class=\"no-focus-line custom-height\"\n [(model)]=\"firstDateAsString\"\n [noClickFocus]=\"true\"\n [pattern]=\"'yyyy-MM-dd'\"\n [type]=\"'date'\"\n [leftIcon]=\"leftIcon\"\n [leftIconData]=\"leftIconData\"\n [placeholder]=\"placeholder\"\n (blur)=\"handleFirstDateChanged(firstDateAsString)\"\n (clearIconClick)=\"clearDate(0)\"\n ></co-input-text>\n <co-input-text class=\"no-focus-line custom-height\"\n [(model)]= \"secondDateAsString\"\n [noClickFocus]=\"true\"\n [pattern]=\"'yyyy-MM-dd'\"\n [type]=\"'date'\"\n [rightIcon]=\"rightIcon\"\n (rightIconClick)=\"toggleCalendar()\"\n (blur)=\"handleSecondDateChanged(secondDateAsString)\"\n (clearIconClick)=\"clearDate(1)\"\n ></co-input-text>\n </div>\n ",
|
|
7156
7159
|
providers: [
|
|
7157
7160
|
OverlayService,
|
|
7158
7161
|
{
|
|
@@ -7678,6 +7681,9 @@
|
|
|
7678
7681
|
return false;
|
|
7679
7682
|
}
|
|
7680
7683
|
};
|
|
7684
|
+
InputNumberPickerComponent.prototype.handleBlur = function () {
|
|
7685
|
+
this.modelChange.next(this.model);
|
|
7686
|
+
};
|
|
7681
7687
|
InputNumberPickerComponent.prototype.handleChangeModel = function (value) {
|
|
7682
7688
|
this._changeFromButton = false;
|
|
7683
7689
|
this.numberLogic.setValue(value);
|
|
@@ -7794,7 +7800,7 @@
|
|
|
7794
7800
|
InputNumberPickerComponent.decorators = [
|
|
7795
7801
|
{ type: i0.Component, args: [{
|
|
7796
7802
|
selector: 'co-input-number-picker',
|
|
7797
|
-
template: "\n <div class=\"icon-wrapper\" *ngIf=\"leftIconData\">\n <co-icon class=\"input-number-picker-icon\" [iconData]=\"leftIconData\" (click)=\"iconClick.emit($event)\"></co-icon>\n <div class=\"spacer\"></div>\n </div>\n <div class=\"button-wrapper\">\n <co-button *ngIf=\"showButtons\" class=\"minus-operator\" [class.select]=\"minSelected\" tabindex=\"-1\"\n [disabled]=\"readonly\"\n [iconData]=\"iconCacheService.getIcon(minusIcon)\"\n (mousedown)=\"onMinusMouseDown($event)\"\n (mouseup)=\"stopAutoCounting()\" (mouseleave)=\"stopAutoCounting()\"></co-button>\n </div>\n <input type=\"text\"\n [tabIndex]=\"readonly ? -1 : 0\"\n [ngModel]=\"model\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n (ngModelChange)=\"handleChangeModel($event)\"\n (keydown)=\"handleInputKeyDown($event)\"/>\n <div class=\"button-wrapper\">\n <co-button *ngIf=\"showButtons\" class=\"plus-operator\" [class.select]=\"plusSelected\" tabindex=\"-1\"\n [disabled]=\"readonly\"\n [iconData]=\"iconCacheService.getIcon(plusIcon)\"\n (mousedown)=\"onPlusMouseDown($event)\"\n (mouseup)=\"stopAutoCounting()\" (mouseleave)=\"stopAutoCounting()\"></co-button>\n </div>\n ",
|
|
7803
|
+
template: "\n <div class=\"icon-wrapper\" *ngIf=\"leftIconData\">\n <co-icon class=\"input-number-picker-icon\" [iconData]=\"leftIconData\" (click)=\"iconClick.emit($event)\"></co-icon>\n <div class=\"spacer\"></div>\n </div>\n <div class=\"button-wrapper\">\n <co-button *ngIf=\"showButtons\" class=\"minus-operator\" [class.select]=\"minSelected\" tabindex=\"-1\"\n [disabled]=\"readonly\"\n [iconData]=\"iconCacheService.getIcon(minusIcon)\"\n (mousedown)=\"onMinusMouseDown($event)\"\n (mouseup)=\"stopAutoCounting()\" (mouseleave)=\"stopAutoCounting()\"></co-button>\n </div>\n <input type=\"text\"\n [tabIndex]=\"readonly ? -1 : 0\"\n [ngModel]=\"model\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n (ngModelChange)=\"handleChangeModel($event)\"\n (keydown)=\"handleInputKeyDown($event)\"\n (blur)=\"handleBlur()\"/>\n <div class=\"button-wrapper\">\n <co-button *ngIf=\"showButtons\" class=\"plus-operator\" [class.select]=\"plusSelected\" tabindex=\"-1\"\n [disabled]=\"readonly\"\n [iconData]=\"iconCacheService.getIcon(plusIcon)\"\n (mousedown)=\"onPlusMouseDown($event)\"\n (mouseup)=\"stopAutoCounting()\" (mouseleave)=\"stopAutoCounting()\"></co-button>\n </div>\n ",
|
|
7798
7804
|
providers: [
|
|
7799
7805
|
OverlayService, {
|
|
7800
7806
|
provide: SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME, useExisting: i0.forwardRef(function () { return InputNumberPickerComponent; })
|
|
@@ -10805,7 +10811,6 @@
|
|
|
10805
10811
|
this._collection = [];
|
|
10806
10812
|
this._searchTerm = '';
|
|
10807
10813
|
this._lovItems = [];
|
|
10808
|
-
this._activeIndex = -1;
|
|
10809
10814
|
}
|
|
10810
10815
|
Object.defineProperty(ListOfValuesPopupComponent.prototype, "lovItems", {
|
|
10811
10816
|
set: function (children) {
|
|
@@ -10847,6 +10852,8 @@
|
|
|
10847
10852
|
},
|
|
10848
10853
|
set: function (value) {
|
|
10849
10854
|
this._searchTerm = value;
|
|
10855
|
+
this.model = undefined;
|
|
10856
|
+
this.highLightModel = undefined;
|
|
10850
10857
|
this.filterViewModels();
|
|
10851
10858
|
},
|
|
10852
10859
|
enumerable: false,
|
|
@@ -10856,7 +10863,6 @@
|
|
|
10856
10863
|
var _this = this;
|
|
10857
10864
|
if (this.model) {
|
|
10858
10865
|
if (!this.multiselect) {
|
|
10859
|
-
this._activeIndex = this.viewModelsMain.findIndex(function (v) { return v.model === _this.model; });
|
|
10860
10866
|
this._scrollIntoView();
|
|
10861
10867
|
}
|
|
10862
10868
|
else {
|
|
@@ -10873,53 +10879,92 @@
|
|
|
10873
10879
|
}
|
|
10874
10880
|
}
|
|
10875
10881
|
};
|
|
10882
|
+
ListOfValuesPopupComponent.prototype.handleInputKeyDown = function (event) {
|
|
10883
|
+
if (event) {
|
|
10884
|
+
switch (event.code) {
|
|
10885
|
+
case KeyboardKey.Down:
|
|
10886
|
+
this.selectNextOption();
|
|
10887
|
+
return false;
|
|
10888
|
+
case KeyboardKey.Up:
|
|
10889
|
+
this.selectNextOption(true);
|
|
10890
|
+
return false;
|
|
10891
|
+
case KeyboardKey.SpaceBar:
|
|
10892
|
+
if (this.highLightModel) {
|
|
10893
|
+
this.selectViewModel(this.highLightModel, false);
|
|
10894
|
+
return false;
|
|
10895
|
+
}
|
|
10896
|
+
}
|
|
10897
|
+
}
|
|
10898
|
+
};
|
|
10876
10899
|
ListOfValuesPopupComponent.prototype.filterViewModels = function () {
|
|
10877
10900
|
if (!this.collection) {
|
|
10878
10901
|
return;
|
|
10879
10902
|
}
|
|
10880
10903
|
this._prepareViewModels();
|
|
10881
10904
|
};
|
|
10882
|
-
ListOfValuesPopupComponent.prototype.selectViewModel = function (viewModel) {
|
|
10883
|
-
|
|
10905
|
+
ListOfValuesPopupComponent.prototype.selectViewModel = function (viewModel, closePopup) {
|
|
10906
|
+
if (closePopup === void 0) { closePopup = true; }
|
|
10884
10907
|
if (!this.multiselect) {
|
|
10885
|
-
this.
|
|
10886
|
-
this.selectOptionByActiveIndex();
|
|
10908
|
+
this.selectModelByViewModel(viewModel, closePopup);
|
|
10887
10909
|
}
|
|
10888
10910
|
else {
|
|
10889
|
-
|
|
10911
|
+
var idx = this.viewModels.findIndex(function (vm) { return vm === viewModel; });
|
|
10912
|
+
this.viewModels[idx].checked = !this.viewModels[idx].checked;
|
|
10890
10913
|
this.selectOptions();
|
|
10891
10914
|
}
|
|
10892
10915
|
};
|
|
10893
|
-
|
|
10894
|
-
ListOfValuesPopupComponent.prototype.selectOptionByActiveIndex = function (closePopup) {
|
|
10916
|
+
ListOfValuesPopupComponent.prototype.selectModelByViewModel = function (viewModel, closePopup) {
|
|
10895
10917
|
if (closePopup === void 0) { closePopup = true; }
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10918
|
+
this.model = this.viewModelsMain.find(function (vm) { return vm === viewModel; }).model;
|
|
10919
|
+
this.modelChange.emit(this.model);
|
|
10920
|
+
this._scrollIntoView();
|
|
10921
|
+
if (closePopup) {
|
|
10922
|
+
this.closePopup.emit();
|
|
10923
|
+
}
|
|
10924
|
+
};
|
|
10925
|
+
// for single select
|
|
10926
|
+
ListOfValuesPopupComponent.prototype.selectOptionAndClosePopup = function () {
|
|
10927
|
+
var _this = this;
|
|
10928
|
+
if (!this.model && this.searchTerm) {
|
|
10929
|
+
var wishModel = this.viewModelsMain.find(function (vmm) { return vmm.model[_this.displayField] === _this.searchTerm; });
|
|
10930
|
+
if (wishModel) {
|
|
10931
|
+
this.selectViewModel(wishModel);
|
|
10932
|
+
}
|
|
10933
|
+
else {
|
|
10934
|
+
this.model = undefined;
|
|
10935
|
+
this.modelChange.emit(this.model);
|
|
10936
|
+
this.searchTerm = '';
|
|
10902
10937
|
}
|
|
10903
10938
|
}
|
|
10939
|
+
else {
|
|
10940
|
+
this.closePopup.emit();
|
|
10941
|
+
}
|
|
10904
10942
|
};
|
|
10905
10943
|
// for multi select
|
|
10906
10944
|
ListOfValuesPopupComponent.prototype.selectOptions = function () {
|
|
10907
10945
|
this.model = this.viewModelsMain.filter(function (v) { return v.checked; }).map(function (m) { return m.model; });
|
|
10908
10946
|
this.modelChange.emit(this.model);
|
|
10909
10947
|
};
|
|
10910
|
-
ListOfValuesPopupComponent.prototype.selectNextOption = function () {
|
|
10911
|
-
|
|
10912
|
-
|
|
10948
|
+
ListOfValuesPopupComponent.prototype.selectNextOption = function (back) {
|
|
10949
|
+
var _this = this;
|
|
10950
|
+
if (back === void 0) { back = false; }
|
|
10951
|
+
var nextModel;
|
|
10952
|
+
if (!this.highLightModel) {
|
|
10953
|
+
nextModel = this.viewModels[back ? this.viewModels.length - 1 : 0];
|
|
10913
10954
|
}
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
|
|
10917
|
-
|
|
10918
|
-
|
|
10919
|
-
|
|
10955
|
+
else {
|
|
10956
|
+
var currentViewModelIdx = this.viewModels.findIndex(function (vm) { return vm === _this.highLightModel; });
|
|
10957
|
+
if (back) {
|
|
10958
|
+
nextModel = this.viewModels[currentViewModelIdx <= 0 ? this.viewModels.length - 1 : currentViewModelIdx - 1];
|
|
10959
|
+
}
|
|
10960
|
+
else {
|
|
10961
|
+
nextModel = this.viewModels[currentViewModelIdx >= this.viewModels.length - 1 ? 0 : currentViewModelIdx + 1];
|
|
10962
|
+
}
|
|
10963
|
+
}
|
|
10964
|
+
this.highLightModel = nextModel;
|
|
10965
|
+
if (!this.multiselect) {
|
|
10966
|
+
this.selectViewModel(nextModel, false);
|
|
10920
10967
|
}
|
|
10921
|
-
this._activeIndex--;
|
|
10922
|
-
this.selectOptionByActiveIndex(false);
|
|
10923
10968
|
};
|
|
10924
10969
|
ListOfValuesPopupComponent.prototype._prepareViewModelsMain = function () {
|
|
10925
10970
|
var _this = this;
|
|
@@ -10934,10 +10979,12 @@
|
|
|
10934
10979
|
this.viewModels = this.viewModelsMain.filter(function (vm) { return vm.model[_this.displayField] && vm.model[_this.displayField].toLowerCase().includes(_this.searchTerm ? _this.searchTerm.toLowerCase() : ""); });
|
|
10935
10980
|
};
|
|
10936
10981
|
ListOfValuesPopupComponent.prototype._scrollIntoView = function () {
|
|
10937
|
-
|
|
10982
|
+
var _this = this;
|
|
10983
|
+
var activeIndex = this.viewModels.findIndex(function (vmm) { return vmm === _this.highLightModel; });
|
|
10984
|
+
if (!this._lovItems || this._lovItems.length <= 0 || activeIndex < 0 || !this.dropDownList) {
|
|
10938
10985
|
return;
|
|
10939
10986
|
}
|
|
10940
|
-
var activeItem = this._lovItems[
|
|
10987
|
+
var activeItem = this._lovItems[activeIndex].nativeElement ? this._lovItems[activeIndex].nativeElement : undefined;
|
|
10941
10988
|
var scrollParent = this.dropDownList.nativeElement ? this.dropDownList.nativeElement : undefined;
|
|
10942
10989
|
this._scrollActiveItemIntoView(activeItem, scrollParent);
|
|
10943
10990
|
};
|
|
@@ -10961,7 +11008,7 @@
|
|
|
10961
11008
|
ListOfValuesPopupComponent.decorators = [
|
|
10962
11009
|
{ type: i0.Component, args: [{
|
|
10963
11010
|
selector: 'co-list-of-values-popup',
|
|
10964
|
-
template: "\n <div class=\"lov-options\"
|
|
11011
|
+
template: "\n <div class=\"lov-options\" [overlay]=\"parentForOverlay\" [inheritWidth]=\"true\" [ngClass]=\"customCssClass\" id=\"lov-popup\"\n [tabIndex]=\"-1\" role=\"listbox\"\n (clickOutside)=\"closePopup.emit($event)\">\n <co-input-search *ngIf=\"multiselect\" \n [(model)]=\"searchTerm\"\n [placeholder]=\"searchPlaceholder\"\n (keydown)=\"handleInputKeyDown($event)\"\n (modelChange)=\"filterViewModels()\"></co-input-search>\n <ul class=\"dropdown-list\" #dropDownList>\n <li #lovItem *ngFor=\"let viewModel of viewModels; let index = index\" [class.selected]=\"viewModel === highLightModel\"\n (click)=\"selectViewModel(viewModel, false)\" role=\"option\">\n <ng-container *ngIf=\"!multiselect\">\n <span class=\"lov-options-text\" [textContent]=\"viewModel.model[displayField]\"></span>\n </ng-container>\n <ng-container *ngIf=\"multiselect\">\n <co-input-checkbox [model]=\"viewModel.checked\" (modelChange)=\"selectViewModel(viewModel, false)\"></co-input-checkbox>\n <span class=\"lov-options-text\" [textContent]=\"viewModel.model[displayField]\"></span>\n </ng-container>\n </li>\n </ul>\n </div>\n ",
|
|
10965
11012
|
encapsulation: i0.ViewEncapsulation.None
|
|
10966
11013
|
},] }
|
|
10967
11014
|
];
|
|
@@ -11028,6 +11075,7 @@
|
|
|
11028
11075
|
if (this._lovPopupComponentRef) {
|
|
11029
11076
|
this._lovPopupComponentRef.instance.searchTerm = model;
|
|
11030
11077
|
}
|
|
11078
|
+
this.selectedModel = model;
|
|
11031
11079
|
};
|
|
11032
11080
|
ListOfValuesComponent.prototype.handleInputKeyDown = function (event) {
|
|
11033
11081
|
if (event) {
|
|
@@ -11041,13 +11089,13 @@
|
|
|
11041
11089
|
this._lovPopupComponentRef.instance.selectNextOption();
|
|
11042
11090
|
return false;
|
|
11043
11091
|
case KeyboardKey.Up:
|
|
11044
|
-
this._lovPopupComponentRef.instance.
|
|
11092
|
+
this._lovPopupComponentRef.instance.selectNextOption(true);
|
|
11045
11093
|
return false;
|
|
11046
11094
|
case KeyboardKey.Enter:
|
|
11047
|
-
this._lovPopupComponentRef.instance.
|
|
11095
|
+
this._lovPopupComponentRef.instance.selectOptionAndClosePopup();
|
|
11048
11096
|
return false;
|
|
11049
11097
|
case KeyboardKey.Tab:
|
|
11050
|
-
this._lovPopupComponentRef.instance.
|
|
11098
|
+
this._lovPopupComponentRef.instance.selectOptionAndClosePopup();
|
|
11051
11099
|
}
|
|
11052
11100
|
}
|
|
11053
11101
|
}
|
|
@@ -11097,11 +11145,13 @@
|
|
|
11097
11145
|
};
|
|
11098
11146
|
ListOfValuesComponent.prototype.optionChosen = function (option) {
|
|
11099
11147
|
var _this = this;
|
|
11100
|
-
if (
|
|
11101
|
-
this.
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11148
|
+
if (option) {
|
|
11149
|
+
if (this.multiselect) {
|
|
11150
|
+
this.selectedModels = option.map(function (o) { return o[_this.displayField]; });
|
|
11151
|
+
}
|
|
11152
|
+
else {
|
|
11153
|
+
this.selectedModel = option[this.displayField];
|
|
11154
|
+
}
|
|
11105
11155
|
}
|
|
11106
11156
|
this.model = option;
|
|
11107
11157
|
this.modelChange.emit(this.model);
|
|
@@ -11112,6 +11162,19 @@
|
|
|
11112
11162
|
this._lovPopupComponentRef = undefined;
|
|
11113
11163
|
this.focused = false;
|
|
11114
11164
|
};
|
|
11165
|
+
ListOfValuesComponent.prototype.checkModel = function () {
|
|
11166
|
+
var _this = this;
|
|
11167
|
+
if (!this.multiselect && this.selectedModel && this.collection) {
|
|
11168
|
+
var model = this.collection.find(function (c) { return c[_this.displayField] === _this.selectedModel; });
|
|
11169
|
+
if (model) {
|
|
11170
|
+
this.model = model;
|
|
11171
|
+
}
|
|
11172
|
+
else {
|
|
11173
|
+
this.model = undefined;
|
|
11174
|
+
}
|
|
11175
|
+
this.modelChange.emit(this.model);
|
|
11176
|
+
}
|
|
11177
|
+
};
|
|
11115
11178
|
ListOfValuesComponent.prototype._setSelectedModel = function () {
|
|
11116
11179
|
var _this = this;
|
|
11117
11180
|
if (this.multiselect) {
|
|
@@ -11139,7 +11202,7 @@
|
|
|
11139
11202
|
ListOfValuesComponent.decorators = [
|
|
11140
11203
|
{ type: i0.Component, args: [{
|
|
11141
11204
|
selector: 'co-list-of-values',
|
|
11142
|
-
template: "\n <co-input-text aria-haspopup=\"listbox\" [attr.aria-expanded]=\"isSelectOpen\" aria-controls=\"lov-popup\" role=\"combobox\"\n class=\"no-focus-line\"\n overlayParent\n #parentForOverlay=\"overlayParent\" type=\"text\" [id]=\"label\"\n [model]=\"multiselect ? selectedModels : selectedModel\"\n [placeholder]=\"label\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [noClickFocus]=\"false\"\n [leftIconData]=\"leftIconData\"\n [rightIcon]=\"isSelectOpen ? icons.ChevronUpRegular : icons.ChevronDownRegular\"\n [showClearButton]=\"true\"\n [useContent]=\"multiselect\"\n (modelChange)=\"handleInputModelChange($event)\"\n (click)=\"openPopup()\"\n (rightIconClick)=\"toggleSelect()\"\n (keydown)=\"handleInputKeyDown($event)\"\n (clearIconClick)=\"clearModel($event)\"\n >\n </co-input-text>\n <ng-container *ngIf=\"multiselect\">\n <div class=\"multiselect-chips-wrapper\">\n <div class=\"chips\" *ngFor=\"let chip of model\">\n <span class=\"chips-description\" [textContent]=\"chip[displayField]\"></span>\n <co-icon class=\"remove-chip-icon\" [icon]=\"icons.CrossSkinny\" (click)=\"removeOptionFromModel(chip)\"></co-icon>\n </div>\n </div>\n </ng-container>\n ",
|
|
11205
|
+
template: "\n <co-input-text aria-haspopup=\"listbox\" [attr.aria-expanded]=\"isSelectOpen\" aria-controls=\"lov-popup\" role=\"combobox\"\n class=\"no-focus-line\"\n overlayParent\n #parentForOverlay=\"overlayParent\" type=\"text\" [id]=\"label\"\n [model]=\"multiselect ? selectedModels : selectedModel\"\n [placeholder]=\"label\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [noClickFocus]=\"false\"\n [leftIconData]=\"leftIconData\"\n [rightIcon]=\"isSelectOpen ? icons.ChevronUpRegular : icons.ChevronDownRegular\"\n [showClearButton]=\"true\"\n [useContent]=\"multiselect\"\n (modelChange)=\"handleInputModelChange($event)\"\n (click)=\"openPopup()\"\n (rightIconClick)=\"toggleSelect()\"\n (keydown)=\"handleInputKeyDown($event)\"\n (clearIconClick)=\"clearModel($event)\"\n (blur)=\"checkModel()\"\n >\n </co-input-text>\n <ng-container *ngIf=\"multiselect\">\n <div class=\"multiselect-chips-wrapper\">\n <div class=\"chips\" *ngFor=\"let chip of model\">\n <span class=\"chips-description\" [textContent]=\"chip[displayField]\"></span>\n <co-icon class=\"remove-chip-icon\" [icon]=\"icons.CrossSkinny\" (click)=\"removeOptionFromModel(chip)\"></co-icon>\n </div>\n </div>\n </ng-container>\n ",
|
|
11143
11206
|
providers: [
|
|
11144
11207
|
OverlayService
|
|
11145
11208
|
],
|