@wizishop/angular-components 0.0.237 → 0.0.241
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 +611 -315
- package/bundles/wizishop-angular-components.umd.js +40 -8
- 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/button/button.component.js +4 -2
- package/esm2015/lib/components/switch/switch.component.js +40 -9
- package/fesm2015/wizishop-angular-components.js +41 -9
- package/fesm2015/wizishop-angular-components.js.map +1 -1
- package/lib/components/button/button.component.d.ts +1 -0
- package/lib/components/switch/switch.component.d.ts +13 -3
- package/package.json +1 -1
- package/wizishop-angular-components-0.0.241.tgz +0 -0
- package/wizishop-angular-components.metadata.json +1 -1
- package/wizishop-angular-components-0.0.237.tgz +0 -0
|
@@ -1245,6 +1245,7 @@
|
|
|
1245
1245
|
this.confirmDeleteText = '';
|
|
1246
1246
|
this.noPadding = false;
|
|
1247
1247
|
this.tooltipPosition = 'top-center';
|
|
1248
|
+
this.tooltipOneline = false;
|
|
1248
1249
|
this.confirmDeletePosition = 'right';
|
|
1249
1250
|
this.click = new i0.EventEmitter();
|
|
1250
1251
|
this.isLoadingChange = new i0.EventEmitter();
|
|
@@ -1334,7 +1335,7 @@
|
|
|
1334
1335
|
ButtonComponent.decorators = [
|
|
1335
1336
|
{ type: i0.Component, args: [{
|
|
1336
1337
|
selector: 'wac-button',
|
|
1337
|
-
template: "<a\n [class]=\"'wac-button ' + extraClasses\"\n (click)=\"confirmDelete && waitForConfirmDelete ? addMaxWidthDelete() : '';onButtonClick($event);\"\n (mouseleave)=\"animation ? resetMaxWidth() : '';\"\n (mouseenter)=\"animation ? addMaxWidth() : '';\"\n wzAutoHide (clickOutside)=\"confirmDelete && !waitForConfirmDelete ? resetMaxWidthDelete() : ''\"\n [ngClass]=\"[\n label === '' ? 'alone' : '',\n coin ? 'has-coin width-auto' : '',\n animationRight ? 'animation-right' : '',\n animation ? 'animationText' : '',\n isLoading ? 'is-loading' : '',\n opacity ? 'opacity' : '',\n disabled ? 'disabled' : '',\n widthAuto ? 'width-auto' : '',\n noPadding ? 'no-padding' : '',\n
|
|
1338
|
+
template: "<a\n [class]=\"'wac-button ' + extraClasses\"\n (click)=\"confirmDelete && waitForConfirmDelete ? addMaxWidthDelete() : '';onButtonClick($event);\"\n (mouseleave)=\"animation ? resetMaxWidth() : '';\"\n (mouseenter)=\"animation ? addMaxWidth() : '';\"\n wzAutoHide (clickOutside)=\"confirmDelete && !waitForConfirmDelete ? resetMaxWidthDelete() : ''\"\n [ngClass]=\"[\n label === '' ? 'alone' : '',\n coin ? 'has-coin width-auto' : '',\n animationRight ? 'animation-right' : '',\n animation ? 'animationText' : '',\n isLoading ? 'is-loading' : '',\n opacity ? 'opacity' : '',\n disabled ? 'disabled' : '',\n widthAuto ? 'width-auto' : '',\n noPadding ? 'no-padding' : '',\n whiteSpaceNowrap ? 'white-space-no-wrap' : '',\n !waitForConfirmDelete && confirmDelete ? 'step-delete' : '',\n confirmDelete ? 'deletePosition-' + confirmDeletePosition : ''\n ]\"\n [ngStyle]=\"{\n 'text-align': contentHorizontalPosition\n }\"\n>\n <span class=\"wac-button__wrapper\" [style.color]=\"textcolor ? textcolor : ''\">\n <i *ngIf=\"icon\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n <span class=\"wac-button__animation\" [style.maxWidth]=\"buttonMaxWidth\" [style.width]=\"buttonWidth + 'px'\">\n <span #calculWidth class=\"wac-button__animation__text\" [innerHTML]=\"animationText\"></span>\n </span>\n <span class=\"wac-button__confirmDelete\" [style.maxWidth]=\"buttonMaxWidthDelete\" [style.width]=\"buttonWidthDelete + 'px'\">\n <span #calculWidthDelete class=\"wac-button__confirmDelete__text\" [innerHTML]=\"confirmDeleteText\"></span>\n </span>\n <span *ngIf=\"coin\" class=\"wac-button__coin\"><i class=\"fa-solid fa-coin-front\"></i><span [innerHTML]=\"coin\"></span></span>\n <span\n class=\"wac-button__loader\"\n [ngClass]=\"extraClasses.includes('is-outlined') ? 'outlined' : ''\"\n *ngIf=\"isLoading\"\n [style.width]=\"currentLoading + '%'\"\n >\n <span *ngIf=\"extraClasses.includes('is-outlined')\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n </span>\n <span class=\"wac-button__tooltips {{ tooltipPosition }}\" [ngClass]=\"{'oneline': tooltipOneline}\" [style.minWidth]=\"tooltipWidth\" *ngIf=\"tooltip\">\n {{ tooltip }}\n </span>\n</a>\n"
|
|
1338
1339
|
},] }
|
|
1339
1340
|
];
|
|
1340
1341
|
ButtonComponent.ctorParameters = function () { return []; };
|
|
@@ -1361,6 +1362,7 @@
|
|
|
1361
1362
|
tooltipWidth: [{ type: i0.Input }],
|
|
1362
1363
|
noPadding: [{ type: i0.Input }],
|
|
1363
1364
|
tooltipPosition: [{ type: i0.Input }],
|
|
1365
|
+
tooltipOneline: [{ type: i0.Input }],
|
|
1364
1366
|
confirmDeletePosition: [{ type: i0.Input }],
|
|
1365
1367
|
click: [{ type: i0.Output }],
|
|
1366
1368
|
isLoading: [{ type: i0.Input }],
|
|
@@ -2396,36 +2398,66 @@
|
|
|
2396
2398
|
};
|
|
2397
2399
|
|
|
2398
2400
|
var SwitchComponent = /** @class */ (function () {
|
|
2399
|
-
function SwitchComponent() {
|
|
2400
|
-
|
|
2401
|
+
function SwitchComponent(changeDetectorRef) {
|
|
2402
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
2403
|
+
// todo add ngmodel and review texts display (textState is mandatory in order to display textStateEnable and textStateDisable)
|
|
2401
2404
|
this.value = false;
|
|
2402
2405
|
this.textState = false;
|
|
2403
2406
|
this.textStateEnable = '';
|
|
2404
2407
|
this.textStateDisable = '';
|
|
2405
|
-
this.showInput = false;
|
|
2408
|
+
this.showInput = false; // todo should not be handle here, but in another component
|
|
2406
2409
|
this.danger = false;
|
|
2407
2410
|
this.whiteSpace = false;
|
|
2408
2411
|
this.switchChange = new i0.EventEmitter(); // todo set emitted type
|
|
2409
|
-
this.changeInput = new i0.EventEmitter(); // todo set emitted type
|
|
2412
|
+
this.changeInput = new i0.EventEmitter(); // todo set emitted type, should be removed
|
|
2413
|
+
this.onChange = function (value) { };
|
|
2414
|
+
this.onTouched = function () { };
|
|
2410
2415
|
}
|
|
2411
2416
|
SwitchComponent.prototype.ngOnInit = function () {
|
|
2412
2417
|
this.id = 'switch-' + Math.floor(Math.random() * Math.floor(1000));
|
|
2413
2418
|
};
|
|
2414
2419
|
SwitchComponent.prototype.changeValue = function (event) {
|
|
2415
|
-
this.
|
|
2420
|
+
if (this.disabled) {
|
|
2421
|
+
return;
|
|
2422
|
+
}
|
|
2423
|
+
this.value = event.target.checked;
|
|
2424
|
+
this.switchChange.emit(this.value);
|
|
2425
|
+
this.onChange(this.value);
|
|
2416
2426
|
};
|
|
2417
2427
|
SwitchComponent.prototype.triggerInput = function () {
|
|
2418
2428
|
this.changeInput.emit(this.valueInput);
|
|
2419
2429
|
};
|
|
2430
|
+
SwitchComponent.prototype.writeValue = function (value) {
|
|
2431
|
+
this.value = value;
|
|
2432
|
+
};
|
|
2433
|
+
SwitchComponent.prototype.registerOnChange = function (onChange) {
|
|
2434
|
+
this.onChange = onChange;
|
|
2435
|
+
};
|
|
2436
|
+
SwitchComponent.prototype.onBlur = function () {
|
|
2437
|
+
this.onTouched();
|
|
2438
|
+
};
|
|
2439
|
+
SwitchComponent.prototype.registerOnTouched = function (onTouched) {
|
|
2440
|
+
this.onTouched = onTouched;
|
|
2441
|
+
};
|
|
2442
|
+
SwitchComponent.prototype.setDisabledState = function (disabled) {
|
|
2443
|
+
this.disabled = disabled;
|
|
2444
|
+
this.changeDetectorRef.markForCheck();
|
|
2445
|
+
};
|
|
2420
2446
|
return SwitchComponent;
|
|
2421
2447
|
}());
|
|
2422
2448
|
SwitchComponent.decorators = [
|
|
2423
2449
|
{ type: i0.Component, args: [{
|
|
2424
2450
|
selector: 'wac-switch',
|
|
2425
|
-
template: "<div class=\"wac-switch\">\n <input type=\"checkbox\" [checked]=\"value\" (change)=\"changeValue($event)\" [id]=\"id\" [ngClass]=\"{ danger: danger }\"/>\n <label [for]=\"id\" class=\"wac-switch__label\">\n <span class=\"wac-switch__label__text\"\n ><ng-content></ng-content\n ><span\n *ngIf=\"textState\"\n [ngStyle]=\"{'whiteSpace': whiteSpace ? 'nowrap' :'normal'}\"\n >{{ textState }} <strong class=\"disable\" *ngIf=\"textStateDisable\">{{ textStateDisable }}</strong>\n <strong class=\"enable\" *ngIf=\"textStateEnable\">{{ textStateEnable }}</strong></span\n ></span\n >\n </label>\n</div>\n<div class=\"wac-show-input\" *ngIf=\"showInput && value\">\n <input [placeholder]=\"placholderInput\" type=\"text\" [(ngModel)]=\"valueInput\" (blur)=\"triggerInput()\" />\n</div>\n"
|
|
2451
|
+
template: "<div class=\"wac-switch\">\n <input type=\"checkbox\" [checked]=\"value\" (change)=\"changeValue($event)\" [id]=\"id\" [ngClass]=\"{ danger: danger }\" [disabled]=\"disabled\"/>\n <label [for]=\"id\" class=\"wac-switch__label\">\n <span class=\"wac-switch__label__text\"\n ><ng-content></ng-content\n ><span\n *ngIf=\"textState\"\n [ngStyle]=\"{'whiteSpace': whiteSpace ? 'nowrap' :'normal'}\"\n >{{ textState }} <strong class=\"disable\" *ngIf=\"textStateDisable\">{{ textStateDisable }}</strong>\n <strong class=\"enable\" *ngIf=\"textStateEnable\">{{ textStateEnable }}</strong></span\n ></span\n >\n </label>\n</div>\n<div class=\"wac-show-input\" *ngIf=\"showInput && value\">\n <input [placeholder]=\"placholderInput\" type=\"text\" [(ngModel)]=\"valueInput\" (blur)=\"triggerInput()\" />\n</div>\n",
|
|
2452
|
+
providers: [
|
|
2453
|
+
{ provide: forms.NG_VALUE_ACCESSOR, useExisting: SwitchComponent, multi: true },
|
|
2454
|
+
],
|
|
2455
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
2426
2456
|
},] }
|
|
2427
2457
|
];
|
|
2428
|
-
SwitchComponent.ctorParameters = function () { return [
|
|
2458
|
+
SwitchComponent.ctorParameters = function () { return [
|
|
2459
|
+
{ type: i0.ChangeDetectorRef }
|
|
2460
|
+
]; };
|
|
2429
2461
|
SwitchComponent.propDecorators = {
|
|
2430
2462
|
value: [{ type: i0.Input }],
|
|
2431
2463
|
textState: [{ type: i0.Input }],
|