ps-toolkit-ui 0.2.87 → 0.2.90
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 +46 -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/esm2015/lib/components/table/row/table.row.component.js +2 -1
- package/fesm2015/ps-toolkit-ui.js +44 -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
|
@@ -2643,6 +2643,7 @@
|
|
|
2643
2643
|
new RequestClass(_this.table.l).send(p.getUrl(), exports.Method.Post, null, null, function () {
|
|
2644
2644
|
});
|
|
2645
2645
|
};
|
|
2646
|
+
inp.displayLabel = false;
|
|
2646
2647
|
opts.push(inp);
|
|
2647
2648
|
};
|
|
2648
2649
|
var this_1 = this;
|
|
@@ -3512,13 +3513,57 @@
|
|
|
3512
3513
|
this.changeIndex = new core.EventEmitter();
|
|
3513
3514
|
}
|
|
3514
3515
|
FormCheckboxComponent.prototype.ngOnInit = function () {
|
|
3516
|
+
var _this = this;
|
|
3517
|
+
this.inp.clear = function () {
|
|
3518
|
+
_this.inp.error = null;
|
|
3519
|
+
_this.inp.value = _this.inp.default;
|
|
3520
|
+
};
|
|
3521
|
+
this.inp.isValid = function () {
|
|
3522
|
+
_this.inp.error = null;
|
|
3523
|
+
if (_this.inp.required && !_this.inp.value) {
|
|
3524
|
+
_this.inp.error = exports.InputError.Required;
|
|
3525
|
+
return false;
|
|
3526
|
+
}
|
|
3527
|
+
return true;
|
|
3528
|
+
};
|
|
3529
|
+
this.inp.data = function () {
|
|
3530
|
+
return _this.inp.value;
|
|
3531
|
+
};
|
|
3532
|
+
this.inp.setValue = function (v) {
|
|
3533
|
+
_this.inp.value = v;
|
|
3534
|
+
};
|
|
3535
|
+
this.inp.focus = function () {
|
|
3536
|
+
_this.onFocusIn();
|
|
3537
|
+
};
|
|
3538
|
+
};
|
|
3539
|
+
FormCheckboxComponent.prototype.onFocusIn = function () {
|
|
3540
|
+
this.inp.error = null;
|
|
3541
|
+
this.inputBase.nativeElement.focus();
|
|
3542
|
+
};
|
|
3543
|
+
FormCheckboxComponent.prototype.onClick = function () {
|
|
3544
|
+
this.inputBase.nativeElement.click();
|
|
3545
|
+
};
|
|
3546
|
+
FormCheckboxComponent.prototype.onChange = function () {
|
|
3547
|
+
var _this = this;
|
|
3548
|
+
if (this.inp.onChange) {
|
|
3549
|
+
setTimeout(function () {
|
|
3550
|
+
_this.inp.onChange(_this.inp);
|
|
3551
|
+
}, 1);
|
|
3552
|
+
}
|
|
3553
|
+
};
|
|
3554
|
+
FormCheckboxComponent.prototype.onKeyDown = function (e) {
|
|
3555
|
+
var code = e.keyCode || e.which;
|
|
3556
|
+
if (code === 9 || code === 13) {
|
|
3557
|
+
e.preventDefault();
|
|
3558
|
+
this.changeIndex.emit(code === 9 ? e.shiftKey ? 'ShiftTab' : 'Tab' : e.shiftKey ? 'ShiftEnter' : 'Enter');
|
|
3559
|
+
}
|
|
3515
3560
|
};
|
|
3516
3561
|
return FormCheckboxComponent;
|
|
3517
3562
|
}());
|
|
3518
3563
|
FormCheckboxComponent.decorators = [
|
|
3519
3564
|
{ type: core.Component, args: [{
|
|
3520
3565
|
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 <div class=\"form-input\" (click)=\"onFocusIn()\">\r\n <div *ngIf=\"inp.displayLabel\" class=\"label\"></div>\r\n <
|
|
3566
|
+
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 class=\"form-input\" (click)=\"onFocusIn()\">\r\n <div *ngIf=\"inp.displayLabel\" class=\"label\"></div>\r\n <div (click)=\"onClick()\" class=\"control\">{{inp.l(inp.name)}}</div>\r\n <i *ngIf=\"inp.icon != null || inp.loading\" #inputIcon [className]=\"(inp.loading ? 'fa-duotone fa-spin fa-spinner' : inp.icon) + ' icon'\"></i>\r\n </div>\r\n</div>\r\n",
|
|
3522
3567
|
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
3568
|
},] }
|
|
3524
3569
|
];
|