@skyux/indicators 5.7.2 → 6.0.0-beta.2

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 (171) hide show
  1. package/documentation.json +2 -2
  2. package/esm2020/index.mjs +38 -0
  3. package/esm2020/lib/modules/alert/alert.component.mjs +56 -0
  4. package/esm2020/lib/modules/alert/alert.module.mjs +38 -0
  5. package/esm2020/lib/modules/chevron/chevron.component.mjs +62 -0
  6. package/esm2020/lib/modules/chevron/chevron.module.mjs +38 -0
  7. package/esm2020/lib/modules/expansion-indicator/expansion-indicator.component.mjs +31 -0
  8. package/esm2020/lib/modules/expansion-indicator/expansion-indicator.module.mjs +19 -0
  9. package/esm2020/lib/modules/help-inline/help-inline.component.mjs +26 -0
  10. package/esm2020/lib/modules/help-inline/help-inline.module.mjs +38 -0
  11. package/esm2020/lib/modules/icon/icon-class-list.pipe.mjs +38 -0
  12. package/esm2020/lib/modules/icon/icon-resolver.service.mjs +42 -0
  13. package/esm2020/lib/modules/icon/icon-stack-item.mjs +2 -0
  14. package/esm2020/lib/modules/icon/icon-stack.component.mjs +19 -0
  15. package/esm2020/lib/modules/icon/icon.component.mjs +32 -0
  16. package/esm2020/lib/modules/icon/icon.module.mjs +21 -0
  17. package/esm2020/lib/modules/icon/types/icon-type.mjs +2 -0
  18. package/esm2020/lib/modules/icon/types/icon-variant-type.mjs +2 -0
  19. package/esm2020/lib/modules/key-info/key-info-label.component.mjs +18 -0
  20. package/esm2020/lib/modules/key-info/key-info-value.component.mjs +18 -0
  21. package/esm2020/lib/modules/key-info/key-info.component.mjs +22 -0
  22. package/esm2020/lib/modules/key-info/key-info.module.mjs +32 -0
  23. package/esm2020/lib/modules/label/label-type.mjs +2 -0
  24. package/esm2020/lib/modules/label/label.component.mjs +34 -0
  25. package/esm2020/lib/modules/label/label.module.mjs +19 -0
  26. package/esm2020/lib/modules/shared/indicator-description-type.mjs +2 -0
  27. package/esm2020/lib/modules/shared/indicator-icon-type.mjs +2 -0
  28. package/esm2020/lib/modules/shared/indicator-icon-utility.mjs +41 -0
  29. package/esm2020/lib/modules/shared/indicator-icon.mjs +2 -0
  30. package/esm2020/lib/modules/shared/sky-indicators-resources.module.mjs +61 -0
  31. package/esm2020/lib/modules/status-indicator/status-indicator.component.mjs +94 -0
  32. package/esm2020/lib/modules/status-indicator/status-indicator.module.mjs +34 -0
  33. package/esm2020/lib/modules/text-highlight/text-highlight.directive.mjs +153 -0
  34. package/esm2020/lib/modules/text-highlight/text-highlight.module.mjs +18 -0
  35. package/esm2020/lib/modules/tokens/token.component.mjs +107 -0
  36. package/esm2020/lib/modules/tokens/tokens.component.mjs +298 -0
  37. package/esm2020/lib/modules/tokens/tokens.module.mjs +35 -0
  38. package/esm2020/lib/modules/tokens/types/token-selected-event-args.mjs +2 -0
  39. package/esm2020/lib/modules/tokens/types/token.mjs +2 -0
  40. package/esm2020/lib/modules/tokens/types/tokens-message-type.mjs +24 -0
  41. package/esm2020/lib/modules/tokens/types/tokens-message.mjs +2 -0
  42. package/esm2020/lib/modules/wait/wait-adapter.service.mjs +201 -0
  43. package/esm2020/lib/modules/wait/wait-page-adapter.service.mjs +25 -0
  44. package/esm2020/lib/modules/wait/wait-page.component.mjs +19 -0
  45. package/esm2020/lib/modules/wait/wait.component.mjs +89 -0
  46. package/esm2020/lib/modules/wait/wait.module.mjs +21 -0
  47. package/esm2020/lib/modules/wait/wait.service.mjs +164 -0
  48. package/esm2020/skyux-indicators.mjs +5 -0
  49. package/esm2020/testing/alert-fixture.mjs +67 -0
  50. package/esm2020/testing/label-fixture.mjs +40 -0
  51. package/esm2020/testing/public-api.mjs +4 -0
  52. package/esm2020/testing/skyux-indicators-testing.mjs +5 -0
  53. package/esm2020/testing/wait-fixture.mjs +24 -0
  54. package/fesm2015/{skyux-indicators-testing.js → skyux-indicators-testing.mjs} +1 -1
  55. package/fesm2015/skyux-indicators-testing.mjs.map +1 -0
  56. package/fesm2015/skyux-indicators.mjs +1830 -0
  57. package/fesm2015/skyux-indicators.mjs.map +1 -0
  58. package/fesm2020/skyux-indicators-testing.mjs +135 -0
  59. package/fesm2020/skyux-indicators-testing.mjs.map +1 -0
  60. package/{fesm2015/skyux-indicators.js → fesm2020/skyux-indicators.mjs} +126 -185
  61. package/fesm2020/skyux-indicators.mjs.map +1 -0
  62. package/package.json +39 -15
  63. package/testing/package.json +5 -5
  64. package/bundles/skyux-indicators-testing.umd.js +0 -187
  65. package/bundles/skyux-indicators.umd.js +0 -2463
  66. package/esm2015/index.js +0 -38
  67. package/esm2015/index.js.map +0 -1
  68. package/esm2015/lib/modules/alert/alert.component.js +0 -60
  69. package/esm2015/lib/modules/alert/alert.component.js.map +0 -1
  70. package/esm2015/lib/modules/alert/alert.module.js +0 -38
  71. package/esm2015/lib/modules/alert/alert.module.js.map +0 -1
  72. package/esm2015/lib/modules/chevron/chevron.component.js +0 -66
  73. package/esm2015/lib/modules/chevron/chevron.component.js.map +0 -1
  74. package/esm2015/lib/modules/chevron/chevron.module.js +0 -38
  75. package/esm2015/lib/modules/chevron/chevron.module.js.map +0 -1
  76. package/esm2015/lib/modules/expansion-indicator/expansion-indicator.component.js +0 -35
  77. package/esm2015/lib/modules/expansion-indicator/expansion-indicator.component.js.map +0 -1
  78. package/esm2015/lib/modules/expansion-indicator/expansion-indicator.module.js +0 -19
  79. package/esm2015/lib/modules/expansion-indicator/expansion-indicator.module.js.map +0 -1
  80. package/esm2015/lib/modules/help-inline/help-inline.component.js +0 -30
  81. package/esm2015/lib/modules/help-inline/help-inline.component.js.map +0 -1
  82. package/esm2015/lib/modules/help-inline/help-inline.module.js +0 -38
  83. package/esm2015/lib/modules/help-inline/help-inline.module.js.map +0 -1
  84. package/esm2015/lib/modules/icon/icon-class-list.pipe.js +0 -38
  85. package/esm2015/lib/modules/icon/icon-class-list.pipe.js.map +0 -1
  86. package/esm2015/lib/modules/icon/icon-resolver.service.js +0 -42
  87. package/esm2015/lib/modules/icon/icon-resolver.service.js.map +0 -1
  88. package/esm2015/lib/modules/icon/icon-stack-item.js +0 -2
  89. package/esm2015/lib/modules/icon/icon-stack-item.js.map +0 -1
  90. package/esm2015/lib/modules/icon/icon-stack.component.js +0 -23
  91. package/esm2015/lib/modules/icon/icon-stack.component.js.map +0 -1
  92. package/esm2015/lib/modules/icon/icon.component.js +0 -37
  93. package/esm2015/lib/modules/icon/icon.component.js.map +0 -1
  94. package/esm2015/lib/modules/icon/icon.module.js +0 -21
  95. package/esm2015/lib/modules/icon/icon.module.js.map +0 -1
  96. package/esm2015/lib/modules/icon/types/icon-type.js +0 -2
  97. package/esm2015/lib/modules/icon/types/icon-type.js.map +0 -1
  98. package/esm2015/lib/modules/icon/types/icon-variant-type.js +0 -2
  99. package/esm2015/lib/modules/icon/types/icon-variant-type.js.map +0 -1
  100. package/esm2015/lib/modules/key-info/key-info-label.component.js +0 -18
  101. package/esm2015/lib/modules/key-info/key-info-label.component.js.map +0 -1
  102. package/esm2015/lib/modules/key-info/key-info-value.component.js +0 -18
  103. package/esm2015/lib/modules/key-info/key-info-value.component.js.map +0 -1
  104. package/esm2015/lib/modules/key-info/key-info.component.js +0 -26
  105. package/esm2015/lib/modules/key-info/key-info.component.js.map +0 -1
  106. package/esm2015/lib/modules/key-info/key-info.module.js +0 -32
  107. package/esm2015/lib/modules/key-info/key-info.module.js.map +0 -1
  108. package/esm2015/lib/modules/label/label-type.js +0 -2
  109. package/esm2015/lib/modules/label/label-type.js.map +0 -1
  110. package/esm2015/lib/modules/label/label.component.js +0 -38
  111. package/esm2015/lib/modules/label/label.component.js.map +0 -1
  112. package/esm2015/lib/modules/label/label.module.js +0 -19
  113. package/esm2015/lib/modules/label/label.module.js.map +0 -1
  114. package/esm2015/lib/modules/shared/indicator-description-type.js +0 -2
  115. package/esm2015/lib/modules/shared/indicator-description-type.js.map +0 -1
  116. package/esm2015/lib/modules/shared/indicator-icon-type.js +0 -2
  117. package/esm2015/lib/modules/shared/indicator-icon-type.js.map +0 -1
  118. package/esm2015/lib/modules/shared/indicator-icon-utility.js +0 -41
  119. package/esm2015/lib/modules/shared/indicator-icon-utility.js.map +0 -1
  120. package/esm2015/lib/modules/shared/indicator-icon.js +0 -2
  121. package/esm2015/lib/modules/shared/indicator-icon.js.map +0 -1
  122. package/esm2015/lib/modules/shared/sky-indicators-resources.module.js +0 -61
  123. package/esm2015/lib/modules/shared/sky-indicators-resources.module.js.map +0 -1
  124. package/esm2015/lib/modules/status-indicator/status-indicator.component.js +0 -99
  125. package/esm2015/lib/modules/status-indicator/status-indicator.component.js.map +0 -1
  126. package/esm2015/lib/modules/status-indicator/status-indicator.module.js +0 -34
  127. package/esm2015/lib/modules/status-indicator/status-indicator.module.js.map +0 -1
  128. package/esm2015/lib/modules/text-highlight/text-highlight.directive.js +0 -153
  129. package/esm2015/lib/modules/text-highlight/text-highlight.directive.js.map +0 -1
  130. package/esm2015/lib/modules/text-highlight/text-highlight.module.js +0 -18
  131. package/esm2015/lib/modules/text-highlight/text-highlight.module.js.map +0 -1
  132. package/esm2015/lib/modules/tokens/token.component.js +0 -112
  133. package/esm2015/lib/modules/tokens/token.component.js.map +0 -1
  134. package/esm2015/lib/modules/tokens/tokens.component.js +0 -304
  135. package/esm2015/lib/modules/tokens/tokens.component.js.map +0 -1
  136. package/esm2015/lib/modules/tokens/tokens.module.js +0 -35
  137. package/esm2015/lib/modules/tokens/tokens.module.js.map +0 -1
  138. package/esm2015/lib/modules/tokens/types/token-selected-event-args.js +0 -2
  139. package/esm2015/lib/modules/tokens/types/token-selected-event-args.js.map +0 -1
  140. package/esm2015/lib/modules/tokens/types/token.js +0 -2
  141. package/esm2015/lib/modules/tokens/types/token.js.map +0 -1
  142. package/esm2015/lib/modules/tokens/types/tokens-message-type.js +0 -24
  143. package/esm2015/lib/modules/tokens/types/tokens-message-type.js.map +0 -1
  144. package/esm2015/lib/modules/tokens/types/tokens-message.js +0 -2
  145. package/esm2015/lib/modules/tokens/types/tokens-message.js.map +0 -1
  146. package/esm2015/lib/modules/wait/wait-adapter.service.js +0 -201
  147. package/esm2015/lib/modules/wait/wait-adapter.service.js.map +0 -1
  148. package/esm2015/lib/modules/wait/wait-page-adapter.service.js +0 -25
  149. package/esm2015/lib/modules/wait/wait-page-adapter.service.js.map +0 -1
  150. package/esm2015/lib/modules/wait/wait-page.component.js +0 -23
  151. package/esm2015/lib/modules/wait/wait-page.component.js.map +0 -1
  152. package/esm2015/lib/modules/wait/wait.component.js +0 -94
  153. package/esm2015/lib/modules/wait/wait.component.js.map +0 -1
  154. package/esm2015/lib/modules/wait/wait.module.js +0 -22
  155. package/esm2015/lib/modules/wait/wait.module.js.map +0 -1
  156. package/esm2015/lib/modules/wait/wait.service.js +0 -164
  157. package/esm2015/lib/modules/wait/wait.service.js.map +0 -1
  158. package/esm2015/skyux-indicators.js +0 -5
  159. package/esm2015/skyux-indicators.js.map +0 -1
  160. package/esm2015/testing/alert-fixture.js +0 -67
  161. package/esm2015/testing/alert-fixture.js.map +0 -1
  162. package/esm2015/testing/label-fixture.js +0 -40
  163. package/esm2015/testing/label-fixture.js.map +0 -1
  164. package/esm2015/testing/public-api.js +0 -4
  165. package/esm2015/testing/public-api.js.map +0 -1
  166. package/esm2015/testing/skyux-indicators-testing.js +0 -5
  167. package/esm2015/testing/skyux-indicators-testing.js.map +0 -1
  168. package/esm2015/testing/wait-fixture.js +0 -24
  169. package/esm2015/testing/wait-fixture.js.map +0 -1
  170. package/fesm2015/skyux-indicators-testing.js.map +0 -1
  171. package/fesm2015/skyux-indicators.js.map +0 -1
@@ -1,34 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { NgModule } from '@angular/core';
3
- import { SkyI18nModule } from '@skyux/i18n';
4
- import { SkyIconModule } from '../icon/icon.module';
5
- import { SkyIndicatorsResourcesModule } from '../shared/sky-indicators-resources.module';
6
- import { SkyStatusIndicatorComponent } from './status-indicator.component';
7
- import * as i0 from "@angular/core";
8
- export class SkyStatusIndicatorModule {
9
- }
10
- SkyStatusIndicatorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyStatusIndicatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
11
- SkyStatusIndicatorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyStatusIndicatorModule, declarations: [SkyStatusIndicatorComponent], imports: [CommonModule,
12
- SkyI18nModule,
13
- SkyIconModule,
14
- SkyIndicatorsResourcesModule], exports: [SkyStatusIndicatorComponent] });
15
- SkyStatusIndicatorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyStatusIndicatorModule, imports: [[
16
- CommonModule,
17
- SkyI18nModule,
18
- SkyIconModule,
19
- SkyIndicatorsResourcesModule,
20
- ]] });
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyStatusIndicatorModule, decorators: [{
22
- type: NgModule,
23
- args: [{
24
- declarations: [SkyStatusIndicatorComponent],
25
- imports: [
26
- CommonModule,
27
- SkyI18nModule,
28
- SkyIconModule,
29
- SkyIndicatorsResourcesModule,
30
- ],
31
- exports: [SkyStatusIndicatorComponent],
32
- }]
33
- }] });
34
- //# sourceMappingURL=status-indicator.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"status-indicator.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/indicators/src/lib/modules/status-indicator/status-indicator.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AAEzF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;;AAY3E,MAAM,OAAO,wBAAwB;;sHAAxB,wBAAwB;uHAAxB,wBAAwB,iBATpB,2BAA2B,aAExC,YAAY;QACZ,aAAa;QACb,aAAa;QACb,4BAA4B,aAEpB,2BAA2B;uHAE1B,wBAAwB,YAR1B;YACP,YAAY;YACZ,aAAa;YACb,aAAa;YACb,4BAA4B;SAC7B;4FAGU,wBAAwB;kBAVpC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,2BAA2B,CAAC;oBAC3C,OAAO,EAAE;wBACP,YAAY;wBACZ,aAAa;wBACb,aAAa;wBACb,4BAA4B;qBAC7B;oBACD,OAAO,EAAE,CAAC,2BAA2B,CAAC;iBACvC","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SkyI18nModule } from '@skyux/i18n';\n\nimport { SkyIconModule } from '../icon/icon.module';\nimport { SkyIndicatorsResourcesModule } from '../shared/sky-indicators-resources.module';\n\nimport { SkyStatusIndicatorComponent } from './status-indicator.component';\n\n@NgModule({\n declarations: [SkyStatusIndicatorComponent],\n imports: [\n CommonModule,\n SkyI18nModule,\n SkyIconModule,\n SkyIndicatorsResourcesModule,\n ],\n exports: [SkyStatusIndicatorComponent],\n})\nexport class SkyStatusIndicatorModule {}\n"]}
@@ -1,153 +0,0 @@
1
- import { Directive, ElementRef, Input, } from '@angular/core';
2
- import { MutationObserverService } from '@skyux/core';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "@skyux/core";
5
- const className = 'sky-highlight-mark';
6
- // Need to add the following to classes which contain static methods.
7
- // See: https://github.com/ng-packagr/ng-packagr/issues/641
8
- // @dynamic
9
- /**
10
- * Highlights all matching text within DOM elements that it is placed on.
11
- * The directive is only valid for elements that contain content, so you
12
- * cannot place it on `ng-template`, `ng-content`, or `ng-container` tags.
13
- */
14
- export class SkyTextHighlightDirective {
15
- constructor(el, observerService) {
16
- this.el = el;
17
- this.observerService = observerService;
18
- this.existingHighlight = false;
19
- }
20
- /**
21
- * Specifies the text to highlight.
22
- */
23
- set skyHighlight(value) {
24
- value = value || [];
25
- this._skyHighlight = [];
26
- if (Array.isArray(value)) {
27
- this._skyHighlight = value.filter((item) => !!item);
28
- // Reorder strings by their length in descending order to avoid missing matches
29
- // that contain substrings of other matches.
30
- this._skyHighlight.sort(function (a, b) {
31
- return b.length - a.length;
32
- });
33
- }
34
- else {
35
- this._skyHighlight = [value];
36
- }
37
- }
38
- static cleanRegex(regex) {
39
- return regex.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
40
- }
41
- static markNode(node, searchTerms) {
42
- /* istanbul ignore else */
43
- if (searchTerms) {
44
- const text = node.nodeValue;
45
- for (let i = 0; i < searchTerms.length; i++) {
46
- searchTerms[i] = this.cleanRegex(searchTerms[i]);
47
- }
48
- const searchRegex = new RegExp(searchTerms.join('|'), 'gi');
49
- const match = searchRegex.exec(text);
50
- if (match) {
51
- // Split apart text node with mark tags in the middle on the search term.
52
- const matchIndex = match.index;
53
- const middle = node.splitText(matchIndex);
54
- middle.splitText(searchRegex.lastIndex - matchIndex);
55
- const middleClone = middle.cloneNode(true);
56
- const markNode = document.createElement('mark');
57
- markNode.className = className;
58
- markNode.appendChild(middleClone);
59
- middle.parentNode.replaceChild(markNode, middle);
60
- return 1;
61
- }
62
- }
63
- return 0;
64
- }
65
- static markTextNodes(node, searchTerms) {
66
- if (node.nodeType === 3) {
67
- return SkyTextHighlightDirective.markNode(node, searchTerms);
68
- }
69
- else if (node.nodeType === 1 && node.childNodes) {
70
- for (let i = 0; i < node.childNodes.length; i++) {
71
- const childNode = node.childNodes[i];
72
- i += SkyTextHighlightDirective.markTextNodes(childNode, searchTerms);
73
- }
74
- }
75
- return 0;
76
- }
77
- static removeHighlight(el) {
78
- const matchedElements = el.nativeElement.querySelectorAll(`mark.${className}`);
79
- /* istanbul ignore else */
80
- /* sanity check */
81
- if (matchedElements) {
82
- for (let i = 0; i < matchedElements.length; i++) {
83
- const node = matchedElements[i];
84
- const parentNode = node.parentNode;
85
- parentNode.replaceChild(node.firstChild, node);
86
- parentNode.normalize();
87
- }
88
- }
89
- }
90
- ngOnChanges(changes) {
91
- if (changes.skyHighlight && !changes.skyHighlight.firstChange) {
92
- this.highlight();
93
- }
94
- }
95
- ngAfterViewInit() {
96
- this.observer = this.observerService.create(() => {
97
- this.highlight();
98
- });
99
- this.observeDom();
100
- if (this._skyHighlight && this._skyHighlight.length > 0) {
101
- this.highlight();
102
- }
103
- }
104
- ngOnDestroy() {
105
- /* istanbul ignore else */
106
- if (this.observer) {
107
- this.observer.disconnect();
108
- }
109
- }
110
- readyForHighlight(searchText) {
111
- return searchText && searchText.length > 0 && this.el.nativeElement;
112
- }
113
- highlight() {
114
- /* istanbul ignore else */
115
- if (this.observer) {
116
- this.observer.disconnect();
117
- }
118
- const searchText = this._skyHighlight;
119
- if (this.existingHighlight) {
120
- SkyTextHighlightDirective.removeHighlight(this.el);
121
- }
122
- /* istanbul ignore else */
123
- if (this.readyForHighlight(searchText)) {
124
- const node = this.el.nativeElement;
125
- // mark all matched text in the DOM
126
- SkyTextHighlightDirective.markTextNodes(node, searchText);
127
- this.existingHighlight = true;
128
- }
129
- this.observeDom();
130
- }
131
- observeDom() {
132
- /* istanbul ignore else */
133
- if (this.observer) {
134
- const config = {
135
- attributes: false,
136
- childList: true,
137
- characterData: true,
138
- };
139
- this.observer.observe(this.el.nativeElement, config);
140
- }
141
- }
142
- }
143
- SkyTextHighlightDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyTextHighlightDirective, deps: [{ token: i0.ElementRef }, { token: i1.MutationObserverService }], target: i0.ɵɵFactoryTarget.Directive });
144
- SkyTextHighlightDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyTextHighlightDirective, selector: "[skyHighlight]", inputs: { skyHighlight: "skyHighlight" }, usesOnChanges: true, ngImport: i0 });
145
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyTextHighlightDirective, decorators: [{
146
- type: Directive,
147
- args: [{
148
- selector: '[skyHighlight]',
149
- }]
150
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.MutationObserverService }]; }, propDecorators: { skyHighlight: [{
151
- type: Input
152
- }] } });
153
- //# sourceMappingURL=text-highlight.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"text-highlight.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/indicators/src/lib/modules/text-highlight/text-highlight.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,UAAU,EACV,KAAK,GAIN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;;;AAEtD,MAAM,SAAS,GAAG,oBAAoB,CAAC;AAEvC,qEAAqE;AACrE,2DAA2D;AAC3D,WAAW;AACX;;;;GAIG;AAIH,MAAM,OAAO,yBAAyB;IA6BpC,YACU,EAAc,EACd,eAAwC;QADxC,OAAE,GAAF,EAAE,CAAY;QACd,oBAAe,GAAf,eAAe,CAAyB;QAR1C,sBAAiB,GAAG,KAAK,CAAC;IAS/B,CAAC;IA7BJ;;OAEG;IACH,IACW,YAAY,CAAC,KAAwB;QAC9C,KAAK,GAAG,KAAK,IAAI,EAAE,CAAC;QACpB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QAExB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACxB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACpD,+EAA+E;YAC/E,4CAA4C;YAC5C,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;gBACpC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;YAC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AC/B;QAED,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAEO,UAAU;QAChB,0BAA0B;QAC1B,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,MAAM,MAAM,GAAG;gBACb,UAAU,EAAE,KAAK;gBACjB,SAAS,EAAE,IAAI;gBACf,aAAa,EAAE,IAAI;aACpB,CAAC;YACF,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;SACtD;IACH,CAAC;;uHAlKU,yBAAyB;2GAAzB,yBAAyB;4FAAzB,yBAAyB;kBAHrC,SAAS;mBAAC;oBACT,QAAQ,EAAE,gBAAgB;iBAC3B;uIAQY,YAAY;sBADtB,KAAK","sourcesContent":["import {\n AfterViewInit,\n Directive,\n ElementRef,\n Input,\n OnChanges,\n OnDestroy,\n SimpleChanges,\n} from '@angular/core';\nimport { MutationObserverService } from '@skyux/core';\n\nconst className = 'sky-highlight-mark';\n\n// Need to add the following to classes which contain static methods.\n// See: https://github.com/ng-packagr/ng-packagr/issues/641\n// @dynamic\n/**\n * Highlights all matching text within DOM elements that it is placed on.\n * The directive is only valid for elements that contain content, so you\n * cannot place it on `ng-template`, `ng-content`, or `ng-container` tags.\n */\n@Directive({\n selector: '[skyHighlight]',\n})\nexport class SkyTextHighlightDirective\n implements OnChanges, AfterViewInit, OnDestroy\n{\n /**\n * Specifies the text to highlight.\n */\n @Input()\n public set skyHighlight(value: string | string[]) {\n value = value || [];\n this._skyHighlight = [];\n\n if (Array.isArray(value)) {\n this._skyHighlight = value.filter((item) => !!item);\n // Reorder strings by their length in descending order to avoid missing matches\n // that contain substrings of other matches.\n this._skyHighlight.sort(function (a, b) {\n return b.length - a.length;\n });\n } else {\n this._skyHighlight = [value as string];\n }\n }\n\n private existingHighlight = false;\n\n private observer: MutationObserver;\n\n private _skyHighlight: string[];\n\n constructor(\n private el: ElementRef,\n private observerService: MutationObserverService\n ) {}\n\n private static cleanRegex(regex: string): string {\n return regex.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n private static markNode(node: any, searchTerms: string[]): number {\n /* istanbul ignore else */\n if (searchTerms) {\n const text = node.nodeValue;\n for (let i = 0; i < searchTerms.length; i++) {\n searchTerms[i] = this.cleanRegex(searchTerms[i]);\n }\n const searchRegex = new RegExp(searchTerms.join('|'), 'gi');\n const match = searchRegex.exec(text);\n if (match) {\n // Split apart text node with mark tags in the middle on the search term.\n const matchIndex = match.index;\n\n const middle = node.splitText(matchIndex);\n middle.splitText(searchRegex.lastIndex - matchIndex);\n const middleClone = middle.cloneNode(true);\n\n const markNode = document.createElement('mark');\n markNode.className = className;\n markNode.appendChild(middleClone);\n middle.parentNode.replaceChild(markNode, middle);\n\n return 1;\n }\n }\n return 0;\n }\n\n private static markTextNodes(\n node: HTMLElement,\n searchTerms: string[]\n ): number {\n if (node.nodeType === 3) {\n return SkyTextHighlightDirective.markNode(node, searchTerms);\n } else if (node.nodeType === 1 && node.childNodes) {\n for (let i = 0; i < node.childNodes.length; i++) {\n const childNode = node.childNodes[i] as HTMLElement;\n i += SkyTextHighlightDirective.markTextNodes(childNode, searchTerms);\n }\n }\n\n return 0;\n }\n\n private static removeHighlight(el: ElementRef): void {\n const matchedElements = el.nativeElement.querySelectorAll(\n `mark.${className}`\n ) as NodeList;\n\n /* istanbul ignore else */\n /* sanity check */\n if (matchedElements) {\n for (let i = 0; i < matchedElements.length; i++) {\n const node = matchedElements[i];\n const parentNode = node.parentNode;\n\n parentNode.replaceChild(node.firstChild, node);\n parentNode.normalize();\n }\n }\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes.skyHighlight && !changes.skyHighlight.firstChange) {\n this.highlight();\n }\n }\n\n public ngAfterViewInit(): void {\n this.observer = this.observerService.create(() => {\n this.highlight();\n });\n\n this.observeDom();\n if (this._skyHighlight && this._skyHighlight.length > 0) {\n this.highlight();\n }\n }\n\n public ngOnDestroy(): void {\n /* istanbul ignore else */\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n private readyForHighlight(searchText: string[]): boolean {\n return searchText && searchText.length > 0 && this.el.nativeElement;\n }\n\n private highlight(): void {\n /* istanbul ignore else */\n if (this.observer) {\n this.observer.disconnect();\n }\n\n const searchText = this._skyHighlight;\n\n if (this.existingHighlight) {\n SkyTextHighlightDirective.removeHighlight(this.el);\n }\n\n /* istanbul ignore else */\n if (this.readyForHighlight(searchText)) {\n const node: HTMLElement = this.el.nativeElement;\n\n // mark all matched text in the DOM\n SkyTextHighlightDirective.markTextNodes(node, searchText);\n this.existingHighlight = true;\n }\n\n this.observeDom();\n }\n\n private observeDom(): void {\n /* istanbul ignore else */\n if (this.observer) {\n const config = {\n attributes: false,\n childList: true,\n characterData: true,\n };\n this.observer.observe(this.el.nativeElement, config);\n }\n }\n}\n"]}
@@ -1,18 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { MutationObserverService } from '@skyux/core';
3
- import { SkyTextHighlightDirective } from './text-highlight.directive';
4
- import * as i0 from "@angular/core";
5
- export class SkyTextHighlightModule {
6
- }
7
- SkyTextHighlightModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyTextHighlightModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
8
- SkyTextHighlightModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyTextHighlightModule, declarations: [SkyTextHighlightDirective], exports: [SkyTextHighlightDirective] });
9
- SkyTextHighlightModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyTextHighlightModule, providers: [MutationObserverService] });
10
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyTextHighlightModule, decorators: [{
11
- type: NgModule,
12
- args: [{
13
- declarations: [SkyTextHighlightDirective],
14
- exports: [SkyTextHighlightDirective],
15
- providers: [MutationObserverService],
16
- }]
17
- }] });
18
- //# sourceMappingURL=text-highlight.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"text-highlight.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/indicators/src/lib/modules/text-highlight/text-highlight.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;;AAOvE,MAAM,OAAO,sBAAsB;;oHAAtB,sBAAsB;qHAAtB,sBAAsB,iBAJlB,yBAAyB,aAC9B,yBAAyB;qHAGxB,sBAAsB,aAFtB,CAAC,uBAAuB,CAAC;4FAEzB,sBAAsB;kBALlC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,yBAAyB,CAAC;oBACzC,OAAO,EAAE,CAAC,yBAAyB,CAAC;oBACpC,SAAS,EAAE,CAAC,uBAAuB,CAAC;iBACrC","sourcesContent":["import { NgModule } from '@angular/core';\nimport { MutationObserverService } from '@skyux/core';\n\nimport { SkyTextHighlightDirective } from './text-highlight.directive';\n\n@NgModule({\n declarations: [SkyTextHighlightDirective],\n exports: [SkyTextHighlightDirective],\n providers: [MutationObserverService],\n})\nexport class SkyTextHighlightModule {}\n"]}
@@ -1,112 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, } from '@angular/core';
2
- import { SkyLibResourcesService } from '@skyux/i18n';
3
- import * as i0 from "@angular/core";
4
- import * as i1 from "@skyux/i18n";
5
- import * as i2 from "../icon/icon.component";
6
- import * as i3 from "@angular/common";
7
- export class SkyTokenComponent {
8
- constructor(elementRef, resourcesService) {
9
- this.elementRef = elementRef;
10
- this.resourcesService = resourcesService;
11
- /**
12
- * Fires when users click the close button or press the `Backspace` key to dismiss the token.
13
- */
14
- this.dismiss = new EventEmitter();
15
- /**
16
- * Fires when users place focus on the token by navigating to it with the `Tab` key.
17
- */
18
- this.tokenFocus = new EventEmitter();
19
- }
20
- /**
21
- * Indicates whether to disable the token to prevent users from selecting it, dismissing it,
22
- * or navigating to it with the arrow keys. When the token is disabled,
23
- * users can still place focus on it using the `Tab` key.
24
- * @default true
25
- */
26
- set disabled(value) {
27
- this._disabled = value;
28
- }
29
- get disabled() {
30
- return !!this._disabled;
31
- }
32
- /**
33
- * Specifies an ARIA label for the token's close button. This sets the button's `aria-label`
34
- * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).
35
- * @default "Remove item"
36
- */
37
- set ariaLabel(value) {
38
- this._ariaLabel = value;
39
- }
40
- get ariaLabel() {
41
- return (this._ariaLabel || this.getString('skyux_tokens_dismiss_button_title'));
42
- }
43
- /**
44
- * Indicates whether users can remove the token from the list by selecting the close button
45
- * or pressing the `Backspace` key.
46
- * @default true
47
- */
48
- set dismissible(value) {
49
- this._dismissible = value;
50
- }
51
- get dismissible() {
52
- return this._dismissible !== false;
53
- }
54
- /**
55
- * Indicates whether users can press the `Tab` key to place focus on the token. This does not
56
- * affect the ability to select the token, dismiss it, or navigate to it with the arrow keys.
57
- * @default true
58
- */
59
- set focusable(value) {
60
- this._focusable = value;
61
- }
62
- get focusable() {
63
- return this._focusable !== false;
64
- }
65
- /**
66
- * @internal
67
- */
68
- get tabIndex() {
69
- return this.focusable ? 0 : -1;
70
- }
71
- dismissToken(event) {
72
- event.stopPropagation();
73
- this.dismiss.emit();
74
- }
75
- focusElement() {
76
- this.elementRef.nativeElement.querySelector('.sky-token').focus();
77
- }
78
- setTokenActive(tokenActive) {
79
- this.tokenActive = tokenActive;
80
- }
81
- setCloseActive(closeActive) {
82
- this.closeActive = closeActive;
83
- }
84
- getString(key) {
85
- // TODO: Need to implement the async `getString` method in a breaking change.
86
- return this.resourcesService.getStringForLocale({ locale: 'en-US' }, key);
87
- }
88
- }
89
- SkyTokenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyTokenComponent, deps: [{ token: i0.ElementRef }, { token: i1.SkyLibResourcesService }], target: i0.ɵɵFactoryTarget.Component });
90
- SkyTokenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyTokenComponent, selector: "sky-token", inputs: { disabled: "disabled", ariaLabel: "ariaLabel", dismissible: "dismissible", focusable: "focusable" }, outputs: { dismiss: "dismiss", tokenFocus: "tokenFocus" }, ngImport: i0, template: "<div\n class=\"sky-token sky-btn sky-btn-default\"\n role=\"button\"\n [attr.aria-disabled]=\"disabled\"\n [attr.tabindex]=\"tabIndex\"\n [ngClass]=\"{\n 'sky-btn-disabled': disabled,\n 'sky-token-dismissable': dismissible,\n 'sky-token-active': tokenActive && !closeActive\n }\"\n (document:mouseup)=\"setTokenActive(false)\"\n (focus)=\"tokenFocus.emit()\"\n (mousedown)=\"setTokenActive(true)\"\n>\n <ng-content></ng-content>\n <button\n *ngIf=\"dismissible\"\n class=\"sky-btn sky-token-btn-close\"\n type=\"button\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.tabindex]=\"tabIndex\"\n [attr.title]=\"ariaLabel\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'sky-token-btn-close-active': closeActive\n }\"\n (click)=\"dismissToken($event)\"\n (document:mouseup)=\"setCloseActive(false)\"\n (mousedown)=\"setCloseActive(true)\"\n >\n <sky-icon class=\"sky-token-btn-close-icon-default\" icon=\"times\"></sky-icon>\n <sky-icon\n class=\"sky-token-btn-close-icon-modern\"\n icon=\"close\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n</div>\n", styles: [".sky-token{background-color:#c1e8fb;border:1px solid #00b4f1;overflow:hidden;padding:2px 8px;display:inline-block;-webkit-user-select:none;user-select:none}.sky-token:hover,.sky-token:focus{background-color:#91d6f8;border-color:#008ebe;cursor:pointer}.sky-token:focus{box-shadow:0 0 8px #00b4f199;border:1px solid #00b4f1;outline:none}.sky-btn-disabled{cursor:default;-webkit-user-select:none;user-select:none}.sky-token-btn-close{background:transparent;padding:0;border:0;margin-left:2px;opacity:.9}.sky-token-btn-close:hover,.sky-token-btn-close:focus{opacity:1}.sky-token-btn-close-icon-modern{display:none}:host-context(.sky-theme-modern) .sky-token{align-items:center;display:inline-flex;padding:1px 5px;font-size:14px}:host-context(.sky-theme-modern) .sky-token.sky-btn-disabled{color:#212327}:host-context(.sky-theme-modern) .sky-token:not(.sky-btn-disabled){border:none;box-shadow:inset 0 0 0 1px #81d4f7}:host-context(.sky-theme-modern) .sky-token.sky-token-dismissable{padding-right:1px}:host-context(.sky-theme-modern) .sky-token:hover:not(:active){border:none;box-shadow:inset 0 0 0 1px #1870b8}:host-context(.sky-theme-modern) .sky-token.sky-token-active{border:none;box-shadow:inset 0 0 0 2px #1870b8}:host-context(.sky-theme-modern) .sky-token:focus:not(:active){border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 3px #0000004d}:host-context(.sky-theme-modern) .sky-token:focus,:host-context(.sky-theme-modern) .sky-token:hover{background-color:#c1e8fb}:host-context(.sky-theme-modern) .sky-token-btn-close{align-items:center;border-radius:5px;display:flex;height:20px;margin-left:5px;width:20px}:host-context(.sky-theme-modern) .sky-token-btn-close:hover{border:none;box-shadow:inset 0 0 0 1px transparent}:host-context(.sky-theme-modern) .sky-token-btn-close.sky-token-btn-close-active{border:none;box-shadow:inset 0 0 0 2px #1870b8}:host-context(.sky-theme-modern) .sky-token-btn-close:focus{outline:none}:host-context(.sky-theme-modern) .sky-token-btn-close:focus:not(:active){border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 3px #0000004d}:host-context(.sky-theme-modern) .sky-token-btn-close-icon-default{display:none}:host-context(.sky-theme-modern) .sky-token-btn-close-icon-modern{display:inline-block;width:100%}.sky-theme-modern .sky-token{align-items:center;display:inline-flex;padding:1px 5px;font-size:14px}.sky-theme-modern .sky-token.sky-btn-disabled{color:#212327}.sky-theme-modern .sky-token:not(.sky-btn-disabled){border:none;box-shadow:inset 0 0 0 1px #81d4f7}.sky-theme-modern .sky-token.sky-token-dismissable{padding-right:1px}.sky-theme-modern .sky-token:hover:not(:active){border:none;box-shadow:inset 0 0 0 1px #1870b8}.sky-theme-modern .sky-token.sky-token-active{border:none;box-shadow:inset 0 0 0 2px #1870b8}.sky-theme-modern .sky-token:focus:not(:active){border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 3px #0000004d}.sky-theme-modern .sky-token:focus,.sky-theme-modern .sky-token:hover{background-color:#c1e8fb}.sky-theme-modern .sky-token-btn-close{align-items:center;border-radius:5px;display:flex;height:20px;margin-left:5px;width:20px}.sky-theme-modern .sky-token-btn-close:hover{border:none;box-shadow:inset 0 0 0 1px transparent}.sky-theme-modern .sky-token-btn-close.sky-token-btn-close-active{border:none;box-shadow:inset 0 0 0 2px #1870b8}.sky-theme-modern .sky-token-btn-close:focus{outline:none}.sky-theme-modern .sky-token-btn-close:focus:not(:active){border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 3px #0000004d}.sky-theme-modern .sky-token-btn-close-icon-default{display:none}.sky-theme-modern .sky-token-btn-close-icon-modern{display:inline-block;width:100%}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-token{background-color:#c1e8fb}:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-token,:host-context(.sky-theme-modern.sky-theme-mode-dark) .sky-token-btn-close{color:#212327}.sky-theme-modern.sky-theme-mode-dark .sky-token{background-color:#c1e8fb}.sky-theme-modern.sky-theme-mode-dark .sky-token,.sky-theme-modern.sky-theme-mode-dark .sky-token-btn-close{color:#212327}\n"], components: [{ type: i2.SkyIconComponent, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
91
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyTokenComponent, decorators: [{
92
- type: Component,
93
- args: [{
94
- selector: 'sky-token',
95
- templateUrl: './token.component.html',
96
- styleUrls: ['./token.component.scss'],
97
- changeDetection: ChangeDetectionStrategy.OnPush,
98
- }]
99
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.SkyLibResourcesService }]; }, propDecorators: { disabled: [{
100
- type: Input
101
- }], ariaLabel: [{
102
- type: Input
103
- }], dismissible: [{
104
- type: Input
105
- }], focusable: [{
106
- type: Input
107
- }], dismiss: [{
108
- type: Output
109
- }], tokenFocus: [{
110
- type: Output
111
- }] } });
112
- //# sourceMappingURL=token.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/indicators/src/lib/modules/tokens/token.component.ts","../../../../../../../../libs/components/indicators/src/lib/modules/tokens/token.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;;;;;AAQrD,MAAM,OAAO,iBAAiB;IA8F5B,YACU,UAAsB,EACtB,gBAAwC;QADxC,eAAU,GAAV,UAAU,CAAY;QACtB,qBAAgB,GAAhB,gBAAgB,CAAwB;QApClD;;WAEG;QAEI,YAAO,GAAG,IAAI,YAAY,EAAQ,CAAC;QAE1C;;WAEG;QAEI,eAAU,GAAG,IAAI,YAAY,EAAQ,CAAC;IA2B1C,CAAC;IAhGJ;;;;;OAKG;IACH,IACW,QAAQ,CAAC,KAAc;QAChC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED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C,CAAC;IAC5E,CAAC;;+GAvHU,iBAAiB;mGAAjB,iBAAiB,0NChB9B,mnCAuCA;4FDvBa,iBAAiB;kBAN7B,SAAS;mBAAC;oBACT,QAAQ,EAAE,WAAW;oBACrB,WAAW,EAAE,wBAAwB;oBACrC,SAAS,EAAE,CAAC,wBAAwB,CAAC;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;sIASY,QAAQ;sBADlB,KAAK;gBAeK,SAAS;sBADnB,KAAK;gBAiBK,WAAW;sBADrB,KAAK;gBAeK,SAAS;sBADnB,KAAK;gBAaC,OAAO;sBADb,MAAM;gBAOA,UAAU;sBADhB,MAAM","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\n@Component({\n selector: 'sky-token',\n templateUrl: './token.component.html',\n styleUrls: ['./token.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyTokenComponent {\n /**\n * Indicates whether to disable the token to prevent users from selecting it, dismissing it,\n * or navigating to it with the arrow keys. When the token is disabled,\n * users can still place focus on it using the `Tab` key.\n * @default true\n */\n @Input()\n public set disabled(value: boolean) {\n this._disabled = value;\n }\n\n public get disabled(): boolean {\n return !!this._disabled;\n }\n\n /**\n * Specifies an ARIA label for the token's close button. This sets the button's `aria-label`\n * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).\n * @default \"Remove item\"\n */\n @Input()\n public set ariaLabel(value: string) {\n this._ariaLabel = value;\n }\n\n public get ariaLabel(): string {\n return (\n this._ariaLabel || this.getString('skyux_tokens_dismiss_button_title')\n );\n }\n\n /**\n * Indicates whether users can remove the token from the list by selecting the close button\n * or pressing the `Backspace` key.\n * @default true\n */\n @Input()\n public set dismissible(value: boolean) {\n this._dismissible = value;\n }\n\n public get dismissible(): boolean {\n return this._dismissible !== false;\n }\n\n /**\n * Indicates whether users can press the `Tab` key to place focus on the token. This does not\n * affect the ability to select the token, dismiss it, or navigate to it with the arrow keys.\n * @default true\n */\n @Input()\n public set focusable(value: boolean) {\n this._focusable = value;\n }\n\n public get focusable(): boolean {\n return this._focusable !== false;\n }\n\n /**\n * Fires when users click the close button or press the `Backspace` key to dismiss the token.\n */\n @Output()\n public dismiss = new EventEmitter<void>();\n\n /**\n * Fires when users place focus on the token by navigating to it with the `Tab` key.\n */\n @Output()\n public tokenFocus = new EventEmitter<void>();\n\n /**\n * @internal\n */\n public get tabIndex(): number | boolean {\n return this.focusable ? 0 : -1;\n }\n\n /**\n * @internal\n */\n public tokenActive: boolean;\n\n /**\n * @internal\n */\n public closeActive: boolean;\n\n private _ariaLabel: string;\n private _disabled: boolean;\n private _dismissible: boolean;\n private _focusable: boolean;\n\n constructor(\n private elementRef: ElementRef,\n private resourcesService: SkyLibResourcesService\n ) {}\n\n public dismissToken(event: Event): void {\n event.stopPropagation();\n this.dismiss.emit();\n }\n\n public focusElement(): void {\n this.elementRef.nativeElement.querySelector('.sky-token').focus();\n }\n\n public setTokenActive(tokenActive: boolean): void {\n this.tokenActive = tokenActive;\n }\n\n public setCloseActive(closeActive: boolean): void {\n this.closeActive = closeActive;\n }\n\n private getString(key: string): string {\n // TODO: Need to implement the async `getString` method in a breaking change.\n return this.resourcesService.getStringForLocale({ locale: 'en-US' }, key);\n }\n}\n","<div\n class=\"sky-token sky-btn sky-btn-default\"\n role=\"button\"\n [attr.aria-disabled]=\"disabled\"\n [attr.tabindex]=\"tabIndex\"\n [ngClass]=\"{\n 'sky-btn-disabled': disabled,\n 'sky-token-dismissable': dismissible,\n 'sky-token-active': tokenActive && !closeActive\n }\"\n (document:mouseup)=\"setTokenActive(false)\"\n (focus)=\"tokenFocus.emit()\"\n (mousedown)=\"setTokenActive(true)\"\n>\n <ng-content></ng-content>\n <button\n *ngIf=\"dismissible\"\n class=\"sky-btn sky-token-btn-close\"\n type=\"button\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.tabindex]=\"tabIndex\"\n [attr.title]=\"ariaLabel\"\n [disabled]=\"disabled\"\n [ngClass]=\"{\n 'sky-token-btn-close-active': closeActive\n }\"\n (click)=\"dismissToken($event)\"\n (document:mouseup)=\"setCloseActive(false)\"\n (mousedown)=\"setCloseActive(true)\"\n >\n <sky-icon class=\"sky-token-btn-close-icon-default\" icon=\"times\"></sky-icon>\n <sky-icon\n class=\"sky-token-btn-close-icon-modern\"\n icon=\"close\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </button>\n</div>\n"]}