@wizishop/angular-components 0.0.125 → 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 +40 -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 +14 -5
- package/esm2015/lib/directives/keyboard-events/keypress-enter.directive.js +21 -0
- package/esm2015/lib/directives/shared-directives.module.js +3 -2
- package/esm2015/public-api.js +2 -1
- package/fesm2015/wizishop-angular-components.js +35 -6
- package/fesm2015/wizishop-angular-components.js.map +1 -1
- package/lib/components/selects/select/select.component.d.ts +4 -1
- package/lib/directives/keyboard-events/keypress-enter.directive.d.ts +7 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/wizishop-angular-components-0.0.128.tgz +0 -0
- package/wizishop-angular-components.metadata.json +1 -1
- package/wizishop-angular-components-0.0.125.tgz +0 -0
|
@@ -633,7 +633,28 @@
|
|
|
633
633
|
ngVar: [{ type: i0.Input }]
|
|
634
634
|
};
|
|
635
635
|
|
|
636
|
-
var
|
|
636
|
+
var KeypressEnterDirective = /** @class */ (function () {
|
|
637
|
+
function KeypressEnterDirective() {
|
|
638
|
+
this.KEYPRESS_ENTER = "Enter";
|
|
639
|
+
this.keypressEnter = new i0.EventEmitter();
|
|
640
|
+
}
|
|
641
|
+
KeypressEnterDirective.prototype.onKeypress = function (event) {
|
|
642
|
+
if (event.key === this.KEYPRESS_ENTER) {
|
|
643
|
+
this.keypressEnter.next(true);
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
return KeypressEnterDirective;
|
|
647
|
+
}());
|
|
648
|
+
KeypressEnterDirective.decorators = [
|
|
649
|
+
{ type: i0.Directive, args: [{ selector: '[keypressEnter]' },] }
|
|
650
|
+
];
|
|
651
|
+
KeypressEnterDirective.ctorParameters = function () { return []; };
|
|
652
|
+
KeypressEnterDirective.propDecorators = {
|
|
653
|
+
onKeypress: [{ type: i0.HostListener, args: ['keypress', ['$event'],] }],
|
|
654
|
+
keypressEnter: [{ type: i0.Output }]
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
var directives = [DebounceKeyupDirective, AbstractDebounceDirective, AutoHideDirective, ZindexToggleDirective, VarDirective, KeypressEnterDirective];
|
|
637
658
|
var SharedDirectives = /** @class */ (function () {
|
|
638
659
|
function SharedDirectives() {
|
|
639
660
|
}
|
|
@@ -3114,6 +3135,17 @@
|
|
|
3114
3135
|
this.onChange = function () { };
|
|
3115
3136
|
this.onTouch = function () { };
|
|
3116
3137
|
}
|
|
3138
|
+
Object.defineProperty(SelectComponent.prototype, "items", {
|
|
3139
|
+
get: function () {
|
|
3140
|
+
return this._items;
|
|
3141
|
+
},
|
|
3142
|
+
set: function (items) {
|
|
3143
|
+
this._items = items;
|
|
3144
|
+
this.setIndexItemSelected();
|
|
3145
|
+
},
|
|
3146
|
+
enumerable: false,
|
|
3147
|
+
configurable: true
|
|
3148
|
+
});
|
|
3117
3149
|
Object.defineProperty(SelectComponent.prototype, "callToAction", {
|
|
3118
3150
|
get: function () {
|
|
3119
3151
|
return this._calllToAction;
|
|
@@ -3125,7 +3157,6 @@
|
|
|
3125
3157
|
configurable: true
|
|
3126
3158
|
});
|
|
3127
3159
|
SelectComponent.prototype.ngOnInit = function () {
|
|
3128
|
-
this.indexItemSelected = this.items.findIndex(function (item) { return item.selected; });
|
|
3129
3160
|
};
|
|
3130
3161
|
SelectComponent.prototype.onClose = function () {
|
|
3131
3162
|
this.openCategories = false;
|
|
@@ -3135,7 +3166,7 @@
|
|
|
3135
3166
|
};
|
|
3136
3167
|
SelectComponent.prototype.onSelectItem = function (id) {
|
|
3137
3168
|
this.unselectAll();
|
|
3138
|
-
this.
|
|
3169
|
+
this.setIndexItemSelectedById(id);
|
|
3139
3170
|
var itemSelected = this.getItemSelected();
|
|
3140
3171
|
itemSelected.selected = true;
|
|
3141
3172
|
this.selectValue.emit(this.indexItemSelected);
|
|
@@ -3161,16 +3192,19 @@
|
|
|
3161
3192
|
SelectComponent.prototype.unselectAll = function () {
|
|
3162
3193
|
this.items.forEach(function (item) { return item.selected = false; });
|
|
3163
3194
|
};
|
|
3164
|
-
SelectComponent.prototype.
|
|
3195
|
+
SelectComponent.prototype.setIndexItemSelectedById = function (id) {
|
|
3165
3196
|
this.indexItemSelected = this.items.findIndex(function (item) { return item.id === id; });
|
|
3166
3197
|
};
|
|
3198
|
+
SelectComponent.prototype.setIndexItemSelected = function () {
|
|
3199
|
+
this.indexItemSelected = this.items.findIndex(function (item) { return item.selected; });
|
|
3200
|
+
};
|
|
3167
3201
|
SelectComponent.prototype.writeValue = function (selectItem) {
|
|
3168
3202
|
if (!selectItem) {
|
|
3169
3203
|
return;
|
|
3170
3204
|
}
|
|
3171
3205
|
this.unselectAll();
|
|
3172
3206
|
selectItem.selected = true;
|
|
3173
|
-
this.
|
|
3207
|
+
this.setIndexItemSelectedById(selectItem.id);
|
|
3174
3208
|
};
|
|
3175
3209
|
SelectComponent.prototype.registerOnChange = function (fn) {
|
|
3176
3210
|
this.onChange = fn;
|
|
@@ -4303,6 +4337,7 @@
|
|
|
4303
4337
|
exports.InputComponent = InputComponent;
|
|
4304
4338
|
exports.InputSearchComponent = InputSearchComponent;
|
|
4305
4339
|
exports.InputWithSelectComponent = InputWithSelectComponent;
|
|
4340
|
+
exports.KeypressEnterDirective = KeypressEnterDirective;
|
|
4306
4341
|
exports.LabelComponent = LabelComponent;
|
|
4307
4342
|
exports.LinkComponent = LinkComponent;
|
|
4308
4343
|
exports.LoaderComponent = LoaderComponent;
|