@ng-select/ng-select 3.7.2 → 3.7.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/README.md +1 -3
- package/bundles/ng-select-ng-select.umd.js +68 -6
- package/bundles/ng-select-ng-select.umd.js.map +1 -1
- package/bundles/ng-select-ng-select.umd.min.js +1 -1
- package/bundles/ng-select-ng-select.umd.min.js.map +1 -1
- package/esm2015/lib/ng-select.component.js +41 -4
- package/esm5/lib/ng-select.component.js +49 -4
- package/fesm2015/ng-select-ng-select.js +40 -3
- package/fesm2015/ng-select-ng-select.js.map +1 -1
- package/fesm5/ng-select-ng-select.js +48 -3
- package/fesm5/ng-select-ng-select.js.map +1 -1
- package/lib/ng-select.component.d.ts +4 -0
- package/ng-select-ng-select.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -3256,6 +3256,7 @@ var NgSelectComponent = /** @class */ (function () {
|
|
|
3256
3256
|
this.readonly = false;
|
|
3257
3257
|
this.searchWhileComposing = true;
|
|
3258
3258
|
this.minTermLength = 0;
|
|
3259
|
+
this.editableSearchTerm = false;
|
|
3259
3260
|
this.keyDownFn = (/**
|
|
3260
3261
|
* @param {?} _
|
|
3261
3262
|
* @return {?}
|
|
@@ -3282,6 +3283,7 @@ var NgSelectComponent = /** @class */ (function () {
|
|
|
3282
3283
|
this.searchTerm = null;
|
|
3283
3284
|
this.dropdownId = newId();
|
|
3284
3285
|
this.escapeHTML = true;
|
|
3286
|
+
this.useDefaultClass = true;
|
|
3285
3287
|
this._items = [];
|
|
3286
3288
|
this._defaultLabel = 'label';
|
|
3287
3289
|
this._pressedKeys = [];
|
|
@@ -3396,6 +3398,17 @@ var NgSelectComponent = /** @class */ (function () {
|
|
|
3396
3398
|
configurable: true
|
|
3397
3399
|
});
|
|
3398
3400
|
;
|
|
3401
|
+
Object.defineProperty(NgSelectComponent.prototype, "_editableSearchTerm", {
|
|
3402
|
+
get: /**
|
|
3403
|
+
* @private
|
|
3404
|
+
* @return {?}
|
|
3405
|
+
*/
|
|
3406
|
+
function () {
|
|
3407
|
+
return this.editableSearchTerm && !this.multiple;
|
|
3408
|
+
},
|
|
3409
|
+
enumerable: true,
|
|
3410
|
+
configurable: true
|
|
3411
|
+
});
|
|
3399
3412
|
Object.defineProperty(NgSelectComponent.prototype, "selectedItems", {
|
|
3400
3413
|
get: /**
|
|
3401
3414
|
* @return {?}
|
|
@@ -3723,7 +3736,12 @@ var NgSelectComponent = /** @class */ (function () {
|
|
|
3723
3736
|
return;
|
|
3724
3737
|
}
|
|
3725
3738
|
this.isOpen = false;
|
|
3726
|
-
this.
|
|
3739
|
+
if (!this._editableSearchTerm) {
|
|
3740
|
+
this._clearSearch();
|
|
3741
|
+
}
|
|
3742
|
+
else {
|
|
3743
|
+
this.itemsList.resetFilteredItems();
|
|
3744
|
+
}
|
|
3727
3745
|
this.itemsList.unmarkItem();
|
|
3728
3746
|
this._onTouched();
|
|
3729
3747
|
this.closeEvent.emit();
|
|
@@ -3747,6 +3765,9 @@ var NgSelectComponent = /** @class */ (function () {
|
|
|
3747
3765
|
else {
|
|
3748
3766
|
this.select(item);
|
|
3749
3767
|
}
|
|
3768
|
+
if (this._editableSearchTerm) {
|
|
3769
|
+
this._setSearchTermFromItems();
|
|
3770
|
+
}
|
|
3750
3771
|
this._onSelectionChanged();
|
|
3751
3772
|
};
|
|
3752
3773
|
/**
|
|
@@ -3760,7 +3781,7 @@ var NgSelectComponent = /** @class */ (function () {
|
|
|
3760
3781
|
function (item) {
|
|
3761
3782
|
if (!item.selected) {
|
|
3762
3783
|
this.itemsList.select(item);
|
|
3763
|
-
if (this.clearSearchOnAdd) {
|
|
3784
|
+
if (this.clearSearchOnAdd && !this._editableSearchTerm) {
|
|
3764
3785
|
this._clearSearch();
|
|
3765
3786
|
}
|
|
3766
3787
|
this._updateNgModel();
|
|
@@ -3968,6 +3989,9 @@ var NgSelectComponent = /** @class */ (function () {
|
|
|
3968
3989
|
if (this.focused) {
|
|
3969
3990
|
return;
|
|
3970
3991
|
}
|
|
3992
|
+
if (this._editableSearchTerm) {
|
|
3993
|
+
this._setSearchTermFromItems();
|
|
3994
|
+
}
|
|
3971
3995
|
this.element.classList.add('ng-select-focused');
|
|
3972
3996
|
this.focusEvent.emit($event);
|
|
3973
3997
|
this.focused = true;
|
|
@@ -3986,6 +4010,9 @@ var NgSelectComponent = /** @class */ (function () {
|
|
|
3986
4010
|
if (!this.isOpen && !this.disabled) {
|
|
3987
4011
|
this._onTouched();
|
|
3988
4012
|
}
|
|
4013
|
+
if (this._editableSearchTerm) {
|
|
4014
|
+
this._setSearchTermFromItems();
|
|
4015
|
+
}
|
|
3989
4016
|
this.focused = false;
|
|
3990
4017
|
};
|
|
3991
4018
|
/**
|
|
@@ -4013,6 +4040,19 @@ var NgSelectComponent = /** @class */ (function () {
|
|
|
4013
4040
|
this._cd.detectChanges();
|
|
4014
4041
|
}
|
|
4015
4042
|
};
|
|
4043
|
+
/**
|
|
4044
|
+
* @private
|
|
4045
|
+
* @return {?}
|
|
4046
|
+
*/
|
|
4047
|
+
NgSelectComponent.prototype._setSearchTermFromItems = /**
|
|
4048
|
+
* @private
|
|
4049
|
+
* @return {?}
|
|
4050
|
+
*/
|
|
4051
|
+
function () {
|
|
4052
|
+
/** @type {?} */
|
|
4053
|
+
var selected = this.selectedItems && this.selectedItems[0];
|
|
4054
|
+
this.searchTerm = (selected && selected.label) || null;
|
|
4055
|
+
};
|
|
4016
4056
|
/**
|
|
4017
4057
|
* @private
|
|
4018
4058
|
* @param {?} items
|
|
@@ -4627,7 +4667,7 @@ var NgSelectComponent = /** @class */ (function () {
|
|
|
4627
4667
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4628
4668
|
host: {
|
|
4629
4669
|
'role': 'listbox',
|
|
4630
|
-
'class': '
|
|
4670
|
+
'[class.ng-select]': 'useDefaultClass',
|
|
4631
4671
|
'[class.ng-select-single]': '!multiple',
|
|
4632
4672
|
},
|
|
4633
4673
|
styles: [".ng-select{position:relative;display:block;box-sizing:border-box}.ng-select div,.ng-select input,.ng-select span{box-sizing:border-box}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-select-container .ng-value-container .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-placeholder,.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-value{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.ng-select.ng-select-disabled .ng-arrow-wrapper{cursor:default}.ng-select.ng-select-filtered .ng-placeholder{display:none}.ng-select .ng-select-container{cursor:default;display:-webkit-box;display:flex;outline:0;overflow:hidden;position:relative;width:100%}.ng-select .ng-select-container .ng-value-container{display:-webkit-box;display:flex;-webkit-box-flex:1;flex:1}.ng-select .ng-select-container .ng-value-container .ng-input{opacity:0}.ng-select .ng-select-container .ng-value-container .ng-input>input{box-sizing:content-box;background:none;border:0;box-shadow:none;outline:0;cursor:default;width:100%}.ng-select .ng-select-container .ng-value-container .ng-input>input::-ms-clear{display:none}.ng-select .ng-select-container .ng-value-container .ng-input>input[readonly]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-select-container .ng-value-container .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{-webkit-box-flex:1;flex:1;z-index:2}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{position:absolute;z-index:1}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ng-select .ng-clear-wrapper .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-spinner-loader{border-radius:50%;width:17px;height:17px;margin-right:5px;font-size:10px;position:relative;text-indent:-9999em;border-top:2px solid rgba(66,66,66,.2);border-right:2px solid rgba(66,66,66,.2);border-bottom:2px solid rgba(66,66,66,.2);border-left:2px solid #424242;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:.8s linear infinite load8;animation:.8s linear infinite load8}.ng-select .ng-spinner-loader:after{border-radius:50%;width:17px;height:17px}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ng-select .ng-arrow-wrapper{cursor:pointer;position:relative;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ng-select .ng-arrow-wrapper .ng-arrow{pointer-events:none;display:inline-block;height:0;width:0;position:relative}.ng-dropdown-panel{box-sizing:border-box;position:absolute;opacity:0;width:100%;z-index:1050;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;box-sizing:border-box;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{box-sizing:border-box;cursor:pointer;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.disabled{cursor:default}.ng-dropdown-panel .scroll-host{overflow:hidden;overflow-y:auto;position:relative;display:block;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .scrollable-content{top:0;left:0;width:100%;height:100%;position:absolute}.ng-dropdown-panel .total-padding{width:1px;opacity:0}"]
|
|
@@ -4677,6 +4717,7 @@ var NgSelectComponent = /** @class */ (function () {
|
|
|
4677
4717
|
readonly: [{ type: Input }],
|
|
4678
4718
|
searchWhileComposing: [{ type: Input }],
|
|
4679
4719
|
minTermLength: [{ type: Input }],
|
|
4720
|
+
editableSearchTerm: [{ type: Input }],
|
|
4680
4721
|
keyDownFn: [{ type: Input }],
|
|
4681
4722
|
typeahead: [{ type: Input }, { type: HostBinding, args: ['class.ng-select-typeahead',] }],
|
|
4682
4723
|
multiple: [{ type: Input }, { type: HostBinding, args: ['class.ng-select-multiple',] }],
|
|
@@ -4789,6 +4830,8 @@ if (false) {
|
|
|
4789
4830
|
/** @type {?} */
|
|
4790
4831
|
NgSelectComponent.prototype.minTermLength;
|
|
4791
4832
|
/** @type {?} */
|
|
4833
|
+
NgSelectComponent.prototype.editableSearchTerm;
|
|
4834
|
+
/** @type {?} */
|
|
4792
4835
|
NgSelectComponent.prototype.keyDownFn;
|
|
4793
4836
|
/** @type {?} */
|
|
4794
4837
|
NgSelectComponent.prototype.typeahead;
|
|
@@ -4866,6 +4909,8 @@ if (false) {
|
|
|
4866
4909
|
NgSelectComponent.prototype.focused;
|
|
4867
4910
|
/** @type {?} */
|
|
4868
4911
|
NgSelectComponent.prototype.escapeHTML;
|
|
4912
|
+
/** @type {?} */
|
|
4913
|
+
NgSelectComponent.prototype.useDefaultClass;
|
|
4869
4914
|
/**
|
|
4870
4915
|
* @type {?}
|
|
4871
4916
|
* @private
|