@wizishop/angular-components 0.0.127 → 0.0.128
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/wizishop-angular-components.umd.js +7 -5
- package/bundles/wizishop-angular-components.umd.js.map +1 -1
- package/bundles/wizishop-angular-components.umd.min.js +1 -1
- package/bundles/wizishop-angular-components.umd.min.js.map +1 -1
- package/esm2015/lib/components/selects/select/select.component.js +8 -6
- package/fesm2015/wizishop-angular-components.js +7 -5
- package/fesm2015/wizishop-angular-components.js.map +1 -1
- package/lib/components/selects/select/select.component.d.ts +1 -0
- package/package.json +1 -1
- package/wizishop-angular-components-0.0.128.tgz +0 -0
- package/wizishop-angular-components.metadata.json +1 -1
- package/wizishop-angular-components-0.0.127.tgz +0 -0
|
@@ -3141,7 +3141,7 @@
|
|
|
3141
3141
|
},
|
|
3142
3142
|
set: function (items) {
|
|
3143
3143
|
this._items = items;
|
|
3144
|
-
this.
|
|
3144
|
+
this.setIndexItemSelected();
|
|
3145
3145
|
},
|
|
3146
3146
|
enumerable: false,
|
|
3147
3147
|
configurable: true
|
|
@@ -3157,7 +3157,6 @@
|
|
|
3157
3157
|
configurable: true
|
|
3158
3158
|
});
|
|
3159
3159
|
SelectComponent.prototype.ngOnInit = function () {
|
|
3160
|
-
this.indexItemSelected = this.items.findIndex(function (item) { return item.selected; });
|
|
3161
3160
|
};
|
|
3162
3161
|
SelectComponent.prototype.onClose = function () {
|
|
3163
3162
|
this.openCategories = false;
|
|
@@ -3167,7 +3166,7 @@
|
|
|
3167
3166
|
};
|
|
3168
3167
|
SelectComponent.prototype.onSelectItem = function (id) {
|
|
3169
3168
|
this.unselectAll();
|
|
3170
|
-
this.
|
|
3169
|
+
this.setIndexItemSelectedById(id);
|
|
3171
3170
|
var itemSelected = this.getItemSelected();
|
|
3172
3171
|
itemSelected.selected = true;
|
|
3173
3172
|
this.selectValue.emit(this.indexItemSelected);
|
|
@@ -3193,16 +3192,19 @@
|
|
|
3193
3192
|
SelectComponent.prototype.unselectAll = function () {
|
|
3194
3193
|
this.items.forEach(function (item) { return item.selected = false; });
|
|
3195
3194
|
};
|
|
3196
|
-
SelectComponent.prototype.
|
|
3195
|
+
SelectComponent.prototype.setIndexItemSelectedById = function (id) {
|
|
3197
3196
|
this.indexItemSelected = this.items.findIndex(function (item) { return item.id === id; });
|
|
3198
3197
|
};
|
|
3198
|
+
SelectComponent.prototype.setIndexItemSelected = function () {
|
|
3199
|
+
this.indexItemSelected = this.items.findIndex(function (item) { return item.selected; });
|
|
3200
|
+
};
|
|
3199
3201
|
SelectComponent.prototype.writeValue = function (selectItem) {
|
|
3200
3202
|
if (!selectItem) {
|
|
3201
3203
|
return;
|
|
3202
3204
|
}
|
|
3203
3205
|
this.unselectAll();
|
|
3204
3206
|
selectItem.selected = true;
|
|
3205
|
-
this.
|
|
3207
|
+
this.setIndexItemSelectedById(selectItem.id);
|
|
3206
3208
|
};
|
|
3207
3209
|
SelectComponent.prototype.registerOnChange = function (fn) {
|
|
3208
3210
|
this.onChange = fn;
|