@wizishop/angular-components 0.0.200 → 0.0.201
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/angular-components.scss +332 -315
- package/bundles/wizishop-angular-components.umd.js +11 -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/draganddrop-list/draganddrop-list.component.js +12 -6
- package/fesm2015/wizishop-angular-components.js +11 -5
- package/fesm2015/wizishop-angular-components.js.map +1 -1
- package/lib/components/draganddrop-list/draganddrop-list.component.d.ts +1 -0
- package/package.json +1 -1
- package/wizishop-angular-components-0.0.201.tgz +0 -0
- package/wizishop-angular-components.metadata.json +1 -1
- package/wizishop-angular-components-0.0.200.tgz +0 -0
|
@@ -2,26 +2,32 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from
|
|
|
2
2
|
import { moveItemInArray } from '@angular/cdk/drag-drop';
|
|
3
3
|
export class DraganddropListComponent {
|
|
4
4
|
constructor() {
|
|
5
|
+
this.disable = false;
|
|
5
6
|
this.itemsChange = new EventEmitter();
|
|
6
7
|
}
|
|
7
8
|
drop(event) {
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
if (!this.disable) {
|
|
10
|
+
moveItemInArray(this.items, event.previousIndex, event.currentIndex);
|
|
11
|
+
this.itemsChange.emit(this.items);
|
|
12
|
+
}
|
|
10
13
|
}
|
|
11
14
|
delete(index) {
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
if (!this.disable) {
|
|
16
|
+
this.items = this.items.filter((value, i) => i !== index);
|
|
17
|
+
this.itemsChange.emit(this.items);
|
|
18
|
+
}
|
|
14
19
|
}
|
|
15
20
|
}
|
|
16
21
|
DraganddropListComponent.decorators = [
|
|
17
22
|
{ type: Component, args: [{
|
|
18
23
|
selector: 'wac-draganddrop-list',
|
|
19
|
-
template: "<div class=\"wac-draganddrop-list\">\n <div class=\"wac-draganddrop-list__wrapper\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div class=\"wac-draganddrop-list__wrapper__item\" *ngFor=\"let item of items;let i = index;\" cdkDrag>\n <div>\n <span class=\"wac-draganddrop-list__wrapper__item__icon\">\n <span></span>\n </span>\n <span class=\"wac-draganddrop-list__wrapper__item__label\" [innerHTML]=\"item\"></span>\n </div>\n <div>\n <wac-button [iconFontSize]=\"'14px'\" [opacity]=\"true\" [icon]=\"'fa-regular fa-trash-can'\" [extraClasses]=\"'is-danger'\" (click)=\"delete(i)\"></wac-button>\n </div>\n </div>\n </div>\n</div>\n",
|
|
24
|
+
template: "<div class=\"wac-draganddrop-list\" *ngIf=\"!disable\">\n <div class=\"wac-draganddrop-list__wrapper\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div class=\"wac-draganddrop-list__wrapper__item\" *ngFor=\"let item of items;let i = index;\" cdkDrag>\n <div>\n <span class=\"wac-draganddrop-list__wrapper__item__icon\">\n <span></span>\n </span>\n <span class=\"wac-draganddrop-list__wrapper__item__label\" [innerHTML]=\"item\"></span>\n </div>\n <div>\n <wac-button [iconFontSize]=\"'14px'\" [opacity]=\"true\" [icon]=\"'fa-regular fa-trash-can'\" [extraClasses]=\"'is-danger'\" (click)=\"delete(i)\"></wac-button>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"wac-draganddrop-list wac-draganddrop-list--disabled\" *ngIf=\"disable\">\n <div class=\"wac-draganddrop-list__wrapper\">\n <div class=\"wac-draganddrop-list__wrapper__item\" *ngFor=\"let item of items;let i = index;\">\n <div>\n <span class=\"wac-draganddrop-list__wrapper__item__label\" [innerHTML]=\"item\"></span>\n </div>\n </div>\n </div>\n</div>\n",
|
|
20
25
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
21
26
|
},] }
|
|
22
27
|
];
|
|
23
28
|
DraganddropListComponent.propDecorators = {
|
|
24
29
|
items: [{ type: Input }],
|
|
30
|
+
disable: [{ type: Input }],
|
|
25
31
|
itemsChange: [{ type: Output }]
|
|
26
32
|
};
|
|
27
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJhZ2FuZGRyb3AtbGlzdC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyLWNvbXBvbmVudHMvc3JjL2xpYi9jb21wb25lbnRzL2RyYWdhbmRkcm9wLWxpc3QvZHJhZ2FuZGRyb3AtbGlzdC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFVLE1BQU0sRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUN0RyxPQUFPLEVBQWMsZUFBZSxFQUFDLE1BQU0sd0JBQXdCLENBQUM7QUFPcEUsTUFBTSxPQUFPLHdCQUF3QjtJQUxyQztRQVdFLFlBQU8sR0FBRyxLQUFLLENBQUM7UUFHaEIsZ0JBQVcsR0FBRyxJQUFJLFlBQVksRUFBaUIsQ0FBQztJQWdCbEQsQ0FBQztJQWRDLElBQUksQ0FBQyxLQUE0QjtRQUMvQixJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sRUFBRTtZQUNqQixlQUFlLENBQUMsSUFBSSxDQUFDLEtBQUssRUFBRSxLQUFLLENBQUMsYUFBYSxFQUFFLEtBQUssQ0FBQyxZQUFZLENBQUMsQ0FBQztZQUNyRSxJQUFJLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7U0FDbkM7SUFDSCxDQUFDO0lBRUQsTUFBTSxDQUFDLEtBQUs7UUFDVixJQUFJLENBQUMsSUFBSSxDQUFDLE9B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xuXG4gIEBPdXRwdXQoKVxuICBpdGVtc0NoYW5nZSA9IG5ldyBFdmVudEVtaXR0ZXI8QXJyYXk8c3RyaW5nPj4oKTtcblxuICBkcm9wKGV2ZW50OiBDZGtEcmFnRHJvcDxzdHJpbmdbXT4pIHtcbiAgICBpZiAoIXRoaXMuZGlzYWJsZSkge1xuICAgICAgbW92ZUl0ZW1JbkFycmF5KHRoaXMuaXRlbXMsIGV2ZW50LnByZXZpb3VzSW5kZXgsIGV2ZW50LmN1cnJlbnRJbmRleCk7XG4gICAgICB0aGlzLml0ZW1zQ2hhbmdlLmVtaXQodGhpcy5pdGVtcyk7XG4gICAgfVxuICB9XG5cbiAgZGVsZXRlKGluZGV4KSB7XG4gICAgaWYgKCF0aGlzLmRpc2FibGUpIHtcbiAgICAgIHRoaXMuaXRlbXMgPSB0aGlzLml0ZW1zLmZpbHRlcigodmFsdWUsIGkpID0+IGkgIT09IGluZGV4ICk7XG4gICAgICB0aGlzLml0ZW1zQ2hhbmdlLmVtaXQodGhpcy5pdGVtcyk7XG4gICAgfVxuICB9XG5cbn1cbiJdfQ==
|
|
@@ -4042,26 +4042,32 @@ WrapperMultipleBlockComponent.ctorParameters = () => [];
|
|
|
4042
4042
|
|
|
4043
4043
|
class DraganddropListComponent {
|
|
4044
4044
|
constructor() {
|
|
4045
|
+
this.disable = false;
|
|
4045
4046
|
this.itemsChange = new EventEmitter();
|
|
4046
4047
|
}
|
|
4047
4048
|
drop(event) {
|
|
4048
|
-
|
|
4049
|
-
|
|
4049
|
+
if (!this.disable) {
|
|
4050
|
+
moveItemInArray(this.items, event.previousIndex, event.currentIndex);
|
|
4051
|
+
this.itemsChange.emit(this.items);
|
|
4052
|
+
}
|
|
4050
4053
|
}
|
|
4051
4054
|
delete(index) {
|
|
4052
|
-
|
|
4053
|
-
|
|
4055
|
+
if (!this.disable) {
|
|
4056
|
+
this.items = this.items.filter((value, i) => i !== index);
|
|
4057
|
+
this.itemsChange.emit(this.items);
|
|
4058
|
+
}
|
|
4054
4059
|
}
|
|
4055
4060
|
}
|
|
4056
4061
|
DraganddropListComponent.decorators = [
|
|
4057
4062
|
{ type: Component, args: [{
|
|
4058
4063
|
selector: 'wac-draganddrop-list',
|
|
4059
|
-
template: "<div class=\"wac-draganddrop-list\">\n <div class=\"wac-draganddrop-list__wrapper\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div class=\"wac-draganddrop-list__wrapper__item\" *ngFor=\"let item of items;let i = index;\" cdkDrag>\n <div>\n <span class=\"wac-draganddrop-list__wrapper__item__icon\">\n <span></span>\n </span>\n <span class=\"wac-draganddrop-list__wrapper__item__label\" [innerHTML]=\"item\"></span>\n </div>\n <div>\n <wac-button [iconFontSize]=\"'14px'\" [opacity]=\"true\" [icon]=\"'fa-regular fa-trash-can'\" [extraClasses]=\"'is-danger'\" (click)=\"delete(i)\"></wac-button>\n </div>\n </div>\n </div>\n</div>\n",
|
|
4064
|
+
template: "<div class=\"wac-draganddrop-list\" *ngIf=\"!disable\">\n <div class=\"wac-draganddrop-list__wrapper\" cdkDropList (cdkDropListDropped)=\"drop($event)\">\n <div class=\"wac-draganddrop-list__wrapper__item\" *ngFor=\"let item of items;let i = index;\" cdkDrag>\n <div>\n <span class=\"wac-draganddrop-list__wrapper__item__icon\">\n <span></span>\n </span>\n <span class=\"wac-draganddrop-list__wrapper__item__label\" [innerHTML]=\"item\"></span>\n </div>\n <div>\n <wac-button [iconFontSize]=\"'14px'\" [opacity]=\"true\" [icon]=\"'fa-regular fa-trash-can'\" [extraClasses]=\"'is-danger'\" (click)=\"delete(i)\"></wac-button>\n </div>\n </div>\n </div>\n</div>\n\n<div class=\"wac-draganddrop-list wac-draganddrop-list--disabled\" *ngIf=\"disable\">\n <div class=\"wac-draganddrop-list__wrapper\">\n <div class=\"wac-draganddrop-list__wrapper__item\" *ngFor=\"let item of items;let i = index;\">\n <div>\n <span class=\"wac-draganddrop-list__wrapper__item__label\" [innerHTML]=\"item\"></span>\n </div>\n </div>\n </div>\n</div>\n",
|
|
4060
4065
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
4061
4066
|
},] }
|
|
4062
4067
|
];
|
|
4063
4068
|
DraganddropListComponent.propDecorators = {
|
|
4064
4069
|
items: [{ type: Input }],
|
|
4070
|
+
disable: [{ type: Input }],
|
|
4065
4071
|
itemsChange: [{ type: Output }]
|
|
4066
4072
|
};
|
|
4067
4073
|
|