ps-toolkit-ui 0.2.87 → 0.2.88
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/ps-toolkit-ui.umd.js +45 -1
- package/bundles/ps-toolkit-ui.umd.js.map +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js.map +1 -1
- package/esm2015/lib/components/form/checkbox/form.checkbox.component.js +45 -2
- package/fesm2015/ps-toolkit-ui.js +43 -1
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/components/form/checkbox/form.checkbox.component.d.ts +4 -0
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -3512,13 +3512,57 @@
|
|
|
3512
3512
|
this.changeIndex = new core.EventEmitter();
|
|
3513
3513
|
}
|
|
3514
3514
|
FormCheckboxComponent.prototype.ngOnInit = function () {
|
|
3515
|
+
var _this = this;
|
|
3516
|
+
this.inp.clear = function () {
|
|
3517
|
+
_this.inp.error = null;
|
|
3518
|
+
_this.inp.value = _this.inp.default;
|
|
3519
|
+
};
|
|
3520
|
+
this.inp.isValid = function () {
|
|
3521
|
+
_this.inp.error = null;
|
|
3522
|
+
if (_this.inp.required && !_this.inp.value) {
|
|
3523
|
+
_this.inp.error = exports.InputError.Required;
|
|
3524
|
+
return false;
|
|
3525
|
+
}
|
|
3526
|
+
return true;
|
|
3527
|
+
};
|
|
3528
|
+
this.inp.data = function () {
|
|
3529
|
+
return _this.inp.value;
|
|
3530
|
+
};
|
|
3531
|
+
this.inp.setValue = function (v) {
|
|
3532
|
+
_this.inp.value = v;
|
|
3533
|
+
};
|
|
3534
|
+
this.inp.focus = function () {
|
|
3535
|
+
_this.onFocusIn();
|
|
3536
|
+
};
|
|
3537
|
+
};
|
|
3538
|
+
FormCheckboxComponent.prototype.onFocusIn = function () {
|
|
3539
|
+
this.inp.error = null;
|
|
3540
|
+
this.inputBase.nativeElement.focus();
|
|
3541
|
+
};
|
|
3542
|
+
FormCheckboxComponent.prototype.onClick = function () {
|
|
3543
|
+
this.inputBase.nativeElement.click();
|
|
3544
|
+
};
|
|
3545
|
+
FormCheckboxComponent.prototype.onChange = function () {
|
|
3546
|
+
var _this = this;
|
|
3547
|
+
if (this.inp.onChange) {
|
|
3548
|
+
setTimeout(function () {
|
|
3549
|
+
_this.inp.onChange(_this.inp);
|
|
3550
|
+
}, 1);
|
|
3551
|
+
}
|
|
3552
|
+
};
|
|
3553
|
+
FormCheckboxComponent.prototype.onKeyDown = function (e) {
|
|
3554
|
+
var code = e.keyCode || e.which;
|
|
3555
|
+
if (code === 9 || code === 13) {
|
|
3556
|
+
e.preventDefault();
|
|
3557
|
+
this.changeIndex.emit(code === 9 ? e.shiftKey ? 'ShiftTab' : 'Tab' : e.shiftKey ? 'ShiftEnter' : 'Enter');
|
|
3558
|
+
}
|
|
3515
3559
|
};
|
|
3516
3560
|
return FormCheckboxComponent;
|
|
3517
3561
|
}());
|
|
3518
3562
|
FormCheckboxComponent.decorators = [
|
|
3519
3563
|
{ type: core.Component, args: [{
|
|
3520
3564
|
selector: 'lib-form-checkbox',
|
|
3521
|
-
template: "<div #inputDiv [id]=\"inp.name + 'Input'\" [style]=\"inp.style\" [className]=\"'form-input-con checkbox w-100' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '') + (inp.icon == null ? ' without-icon' : '') + (!inp.displayLabel ? ' without-label' : '') + ' ' + inp.class\">\r\n
|
|
3565
|
+
template: "<div #inputDiv [id]=\"inp.name + 'Input'\" [style]=\"inp.style\" [className]=\"'form-input-con checkbox w-100' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '') + (inp.icon == null ? ' without-icon' : '') + (!inp.displayLabel ? ' without-label' : '') + ' ' + inp.class\">\r\n</div>\r\n",
|
|
3522
3566
|
styles: [".form-input-con.checkbox{padding:0 15px;position:relative}.form-input-con.checkbox .form-input{float:right;position:relative;width:100%}.form-input-con.checkbox .form-input .label{cursor:default;direction:rtl;font-size:12px;height:20px;margin-bottom:3px;padding:0 10px;text-align:right}.form-input-con.checkbox .form-input .control,.form-input-con.checkbox .form-input .label{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;float:right;line-height:20px;width:100%}.form-input-con.checkbox .form-input .control{align-items:center;background-color:#fff;border:var(--border-input);border-radius:var(--border-radius-base);cursor:pointer;display:flex;font-size:11px;justify-content:center;min-height:35px;padding:5px 45px;position:relative;text-align:center;z-index:2}.form-input-con.checkbox.without-border .form-input .control{border:unset}.form-input-con.checkbox .form-input .control:after{content:\"\\f0c8\";font-family:Font Awesome\\ 5 Pro;font-size:17px;font-weight:400;height:35px;line-height:32px;position:absolute;right:0;top:0;width:35px}.form-input-con.checkbox:not(.without-border) .form-input .check:focus+.control,.form-input-con.checkbox:not(.without-border) .form-input .control:hover{border:var(--border-input-dark);outline:none}.form-input-con.checkbox.error .form-input .control{border:var(--border-input-red)}.form-input-con.checkbox.error .form-input .control,.form-input-con.checkbox.error .form-input span.icon{color:var(--red)}.form-input-con.checkbox .form-input .check{cursor:pointer;height:0;opacity:0;position:absolute;right:50%;top:50%;width:0;z-index:1}.form-input-con.checkbox .form-input .check:checked+.control:after{animation:pop .18s ease-in;color:var(--green);content:\"\\f14a\";font-weight:900}.form-input-con.checkbox .form-input i.icon{color:var(--primary);cursor:pointer;font-size:13px;height:35px;left:0;line-height:35px;position:absolute;text-align:center;top:24px;transition:all .35s ease-in-out;width:35px;z-index:2}.form-input-con.checkbox.without-label .form-input i.icon{top:0}.form-input-con.checkbox.without-icon .form-input .control{padding:0 35px 0 0}.form-input-con.checkbox.h-30 .form-input .control{font-size:10px;line-height:28px;min-height:30px;padding:0 40px}.form-input-con.checkbox.h-30 .form-input .control:after{font-size:14px;height:30px;line-height:28px;width:30px}.form-input-con.checkbox.h-30 .form-input i.icon{font-size:11px;height:30px;line-height:30px;width:30px}.form-input-con.checkbox.h-30.without-icon .form-input .control{padding:0 0 0 40px}"]
|
|
3523
3567
|
},] }
|
|
3524
3568
|
];
|