@covalent/highlight 4.0.0 → 4.1.1-beta.3

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.
Files changed (34) hide show
  1. package/README.md +33 -151
  2. package/covalent-highlight.d.ts +2 -1
  3. package/esm2020/covalent-highlight.mjs +5 -0
  4. package/esm2020/lib/copy-code-button/copy-code-button.component.mjs +55 -0
  5. package/esm2020/lib/highlight.component.mjs +179 -0
  6. package/esm2020/lib/highlight.module.mjs +39 -0
  7. package/esm2020/public_api.mjs +4 -0
  8. package/fesm2015/covalent-highlight.mjs +271 -0
  9. package/fesm2015/covalent-highlight.mjs.map +1 -0
  10. package/fesm2020/covalent-highlight.mjs +270 -0
  11. package/fesm2020/covalent-highlight.mjs.map +1 -0
  12. package/{copy-code-button → lib/copy-code-button}/copy-code-button.component.d.ts +4 -1
  13. package/{highlight.component.d.ts → lib/highlight.component.d.ts} +6 -3
  14. package/lib/highlight.module.d.ts +13 -0
  15. package/package.json +30 -34
  16. package/public_api.d.ts +3 -3
  17. package/_highlight-theme.scss +0 -96
  18. package/bundles/covalent-highlight.umd.js +0 -444
  19. package/bundles/covalent-highlight.umd.js.map +0 -1
  20. package/bundles/covalent-highlight.umd.min.js +0 -2
  21. package/bundles/covalent-highlight.umd.min.js.map +0 -1
  22. package/copy-code-button/copy-code-button.component.scss +0 -0
  23. package/covalent-highlight.metadata.json +0 -1
  24. package/esm2015/copy-code-button/copy-code-button.component.js +0 -92
  25. package/esm2015/covalent-highlight.js +0 -10
  26. package/esm2015/highlight.component.js +0 -286
  27. package/esm2015/highlight.module.js +0 -23
  28. package/esm2015/index.js +0 -7
  29. package/esm2015/public_api.js +0 -9
  30. package/fesm2015/covalent-highlight.js +0 -416
  31. package/fesm2015/covalent-highlight.js.map +0 -1
  32. package/highlight.component.scss +0 -49
  33. package/highlight.module.d.ts +0 -2
  34. package/index.d.ts +0 -1
@@ -1,7 +1,8 @@
1
1
  import { AfterViewInit, ElementRef, EventEmitter, Renderer2, ChangeDetectorRef, AfterViewChecked } from '@angular/core';
2
2
  import { DomSanitizer } from '@angular/platform-browser';
3
3
  import { MatTooltip } from '@angular/material/tooltip';
4
- import { ICopyCodeTooltips } from '.';
4
+ import { ICopyCodeTooltips } from './copy-code-button/copy-code-button.component';
5
+ import * as i0 from "@angular/core";
5
6
  export declare class TdHighlightComponent implements AfterViewInit, AfterViewChecked {
6
7
  private _renderer;
7
8
  private _elementRef;
@@ -24,13 +25,13 @@ export declare class TdHighlightComponent implements AfterViewInit, AfterViewChe
24
25
  *
25
26
  * Display copy button on code snippets to copy code to clipboard.
26
27
  */
27
- copyCodeToClipboard: boolean;
28
+ copyCodeToClipboard?: boolean | undefined;
28
29
  /**
29
30
  * copyCodeTooltips?: ICopyCodeTooltips
30
31
  *
31
32
  * Tooltips for copy button to copy and upon copying.
32
33
  */
33
- copyCodeTooltips: ICopyCodeTooltips;
34
+ copyCodeTooltips?: ICopyCodeTooltips;
34
35
  /**
35
36
  * lang?: string
36
37
  *
@@ -61,4 +62,6 @@ export declare class TdHighlightComponent implements AfterViewInit, AfterViewChe
61
62
  private _loadContent;
62
63
  private _elementFromString;
63
64
  private _render;
65
+ static ɵfac: i0.ɵɵFactoryDeclaration<TdHighlightComponent, never>;
66
+ static ɵcmp: i0.ɵɵComponentDeclaration<TdHighlightComponent, "td-highlight", never, { "content": "content"; "copyCodeToClipboard": "copyCodeToClipboard"; "copyCodeTooltips": "copyCodeTooltips"; "codeLang": "codeLang"; "lang": "lang"; }, { "contentReady": "contentReady"; }, never, ["*"]>;
64
67
  }
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./highlight.component";
3
+ import * as i2 from "./copy-code-button/copy-code-button.component";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "@angular/cdk/clipboard";
6
+ import * as i5 from "@angular/material/icon";
7
+ import * as i6 from "@angular/material/tooltip";
8
+ import * as i7 from "@angular/material/button";
9
+ export declare class CovalentHighlightModule {
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<CovalentHighlightModule, never>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CovalentHighlightModule, [typeof i1.TdHighlightComponent, typeof i2.TdCopyCodeButtonComponent], [typeof i3.CommonModule, typeof i4.ClipboardModule, typeof i5.MatIconModule, typeof i6.MatTooltipModule, typeof i7.MatButtonModule], [typeof i1.TdHighlightComponent]>;
12
+ static ɵinj: i0.ɵɵInjectorDeclaration<CovalentHighlightModule>;
13
+ }
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@covalent/highlight",
3
- "version": "4.0.0",
3
+ "version": "4.1.1-beta.3",
4
4
  "description": "Teradata UI Platform Highlight Module",
5
+ "license": "MIT",
6
+ "author": "Teradata UX",
5
7
  "keywords": [
6
8
  "angular",
7
9
  "components",
@@ -9,41 +11,35 @@
9
11
  "highlight",
10
12
  "highlightjs"
11
13
  ],
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/teradata/covalent.git"
15
- },
16
- "bugs": {
17
- "url": "https://github.com/teradata/covalent/issues"
14
+ "peerDependencies": {
15
+ "highlight.js": "^11.4.0",
16
+ "@angular/common": "^13.2.0",
17
+ "@angular/core": "^13.2.0",
18
+ "@angular/platform-browser": "^13.2.0",
19
+ "@angular/cdk": "^13.2.0",
20
+ "@angular/material": "^13.2.0"
18
21
  },
19
- "license": "MIT",
20
- "author": "Teradata UX",
21
- "contributors": [
22
- "Kyle Ledbetter <kyle.ledbetter@teradata.com>",
23
- "Richa Vyas <richa.vyas@teradata.com>",
24
- "Ed Morales <eduardo.morales@teradata.com>",
25
- "Jason Weaver <jason.weaver@teradata.com>",
26
- "Jeremy Wilken <jeremy.wilken@teradata.com>",
27
- "Jeremy Smartt <jeremy.smartt@teradata.com>",
28
- "Steven Ov <steven.ov@teradata.com>"
29
- ],
30
22
  "dependencies": {
31
- "highlight.js": "^9.13.1",
32
- "tslib": "^2.0.0"
23
+ "tslib": "^2.3.0"
33
24
  },
34
- "peerDependencies": {
35
- "@angular/common": "^9.0.0 || ^10.0.0-0 || ^11.0.0-0",
36
- "@angular/core": "^9.0.0 || ^10.0.0-0 || ^11.0.0-0",
37
- "@angular/platform-browser": "^9.0.0 || ^10.0.0-0 || ^11.0.0-0",
38
- "@angular/cdk": "^9.0.0 || ^10.0.0-0 || ^11.0.0-0",
39
- "@angular/material": "^9.0.0 || ^10.0.0-0 || ^11.0.0-0"
40
- },
41
- "main": "bundles/covalent-highlight.umd.js",
42
- "module": "fesm2015/covalent-highlight.js",
43
- "es2015": "fesm2015/covalent-highlight.js",
44
- "esm2015": "esm2015/covalent-highlight.js",
45
- "fesm2015": "fesm2015/covalent-highlight.js",
25
+ "module": "fesm2015/covalent-highlight.mjs",
26
+ "es2020": "fesm2020/covalent-highlight.mjs",
27
+ "esm2020": "esm2020/covalent-highlight.mjs",
28
+ "fesm2020": "fesm2020/covalent-highlight.mjs",
29
+ "fesm2015": "fesm2015/covalent-highlight.mjs",
46
30
  "typings": "covalent-highlight.d.ts",
47
- "metadata": "covalent-highlight.metadata.json",
31
+ "exports": {
32
+ "./package.json": {
33
+ "default": "./package.json"
34
+ },
35
+ ".": {
36
+ "types": "./covalent-highlight.d.ts",
37
+ "esm2020": "./esm2020/covalent-highlight.mjs",
38
+ "es2020": "./fesm2020/covalent-highlight.mjs",
39
+ "es2015": "./fesm2015/covalent-highlight.mjs",
40
+ "node": "./fesm2015/covalent-highlight.mjs",
41
+ "default": "./fesm2020/covalent-highlight.mjs"
42
+ }
43
+ },
48
44
  "sideEffects": false
49
- }
45
+ }
package/public_api.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './highlight.component';
2
- export * from './highlight.module';
3
- export * from './copy-code-button/copy-code-button.component';
1
+ export * from './lib/highlight.component';
2
+ export * from './lib/highlight.module';
3
+ export * from './lib/copy-code-button/copy-code-button.component';
@@ -1,96 +0,0 @@
1
- @import '../../../node_modules/@angular/material/theming';
2
-
3
- /**
4
- * Mimicking VS Dark+ theme as closely as possible
5
- */
6
- @mixin covalent-highlight-theme() {
7
- td-highlight {
8
- background: #1e1e21;
9
- .highlight {
10
- color: $light-primary-text;
11
- }
12
- .copy-button {
13
- color: $light-primary-text;
14
- }
15
-
16
- .hljs-comment,
17
- .hljs-quote {
18
- color: #608b4e;
19
- }
20
-
21
- .hljs-tag,
22
- .hljs-name,
23
- .hljs-selector-tag,
24
- .hljs-literal {
25
- color: #569cd6;
26
- }
27
-
28
- .hljs-keyword {
29
- color: #c288bf;
30
- }
31
-
32
- .hljs-attr,
33
- //.hljs-params, // Remove param color for now
34
- .hljs-attribute {
35
- color: #9cdcfe;
36
- }
37
-
38
- .hljs-string,
39
- .hljs-selector-attr,
40
- .hljs-regexp,
41
- .hljs-link {
42
- color: #ce9178;
43
- }
44
-
45
- .hljs-selector-id,
46
- .hljs-selector-class,
47
- .hljs-selector-pseudo {
48
- color: #d7ba7d;
49
- }
50
-
51
- .hljs-meta {
52
- color: #dcdcaa;
53
- }
54
-
55
- .hljs-built_in,
56
- .hljs-builtin-name,
57
- .hljs-type,
58
- .hljs-section,
59
- .hljs-class .hljs-title,
60
- .hljs-symbol,
61
- .hljs-bullet {
62
- color: #4ec9b0;
63
- }
64
-
65
- .hljs-number {
66
- color: #b5cea8;
67
- }
68
-
69
- .hljs-variable,
70
- .hljs-template-variable {
71
- color: #9fddfc;
72
- }
73
-
74
- .hljs-deletion {
75
- color: #ffc8bd;
76
- }
77
-
78
- .hljs-addition {
79
- background-color: #baeeba;
80
- }
81
-
82
- .hljs-emphasis {
83
- font-style: italic;
84
- }
85
-
86
- .hljs-doctag,
87
- .hljs-strong {
88
- font-weight: bold;
89
- }
90
-
91
- .hljs-formula {
92
- background-color: #eeeeee;
93
- font-style: italic;
94
- }
95
- }
96
- }
@@ -1,444 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/platform-browser'), require('@angular/common'), require('@angular/cdk/clipboard'), require('@angular/material/icon'), require('@angular/material/tooltip'), require('@angular/material/button')) :
3
- typeof define === 'function' && define.amd ? define('@covalent/highlight', ['exports', '@angular/core', '@angular/platform-browser', '@angular/common', '@angular/cdk/clipboard', '@angular/material/icon', '@angular/material/tooltip', '@angular/material/button'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.covalent = global.covalent || {}, global.covalent.highlight = {}), global.ng.core, global.ng.platformBrowser, global.ng.common, global.ng.cdk.clipboard, global.ng.material.icon, global.ng.material.tooltip, global.ng.material.button));
5
- }(this, (function (exports, core, platformBrowser, common, clipboard, icon, tooltip, button) { 'use strict';
6
-
7
- /**
8
- * @fileoverview added by tsickle
9
- * Generated from: highlight.component.ts
10
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
11
- */
12
- /* tslint:disable-next-line */
13
- /** @type {?} */
14
- var hljs = require('highlight.js/lib');
15
- var TdHighlightComponent = /** @class */ (function () {
16
- /**
17
- * @param {?} _renderer
18
- * @param {?} _elementRef
19
- * @param {?} _domSanitizer
20
- * @param {?} cdr
21
- */
22
- function TdHighlightComponent(_renderer, _elementRef, _domSanitizer, cdr) {
23
- this._renderer = _renderer;
24
- this._elementRef = _elementRef;
25
- this._domSanitizer = _domSanitizer;
26
- this.cdr = cdr;
27
- this._initialized = false;
28
- this._lang = 'typescript';
29
- /**
30
- * copyCodeToClipboard?: boolean
31
- *
32
- * Display copy button on code snippets to copy code to clipboard.
33
- */
34
- this.copyCodeToClipboard = false;
35
- /**
36
- * copyCodeTooltips?: ICopyCodeTooltips
37
- *
38
- * Tooltips for copy button to copy and upon copying.
39
- */
40
- this.copyCodeTooltips = {};
41
- /**
42
- * contentReady?: function
43
- * Event emitted after the highlight content rendering is finished.
44
- */
45
- this.contentReady = new core.EventEmitter();
46
- }
47
- Object.defineProperty(TdHighlightComponent.prototype, "content", {
48
- /**
49
- * content?: string
50
- *
51
- * Code content to be parsed as highlighted html.
52
- * Used to load data dynamically.
53
- *
54
- * e.g. `.html`, `.ts` , etc.
55
- * @param {?} content
56
- * @return {?}
57
- */
58
- set: function (content) {
59
- this._content = content;
60
- if (this._initialized) {
61
- this._loadContent(this._content);
62
- }
63
- },
64
- enumerable: false,
65
- configurable: true
66
- });
67
- Object.defineProperty(TdHighlightComponent.prototype, "codeLang", {
68
- /**
69
- * lang?: string
70
- *
71
- * Language of the code content to be parsed as highlighted html.
72
- * Defaults to `typescript`
73
- *
74
- * e.g. `typescript`, `html` , etc.
75
- * @param {?} lang
76
- * @return {?}
77
- */
78
- set: function (lang) {
79
- this.setLanguage(lang);
80
- },
81
- enumerable: false,
82
- configurable: true
83
- });
84
- Object.defineProperty(TdHighlightComponent.prototype, "lang", {
85
- /**
86
- * @deprecated - removed completely \@4.0.0
87
- * @param {?} lang
88
- * @return {?}
89
- */
90
- set: function (lang) {
91
- // tslint:disable-next-line: no-console
92
- console.warn('DEPRECATION WARNING: switch to codeLang attribute as lang attribute is deprecated.');
93
- this.setLanguage(lang);
94
- },
95
- enumerable: false,
96
- configurable: true
97
- });
98
- /**
99
- * @return {?}
100
- */
101
- TdHighlightComponent.prototype.ngAfterViewChecked = function () {
102
- this.cdr.detectChanges();
103
- };
104
- /**
105
- * @return {?}
106
- */
107
- TdHighlightComponent.prototype.ngAfterViewInit = function () {
108
- if (!this._content) {
109
- this._loadContent((( /** @type {?} */(this.highlightComp.nativeElement))).textContent);
110
- }
111
- else {
112
- this._loadContent(this._content);
113
- }
114
- this._initialized = true;
115
- };
116
- /**
117
- * @param {?} lang
118
- * @return {?}
119
- */
120
- TdHighlightComponent.prototype.setLanguage = function (lang) {
121
- if (!lang) {
122
- throw new Error('Error: language attribute must be defined in TdHighlightComponent.');
123
- }
124
- this._lang = lang;
125
- if (this._initialized) {
126
- this._loadContent(this._content);
127
- }
128
- };
129
- /**
130
- * General method to parse a string of code into HTML Elements and load them into the container
131
- * @private
132
- * @param {?} code
133
- * @return {?}
134
- */
135
- TdHighlightComponent.prototype._loadContent = function (code) {
136
- if (code && code.trim().length > 0) {
137
- // Clean container
138
- this._renderer.setProperty(this._elementRef.nativeElement, 'innerHTML', '');
139
- // Parse html string into actual HTML elements.
140
- this._elementFromString(this._render(code));
141
- if (this.copyCodeToClipboard) {
142
- this._renderer.appendChild(this._elementRef.nativeElement, this.copyComp.nativeElement);
143
- }
144
- }
145
- this.contentReady.emit();
146
- };
147
- /**
148
- * @private
149
- * @param {?} codeStr
150
- * @return {?}
151
- */
152
- TdHighlightComponent.prototype._elementFromString = function (codeStr) {
153
- // Renderer2 doesnt have a parsing method, so we have to sanitize and use [innerHTML]
154
- // to parse the string into DOM element for now.
155
- /** @type {?} */
156
- var preElement = this._renderer.createElement('pre');
157
- this._renderer.appendChild(this._elementRef.nativeElement, preElement);
158
- /** @type {?} */
159
- var codeElement = this._renderer.createElement('code');
160
- this._renderer.appendChild(preElement, codeElement);
161
- // Set .highlight class into <code> element
162
- this._renderer.addClass(codeElement, 'highlight');
163
- codeElement.innerHTML = this._domSanitizer.sanitize(core.SecurityContext.HTML, codeStr);
164
- return preElement;
165
- };
166
- /**
167
- * @private
168
- * @param {?} contents
169
- * @return {?}
170
- */
171
- TdHighlightComponent.prototype._render = function (contents) {
172
- // Trim leading and trailing newlines
173
- contents = contents.replace(/^(\s|\t)*\n+/g, '').replace(/(\s|\t)*\n+(\s|\t)*$/g, '');
174
- // Split markup by line characters
175
- /** @type {?} */
176
- var lines = contents.split('\n');
177
- // check how much indentation is used by the first actual code line
178
- /** @type {?} */
179
- var firstLineWhitespace = lines[0].match(/^(\s|\t)*/)[0];
180
- // Remove all indentation spaces so code can be parsed correctly
181
- /** @type {?} */
182
- var startingWhitespaceRegex = new RegExp('^' + firstLineWhitespace);
183
- lines = lines.map(( /**
184
- * @param {?} line
185
- * @return {?}
186
- */function (line) {
187
- return line
188
- .replace('=""', '') // remove empty values
189
- .replace(startingWhitespaceRegex, '')
190
- .replace(/\s+$/, ''); // remove trailing white spaces
191
- }));
192
- /** @type {?} */
193
- var codeToParse = lines
194
- .join('\n')
195
- .replace(/\{ \{/gi, '{{')
196
- .replace(/\} \}/gi, '}}')
197
- .replace(/&lt;/gi, '<')
198
- .replace(/&gt;/gi, '>');
199
- this.copyContent = codeToParse;
200
- // Parse code with highlight.js depending on language
201
- /** @type {?} */
202
- var highlightedCode = hljs.highlight(this._lang, codeToParse, true);
203
- highlightedCode.value = highlightedCode.value
204
- .replace(/=<span class="hljs-value">""<\/span>/gi, '')
205
- .replace('<head>', '')
206
- .replace('<head/>', '');
207
- return highlightedCode.value;
208
- };
209
- return TdHighlightComponent;
210
- }());
211
- TdHighlightComponent.decorators = [
212
- { type: core.Component, args: [{
213
- selector: 'td-highlight',
214
- template: "<div>\n <div #highlightComponent>\n <ng-content></ng-content>\n </div>\n\n <div #copyComponent *ngIf=\"copyCodeToClipboard\">\n <td-copy-code-button\n [copiedContent]=\"copyContent\"\n [copyCodeToClipboard]=\"copyCodeToClipboard\"\n [copyCodeTooltips]=\"copyCodeTooltips\"\n ></td-copy-code-button>\n </div>\n</div>\n",
215
- styles: [":host ::ng-deep{display:-ms-flexbox;display:flex;overflow-x:auto;padding:16px}:host ::ng-deep .highlight,:host ::ng-deep code,:host ::ng-deep pre{font-family:Menlo,Monaco,Andale Mono,lucida console,Courier New,monospace}:host ::ng-deep pre{-moz-tab-size:2;-o-tab-size:2;-webkit-font-smoothing:auto;-webkit-text-size-adjust:none;background:rgba(0,0,0,0);border-radius:2px;display:block;font-family:Menlo,Monaco,Andale Mono,lucida console,Courier New,monospace;font-size:.8rem;line-height:1.45;margin:0;overflow-x:auto;padding:0;position:relative;tab-size:2;width:100%}:host ::ng-deep code{margin:0;overflow-wrap:break-word;padding:0;white-space:pre-wrap}:host ::ng-deep .highlight{display:block;line-height:1.5;margin:0;overflow-wrap:break-word}:host ::ng-deep .copy-button{background:inherit;border:none;margin-right:-8px;margin-top:-8px}"]
216
- }] }
217
- ];
218
- /** @nocollapse */
219
- TdHighlightComponent.ctorParameters = function () { return [
220
- { type: core.Renderer2 },
221
- { type: core.ElementRef },
222
- { type: platformBrowser.DomSanitizer },
223
- { type: core.ChangeDetectorRef }
224
- ]; };
225
- TdHighlightComponent.propDecorators = {
226
- content: [{ type: core.Input, args: ['content',] }],
227
- copyCodeToClipboard: [{ type: core.Input }],
228
- copyCodeTooltips: [{ type: core.Input }],
229
- codeLang: [{ type: core.Input, args: ['codeLang',] }],
230
- lang: [{ type: core.Input }],
231
- contentReady: [{ type: core.Output }],
232
- highlightComp: [{ type: core.ViewChild, args: ['highlightComponent',] }],
233
- copyComp: [{ type: core.ViewChild, args: ['copyComponent',] }],
234
- tooltip: [{ type: core.ViewChild, args: ['tooltip',] }]
235
- };
236
- if (false) {
237
- /**
238
- * @type {?}
239
- * @private
240
- */
241
- TdHighlightComponent.prototype._initialized;
242
- /**
243
- * @type {?}
244
- * @private
245
- */
246
- TdHighlightComponent.prototype._content;
247
- /**
248
- * @type {?}
249
- * @private
250
- */
251
- TdHighlightComponent.prototype._lang;
252
- /**
253
- * copyCodeToClipboard?: boolean
254
- *
255
- * Display copy button on code snippets to copy code to clipboard.
256
- * @type {?}
257
- */
258
- TdHighlightComponent.prototype.copyCodeToClipboard;
259
- /**
260
- * copyCodeTooltips?: ICopyCodeTooltips
261
- *
262
- * Tooltips for copy button to copy and upon copying.
263
- * @type {?}
264
- */
265
- TdHighlightComponent.prototype.copyCodeTooltips;
266
- /** @type {?} */
267
- TdHighlightComponent.prototype.copyContent;
268
- /**
269
- * contentReady?: function
270
- * Event emitted after the highlight content rendering is finished.
271
- * @type {?}
272
- */
273
- TdHighlightComponent.prototype.contentReady;
274
- /** @type {?} */
275
- TdHighlightComponent.prototype.highlightComp;
276
- /** @type {?} */
277
- TdHighlightComponent.prototype.copyComp;
278
- /** @type {?} */
279
- TdHighlightComponent.prototype.tooltip;
280
- /**
281
- * @type {?}
282
- * @private
283
- */
284
- TdHighlightComponent.prototype._renderer;
285
- /**
286
- * @type {?}
287
- * @private
288
- */
289
- TdHighlightComponent.prototype._elementRef;
290
- /**
291
- * @type {?}
292
- * @private
293
- */
294
- TdHighlightComponent.prototype._domSanitizer;
295
- /**
296
- * @type {?}
297
- * @private
298
- */
299
- TdHighlightComponent.prototype.cdr;
300
- }
301
-
302
- /**
303
- * @fileoverview added by tsickle
304
- * Generated from: copy-code-button/copy-code-button.component.ts
305
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
306
- */
307
- /**
308
- * @record
309
- */
310
- function ICopyCodeTooltips() { }
311
- if (false) {
312
- /** @type {?|undefined} */
313
- ICopyCodeTooltips.prototype.copy;
314
- /** @type {?|undefined} */
315
- ICopyCodeTooltips.prototype.copied;
316
- }
317
- var TdCopyCodeButtonComponent = /** @class */ (function () {
318
- function TdCopyCodeButtonComponent() {
319
- this.copyCodeToClipboard = false;
320
- /**
321
- * copyCodeTooltips?: ICopyCodeTooltips
322
- *
323
- * Tooltips for copy button to copy and upon copying.
324
- */
325
- this.copyCodeTooltips = {};
326
- }
327
- Object.defineProperty(TdCopyCodeButtonComponent.prototype, "copyTooltip", {
328
- /**
329
- * @return {?}
330
- */
331
- get: function () {
332
- return (this.copyCodeTooltips && this.copyCodeTooltips.copy) || 'Copy';
333
- },
334
- enumerable: false,
335
- configurable: true
336
- });
337
- Object.defineProperty(TdCopyCodeButtonComponent.prototype, "copiedTooltip", {
338
- /**
339
- * @return {?}
340
- */
341
- get: function () {
342
- return (this.copyCodeTooltips && this.copyCodeTooltips.copied) || 'Copied';
343
- },
344
- enumerable: false,
345
- configurable: true
346
- });
347
- /**
348
- * @param {?} event
349
- * @return {?}
350
- */
351
- TdCopyCodeButtonComponent.prototype.textCopied = function (event) {
352
- if (event) {
353
- this.tooltip.hide();
354
- this.tooltip.message = this.copiedTooltip;
355
- this.tooltip.show();
356
- }
357
- };
358
- /**
359
- * @return {?}
360
- */
361
- TdCopyCodeButtonComponent.prototype.initializeTooltip = function () {
362
- var _this = this;
363
- setTimeout(( /**
364
- * @return {?}
365
- */function () {
366
- _this.tooltip.message = _this.copyTooltip;
367
- }), 200);
368
- };
369
- return TdCopyCodeButtonComponent;
370
- }());
371
- TdCopyCodeButtonComponent.decorators = [
372
- { type: core.Component, args: [{
373
- selector: 'td-copy-code-button',
374
- template: "<button\n mat-icon-button\n [cdkCopyToClipboard]=\"copiedContent\"\n class=\"copy-button\"\n [matTooltip]=\"copyTooltip\"\n #tooltip=\"matTooltip\"\n (cdkCopyToClipboardCopied)=\"textCopied($event)\"\n>\n <mat-icon role=\"img\">content_copy</mat-icon>\n</button>\n",
375
- styles: [""]
376
- }] }
377
- ];
378
- TdCopyCodeButtonComponent.propDecorators = {
379
- copiedContent: [{ type: core.Input }],
380
- copyCodeToClipboard: [{ type: core.Input }],
381
- copyCodeTooltips: [{ type: core.Input }],
382
- tooltip: [{ type: core.ViewChild, args: ['tooltip',] }],
383
- initializeTooltip: [{ type: core.HostListener, args: ['mouseleave',] }]
384
- };
385
- if (false) {
386
- /** @type {?} */
387
- TdCopyCodeButtonComponent.prototype.copiedContent;
388
- /** @type {?} */
389
- TdCopyCodeButtonComponent.prototype.copyCodeToClipboard;
390
- /**
391
- * copyCodeTooltips?: ICopyCodeTooltips
392
- *
393
- * Tooltips for copy button to copy and upon copying.
394
- * @type {?}
395
- */
396
- TdCopyCodeButtonComponent.prototype.copyCodeTooltips;
397
- /** @type {?} */
398
- TdCopyCodeButtonComponent.prototype.tooltip;
399
- }
400
-
401
- /**
402
- * @fileoverview added by tsickle
403
- * Generated from: highlight.module.ts
404
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
405
- */
406
- var CovalentHighlightModule = /** @class */ (function () {
407
- function CovalentHighlightModule() {
408
- }
409
- return CovalentHighlightModule;
410
- }());
411
- CovalentHighlightModule.decorators = [
412
- { type: core.NgModule, args: [{
413
- imports: [common.CommonModule, clipboard.ClipboardModule, icon.MatIconModule, tooltip.MatTooltipModule, button.MatButtonModule],
414
- declarations: [TdHighlightComponent, TdCopyCodeButtonComponent],
415
- exports: [TdHighlightComponent],
416
- },] }
417
- ];
418
-
419
- /**
420
- * @fileoverview added by tsickle
421
- * Generated from: public_api.ts
422
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
423
- */
424
-
425
- /**
426
- * @fileoverview added by tsickle
427
- * Generated from: index.ts
428
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
429
- */
430
-
431
- /**
432
- * @fileoverview added by tsickle
433
- * Generated from: covalent-highlight.ts
434
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
435
- */
436
-
437
- exports.CovalentHighlightModule = CovalentHighlightModule;
438
- exports.TdCopyCodeButtonComponent = TdCopyCodeButtonComponent;
439
- exports.TdHighlightComponent = TdHighlightComponent;
440
-
441
- Object.defineProperty(exports, '__esModule', { value: true });
442
-
443
- })));
444
- //# sourceMappingURL=covalent-highlight.umd.js.map