@dev-tcloud/tcloud-ui 0.1.19 → 0.1.20
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/esm2020/lib/_directives/el-copy/el-copy.directive.mjs +21 -3
- package/esm2020/lib/_modules/tcloud-ui-input-password/tcloud-ui-input-password.component.mjs +13 -4
- package/esm2020/lib/_pipes/bytes.mjs +10 -2
- package/fesm2015/dev-tcloud-tcloud-ui.mjs +42 -6
- package/fesm2015/dev-tcloud-tcloud-ui.mjs.map +1 -1
- package/fesm2020/dev-tcloud-tcloud-ui.mjs +41 -6
- package/fesm2020/dev-tcloud-tcloud-ui.mjs.map +1 -1
- package/lib/_modules/tcloud-ui-input-password/tcloud-ui-input-password.component.d.ts +4 -1
- package/lib/_pipes/bytes.d.ts +1 -1
- package/package.json +1 -1
- package/scss/components/custom/el-copy.scss +12 -0
|
@@ -2112,7 +2112,15 @@ class BytesPipe {
|
|
|
2112
2112
|
const c = 0 > b ? 0 : b, d = Math.floor(Math.log(a) / Math.log(1024));
|
|
2113
2113
|
return parseFloat((a / Math.pow(1024, d)).toFixed(c)) + ' ' + ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"][d];
|
|
2114
2114
|
}
|
|
2115
|
-
transform(value) {
|
|
2115
|
+
transform(value, typeValue) {
|
|
2116
|
+
if (typeValue !== undefined && typeValue !== null && typeValue !== '') {
|
|
2117
|
+
if ((typeValue).toLowerCase() === 'kb') {
|
|
2118
|
+
value = value * 1024;
|
|
2119
|
+
}
|
|
2120
|
+
if ((typeValue).toLowerCase() === 'mb') {
|
|
2121
|
+
value = (value * 1024) * 1024;
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2116
2124
|
const b = +value;
|
|
2117
2125
|
return this.formatBytes(b);
|
|
2118
2126
|
}
|
|
@@ -4547,7 +4555,13 @@ class TCloudUiElCopyDirective {
|
|
|
4547
4555
|
const btn_copy = this.renderer.createElement('i');
|
|
4548
4556
|
var copyText = () => {
|
|
4549
4557
|
const elementWithCopyAttribute = document.querySelector(`[data-el-copy="${id}"]`);
|
|
4550
|
-
|
|
4558
|
+
let copyText = '';
|
|
4559
|
+
if (elementWithCopyAttribute && elementWithCopyAttribute.tagName && (elementWithCopyAttribute.tagName).toUpperCase() === 'INPUT') {
|
|
4560
|
+
copyText = elementWithCopyAttribute?.value;
|
|
4561
|
+
}
|
|
4562
|
+
else {
|
|
4563
|
+
copyText = elementWithCopyAttribute?.textContent;
|
|
4564
|
+
}
|
|
4551
4565
|
navigator.clipboard.writeText(copyText);
|
|
4552
4566
|
this.renderer.removeClass(btn_copy, 'fa-copy');
|
|
4553
4567
|
this.renderer.addClass(btn_copy, 'fa-check');
|
|
@@ -4566,7 +4580,19 @@ class TCloudUiElCopyDirective {
|
|
|
4566
4580
|
this.renderer.setAttribute(btn_copy, 'id', id);
|
|
4567
4581
|
this.renderer.setAttribute(btn_copy, 'title', 'Copy');
|
|
4568
4582
|
this.renderer.listen(btn_copy, 'click', () => { copyText(); });
|
|
4569
|
-
|
|
4583
|
+
if (((this.el.nativeElement).tagName).toUpperCase() === 'INPUT') {
|
|
4584
|
+
let classList = this.el.nativeElement?.classList;
|
|
4585
|
+
if (classList && (classList).length > 0 && ('tc-form-control').indexOf(classList) > -1) {
|
|
4586
|
+
this.renderer.addClass(btn_copy, 'tcloud-ui-el-input-copy-tc-form-control');
|
|
4587
|
+
}
|
|
4588
|
+
else {
|
|
4589
|
+
this.renderer.addClass(btn_copy, 'tcloud-ui-el-input-copy');
|
|
4590
|
+
}
|
|
4591
|
+
this.renderer.appendChild(this.el.nativeElement.parentNode, btn_copy);
|
|
4592
|
+
}
|
|
4593
|
+
else {
|
|
4594
|
+
this.renderer.appendChild(this.el.nativeElement, btn_copy);
|
|
4595
|
+
}
|
|
4570
4596
|
}
|
|
4571
4597
|
generateID(target) {
|
|
4572
4598
|
const ref = (target) ? `-${target}` : '';
|
|
@@ -5123,6 +5149,9 @@ const noop = () => {
|
|
|
5123
5149
|
};
|
|
5124
5150
|
class TCloudUiInputPasswordComponent {
|
|
5125
5151
|
constructor() {
|
|
5152
|
+
this.actionView = true;
|
|
5153
|
+
this.actionCopy = true;
|
|
5154
|
+
this.actionGeneratePassword = true;
|
|
5126
5155
|
this.numberOfCharacter = 14;
|
|
5127
5156
|
this.atLeastOneUppercaseLetter = true;
|
|
5128
5157
|
this.atLeastOneLowercaseLetter = true;
|
|
@@ -5224,11 +5253,17 @@ class TCloudUiInputPasswordComponent {
|
|
|
5224
5253
|
}
|
|
5225
5254
|
}
|
|
5226
5255
|
TCloudUiInputPasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiInputPasswordComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5227
|
-
TCloudUiInputPasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiInputPasswordComponent, selector: "tcloud-ui-input-password", inputs: { numberOfCharacter: "numberOfCharacter", atLeastOneUppercaseLetter: "atLeastOneUppercaseLetter", atLeastOneLowercaseLetter: "atLeastOneLowercaseLetter", atLeastOneSpecialCharacter: "atLeastOneSpecialCharacter", ngModel: "ngModel" }, outputs: { ngModelChange: "ngModelChange" }, providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR], ngImport: i0, template: "<div class=\"tcloud-ui-input-password\">\r\n <table>\r\n <tr>\r\n <!-- input password -->\r\n <td>\r\n <form #_form=\"ngForm\">\r\n <ng-container *ngIf=\"passwordRegex\">\r\n <input class=\"tc-form-control\" *ngIf=\"mode == 'password'\" type=\"password\" name=\"tc_password\" [pattern]=\"passwordRegex\" autoComplete=\"new-password\" [(ngModel)]=\"innerValue\" required>\r\n <input class=\"tc-form-control\" *ngIf=\"mode == 'text'\" type=\"text\" name=\"tc_text\" [pattern]=\"passwordRegex\" [(ngModel)]=\"innerValue\" required>\r\n </ng-container>\r\n </form>\r\n </td>\r\n\r\n <!-- action show hide -->\r\n <td>\r\n <button type=\"button\" (click)=\"toggleMode()\" [title]=\"(mode == 'password') ? 'Visualizar Senha' : 'Esconder Senha'\">\r\n <i *ngIf=\"mode == 'password'\" class=\"far fa-eye-slash\"></i>\r\n <i *ngIf=\"mode == 'text'\" class=\"far fa-eye\"></i> \r\n </button>\r\n </td>\r\n\r\n <!-- action generate pass -->\r\n <td>\r\n <button type=\"button\" [title]=\"'Gerar Senha'\" (click)=\"generatePassword()\">\r\n <i class=\"fa-solid fa-key\"></i>\r\n </button>\r\n </td>\r\n\r\n <!-- action copy pass -->\r\n <td>\r\n <button type=\"button\" [title]=\"'Copiar Senha'\" (click)=\"copyText()\">\r\n <i *ngIf=\"!isCopy\" class=\"fa-regular fa-copy\"></i>\r\n <i *ngIf=\"isCopy\" class=\"fa-solid fa-check\"></i>\r\n </button>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>", styles: [".tcloud-ui-input-password{border:1px solid var(--tc-gray-300);border-radius:3px}.tcloud-ui-input-password table{width:100%}.tcloud-ui-input-password table td:first-child{width:100%!important}.tcloud-ui-input-password table td:first-child input{width:100%;border:none;height:38px;padding-left:8px}.tcloud-ui-input-password table td{width:50px;height:40px;background-color:#fff}.tcloud-ui-input-password table td button{background:transparent;border:none;margin-right:3px;cursor:pointer;color:var(--tc-gray-500)}.tcloud-ui-input-password table td button:hover{color:var(--tc-primary2)}.tcloud-ui-input-password .ng-invalid.ng-touched{border:1px solid var(--red)!important}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
5256
|
+
TCloudUiInputPasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiInputPasswordComponent, selector: "tcloud-ui-input-password", inputs: { actionView: "actionView", actionCopy: "actionCopy", actionGeneratePassword: "actionGeneratePassword", numberOfCharacter: "numberOfCharacter", atLeastOneUppercaseLetter: "atLeastOneUppercaseLetter", atLeastOneLowercaseLetter: "atLeastOneLowercaseLetter", atLeastOneSpecialCharacter: "atLeastOneSpecialCharacter", ngModel: "ngModel" }, outputs: { ngModelChange: "ngModelChange" }, providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR], ngImport: i0, template: "<div class=\"tcloud-ui-input-password\">\r\n <table>\r\n <tr>\r\n <!-- input password -->\r\n <td>\r\n <form #_form=\"ngForm\">\r\n <ng-container *ngIf=\"passwordRegex\">\r\n <input class=\"tc-form-control\" *ngIf=\"mode == 'password'\" type=\"password\" name=\"tc_password\" [pattern]=\"passwordRegex\" autoComplete=\"new-password\" [(ngModel)]=\"innerValue\" required>\r\n <input class=\"tc-form-control\" *ngIf=\"mode == 'text'\" type=\"text\" name=\"tc_text\" [pattern]=\"passwordRegex\" [(ngModel)]=\"innerValue\" required>\r\n </ng-container>\r\n </form>\r\n </td>\r\n\r\n <!-- action show hide -->\r\n <td *ngIf=\"actionView\">\r\n <button type=\"button\" (click)=\"toggleMode()\" [title]=\"(mode == 'password') ? 'Visualizar Senha' : 'Esconder Senha'\">\r\n <i *ngIf=\"mode == 'password'\" class=\"far fa-eye-slash\"></i>\r\n <i *ngIf=\"mode == 'text'\" class=\"far fa-eye\"></i> \r\n </button>\r\n </td>\r\n\r\n <!-- action generate pass -->\r\n <td *ngIf=\"actionGeneratePassword\">\r\n <button type=\"button\" [title]=\"'Gerar Senha'\" (click)=\"generatePassword()\">\r\n <i class=\"fa-solid fa-key\"></i>\r\n </button>\r\n </td>\r\n\r\n <!-- action copy pass -->\r\n <td *ngIf=\"actionCopy\">\r\n <button type=\"button\" [title]=\"'Copiar Senha'\" (click)=\"copyText()\">\r\n <i *ngIf=\"!isCopy\" class=\"fa-regular fa-copy\"></i>\r\n <i *ngIf=\"isCopy\" class=\"fa-solid fa-check\"></i>\r\n </button>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>", styles: [".tcloud-ui-input-password{border:1px solid var(--tc-gray-300);border-radius:3px}.tcloud-ui-input-password table{width:100%}.tcloud-ui-input-password table td:first-child{width:100%!important}.tcloud-ui-input-password table td:first-child input{width:100%;border:none;height:38px;padding-left:8px}.tcloud-ui-input-password table td{width:50px;height:40px;background-color:#fff}.tcloud-ui-input-password table td button{background:transparent;border:none;margin-right:3px;cursor:pointer;color:var(--tc-gray-500)}.tcloud-ui-input-password table td button:hover{color:var(--tc-primary2)}.tcloud-ui-input-password .ng-invalid.ng-touched{border:1px solid var(--red)!important}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] });
|
|
5228
5257
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiInputPasswordComponent, decorators: [{
|
|
5229
5258
|
type: Component,
|
|
5230
|
-
args: [{ selector: 'tcloud-ui-input-password', providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR], template: "<div class=\"tcloud-ui-input-password\">\r\n <table>\r\n <tr>\r\n <!-- input password -->\r\n <td>\r\n <form #_form=\"ngForm\">\r\n <ng-container *ngIf=\"passwordRegex\">\r\n <input class=\"tc-form-control\" *ngIf=\"mode == 'password'\" type=\"password\" name=\"tc_password\" [pattern]=\"passwordRegex\" autoComplete=\"new-password\" [(ngModel)]=\"innerValue\" required>\r\n <input class=\"tc-form-control\" *ngIf=\"mode == 'text'\" type=\"text\" name=\"tc_text\" [pattern]=\"passwordRegex\" [(ngModel)]=\"innerValue\" required>\r\n </ng-container>\r\n </form>\r\n </td>\r\n\r\n <!-- action show hide -->\r\n <td>\r\n <button type=\"button\" (click)=\"toggleMode()\" [title]=\"(mode == 'password') ? 'Visualizar Senha' : 'Esconder Senha'\">\r\n <i *ngIf=\"mode == 'password'\" class=\"far fa-eye-slash\"></i>\r\n <i *ngIf=\"mode == 'text'\" class=\"far fa-eye\"></i> \r\n </button>\r\n </td>\r\n\r\n <!-- action generate pass -->\r\n <td>\r\n <button type=\"button\" [title]=\"'Gerar Senha'\" (click)=\"generatePassword()\">\r\n <i class=\"fa-solid fa-key\"></i>\r\n </button>\r\n </td>\r\n\r\n <!-- action copy pass -->\r\n <td>\r\n <button type=\"button\" [title]=\"'Copiar Senha'\" (click)=\"copyText()\">\r\n <i *ngIf=\"!isCopy\" class=\"fa-regular fa-copy\"></i>\r\n <i *ngIf=\"isCopy\" class=\"fa-solid fa-check\"></i>\r\n </button>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>", styles: [".tcloud-ui-input-password{border:1px solid var(--tc-gray-300);border-radius:3px}.tcloud-ui-input-password table{width:100%}.tcloud-ui-input-password table td:first-child{width:100%!important}.tcloud-ui-input-password table td:first-child input{width:100%;border:none;height:38px;padding-left:8px}.tcloud-ui-input-password table td{width:50px;height:40px;background-color:#fff}.tcloud-ui-input-password table td button{background:transparent;border:none;margin-right:3px;cursor:pointer;color:var(--tc-gray-500)}.tcloud-ui-input-password table td button:hover{color:var(--tc-primary2)}.tcloud-ui-input-password .ng-invalid.ng-touched{border:1px solid var(--red)!important}\n"] }]
|
|
5231
|
-
}], ctorParameters: function () { return []; }, propDecorators: {
|
|
5259
|
+
args: [{ selector: 'tcloud-ui-input-password', providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR], template: "<div class=\"tcloud-ui-input-password\">\r\n <table>\r\n <tr>\r\n <!-- input password -->\r\n <td>\r\n <form #_form=\"ngForm\">\r\n <ng-container *ngIf=\"passwordRegex\">\r\n <input class=\"tc-form-control\" *ngIf=\"mode == 'password'\" type=\"password\" name=\"tc_password\" [pattern]=\"passwordRegex\" autoComplete=\"new-password\" [(ngModel)]=\"innerValue\" required>\r\n <input class=\"tc-form-control\" *ngIf=\"mode == 'text'\" type=\"text\" name=\"tc_text\" [pattern]=\"passwordRegex\" [(ngModel)]=\"innerValue\" required>\r\n </ng-container>\r\n </form>\r\n </td>\r\n\r\n <!-- action show hide -->\r\n <td *ngIf=\"actionView\">\r\n <button type=\"button\" (click)=\"toggleMode()\" [title]=\"(mode == 'password') ? 'Visualizar Senha' : 'Esconder Senha'\">\r\n <i *ngIf=\"mode == 'password'\" class=\"far fa-eye-slash\"></i>\r\n <i *ngIf=\"mode == 'text'\" class=\"far fa-eye\"></i> \r\n </button>\r\n </td>\r\n\r\n <!-- action generate pass -->\r\n <td *ngIf=\"actionGeneratePassword\">\r\n <button type=\"button\" [title]=\"'Gerar Senha'\" (click)=\"generatePassword()\">\r\n <i class=\"fa-solid fa-key\"></i>\r\n </button>\r\n </td>\r\n\r\n <!-- action copy pass -->\r\n <td *ngIf=\"actionCopy\">\r\n <button type=\"button\" [title]=\"'Copiar Senha'\" (click)=\"copyText()\">\r\n <i *ngIf=\"!isCopy\" class=\"fa-regular fa-copy\"></i>\r\n <i *ngIf=\"isCopy\" class=\"fa-solid fa-check\"></i>\r\n </button>\r\n </td>\r\n </tr>\r\n </table>\r\n</div>", styles: [".tcloud-ui-input-password{border:1px solid var(--tc-gray-300);border-radius:3px}.tcloud-ui-input-password table{width:100%}.tcloud-ui-input-password table td:first-child{width:100%!important}.tcloud-ui-input-password table td:first-child input{width:100%;border:none;height:38px;padding-left:8px}.tcloud-ui-input-password table td{width:50px;height:40px;background-color:#fff}.tcloud-ui-input-password table td button{background:transparent;border:none;margin-right:3px;cursor:pointer;color:var(--tc-gray-500)}.tcloud-ui-input-password table td button:hover{color:var(--tc-primary2)}.tcloud-ui-input-password .ng-invalid.ng-touched{border:1px solid var(--red)!important}\n"] }]
|
|
5260
|
+
}], ctorParameters: function () { return []; }, propDecorators: { actionView: [{
|
|
5261
|
+
type: Input
|
|
5262
|
+
}], actionCopy: [{
|
|
5263
|
+
type: Input
|
|
5264
|
+
}], actionGeneratePassword: [{
|
|
5265
|
+
type: Input
|
|
5266
|
+
}], numberOfCharacter: [{
|
|
5232
5267
|
type: Input
|
|
5233
5268
|
}], atLeastOneUppercaseLetter: [{
|
|
5234
5269
|
type: Input
|