@dev-tcloud/tcloud-ui 0.1.6 → 0.1.7
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/directives.module.mjs +10 -5
- package/esm2020/lib/_directives/el-copy/el-copy.directive.mjs +51 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/dev-tcloud-tcloud-ui.mjs +58 -5
- package/fesm2015/dev-tcloud-tcloud-ui.mjs.map +1 -1
- package/fesm2020/dev-tcloud-tcloud-ui.mjs +58 -5
- package/fesm2020/dev-tcloud-tcloud-ui.mjs.map +1 -1
- package/lib/_directives/directives.module.d.ts +2 -1
- package/lib/_directives/el-copy/el-copy.directive.d.ts +13 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/scss/components/custom/el-copy.scss +6 -0
- package/scss/components/styles.scss +1 -0
|
@@ -4477,14 +4477,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
4477
4477
|
type: Input
|
|
4478
4478
|
}] } });
|
|
4479
4479
|
|
|
4480
|
+
class TCloudUiElCopyDirective {
|
|
4481
|
+
constructor(el, renderer) {
|
|
4482
|
+
this.el = el;
|
|
4483
|
+
this.renderer = renderer;
|
|
4484
|
+
this._isCopy = false;
|
|
4485
|
+
}
|
|
4486
|
+
ngOnInit() {
|
|
4487
|
+
console.log('el', this.el.nativeElement);
|
|
4488
|
+
this.setItemFuncCopy();
|
|
4489
|
+
}
|
|
4490
|
+
setItemFuncCopy() {
|
|
4491
|
+
const btn_copy = this.renderer.createElement('i');
|
|
4492
|
+
var copyText = () => {
|
|
4493
|
+
const elementWithCopyAttribute = document.querySelector(`[data-el-copy="${id}"]`);
|
|
4494
|
+
const copyText = elementWithCopyAttribute?.textContent;
|
|
4495
|
+
navigator.clipboard.writeText(copyText);
|
|
4496
|
+
this.renderer.removeClass(btn_copy, 'fa-copy');
|
|
4497
|
+
this.renderer.addClass(btn_copy, 'fa-check');
|
|
4498
|
+
setTimeout(() => {
|
|
4499
|
+
this.renderer.removeClass(btn_copy, 'fa-check');
|
|
4500
|
+
this.renderer.addClass(btn_copy, 'fa-copy');
|
|
4501
|
+
}, 3000);
|
|
4502
|
+
};
|
|
4503
|
+
const id = this.generateID();
|
|
4504
|
+
this.renderer.setAttribute(this.el.nativeElement, 'data-el-copy', `${id}`);
|
|
4505
|
+
this.renderer.setStyle(btn_copy, 'cursor', 'pointer');
|
|
4506
|
+
this.renderer.setStyle(btn_copy, 'margin-left', '3px');
|
|
4507
|
+
this.renderer.addClass(btn_copy, 'fas');
|
|
4508
|
+
this.renderer.addClass(btn_copy, 'fa-copy');
|
|
4509
|
+
this.renderer.addClass(btn_copy, 'tcloud-ui-el-copy');
|
|
4510
|
+
this.renderer.setAttribute(btn_copy, 'id', id);
|
|
4511
|
+
this.renderer.setAttribute(btn_copy, 'title', 'Copy');
|
|
4512
|
+
this.renderer.listen(btn_copy, 'click', () => { copyText(); });
|
|
4513
|
+
this.renderer.appendChild(this.el.nativeElement, btn_copy);
|
|
4514
|
+
}
|
|
4515
|
+
generateID(target) {
|
|
4516
|
+
const ref = (target) ? `-${target}` : '';
|
|
4517
|
+
return `tc-el-copy-${Math.floor(Math.random() * Math.floor(Math.random() * Date.now()))}${ref}`;
|
|
4518
|
+
}
|
|
4519
|
+
}
|
|
4520
|
+
TCloudUiElCopyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiElCopyDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4521
|
+
TCloudUiElCopyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: TCloudUiElCopyDirective, selector: "[TCCopy]", ngImport: i0 });
|
|
4522
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiElCopyDirective, decorators: [{
|
|
4523
|
+
type: Directive,
|
|
4524
|
+
args: [{
|
|
4525
|
+
selector: '[TCCopy]'
|
|
4526
|
+
}]
|
|
4527
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; } });
|
|
4528
|
+
|
|
4480
4529
|
class TCloudUiDirectiveModule {
|
|
4481
4530
|
}
|
|
4482
4531
|
TCloudUiDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4483
4532
|
TCloudUiDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDirectiveModule, declarations: [TCloudUiTooltipDirective,
|
|
4484
4533
|
TCloudUiAlignDirective,
|
|
4485
|
-
TCloudUiHoverParentDirective
|
|
4534
|
+
TCloudUiHoverParentDirective,
|
|
4535
|
+
TCloudUiElCopyDirective], exports: [TCloudUiTooltipDirective,
|
|
4486
4536
|
TCloudUiAlignDirective,
|
|
4487
|
-
TCloudUiHoverParentDirective
|
|
4537
|
+
TCloudUiHoverParentDirective,
|
|
4538
|
+
TCloudUiElCopyDirective] });
|
|
4488
4539
|
TCloudUiDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDirectiveModule });
|
|
4489
4540
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TCloudUiDirectiveModule, decorators: [{
|
|
4490
4541
|
type: NgModule,
|
|
@@ -4492,12 +4543,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
4492
4543
|
declarations: [
|
|
4493
4544
|
TCloudUiTooltipDirective,
|
|
4494
4545
|
TCloudUiAlignDirective,
|
|
4495
|
-
TCloudUiHoverParentDirective
|
|
4546
|
+
TCloudUiHoverParentDirective,
|
|
4547
|
+
TCloudUiElCopyDirective
|
|
4496
4548
|
],
|
|
4497
4549
|
exports: [
|
|
4498
4550
|
TCloudUiTooltipDirective,
|
|
4499
4551
|
TCloudUiAlignDirective,
|
|
4500
|
-
TCloudUiHoverParentDirective
|
|
4552
|
+
TCloudUiHoverParentDirective,
|
|
4553
|
+
TCloudUiElCopyDirective
|
|
4501
4554
|
],
|
|
4502
4555
|
}]
|
|
4503
4556
|
}] });
|
|
@@ -5331,5 +5384,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
5331
5384
|
* Generated bundle index. Do not edit.
|
|
5332
5385
|
*/
|
|
5333
5386
|
|
|
5334
|
-
export { BytesPipe, CNPJPipe, CPFPipe, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR, DateBRPipe, MonthNamePipe, RespectivePipe, StatusInfoPipe, TCCondition, TCFiltersType, TCloudUiAccordionBodyComponent, TCloudUiAccordionComponent, TCloudUiAccordionModule, TCloudUiAccordionTitleComponent, TCloudUiAlignDirective, TCloudUiChoiceIssuesComponent, TCloudUiChoiceIssuesModule, TCloudUiDataListComponent, TCloudUiDataListModule, TCloudUiDataListOptionComponent, TCloudUiDatepickerComponent, TCloudUiDatepickerModule, TCloudUiDatepickerTimeComponent, TCloudUiDatepickerTimeModule, TCloudUiDirectiveModule, TCloudUiFiltersComponent, TCloudUiFiltersModule, TCloudUiHoverParentDirective, TCloudUiInputPasswordComponent, TCloudUiInputPasswordModule, TCloudUiInputSearchComponent, TCloudUiInputSearchModule, TCloudUiLineStepCircleComponent, TCloudUiLineStepCircleModule, TCloudUiLinhaLogoComponent, TCloudUiLinhaLogoModule, TCloudUiLoadingTransitionsService, TCloudUiModalBodyComponent, TCloudUiModalComponent, TCloudUiModalFooterComponent, TCloudUiModalHeaderComponent, TCloudUiModalModule, TCloudUiModule, TCloudUiMultiInputComponent, TCloudUiMultiInputModule, TCloudUiMultiSelectComponent, TCloudUiMultiSelectModule, TCloudUiMultiplesValuesComponent, TCloudUiMultiplesValuesModule, TCloudUiNotFoundComponent, TCloudUiNotFoundModule, TCloudUiNumberStepComponent, TCloudUiNumberStepModule, TCloudUiPipesModule, TCloudUiRangeDateComponent, TCloudUiScrollBoxComponent, TCloudUiScrollBoxModule, TCloudUiSearchInObjectService, TCloudUiTabContentComponent, TCloudUiTabHeadComponent, TCloudUiTabMenuComponent, TCloudUiTabMenuModule, TCloudUiTabSubtitleComponent, TCloudUiTabTitleComponent, TCloudUiTableComponent, TCloudUiTableModule, TCloudUiTooltipDirective, TCloudUiWelcomeComponent, TCloudUiWelcomeModule, ToTextPipe };
|
|
5387
|
+
export { BytesPipe, CNPJPipe, CPFPipe, CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR, DateBRPipe, MonthNamePipe, RespectivePipe, StatusInfoPipe, TCCondition, TCFiltersType, TCloudUiAccordionBodyComponent, TCloudUiAccordionComponent, TCloudUiAccordionModule, TCloudUiAccordionTitleComponent, TCloudUiAlignDirective, TCloudUiChoiceIssuesComponent, TCloudUiChoiceIssuesModule, TCloudUiDataListComponent, TCloudUiDataListModule, TCloudUiDataListOptionComponent, TCloudUiDatepickerComponent, TCloudUiDatepickerModule, TCloudUiDatepickerTimeComponent, TCloudUiDatepickerTimeModule, TCloudUiDirectiveModule, TCloudUiElCopyDirective, TCloudUiFiltersComponent, TCloudUiFiltersModule, TCloudUiHoverParentDirective, TCloudUiInputPasswordComponent, TCloudUiInputPasswordModule, TCloudUiInputSearchComponent, TCloudUiInputSearchModule, TCloudUiLineStepCircleComponent, TCloudUiLineStepCircleModule, TCloudUiLinhaLogoComponent, TCloudUiLinhaLogoModule, TCloudUiLoadingTransitionsService, TCloudUiModalBodyComponent, TCloudUiModalComponent, TCloudUiModalFooterComponent, TCloudUiModalHeaderComponent, TCloudUiModalModule, TCloudUiModule, TCloudUiMultiInputComponent, TCloudUiMultiInputModule, TCloudUiMultiSelectComponent, TCloudUiMultiSelectModule, TCloudUiMultiplesValuesComponent, TCloudUiMultiplesValuesModule, TCloudUiNotFoundComponent, TCloudUiNotFoundModule, TCloudUiNumberStepComponent, TCloudUiNumberStepModule, TCloudUiPipesModule, TCloudUiRangeDateComponent, TCloudUiScrollBoxComponent, TCloudUiScrollBoxModule, TCloudUiSearchInObjectService, TCloudUiTabContentComponent, TCloudUiTabHeadComponent, TCloudUiTabMenuComponent, TCloudUiTabMenuModule, TCloudUiTabSubtitleComponent, TCloudUiTabTitleComponent, TCloudUiTableComponent, TCloudUiTableModule, TCloudUiTooltipDirective, TCloudUiWelcomeComponent, TCloudUiWelcomeModule, ToTextPipe };
|
|
5335
5388
|
//# sourceMappingURL=dev-tcloud-tcloud-ui.mjs.map
|