ps-toolkit-ui 1.9.7 → 1.9.12
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 +75 -7
- 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/classes/enum.class.js +4 -3
- package/esm2015/lib/components/form/file/form.file.component.js +5 -3
- package/esm2015/lib/components/form/index/form.component.js +2 -2
- package/esm2015/lib/components/form/toggle/form.toggle.component.js +66 -0
- package/esm2015/lib/ps-toolkit-ui.module.js +4 -3
- package/esm2015/public-api.js +2 -1
- package/fesm2015/ps-toolkit-ui.js +73 -8
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/classes/enum.class.d.ts +3 -2
- package/lib/components/form/file/form.file.component.d.ts +1 -0
- package/lib/components/form/toggle/form.toggle.component.d.ts +13 -0
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -441,8 +441,9 @@ var InputType;
|
|
|
441
441
|
InputType[InputType["Finger"] = 42] = "Finger";
|
|
442
442
|
InputType[InputType["Color"] = 43] = "Color";
|
|
443
443
|
InputType[InputType["Star"] = 44] = "Star";
|
|
444
|
-
InputType[InputType["
|
|
445
|
-
InputType[InputType["
|
|
444
|
+
InputType[InputType["Toggle"] = 45] = "Toggle";
|
|
445
|
+
InputType[InputType["BillNumber"] = 46] = "BillNumber";
|
|
446
|
+
InputType[InputType["Ckeditor"] = 47] = "Ckeditor";
|
|
446
447
|
})(InputType || (InputType = {}));
|
|
447
448
|
var OperationEnum;
|
|
448
449
|
(function (OperationEnum) {
|
|
@@ -3427,6 +3428,7 @@ FormDatetimeComponent.propDecorators = {
|
|
|
3427
3428
|
class FormFileComponent {
|
|
3428
3429
|
constructor() {
|
|
3429
3430
|
this.changeIndex = new EventEmitter();
|
|
3431
|
+
this.id = HelperClass.random(10);
|
|
3430
3432
|
}
|
|
3431
3433
|
ngOnInit() {
|
|
3432
3434
|
this.inp.setValue = (v) => {
|
|
@@ -3520,6 +3522,7 @@ class FormFileComponent {
|
|
|
3520
3522
|
v.push(f);
|
|
3521
3523
|
}
|
|
3522
3524
|
this.inp.value = v;
|
|
3525
|
+
console.log(this.inp, this.inp.value);
|
|
3523
3526
|
this.changeIndex.emit('Tab');
|
|
3524
3527
|
}
|
|
3525
3528
|
onKeyDown(e) {
|
|
@@ -3533,7 +3536,6 @@ class FormFileComponent {
|
|
|
3533
3536
|
$$1(this.inputBase.nativeElement).focus();
|
|
3534
3537
|
}
|
|
3535
3538
|
title() {
|
|
3536
|
-
console.log(this.inp, this.inp.value);
|
|
3537
3539
|
if (this.inp.value == null || (this.inp.value instanceof Array && this.inp.value.length === 0)) {
|
|
3538
3540
|
return this.inp.l('FileNotSelected');
|
|
3539
3541
|
}
|
|
@@ -3545,7 +3547,7 @@ class FormFileComponent {
|
|
|
3545
3547
|
FormFileComponent.decorators = [
|
|
3546
3548
|
{ type: Component, args: [{
|
|
3547
3549
|
selector: 'lib-form-file',
|
|
3548
|
-
template: "<label #inputDiv [id]=\"
|
|
3550
|
+
template: "<label #inputDiv [id]=\"id + 'FileInput'\" [for]=\"id + 'FileInputBase'\" [className]=\"'form-input-con file w-100' + (inp.error == null ? '' : ' error') + (inp.value != null && inp.value != '' ? ' has-value' : '') + ' ' + inp.class\">\r\n <div class=\"form-input\" (click)=\"onClick()\">\r\n <div *ngIf=\"inp.displayLabel\" class=\"label\"><i *ngIf=\"inp.required\" class=\"fas fa-star-of-life required-icon\"></i>{{inp.getLabel()}}</div>\r\n <input #inputBaseFile class=\"input-base-file\" type=\"file\" [id]=\"id + 'FileInputBase'\" [multiple]=\"inp.multiple\" (change)=\"onChange($event)\">\r\n <input #inputBase type=\"text\" class=\"input-base\" (keydown)=\"onKeyDown($event)\" (focusin)=\"onFocusIn()\">\r\n <div class=\"control\">\r\n <div class=\"title\">{{title()}}</div>\r\n <div class=\"button\">{{inp.multiple ? inp.l(\"ChooseFiles\") : inp.l(\"ChooseFile\")}}</div>\r\n </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</label>\r\n",
|
|
3549
3551
|
styles: [".form-input-con.file{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;cursor:pointer;padding:0 15px;position:relative}.form-input-con.file .form-input{float:right;position:relative;width:100%}.form-input-con.file .form-input .input-base,.form-input-con.file .form-input .input-base-file{cursor:pointer;height:0;opacity:0;position:absolute;right:50%;top:50%;width:0;z-index:1}.form-input-con.file .form-input .control{background-color:#fff;border:var(--border-input);border-radius:var(--border-radius-base);float:left;font-size:11px;height:35px;line-height:35px;overflow:hidden;padding:0 135px 0 35px;position:relative;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:100%;z-index:2}.form-input-con.file .form-input .control .title{float:right;width:100%}.form-input-con.file .form-input .control:hover,.form-input-con.file .form-input .input-base:focus+.control{border:var(--border-input-dark);outline:none}.form-input-con.file .form-input .button:hover,.form-input-con.file .form-input .control:hover .button,.form-input-con.file .form-input .input-base:focus+.control .button{background-color:var(--green-dark)}.form-input-con.file .form-input i.icon{bottom:0;color:var(--primary);font-size:13px;height:35px;left:0;line-height:35px;position:absolute;text-align:center;width:35px;z-index:2}.form-input-con.file .form-input .label{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;cursor:default;direction:rtl;float:right;font-size:12px;height:20px;line-height:20px;margin-bottom:3px;padding:0 10px;text-align:right;width:100%}.form-input-con.file .form-input .label .required-icon{color:var(--red);font-size:9px;height:20px;line-height:20px;text-align:center;width:20px}.form-input-con.file .form-input .button{background-color:var(--green);border-radius:0 var(--border-radius-base) var(--border-radius-base) 0;bottom:0;color:#fff;font-size:10px;height:35px;line-height:35px;position:absolute;right:0;text-align:center;width:100px;z-index:2}.form-input-con.file.error .form-input .control{border:var(--border-input-red)}.form-input-con.file.error .form-input .label{color:var(--red);font-size:10px}.form-input-con.file.error .form-input .control,.form-input-con.file.error .form-input .icon{color:var(--red)}.form-input-con.file.h-35{height:35px}.form-input-con.file.has-value.h-35 .form-input .control{direction:ltr;font-size:9px;height:35px}.form-input-con.file.h-35 .form-input .button,.form-input-con.file.h-35 .form-input i.icon{height:35px;line-height:35px}.form-input-con.file.h-30{height:30px}.form-input-con.file.h-30 .form-input .control{direction:ltr;font-size:9px;height:30px;line-height:30px}.form-input-con.file.h-30 .form-input .button,.form-input-con.file.h-30 .form-input i.icon{height:30px;line-height:30px}"]
|
|
3550
3552
|
},] }
|
|
3551
3553
|
];
|
|
@@ -3672,7 +3674,7 @@ class FormComponent {
|
|
|
3672
3674
|
FormComponent.decorators = [
|
|
3673
3675
|
{ type: Component, args: [{
|
|
3674
3676
|
selector: 'lib-form',
|
|
3675
|
-
template: "<form [style]=\"form.style\" *ngIf=\"form\" [id]=\"form.id + 'Form'\" [className]=\"'form w-100 m-0' + (form.class ? ' ' + form.class : '')\">\r\n <div *ngIf=\"form.displayLabel\" [className]=\"(form.subName ? '' : 'underline ') + 'title'\">{{this.form.l(this.form.name)}}</div>\r\n <div *ngIf=\"form.displayLabel && form.subName\" class=\"sub-title underline\">{{this.form.l(this.form.subName)}}</div>\r\n <div *ngIf=\"form.loading\" class=\"loading\">\r\n <div class=\"text\" [innerHTML]=\"form.l('LoadingTable', 'Processing')\"></div>\r\n </div>\r\n <div *ngIf=\"!form.permission\" class=\"loading\">\r\n <div class=\"text\"><i class=\"fas fa-shield-alt icon\"></i>{{ form.l(\"PermissionDenied\") }}</div>\r\n </div>\r\n <div class=\"inputs\">\r\n <span *ngFor=\"let inp of form.inputs; let i = index\">\r\n <lib-form-textbox (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Text || inp.type == type.Password || inp.type == type.Mobile || inp.type == type.Phone || inp.type == type.Email || inp.type == type.NationalCode || inp.type == type.Number || inp.type == type.Url || inp.type == type.PostalCode || inp.type == type.Price || inp.type == type.Sheba || inp.type == type.Color || inp.type == type.BillNumber)\" [inp]=\"inp\"></lib-form-textbox>\r\n <lib-form-textarea (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.TextArea\" [inp]=\"inp\"></lib-form-textarea>\r\n <lib-form-checkbox (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Check\" [inp]=\"inp\"></lib-form-checkbox>\r\n <lib-form-select [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Select || inp.type == type.SelectSearch || inp.type == type.SelectAutoComplete)\" [inp]=\"inp\"></lib-form-select>\r\n <lib-form-date [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Date\" [inp]=\"inp\"></lib-form-date>\r\n <lib-form-time [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Time\" [inp]=\"inp\"></lib-form-time>\r\n <lib-form-datetime [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.DateTime\" [inp]=\"inp\"></lib-form-datetime>\r\n <lib-form-label *ngIf=\"inp.visible && inp.type == type.Label\" [inp]=\"inp\"></lib-form-label>\r\n <lib-form-file (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.File\" [inp]=\"inp\"></lib-form-file>\r\n <lib-form-button (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Button || inp.type == type.Submit)\" [inp]=\"inp\"></lib-form-button>\r\n <lib-form-icon (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Icon\" [inp]=\"inp\"></lib-form-icon>\r\n <lib-form-radio (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Radio\" [inp]=\"inp\"></lib-form-radio>\r\n <lib-form-tree (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Tree || inp.type == type.TreeRadio)\" [inp]=\"inp\"></lib-form-tree>\r\n <lib-form-plaque (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Plaque || inp.type == type.PlaqueM || inp.type == type.PlaqueF || inp.type == type.PlaqueG)\" [inp]=\"inp\"></lib-form-plaque>\r\n <lib-form-plaque-select (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.SelectAutoCompletePlaque || inp.type == type.SelectAutoCompletePlaqueM || inp.type == type.SelectAutoCompletePlaqueF || inp.type == type.SelectAutoCompletePlaqueG)\" [inp]=\"inp\"></lib-form-plaque-select>\r\n <lib-form-bank-card (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.BankCard\" [inp]=\"inp\"></lib-form-bank-card>\r\n <lib-form-vehicle-search (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.VehicleSearch\" [inp]=\"inp\"></lib-form-vehicle-search>\r\n <lib-form-vehicle (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Vehicle\" [inp]=\"inp\"></lib-form-vehicle>\r\n <lib-form-finger (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Finger\" [inp]=\"inp\"></lib-form-finger>\r\n <lib-form-star (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Star\" [inp]=\"inp\"></lib-form-star>\r\n <lib-form-table *ngIf=\"inp.visible && inp.type == type.Table\" [inp]=\"inp\"></lib-form-table>\r\n <lib-form-tag (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Tag\" [inp]=\"inp\"></lib-form-tag>\r\n <lib-form-ckeditor (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Ckeditor\" [inp]=\"inp\"></lib-form-ckeditor>\r\n <lib-form-hidden *ngIf=\"inp.type == type.Hidden\" [inp]=\"inp\"></lib-form-hidden>\r\n </span>\r\n </div>\r\n</form>\r\n",
|
|
3677
|
+
template: "<form [style]=\"form.style\" *ngIf=\"form\" [id]=\"form.id + 'Form'\" [className]=\"'form w-100 m-0' + (form.class ? ' ' + form.class : '')\">\r\n <div *ngIf=\"form.displayLabel\" [className]=\"(form.subName ? '' : 'underline ') + 'title'\">{{this.form.l(this.form.name)}}</div>\r\n <div *ngIf=\"form.displayLabel && form.subName\" class=\"sub-title underline\">{{this.form.l(this.form.subName)}}</div>\r\n <div *ngIf=\"form.loading\" class=\"loading\">\r\n <div class=\"text\" [innerHTML]=\"form.l('LoadingTable', 'Processing')\"></div>\r\n </div>\r\n <div *ngIf=\"!form.permission\" class=\"loading\">\r\n <div class=\"text\"><i class=\"fas fa-shield-alt icon\"></i>{{ form.l(\"PermissionDenied\") }}</div>\r\n </div>\r\n <div class=\"inputs\">\r\n <span *ngFor=\"let inp of form.inputs; let i = index\">\r\n <lib-form-textbox (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Text || inp.type == type.Password || inp.type == type.Mobile || inp.type == type.Phone || inp.type == type.Email || inp.type == type.NationalCode || inp.type == type.Number || inp.type == type.Url || inp.type == type.PostalCode || inp.type == type.Price || inp.type == type.Sheba || inp.type == type.Color || inp.type == type.BillNumber)\" [inp]=\"inp\"></lib-form-textbox>\r\n <lib-form-textarea (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.TextArea\" [inp]=\"inp\"></lib-form-textarea>\r\n <lib-form-checkbox (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Check\" [inp]=\"inp\"></lib-form-checkbox>\r\n <lib-form-select [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Select || inp.type == type.SelectSearch || inp.type == type.SelectAutoComplete)\" [inp]=\"inp\"></lib-form-select>\r\n <lib-form-date [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Date\" [inp]=\"inp\"></lib-form-date>\r\n <lib-form-time [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Time\" [inp]=\"inp\"></lib-form-time>\r\n <lib-form-datetime [inForm]=\"true\" (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.DateTime\" [inp]=\"inp\"></lib-form-datetime>\r\n <lib-form-label *ngIf=\"inp.visible && inp.type == type.Label\" [inp]=\"inp\"></lib-form-label>\r\n <lib-form-file (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.File\" [inp]=\"inp\"></lib-form-file>\r\n <lib-form-button (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Button || inp.type == type.Submit)\" [inp]=\"inp\"></lib-form-button>\r\n <lib-form-icon (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Icon\" [inp]=\"inp\"></lib-form-icon>\r\n <lib-form-radio (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Radio\" [inp]=\"inp\"></lib-form-radio>\r\n <lib-form-tree (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Tree || inp.type == type.TreeRadio)\" [inp]=\"inp\"></lib-form-tree>\r\n <lib-form-plaque (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.Plaque || inp.type == type.PlaqueM || inp.type == type.PlaqueF || inp.type == type.PlaqueG)\" [inp]=\"inp\"></lib-form-plaque>\r\n <lib-form-plaque-select (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && (inp.type == type.SelectAutoCompletePlaque || inp.type == type.SelectAutoCompletePlaqueM || inp.type == type.SelectAutoCompletePlaqueF || inp.type == type.SelectAutoCompletePlaqueG)\" [inp]=\"inp\"></lib-form-plaque-select>\r\n <lib-form-bank-card (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.BankCard\" [inp]=\"inp\"></lib-form-bank-card>\r\n <lib-form-vehicle-search (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.VehicleSearch\" [inp]=\"inp\"></lib-form-vehicle-search>\r\n <lib-form-vehicle (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Vehicle\" [inp]=\"inp\"></lib-form-vehicle>\r\n <lib-form-finger (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Finger\" [inp]=\"inp\"></lib-form-finger>\r\n <lib-form-star (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Star\" [inp]=\"inp\"></lib-form-star>\r\n <lib-form-toggle (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Toggle\" [inp]=\"inp\"></lib-form-toggle>\r\n <lib-form-table *ngIf=\"inp.visible && inp.type == type.Table\" [inp]=\"inp\"></lib-form-table>\r\n <lib-form-tag (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Tag\" [inp]=\"inp\"></lib-form-tag>\r\n <lib-form-ckeditor (changeIndex)=\"changeIndex(i, $event)\" *ngIf=\"inp.visible && inp.type == type.Ckeditor\" [inp]=\"inp\"></lib-form-ckeditor>\r\n <lib-form-hidden *ngIf=\"inp.type == type.Hidden\" [inp]=\"inp\"></lib-form-hidden>\r\n </span>\r\n </div>\r\n</form>\r\n",
|
|
3676
3678
|
styles: [".form{border-radius:var(--border-radius-base);padding:20px;position:relative}.form>.title{font-size:16px;font-weight:700;height:40px}.form>.sub-title,.form>.title{float:right;line-height:30px;margin-bottom:10px;position:relative;text-align:right;width:100%}.form>.sub-title{color:var(--black-light);font-size:12px;font-weight:200;height:30px}.form .loading{background-color:#fff;border-radius:var(--border-radius-base);height:100%;right:0;top:0;z-index:104}.form .loading,.form .loading .text{position:absolute;text-align:center;width:100%}.form .loading .text{font-weight:700;height:35px;line-height:35px;top:calc(50% - 20px)}::ng-deep .form .loading .icon{font-size:20px!important;line-height:30px;margin-left:5px;position:relative;top:5px}.form-buttons,.form-error{float:right;width:100%}.form-error{color:var(--red-light);font-size:11px;height:15px;line-height:8px;margin-top:10px;padding:0 10px;position:relative;text-align:center}.form-error .message{float:left;width:calc(100% - 40px)}.form-error .icon{float:right;height:20px;line-height:6px;right:0;top:0;width:40px}.form .inputs{margin:0 -15px}"]
|
|
3677
3679
|
},] }
|
|
3678
3680
|
];
|
|
@@ -6885,6 +6887,69 @@ FormCkeditorComponent.propDecorators = {
|
|
|
6885
6887
|
inputBase: [{ type: ViewChild, args: ['inputBase',] }]
|
|
6886
6888
|
};
|
|
6887
6889
|
|
|
6890
|
+
class FormToggleComponent {
|
|
6891
|
+
constructor() {
|
|
6892
|
+
this.changeIndex = new EventEmitter();
|
|
6893
|
+
}
|
|
6894
|
+
ngOnInit() {
|
|
6895
|
+
this.inp.setValue = (v) => {
|
|
6896
|
+
this.inp.value = v === true;
|
|
6897
|
+
};
|
|
6898
|
+
this.inp.isValid = () => {
|
|
6899
|
+
this.inp.error = null;
|
|
6900
|
+
if (this.inp.required && this.inp.value == null) {
|
|
6901
|
+
this.inp.error = InputError.Required;
|
|
6902
|
+
return false;
|
|
6903
|
+
}
|
|
6904
|
+
return true;
|
|
6905
|
+
};
|
|
6906
|
+
this.inp.clear = () => {
|
|
6907
|
+
this.inp.value = false;
|
|
6908
|
+
};
|
|
6909
|
+
this.inp.data = () => {
|
|
6910
|
+
return this.inp.value;
|
|
6911
|
+
};
|
|
6912
|
+
}
|
|
6913
|
+
onChange(s) {
|
|
6914
|
+
this.inp.value = s;
|
|
6915
|
+
if (this.inp.onChange) {
|
|
6916
|
+
this.inp.onChange(this.inp);
|
|
6917
|
+
}
|
|
6918
|
+
}
|
|
6919
|
+
onClick() {
|
|
6920
|
+
this.onFocusIn();
|
|
6921
|
+
}
|
|
6922
|
+
onFocusIn() {
|
|
6923
|
+
$$1(this.inputBase.nativeElement).focus();
|
|
6924
|
+
}
|
|
6925
|
+
onKeyDown(e) {
|
|
6926
|
+
const code = e.keyCode || e.which;
|
|
6927
|
+
if (code === 9 || code === 13) {
|
|
6928
|
+
e.preventDefault();
|
|
6929
|
+
this.changeIndex.emit(e.shiftKey ? 'ShiftTab' : 'Tab');
|
|
6930
|
+
}
|
|
6931
|
+
else if (code === 37) {
|
|
6932
|
+
this.inp.value = true;
|
|
6933
|
+
}
|
|
6934
|
+
else if (code === 39) {
|
|
6935
|
+
this.inp.value = false;
|
|
6936
|
+
}
|
|
6937
|
+
}
|
|
6938
|
+
}
|
|
6939
|
+
FormToggleComponent.decorators = [
|
|
6940
|
+
{ type: Component, args: [{
|
|
6941
|
+
selector: 'lib-form-toggle',
|
|
6942
|
+
template: "<div #inputDiv [id]=\"inp.id + 'StarInput'\" [style]=\"inp.style\" [className]=\"'form-input-con toggle w-100' + (inp.error == null ? '' : ' error') + (inp.disabled || inp.loading ? ' disabled' : '') + ' ' + inp.class\">\r\n <div class=\"form-input\" (click)=\"onClick()\">\r\n <div *ngIf=\"inp.displayLabel\" class=\"label\"><i *ngIf=\"inp.required\" class=\"fas fa-star-of-life required-icon\"></i>{{inp.getLabel()}}</div>\r\n <input #inputBase type=\"checkbox\" class=\"input-base\" (keydown)=\"onKeyDown($event)\" (focusin)=\"onFocusIn()\">\r\n <div class=\"control\">\r\n <span [className]=\"inp.icon ? inp.icon : ''\"></span>\r\n </div>\r\n </div>\r\n</div>\r\n",
|
|
6943
|
+
styles: [".form-input-con.toggle{padding:0 15px;position:relative}.form-input-con.toggle .form-input{float:right;position:relative;width:100%}.form-input-con.toggle .form-input .label{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;cursor:default;direction:rtl;float:right;font-size:12px;height:20px;line-height:20px;margin-bottom:3px;padding:0 10px;text-align:right;width:100%}.form-input-con.toggle.error .form-input .label{color:var(--red);font-size:10px}.form-input-con.toggle .form-input .label .required-icon{color:var(--red);font-size:9px;height:20px;line-height:20px;text-align:center;width:20px}.form-input-con.toggle .form-input .control{background:#bbb;border-radius:46px;display:inline-block;height:15px;margin-top:10px;position:relative;transition:.4s;width:45px}.form-input-con.toggle .form-input .control span{background:#fff;border-radius:100%;box-shadow:0 0 5px rgba(0,0,0,.2);color:var(--black);content:\"\";height:25px;left:0;line-height:25px;position:absolute;text-align:center;top:-5px;transition:.4s;width:25px;z-index:2}.form-input-con.toggle .form-input .input-base{cursor:pointer;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:5}.form-input-con.toggle .form-input .input-base:checked+.control{background:var(--primary-light)}.form-input-con.toggle .form-input .input-base:checked+.control span{background:var(--primary-dark);color:var(--white);left:20px}"]
|
|
6944
|
+
},] }
|
|
6945
|
+
];
|
|
6946
|
+
FormToggleComponent.ctorParameters = () => [];
|
|
6947
|
+
FormToggleComponent.propDecorators = {
|
|
6948
|
+
inp: [{ type: Input }],
|
|
6949
|
+
changeIndex: [{ type: Output }],
|
|
6950
|
+
inputBase: [{ type: ViewChild, args: ['inputBase',] }]
|
|
6951
|
+
};
|
|
6952
|
+
|
|
6888
6953
|
class PsToolkitUiModule {
|
|
6889
6954
|
static forRoot(config) {
|
|
6890
6955
|
return {
|
|
@@ -6905,7 +6970,7 @@ PsToolkitUiModule.decorators = [
|
|
|
6905
6970
|
TooltipComponent, ConfirmComponent, TableComponent, ModalComponent, FormComponent, TableRowComponent, FormTreeComponent, AlertComponent,
|
|
6906
6971
|
FormTimeComponent, NotfoundComponent, FormFingerComponent, FormVehicleSearchComponent, FormVehicleComponent, FormStarComponent,
|
|
6907
6972
|
SafeStylePipe, LoginComponent, LoadingComponent, NotificationComponent, LayoutComponent, FormHiddenComponent, CalendarComponent,
|
|
6908
|
-
ClockComponent, ChartComponent, SafeHtmlPipe, FormTagComponent, ErrorComponent, FormCkeditorComponent
|
|
6973
|
+
ClockComponent, ChartComponent, SafeHtmlPipe, FormTagComponent, ErrorComponent, FormCkeditorComponent, FormToggleComponent
|
|
6909
6974
|
],
|
|
6910
6975
|
imports: [
|
|
6911
6976
|
CommonModule,
|
|
@@ -6922,7 +6987,7 @@ PsToolkitUiModule.decorators = [
|
|
|
6922
6987
|
TooltipComponent, ConfirmComponent, TableComponent, ModalComponent, FormComponent, TableRowComponent, FormTreeComponent, AlertComponent,
|
|
6923
6988
|
FormTimeComponent, NotfoundComponent, FormFingerComponent, FormVehicleSearchComponent, FormVehicleComponent, FormStarComponent,
|
|
6924
6989
|
LoginComponent, LoadingComponent, NotificationComponent, LayoutComponent, FormHiddenComponent, CalendarComponent,
|
|
6925
|
-
ClockComponent, ChartComponent, FormTagComponent, ErrorComponent, FormCkeditorComponent
|
|
6990
|
+
ClockComponent, ChartComponent, FormTagComponent, ErrorComponent, FormCkeditorComponent, FormToggleComponent
|
|
6926
6991
|
]
|
|
6927
6992
|
},] }
|
|
6928
6993
|
];
|
|
@@ -7397,5 +7462,5 @@ class CurrentDataClass {
|
|
|
7397
7462
|
* Generated bundle index. Do not edit.
|
|
7398
7463
|
*/
|
|
7399
7464
|
|
|
7400
|
-
export { AccordionClass, AccordionComponent, AccordionRowClass, AlertComponent, BaseComponent, ChartClass, ConfirmComponent, CurrentDataClass, DayClass, EnumUtils, ErrorComponent, FooterComponent, FormBankCardComponent, FormButtonComponent, FormCheckboxComponent, FormCkeditorComponent, FormClass, FormComponent, FormDateComponent, FormDatetimeComponent, FormFileComponent, FormFingerComponent, FormIconComponent, FormLabelComponent, FormPlaqueComponent, FormPlaqueSelectComponent, FormRadioComponent, FormSelectComponent, FormStarComponent, FormTableComponent, FormTextareaComponent, FormTextboxComponent, FormTimeComponent, FormTreeComponent, FormVehicleComponent, FormVehicleSearchComponent, HeaderComponent, HelperClass, InputClass, InputError, InputType, LangClass, LayoutComponent, LoadingComponent, LoginClass, LoginStepClass, Method, ModalClass, ModalComponent, NotfoundComponent, OperationEnum, OptionClass, PaymentStatusEnum, PermissionAccessTypeEnum, PermissionClass, PermissionInputActionEnum, PermissionInputTypeEnum, PermissionTypeEnum, Progress, PsToolkitUiModule, RequestClass, ResultStatusEnum, SidebarClass, SidebarComponent, StatusEnum, StepsClass, StepsComponent, StepsItemClass, SubHeaderComponent, TableClass, TableCollClass, TableCollType, TableComponent, TableOptionType, TableRowClass, TooltipComponent, TreeRowClass, UserType, VehicleType, FormSelectItemComponent as ɵa, TablePaginationComponent as ɵb, SidebarItemComponent as ɵc, PsToolkitUiConfigService as ɵd, TableLoadingComponent as ɵe, FormTreeItemComponent as ɵf, TableRowComponent as ɵg, SafeStylePipe as ɵh, LoginComponent as ɵi, NotificationComponent as ɵj, FormHiddenComponent as ɵk, CalendarComponent as ɵl, ClockComponent as ɵm, ChartComponent as ɵn, SafeHtmlPipe as ɵo, FormTagComponent as ɵp };
|
|
7465
|
+
export { AccordionClass, AccordionComponent, AccordionRowClass, AlertComponent, BaseComponent, ChartClass, ConfirmComponent, CurrentDataClass, DayClass, EnumUtils, ErrorComponent, FooterComponent, FormBankCardComponent, FormButtonComponent, FormCheckboxComponent, FormCkeditorComponent, FormClass, FormComponent, FormDateComponent, FormDatetimeComponent, FormFileComponent, FormFingerComponent, FormIconComponent, FormLabelComponent, FormPlaqueComponent, FormPlaqueSelectComponent, FormRadioComponent, FormSelectComponent, FormStarComponent, FormTableComponent, FormTextareaComponent, FormTextboxComponent, FormTimeComponent, FormToggleComponent, FormTreeComponent, FormVehicleComponent, FormVehicleSearchComponent, HeaderComponent, HelperClass, InputClass, InputError, InputType, LangClass, LayoutComponent, LoadingComponent, LoginClass, LoginStepClass, Method, ModalClass, ModalComponent, NotfoundComponent, OperationEnum, OptionClass, PaymentStatusEnum, PermissionAccessTypeEnum, PermissionClass, PermissionInputActionEnum, PermissionInputTypeEnum, PermissionTypeEnum, Progress, PsToolkitUiModule, RequestClass, ResultStatusEnum, SidebarClass, SidebarComponent, StatusEnum, StepsClass, StepsComponent, StepsItemClass, SubHeaderComponent, TableClass, TableCollClass, TableCollType, TableComponent, TableOptionType, TableRowClass, TooltipComponent, TreeRowClass, UserType, VehicleType, FormSelectItemComponent as ɵa, TablePaginationComponent as ɵb, SidebarItemComponent as ɵc, PsToolkitUiConfigService as ɵd, TableLoadingComponent as ɵe, FormTreeItemComponent as ɵf, TableRowComponent as ɵg, SafeStylePipe as ɵh, LoginComponent as ɵi, NotificationComponent as ɵj, FormHiddenComponent as ɵk, CalendarComponent as ɵl, ClockComponent as ɵm, ChartComponent as ɵn, SafeHtmlPipe as ɵo, FormTagComponent as ɵp };
|
|
7401
7466
|
//# sourceMappingURL=ps-toolkit-ui.js.map
|