cps-ui-kit 0.0.1

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 (143) hide show
  1. package/README.md +24 -0
  2. package/assets/icons/absa-logo.svg +12 -0
  3. package/assets/icons/access-denied.svg +12 -0
  4. package/assets/icons/access-menu.svg +11 -0
  5. package/assets/icons/access-unlock.svg +19 -0
  6. package/assets/icons/access.svg +9 -0
  7. package/assets/icons/add-domain.svg +8 -0
  8. package/assets/icons/add.svg +7 -0
  9. package/assets/icons/avatar-top-menu.svg +13 -0
  10. package/assets/icons/avatar.svg +8 -0
  11. package/assets/icons/bell.svg +7 -0
  12. package/assets/icons/book.svg +7 -0
  13. package/assets/icons/bookmark.svg +6 -0
  14. package/assets/icons/briefcase.svg +12 -0
  15. package/assets/icons/browse.svg +9 -0
  16. package/assets/icons/burger-arrow.svg +7 -0
  17. package/assets/icons/caret-down.svg +6 -0
  18. package/assets/icons/change.svg +6 -0
  19. package/assets/icons/checked.svg +15 -0
  20. package/assets/icons/chevron-down-2.svg +8 -0
  21. package/assets/icons/chevron-down.svg +6 -0
  22. package/assets/icons/circle.svg +6 -0
  23. package/assets/icons/close-x-2.svg +6 -0
  24. package/assets/icons/close-x.svg +8 -0
  25. package/assets/icons/community.svg +12 -0
  26. package/assets/icons/construction.svg +10 -0
  27. package/assets/icons/controls.svg +29 -0
  28. package/assets/icons/csv.svg +9 -0
  29. package/assets/icons/cub.svg +6 -0
  30. package/assets/icons/database.svg +12 -0
  31. package/assets/icons/datepicker.svg +8 -0
  32. package/assets/icons/delete.svg +6 -0
  33. package/assets/icons/dislike.svg +13 -0
  34. package/assets/icons/dots.svg +6 -0
  35. package/assets/icons/download.svg +12 -0
  36. package/assets/icons/dq.svg +24 -0
  37. package/assets/icons/dropdown-menu.svg +8 -0
  38. package/assets/icons/edit.svg +9 -0
  39. package/assets/icons/expand.svg +9 -0
  40. package/assets/icons/export.svg +6 -0
  41. package/assets/icons/eye.svg +8 -0
  42. package/assets/icons/filter.svg +8 -0
  43. package/assets/icons/filter_2.svg +11 -0
  44. package/assets/icons/follow.svg +13 -0
  45. package/assets/icons/glossary.svg +16 -0
  46. package/assets/icons/graph.svg +27 -0
  47. package/assets/icons/grid-view.svg +6 -0
  48. package/assets/icons/grid.svg +9 -0
  49. package/assets/icons/health.svg +6 -0
  50. package/assets/icons/heart.svg +6 -0
  51. package/assets/icons/help-circle.svg +7 -0
  52. package/assets/icons/home.svg +21 -0
  53. package/assets/icons/insight.svg +9 -0
  54. package/assets/icons/issues.svg +7 -0
  55. package/assets/icons/jpeg.svg +8 -0
  56. package/assets/icons/kris.svg +28 -0
  57. package/assets/icons/last-seen-product.svg +8 -0
  58. package/assets/icons/like.svg +7 -0
  59. package/assets/icons/line-vertical.svg +39 -0
  60. package/assets/icons/lock.svg +7 -0
  61. package/assets/icons/logout.svg +16 -0
  62. package/assets/icons/menu-expand.svg +17 -0
  63. package/assets/icons/minus.svg +10 -0
  64. package/assets/icons/multiple_users.svg +8 -0
  65. package/assets/icons/open.svg +7 -0
  66. package/assets/icons/path.svg +7 -0
  67. package/assets/icons/pdf.svg +9 -0
  68. package/assets/icons/plus.svg +6 -0
  69. package/assets/icons/projects.svg +10 -0
  70. package/assets/icons/question.svg +13 -0
  71. package/assets/icons/questions.svg +23 -0
  72. package/assets/icons/rectangle-rounded.svg +7 -0
  73. package/assets/icons/refresh-browse.svg +6 -0
  74. package/assets/icons/remove.svg +9 -0
  75. package/assets/icons/right.svg +7 -0
  76. package/assets/icons/schema_filter.svg +7 -0
  77. package/assets/icons/search.svg +9 -0
  78. package/assets/icons/settings.svg +9 -0
  79. package/assets/icons/sliders.svg +13 -0
  80. package/assets/icons/smart.svg +7 -0
  81. package/assets/icons/star.svg +6 -0
  82. package/assets/icons/stepper-completed.svg +6 -0
  83. package/assets/icons/success.svg +8 -0
  84. package/assets/icons/suggestion.svg +7 -0
  85. package/assets/icons/survivorship.svg +25 -0
  86. package/assets/icons/table-row-error.svg +6 -0
  87. package/assets/icons/table-row-success.svg +7 -0
  88. package/assets/icons/table-row-warning.svg +9 -0
  89. package/assets/icons/toast-error.svg +12 -0
  90. package/assets/icons/toast-info.svg +12 -0
  91. package/assets/icons/toast-success.svg +7 -0
  92. package/assets/icons/toast-warning.svg +12 -0
  93. package/assets/icons/tools.svg +18 -0
  94. package/assets/icons/user.svg +7 -0
  95. package/assets/icons/users.svg +10 -0
  96. package/assets/icons/vector-down.svg +7 -0
  97. package/assets/icons/vector-right.svg +6 -0
  98. package/assets/icons/vector-up.svg +7 -0
  99. package/assets/icons/vector.svg +7 -0
  100. package/assets/icons/wallet.svg +10 -0
  101. package/assets/icons/warning-circle.svg +12 -0
  102. package/assets/icons/warning.svg +7 -0
  103. package/assets/icons/widget-button-icon.svg +9 -0
  104. package/assets/icons/xls.svg +9 -0
  105. package/esm2020/cps-ui-kit.mjs +5 -0
  106. package/esm2020/lib/components/cps-button/cps-button.component.mjs +136 -0
  107. package/esm2020/lib/components/cps-checkbox/cps-checkbox.component.mjs +73 -0
  108. package/esm2020/lib/components/cps-chip/cps-chip.component.mjs +58 -0
  109. package/esm2020/lib/components/cps-icon/cps-icon.component.mjs +163 -0
  110. package/esm2020/lib/components/cps-input/cps-input.component.mjs +168 -0
  111. package/esm2020/lib/components/cps-radio/cps-radio.component.mjs +76 -0
  112. package/esm2020/lib/components/cps-select/cps-select.component.mjs +302 -0
  113. package/esm2020/lib/components/cps-tag/cps-tag.component.mjs +103 -0
  114. package/esm2020/lib/directives/click-outside.directive.mjs +32 -0
  115. package/esm2020/lib/pipes/combine-labels.pipe.mjs +24 -0
  116. package/esm2020/lib/pipes/label-by-value.pipe.mjs +15 -0
  117. package/esm2020/lib/utils/colors-utils.mjs +55 -0
  118. package/esm2020/lib/utils/size-utils.mjs +22 -0
  119. package/esm2020/public-api.mjs +12 -0
  120. package/fesm2015/cps-ui-kit.mjs +1210 -0
  121. package/fesm2015/cps-ui-kit.mjs.map +1 -0
  122. package/fesm2020/cps-ui-kit.mjs +1184 -0
  123. package/fesm2020/cps-ui-kit.mjs.map +1 -0
  124. package/index.d.ts +5 -0
  125. package/lib/components/cps-button/cps-button.component.d.ts +28 -0
  126. package/lib/components/cps-checkbox/cps-checkbox.component.d.ts +25 -0
  127. package/lib/components/cps-chip/cps-chip.component.d.ts +16 -0
  128. package/lib/components/cps-icon/cps-icon.component.d.ts +18 -0
  129. package/lib/components/cps-input/cps-input.component.d.ts +50 -0
  130. package/lib/components/cps-radio/cps-radio.component.d.ts +30 -0
  131. package/lib/components/cps-select/cps-select.component.d.ts +54 -0
  132. package/lib/components/cps-tag/cps-tag.component.d.ts +29 -0
  133. package/lib/directives/click-outside.directive.d.ts +10 -0
  134. package/lib/pipes/combine-labels.pipe.d.ts +7 -0
  135. package/lib/pipes/label-by-value.pipe.d.ts +7 -0
  136. package/lib/utils/colors-utils.d.ts +6 -0
  137. package/lib/utils/size-utils.d.ts +5 -0
  138. package/package.json +40 -0
  139. package/public-api.d.ts +8 -0
  140. package/styles/_colors.scss +456 -0
  141. package/styles/_variables.scss +1 -0
  142. package/styles/bootstrap-grid.css +4071 -0
  143. package/styles/styles.scss +2 -0
@@ -0,0 +1,1210 @@
1
+ import * as i2 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { Component, Input, EventEmitter, Self, Optional, Output, ViewChild, Directive, HostListener, Pipe, HostBinding } from '@angular/core';
5
+ import { Subscription } from 'rxjs';
6
+ import * as i1 from '@angular/forms';
7
+ import { FormsModule } from '@angular/forms';
8
+
9
+ const isSameDomain = (styleSheet) => {
10
+ if (!styleSheet.href) {
11
+ return true;
12
+ }
13
+ return styleSheet.href.indexOf(window.location.origin) === 0;
14
+ };
15
+ const isStyleRule = (rule) => rule.type === 1;
16
+ const isValidCSSColor = (val) => {
17
+ if (val === 'currentColor')
18
+ return true;
19
+ const element = document.createElement('div');
20
+ element.style.backgroundColor = val;
21
+ return element && element.style.backgroundColor !== '';
22
+ };
23
+ const isDark = (color) => {
24
+ let r = 0;
25
+ let g = 0;
26
+ let b = 0;
27
+ if (color.match(/^rgb/)) {
28
+ const colorMatched = color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);
29
+ r = colorMatched[1];
30
+ g = colorMatched[2];
31
+ b = colorMatched[3];
32
+ }
33
+ else {
34
+ const colorNum = +('0x' + color.slice(1).replace(color.length < 5 && /./g, '$&$&'));
35
+ r = colorNum >> 16;
36
+ g = (colorNum >> 8) & 255;
37
+ b = colorNum & 255;
38
+ }
39
+ const hsp = Math.sqrt(0.299 * (r * r) + 0.587 * (g * g) + 0.114 * (b * b));
40
+ // Using the HSP value, determine whether the color is light or dark
41
+ return hsp <= 127.5;
42
+ };
43
+ const getCpsColors = () => [...document.styleSheets].filter(isSameDomain).reduce((finalArr, sheet) => finalArr.concat([...sheet.cssRules].filter(isStyleRule).reduce((propValArr, rule) => {
44
+ const props = [...rule.style]
45
+ .map((propName) => [
46
+ propName.trim(),
47
+ rule.style.getPropertyValue(propName).trim()
48
+ ])
49
+ .filter(([propName]) => propName.indexOf('--cps-color') === 0);
50
+ return [...propValArr, ...props];
51
+ }, [])), []);
52
+ const getCSSColor = (val) => {
53
+ return isValidCSSColor(val) ? val : `var(--cps-color-${val})`;
54
+ };
55
+ const getTextColor = (backgroundColor) => {
56
+ if (isDark(backgroundColor)) {
57
+ return '#FFFFFF';
58
+ }
59
+ else {
60
+ return '#000000';
61
+ }
62
+ };
63
+
64
+ const convertSize = (size) => {
65
+ const res = String(size).trim();
66
+ if (!res) {
67
+ return '';
68
+ }
69
+ if (/^\d+(\.\d+)?$/i.test(res)) {
70
+ return res + 'px';
71
+ }
72
+ if (/^\d+(\.\d+)?(px|rem|em|%)$/i.test(res)) {
73
+ return res;
74
+ }
75
+ throw new Error(`Invalid size value: ${size}`);
76
+ };
77
+ const parseSize = (size) => {
78
+ const match = size.match(/^(\d+(?:\.\d+)?)(px|rem|em|%)$/);
79
+ if (!match)
80
+ throw new Error(`Invalid size value: ${size}`);
81
+ const value = parseFloat(match[1]);
82
+ const unit = match[2];
83
+ return { value, unit };
84
+ };
85
+
86
+ const iconNames = [
87
+ 'absa-logo',
88
+ 'access',
89
+ 'access-denied',
90
+ 'access-menu',
91
+ 'access-unlock',
92
+ 'add',
93
+ 'add-domain',
94
+ 'avatar',
95
+ 'avatar-top-menu',
96
+ 'bell',
97
+ 'book',
98
+ 'bookmark',
99
+ 'browse',
100
+ 'burger-arrow',
101
+ 'caret-down',
102
+ 'change',
103
+ 'checked',
104
+ 'chevron-down',
105
+ 'chevron-down-2',
106
+ 'circle',
107
+ 'close-x',
108
+ 'close-x-2',
109
+ 'community',
110
+ 'construction',
111
+ 'controls',
112
+ 'csv',
113
+ 'cub',
114
+ 'database',
115
+ 'datepicker',
116
+ 'delete',
117
+ 'dislike',
118
+ 'dots',
119
+ 'download',
120
+ 'dq',
121
+ 'dropdown-menu',
122
+ 'edit',
123
+ 'expand',
124
+ 'export',
125
+ 'eye',
126
+ 'filter',
127
+ 'filter_2',
128
+ 'follow',
129
+ 'glossary',
130
+ 'graph',
131
+ 'grid',
132
+ 'grid-view',
133
+ 'health',
134
+ 'heart',
135
+ 'help-circle',
136
+ 'home',
137
+ 'insight',
138
+ 'issues',
139
+ 'jpeg',
140
+ 'kris',
141
+ 'last-seen-product',
142
+ 'like',
143
+ 'line-vertical',
144
+ 'lock',
145
+ 'logout',
146
+ 'menu-expand',
147
+ 'minus',
148
+ 'multiple_users',
149
+ 'open',
150
+ 'path',
151
+ 'pdf',
152
+ 'plus',
153
+ 'projects',
154
+ 'question',
155
+ 'questions',
156
+ 'rectangle-rounded',
157
+ 'refresh-browse',
158
+ 'remove',
159
+ 'right',
160
+ 'schema_filter',
161
+ 'search',
162
+ 'settings',
163
+ 'smart',
164
+ 'star',
165
+ 'stepper-completed',
166
+ 'success',
167
+ 'suggestion',
168
+ 'survivorship',
169
+ 'table-row-error',
170
+ 'table-row-success',
171
+ 'table-row-warning',
172
+ 'toast-error',
173
+ 'toast-info',
174
+ 'toast-success',
175
+ 'toast-warning',
176
+ 'tools',
177
+ 'user',
178
+ 'users',
179
+ 'vector',
180
+ 'vector-down',
181
+ 'vector-right',
182
+ 'vector-up',
183
+ 'wallet',
184
+ 'warning',
185
+ 'widget-button-icon',
186
+ 'xls'
187
+ ];
188
+ class CpsIconComponent {
189
+ constructor() {
190
+ this.icon = '';
191
+ this.size = 'small';
192
+ this.color = 'currentColor';
193
+ this.iconColor = 'currentColor';
194
+ this.url = '../../../../assets/icons/';
195
+ this.cvtSize = '';
196
+ this.classesList = ['icon'];
197
+ }
198
+ ngOnChanges() {
199
+ this.iconColor = getCSSColor(this.color);
200
+ this.setClasses();
201
+ }
202
+ setClasses() {
203
+ switch (this.size) {
204
+ case 'fill': {
205
+ this.classesList.push('icon--fill');
206
+ break;
207
+ }
208
+ case 'xsmall': {
209
+ this.classesList.push('icon--xsmall');
210
+ break;
211
+ }
212
+ case 'small': {
213
+ this.classesList.push('icon--small');
214
+ break;
215
+ }
216
+ case 'normal': {
217
+ this.classesList.push('icon--normal');
218
+ break;
219
+ }
220
+ case 'large': {
221
+ this.classesList.push('icon--large');
222
+ break;
223
+ }
224
+ default:
225
+ this.cvtSize = convertSize(this.size);
226
+ break;
227
+ }
228
+ }
229
+ }
230
+ CpsIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
231
+ CpsIconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CpsIconComponent, isStandalone: true, selector: "cps-icon", inputs: { icon: "icon", size: "size", color: "color" }, usesOnChanges: true, ngImport: i0, template: "<i *ngIf=\"icon\" [ngClass]=\"classesList\" [style.color]=\"iconColor\" [ngStyle]=\"{width: cvtSize || 'none', height: cvtSize || 'none'}\">\n <svg>\n <use attr.xlink:href=\"{{ url }}{{ icon }}.svg#{{ icon }}\"></use>\n </svg>\n</i>\n", styles: [":host{display:inline-flex}:host .icon--fill{width:100%;height:100%}:host .icon--xsmall{width:12px;height:12px}:host .icon--small{width:16px;height:16px}:host .icon--normal{width:24px;height:24px}:host .icon--large{width:32px;height:32px}svg{color:inherit;fill:currentColor;height:100%;width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
232
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsIconComponent, decorators: [{
233
+ type: Component,
234
+ args: [{ standalone: true, imports: [CommonModule], selector: 'cps-icon', template: "<i *ngIf=\"icon\" [ngClass]=\"classesList\" [style.color]=\"iconColor\" [ngStyle]=\"{width: cvtSize || 'none', height: cvtSize || 'none'}\">\n <svg>\n <use attr.xlink:href=\"{{ url }}{{ icon }}.svg#{{ icon }}\"></use>\n </svg>\n</i>\n", styles: [":host{display:inline-flex}:host .icon--fill{width:100%;height:100%}:host .icon--xsmall{width:12px;height:12px}:host .icon--small{width:16px;height:16px}:host .icon--normal{width:24px;height:24px}:host .icon--large{width:32px;height:32px}svg{color:inherit;fill:currentColor;height:100%;width:100%}\n"] }]
235
+ }], propDecorators: { icon: [{
236
+ type: Input
237
+ }], size: [{
238
+ type: Input
239
+ }], color: [{
240
+ type: Input
241
+ }] } });
242
+
243
+ class CpsInputComponent {
244
+ set value(value) {
245
+ this._value = value;
246
+ this.onChange(value);
247
+ }
248
+ get value() {
249
+ return this._value;
250
+ }
251
+ constructor(_control, _elementRef, cdRef) {
252
+ this._control = _control;
253
+ this._elementRef = _elementRef;
254
+ this.cdRef = cdRef;
255
+ this.label = '';
256
+ this.placeholder = 'Please enter';
257
+ this.hint = '';
258
+ this.disabled = false;
259
+ this.width = '100%';
260
+ this.type = 'text';
261
+ this.loading = false;
262
+ this.clearable = false;
263
+ this.prefixIcon = '';
264
+ this.prefixIconSize = 'small';
265
+ this.prefixText = '';
266
+ this.hideDetails = false;
267
+ this.valueChanged = new EventEmitter();
268
+ this._statusChangesSubscription = new Subscription();
269
+ this._value = '';
270
+ this.error = '';
271
+ this.currentType = '';
272
+ this.prefixWidth = '';
273
+ this.cvtWidth = '';
274
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
275
+ this.onChange = (event) => { };
276
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
277
+ this.onTouched = () => { };
278
+ if (this._control) {
279
+ this._control.valueAccessor = this;
280
+ }
281
+ }
282
+ ngOnInit() {
283
+ var _a, _b;
284
+ this.currentType = this.type;
285
+ this.cvtWidth = convertSize(this.width);
286
+ this._statusChangesSubscription = (_b = (_a = this._control) === null || _a === void 0 ? void 0 : _a.statusChanges) === null || _b === void 0 ? void 0 : _b.subscribe(() => {
287
+ this._checkErrors();
288
+ });
289
+ }
290
+ ngAfterViewInit() {
291
+ var _a, _b;
292
+ let w = 0;
293
+ if (this.prefixText) {
294
+ w = ((_b = (_a = this.prefixTextSpan) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.offsetWidth) + 22;
295
+ }
296
+ if (this.prefixIcon) {
297
+ w += 38 - (this.prefixText ? 14 : 0);
298
+ }
299
+ this.prefixWidth = w > 0 ? `${w}px` : '';
300
+ this.cdRef.detectChanges();
301
+ }
302
+ ngOnDestroy() {
303
+ var _a;
304
+ (_a = this._statusChangesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
305
+ }
306
+ _checkErrors() {
307
+ var _a, _b, _c;
308
+ const errors = (_a = this._control) === null || _a === void 0 ? void 0 : _a.errors;
309
+ if (!((_c = (_b = this._control) === null || _b === void 0 ? void 0 : _b.control) === null || _c === void 0 ? void 0 : _c.touched) || !errors) {
310
+ this.error = '';
311
+ return;
312
+ }
313
+ if ('required' in errors) {
314
+ this.error = 'Field is required';
315
+ return;
316
+ }
317
+ if ('minlength' in errors) {
318
+ // eslint-disable-next-line dot-notation
319
+ this.error = `Field must contain at least ${errors['minlength'].requiredLength} characters`;
320
+ return;
321
+ }
322
+ const errArr = Object.values(errors);
323
+ if (errArr.length < 1) {
324
+ this.error = '';
325
+ return;
326
+ }
327
+ const message = errArr.find((msg) => typeof msg === 'string');
328
+ this.error = message || 'Unknown error';
329
+ }
330
+ registerOnChange(fn) {
331
+ this.onChange = fn;
332
+ }
333
+ registerOnTouched(fn) {
334
+ this.onTouched = fn;
335
+ }
336
+ writeValue(value) {
337
+ this.value = value;
338
+ }
339
+ updateValueEvent(event) {
340
+ var _a;
341
+ const value = ((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value) || '';
342
+ this._updateValue(value);
343
+ }
344
+ _updateValue(value) {
345
+ this.writeValue(value);
346
+ this.onChange(value);
347
+ this.valueChanged.emit(value);
348
+ }
349
+ clear() {
350
+ if (this.value !== '')
351
+ this._updateValue('');
352
+ }
353
+ togglePassword() {
354
+ this.currentType = this.currentType === 'password' ? 'text' : 'password';
355
+ }
356
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
357
+ setDisabledState(disabled) { }
358
+ onBlur() {
359
+ var _a, _b;
360
+ (_b = (_a = this._control) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.markAsTouched();
361
+ this._checkErrors();
362
+ }
363
+ focus() {
364
+ var _a, _b, _c;
365
+ (_c = (_b = (_a = this._elementRef) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.querySelector('input')) === null || _c === void 0 ? void 0 : _c.focus();
366
+ }
367
+ }
368
+ CpsInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsInputComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
369
+ CpsInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CpsInputComponent, isStandalone: true, selector: "cps-input", inputs: { label: "label", placeholder: "placeholder", hint: "hint", disabled: "disabled", width: "width", type: "type", loading: "loading", clearable: "clearable", prefixIcon: "prefixIcon", prefixIconSize: "prefixIconSize", prefixText: "prefixText", hideDetails: "hideDetails", value: "value" }, outputs: { valueChanged: "valueChanged" }, viewQueries: [{ propertyName: "prefixTextSpan", first: true, predicate: ["prefixTextSpan"], descendants: true }], ngImport: i0, template: "<div class=\"input-container\">\n <label class=\"label-text\" [ngClass]=\"{ 'label-text-disabled': disabled }\">{{\n label\n }}</label>\n\n <div\n class=\"input-wrap\"\n [ngClass]=\"{\n password: type === 'password',\n 'input-wrap-error': error,\n clearable: clearable,\n }\"\n >\n <input\n [type]=\"currentType\"\n [value]=\"value\"\n (input)=\"updateValueEvent($event)\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [ngStyle]=\"{\n width: cvtWidth,\n 'padding-left': prefixWidth || 'none'\n }\"\n (blur)=\"onBlur()\"\n />\n\n <div class=\"prefix\">\n <span *ngIf=\"prefixIcon\" class=\"prefix-icon\">\n <cps-icon [icon]=\"prefixIcon\" [size]=\"prefixIconSize\"></cps-icon>\n </span>\n\n <span *ngIf=\"prefixText\" class=\"prefix-text\" #prefixTextSpan>\n {{ prefixText }}\n </span>\n </div>\n\n <div class=\"action-btns\">\n <span *ngIf=\"clearable\" class=\"clear-btn\">\n <cps-icon icon=\"delete\" size=\"small\" (click)=\"clear()\"></cps-icon>\n </span>\n\n <span\n *ngIf=\"type === 'password'\"\n class=\"password-show-btn\"\n [ngClass]=\"{ 'password-show-btn-active': currentType === 'text' }\"\n >\n <cps-icon icon=\"eye\" size=\"18px\" (click)=\"togglePassword()\"></cps-icon>\n </span>\n </div>\n </div>\n\n <div *ngIf=\"loading\" class=\"progress-bar\" [ngStyle]=\"{ width: cvtWidth }\">\n <div class=\"progress-bar-line inc\"></div>\n <div class=\"progress-bar-line dec\"></div>\n </div>\n <div *ngIf=\"!error && !hideDetails\" class=\"hint-text\">{{ hint }}</div>\n <div *ngIf=\"error && !hideDetails\" class=\"error-text\">{{ error }}</div>\n</div>\n", styles: [":host .input-container{gap:.2rem!important;display:flex!important;flex-direction:column!important;font-family:Source Sans Pro,sans-serif}:host .input-container .input-wrap{position:relative;overflow:hidden}:host .input-container .input-wrap:hover input:enabled{border:1px solid var(--cps-color-calm)}:host .input-container .input-wrap-error input{border-color:#c33!important}:host .input-container .input-wrap-error input:not(:focus){background:#fef3f2!important}:host .input-container .input-wrap input{font-size:1rem;color:var(--cps-color-text-dark);background:#ffffff;padding:.375rem .75rem;line-height:1.5;border:1px solid var(--cps-color-text-lightest);transition-duration:.2s;-webkit-appearance:none;appearance:none;border-radius:4px;width:100%}:host .input-container .input-wrap input:focus{border:1px solid var(--cps-color-calm);outline:0}:host .input-container .input-wrap input:disabled{background-color:#f7f7f7;opacity:1}:host .input-container .input-wrap input:focus+.prefix>.prefix-icon,:host .input-container .input-wrap input:hover+.prefix>.prefix-icon{color:var(--cps-color-calm)}:host .input-container .input-wrap .action-btns{display:flex;align-items:center;position:absolute;top:50%;right:.75rem;margin-top:-.5rem}:host .input-container .input-wrap .action-btns .clear-btn{cursor:pointer;color:var(--cps-color-calm)}:host .input-container .input-wrap .action-btns .clear-btn cps-icon{opacity:.5;transition-duration:.2s}:host .input-container .input-wrap .action-btns .clear-btn cps-icon:hover{opacity:1}:host .input-container .input-wrap .action-btns .password-show-btn{margin-left:.5rem;cursor:pointer;color:var(--cps-color-text-mild)}:host .input-container .input-wrap .action-btns .password-show-btn-active{color:var(--cps-color-calm)}:host .input-container .input-wrap .action-btns .password-show-btn cps-icon{transition-duration:.2s}:host .input-container .input-wrap .action-btns .password-show-btn cps-icon:hover{color:var(--cps-color-calm)}:host .input-container .input-wrap .prefix{height:-webkit-fill-available;display:flex;align-items:center;position:absolute;top:50%;left:.75rem;transform:translateY(-50%)}:host .input-container .input-wrap .prefix:hover .prefix-icon{color:var(--cps-color-calm)}:host .input-container .input-wrap .prefix-icon{transition-duration:.2s;height:-webkit-fill-available;margin-right:.5rem}:host .input-container .input-wrap .prefix-text{color:var(--cps-color-text-mild)}:host .input-container .password.clearable>input{padding-right:3.8rem}:host .input-container .password>input,:host .input-container .clearable>input{padding-right:2.2rem}:host .input-container .hint-text{color:var(--cps-color-text-mild);font-size:.75rem;min-height:1.125rem;cursor:default}:host .input-container .error-text{color:#c33;font-weight:700;font-size:.75rem;min-height:1.125rem;cursor:default}:host .input-container .label-text{color:var(--cps-color-text-dark);font-size:.875rem}:host .input-container .label-text-disabled{color:var(--cps-color-text-mild)}:host .input-container ::placeholder{color:var(--cps-color-text-lightest);font-style:italic;opacity:1}:host .input-container .progress-bar{margin-top:-6px;margin-bottom:1px;position:relative;height:3px;overflow-x:hidden;border-radius:4px}:host .input-container .progress-bar-line{position:absolute;background:var(--cps-color-calm);opacity:.3;height:3px;left:-5%;top:0}:host .input-container .progress-bar .inc{animation:increase 2s infinite}:host .input-container .progress-bar .dec{animation:decrease 2s .5s infinite}@keyframes increase{0%{left:-5%;width:5%}to{left:130%;width:100%}}@keyframes decrease{0%{left:-80%;width:80%}to{left:110%;width:10%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: CpsIconComponent, selector: "cps-icon", inputs: ["icon", "size", "color"] }] });
370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsInputComponent, decorators: [{
371
+ type: Component,
372
+ args: [{ standalone: true, imports: [CommonModule, CpsIconComponent], selector: 'cps-input', template: "<div class=\"input-container\">\n <label class=\"label-text\" [ngClass]=\"{ 'label-text-disabled': disabled }\">{{\n label\n }}</label>\n\n <div\n class=\"input-wrap\"\n [ngClass]=\"{\n password: type === 'password',\n 'input-wrap-error': error,\n clearable: clearable,\n }\"\n >\n <input\n [type]=\"currentType\"\n [value]=\"value\"\n (input)=\"updateValueEvent($event)\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [ngStyle]=\"{\n width: cvtWidth,\n 'padding-left': prefixWidth || 'none'\n }\"\n (blur)=\"onBlur()\"\n />\n\n <div class=\"prefix\">\n <span *ngIf=\"prefixIcon\" class=\"prefix-icon\">\n <cps-icon [icon]=\"prefixIcon\" [size]=\"prefixIconSize\"></cps-icon>\n </span>\n\n <span *ngIf=\"prefixText\" class=\"prefix-text\" #prefixTextSpan>\n {{ prefixText }}\n </span>\n </div>\n\n <div class=\"action-btns\">\n <span *ngIf=\"clearable\" class=\"clear-btn\">\n <cps-icon icon=\"delete\" size=\"small\" (click)=\"clear()\"></cps-icon>\n </span>\n\n <span\n *ngIf=\"type === 'password'\"\n class=\"password-show-btn\"\n [ngClass]=\"{ 'password-show-btn-active': currentType === 'text' }\"\n >\n <cps-icon icon=\"eye\" size=\"18px\" (click)=\"togglePassword()\"></cps-icon>\n </span>\n </div>\n </div>\n\n <div *ngIf=\"loading\" class=\"progress-bar\" [ngStyle]=\"{ width: cvtWidth }\">\n <div class=\"progress-bar-line inc\"></div>\n <div class=\"progress-bar-line dec\"></div>\n </div>\n <div *ngIf=\"!error && !hideDetails\" class=\"hint-text\">{{ hint }}</div>\n <div *ngIf=\"error && !hideDetails\" class=\"error-text\">{{ error }}</div>\n</div>\n", styles: [":host .input-container{gap:.2rem!important;display:flex!important;flex-direction:column!important;font-family:Source Sans Pro,sans-serif}:host .input-container .input-wrap{position:relative;overflow:hidden}:host .input-container .input-wrap:hover input:enabled{border:1px solid var(--cps-color-calm)}:host .input-container .input-wrap-error input{border-color:#c33!important}:host .input-container .input-wrap-error input:not(:focus){background:#fef3f2!important}:host .input-container .input-wrap input{font-size:1rem;color:var(--cps-color-text-dark);background:#ffffff;padding:.375rem .75rem;line-height:1.5;border:1px solid var(--cps-color-text-lightest);transition-duration:.2s;-webkit-appearance:none;appearance:none;border-radius:4px;width:100%}:host .input-container .input-wrap input:focus{border:1px solid var(--cps-color-calm);outline:0}:host .input-container .input-wrap input:disabled{background-color:#f7f7f7;opacity:1}:host .input-container .input-wrap input:focus+.prefix>.prefix-icon,:host .input-container .input-wrap input:hover+.prefix>.prefix-icon{color:var(--cps-color-calm)}:host .input-container .input-wrap .action-btns{display:flex;align-items:center;position:absolute;top:50%;right:.75rem;margin-top:-.5rem}:host .input-container .input-wrap .action-btns .clear-btn{cursor:pointer;color:var(--cps-color-calm)}:host .input-container .input-wrap .action-btns .clear-btn cps-icon{opacity:.5;transition-duration:.2s}:host .input-container .input-wrap .action-btns .clear-btn cps-icon:hover{opacity:1}:host .input-container .input-wrap .action-btns .password-show-btn{margin-left:.5rem;cursor:pointer;color:var(--cps-color-text-mild)}:host .input-container .input-wrap .action-btns .password-show-btn-active{color:var(--cps-color-calm)}:host .input-container .input-wrap .action-btns .password-show-btn cps-icon{transition-duration:.2s}:host .input-container .input-wrap .action-btns .password-show-btn cps-icon:hover{color:var(--cps-color-calm)}:host .input-container .input-wrap .prefix{height:-webkit-fill-available;display:flex;align-items:center;position:absolute;top:50%;left:.75rem;transform:translateY(-50%)}:host .input-container .input-wrap .prefix:hover .prefix-icon{color:var(--cps-color-calm)}:host .input-container .input-wrap .prefix-icon{transition-duration:.2s;height:-webkit-fill-available;margin-right:.5rem}:host .input-container .input-wrap .prefix-text{color:var(--cps-color-text-mild)}:host .input-container .password.clearable>input{padding-right:3.8rem}:host .input-container .password>input,:host .input-container .clearable>input{padding-right:2.2rem}:host .input-container .hint-text{color:var(--cps-color-text-mild);font-size:.75rem;min-height:1.125rem;cursor:default}:host .input-container .error-text{color:#c33;font-weight:700;font-size:.75rem;min-height:1.125rem;cursor:default}:host .input-container .label-text{color:var(--cps-color-text-dark);font-size:.875rem}:host .input-container .label-text-disabled{color:var(--cps-color-text-mild)}:host .input-container ::placeholder{color:var(--cps-color-text-lightest);font-style:italic;opacity:1}:host .input-container .progress-bar{margin-top:-6px;margin-bottom:1px;position:relative;height:3px;overflow-x:hidden;border-radius:4px}:host .input-container .progress-bar-line{position:absolute;background:var(--cps-color-calm);opacity:.3;height:3px;left:-5%;top:0}:host .input-container .progress-bar .inc{animation:increase 2s infinite}:host .input-container .progress-bar .dec{animation:decrease 2s .5s infinite}@keyframes increase{0%{left:-5%;width:5%}to{left:130%;width:100%}}@keyframes decrease{0%{left:-80%;width:80%}to{left:110%;width:10%}}\n"] }]
373
+ }], ctorParameters: function () {
374
+ return [{ type: i1.NgControl, decorators: [{
375
+ type: Self
376
+ }, {
377
+ type: Optional
378
+ }] }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }];
379
+ }, propDecorators: { label: [{
380
+ type: Input
381
+ }], placeholder: [{
382
+ type: Input
383
+ }], hint: [{
384
+ type: Input
385
+ }], disabled: [{
386
+ type: Input
387
+ }], width: [{
388
+ type: Input
389
+ }], type: [{
390
+ type: Input
391
+ }], loading: [{
392
+ type: Input
393
+ }], clearable: [{
394
+ type: Input
395
+ }], prefixIcon: [{
396
+ type: Input
397
+ }], prefixIconSize: [{
398
+ type: Input
399
+ }], prefixText: [{
400
+ type: Input
401
+ }], hideDetails: [{
402
+ type: Input
403
+ }], value: [{
404
+ type: Input
405
+ }], valueChanged: [{
406
+ type: Output
407
+ }], prefixTextSpan: [{
408
+ type: ViewChild,
409
+ args: ['prefixTextSpan']
410
+ }] } });
411
+
412
+ class CpsChipComponent {
413
+ constructor() {
414
+ this.label = '';
415
+ this.icon = '';
416
+ this.iconPosition = 'before';
417
+ this.closable = false;
418
+ this.disabled = false;
419
+ this.closed = new EventEmitter();
420
+ this.classesList = ['chip'];
421
+ }
422
+ ngOnChanges() {
423
+ this.setClasses();
424
+ }
425
+ setClasses() {
426
+ if (this.disabled)
427
+ this.classesList.push('chip-disabled');
428
+ if (this.icon && this.label) {
429
+ switch (this.iconPosition) {
430
+ case 'before': {
431
+ this.classesList.push('chip--icon-before');
432
+ break;
433
+ }
434
+ case 'after': {
435
+ this.classesList.push('chip--icon-after');
436
+ break;
437
+ }
438
+ }
439
+ }
440
+ }
441
+ onCloseClick(event) {
442
+ event.stopPropagation();
443
+ this.closed.emit();
444
+ }
445
+ }
446
+ CpsChipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
447
+ CpsChipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CpsChipComponent, isStandalone: true, selector: "cps-chip", inputs: { label: "label", icon: "icon", iconPosition: "iconPosition", closable: "closable", disabled: "disabled" }, outputs: { closed: "closed" }, usesOnChanges: true, ngImport: i0, template: "<div [ngClass]=\"classesList\">\n <cps-icon\n *ngIf=\"icon\"\n class=\"chip-icon\"\n [icon]=\"icon\"\n color=\"text-darkest\"\n ></cps-icon>\n <span class=\"chip-label\">{{ label }}</span>\n <cps-icon\n *ngIf=\"closable\"\n class=\"chip-close-icon\"\n icon=\"close-x\"\n size=\"xsmall\"\n color=\"text-darkest\"\n (click)=\"onCloseClick($event)\"\n ></cps-icon>\n</div>\n", styles: [":host{width:-moz-fit-content;width:fit-content;display:inline-block;-webkit-user-select:none;user-select:none}:host .chip{display:inline-flex;background-color:var(--cps-color-bg-dark);border-radius:14px;padding:4px 12px;cursor:default}:host .chip-close-icon{margin-left:6px;cursor:pointer}:host .chip-close-icon:hover ::ng-deep .icon{color:var(--cps-color-calm)!important}:host .chip-label{font-size:14px;color:var(--cps-color-text-darkest)}:host .chip.chip-disabled{pointer-events:none;background-color:var(--cps-color-bg-mid)}:host .chip.chip-disabled .chip-label{color:var(--cps-color-text-light)}:host .chip.chip-disabled .chip-icon ::ng-deep .icon,:host .chip.chip-disabled .chip-close-icon ::ng-deep .icon{color:var(--cps-color-text-light)!important}:host .chip.chip--icon-before .chip-icon{margin-right:6px}:host .chip.chip--icon-after .chip-icon{margin-left:6px;order:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CpsIconComponent, selector: "cps-icon", inputs: ["icon", "size", "color"] }] });
448
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsChipComponent, decorators: [{
449
+ type: Component,
450
+ args: [{ standalone: true, imports: [CommonModule, CpsIconComponent], selector: 'cps-chip', template: "<div [ngClass]=\"classesList\">\n <cps-icon\n *ngIf=\"icon\"\n class=\"chip-icon\"\n [icon]=\"icon\"\n color=\"text-darkest\"\n ></cps-icon>\n <span class=\"chip-label\">{{ label }}</span>\n <cps-icon\n *ngIf=\"closable\"\n class=\"chip-close-icon\"\n icon=\"close-x\"\n size=\"xsmall\"\n color=\"text-darkest\"\n (click)=\"onCloseClick($event)\"\n ></cps-icon>\n</div>\n", styles: [":host{width:-moz-fit-content;width:fit-content;display:inline-block;-webkit-user-select:none;user-select:none}:host .chip{display:inline-flex;background-color:var(--cps-color-bg-dark);border-radius:14px;padding:4px 12px;cursor:default}:host .chip-close-icon{margin-left:6px;cursor:pointer}:host .chip-close-icon:hover ::ng-deep .icon{color:var(--cps-color-calm)!important}:host .chip-label{font-size:14px;color:var(--cps-color-text-darkest)}:host .chip.chip-disabled{pointer-events:none;background-color:var(--cps-color-bg-mid)}:host .chip.chip-disabled .chip-label{color:var(--cps-color-text-light)}:host .chip.chip-disabled .chip-icon ::ng-deep .icon,:host .chip.chip-disabled .chip-close-icon ::ng-deep .icon{color:var(--cps-color-text-light)!important}:host .chip.chip--icon-before .chip-icon{margin-right:6px}:host .chip.chip--icon-after .chip-icon{margin-left:6px;order:1}\n"] }]
451
+ }], propDecorators: { label: [{
452
+ type: Input
453
+ }], icon: [{
454
+ type: Input
455
+ }], iconPosition: [{
456
+ type: Input
457
+ }], closable: [{
458
+ type: Input
459
+ }], disabled: [{
460
+ type: Input
461
+ }], closed: [{
462
+ type: Output
463
+ }] } });
464
+
465
+ class ClickOutsideDirective {
466
+ // eslint-disable-next-line no-useless-constructor
467
+ constructor(elementRef) {
468
+ this.elementRef = elementRef;
469
+ this.clickOutside = new EventEmitter();
470
+ }
471
+ onClick(target) {
472
+ var _a, _b, _c, _d, _e;
473
+ if (!((_c = (_b = (_a = this.elementRef) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.classList) === null || _c === void 0 ? void 0 : _c.contains('focused')))
474
+ return;
475
+ const clickedInside = (_e = (_d = this.elementRef) === null || _d === void 0 ? void 0 : _d.nativeElement) === null || _e === void 0 ? void 0 : _e.contains(target);
476
+ if (!clickedInside) {
477
+ this.clickOutside.emit();
478
+ }
479
+ }
480
+ }
481
+ ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
482
+ ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: ClickOutsideDirective, isStandalone: true, selector: "[clickOutside]", outputs: { clickOutside: "clickOutside" }, host: { listeners: { "document:click": "onClick($event.target)" } }, ngImport: i0 });
483
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ClickOutsideDirective, decorators: [{
484
+ type: Directive,
485
+ args: [{
486
+ standalone: true,
487
+ selector: '[clickOutside]'
488
+ }]
489
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { clickOutside: [{
490
+ type: Output
491
+ }], onClick: [{
492
+ type: HostListener,
493
+ args: ['document:click', ['$event.target']]
494
+ }] } });
495
+
496
+ class LabelByValuePipe {
497
+ transform(value, options, valueKey, labelKey) {
498
+ const option = options.find((opt) => opt[valueKey] === value);
499
+ return option ? option[labelKey] : 'unknown';
500
+ }
501
+ }
502
+ LabelByValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LabelByValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
503
+ LabelByValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: LabelByValuePipe, isStandalone: true, name: "labelByValue" });
504
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LabelByValuePipe, decorators: [{
505
+ type: Pipe,
506
+ args: [{ standalone: true, name: 'labelByValue' }]
507
+ }] });
508
+
509
+ class CombineLabelsPipe {
510
+ transform(values, options, valueKey, labelKey, returnObject) {
511
+ return values
512
+ .map((v) => {
513
+ if (returnObject) {
514
+ return v[labelKey];
515
+ }
516
+ else {
517
+ const option = options.find((opt) => opt[valueKey] === v);
518
+ return option ? option[labelKey] : 'unknown';
519
+ }
520
+ })
521
+ .join(', ');
522
+ }
523
+ }
524
+ CombineLabelsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CombineLabelsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
525
+ CombineLabelsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: CombineLabelsPipe, isStandalone: true, name: "combineLabels" });
526
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CombineLabelsPipe, decorators: [{
527
+ type: Pipe,
528
+ args: [{ standalone: true, name: 'combineLabels' }]
529
+ }] });
530
+
531
+ class CpsSelectComponent {
532
+ set value(value) {
533
+ value = this._convertValue(value);
534
+ this._value = value;
535
+ this.onChange(value);
536
+ }
537
+ get value() {
538
+ return this._value;
539
+ }
540
+ constructor(_control) {
541
+ this._control = _control;
542
+ this.label = '';
543
+ this.placeholder = 'Please select';
544
+ this.hint = '';
545
+ this.returnObject = true;
546
+ this.multiple = false;
547
+ this.disabled = false;
548
+ this.width = '100%';
549
+ this.selectAll = true;
550
+ this.chips = true;
551
+ this.closableChips = true;
552
+ this.clearable = false;
553
+ this.openOnClear = true;
554
+ this.options = [];
555
+ this.optionLabel = 'label';
556
+ this.optionValue = 'value'; // works only if returnObject === false (TODO potentially can be of any type)
557
+ this.optionInfo = 'info';
558
+ this.hideDetails = false;
559
+ this._value = undefined;
560
+ this.valueChanged = new EventEmitter();
561
+ this._statusChangesSubscription = new Subscription();
562
+ this.error = '';
563
+ this.cvtWidth = '';
564
+ this.isOpened = false;
565
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
566
+ this.onChange = (event) => { };
567
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
568
+ this.onTouched = () => { };
569
+ if (this._control) {
570
+ this._control.valueAccessor = this;
571
+ }
572
+ }
573
+ ngOnChanges(changes) {
574
+ // eslint-disable-next-line dot-notation
575
+ if ('_value' in changes && changes['_value'].isFirstChange()) {
576
+ this.value = this._convertValue(this.value);
577
+ }
578
+ }
579
+ ngOnInit() {
580
+ var _a, _b;
581
+ this.cvtWidth = convertSize(this.width);
582
+ if (this.multiple && !this._value) {
583
+ this._value = [];
584
+ }
585
+ this._statusChangesSubscription = (_b = (_a = this._control) === null || _a === void 0 ? void 0 : _a.statusChanges) === null || _b === void 0 ? void 0 : _b.subscribe(() => {
586
+ this._checkErrors();
587
+ });
588
+ }
589
+ ngOnDestroy() {
590
+ var _a;
591
+ (_a = this._statusChangesSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
592
+ }
593
+ toggleOptions(dd, show) {
594
+ if (this.disabled || !dd)
595
+ return;
596
+ if (typeof show === 'boolean') {
597
+ if (show)
598
+ dd.classList.add('active');
599
+ else
600
+ dd.classList.remove('active');
601
+ }
602
+ else
603
+ dd.classList.toggle('active');
604
+ this.isOpened = dd.classList.contains('active');
605
+ if (this.isOpened) {
606
+ const selected = this.selectContainer.nativeElement.querySelector('.selected');
607
+ if (selected)
608
+ selected.scrollIntoView();
609
+ }
610
+ }
611
+ // private _filterOptions() {
612
+ // if (!this.optionsFilter || !this.multiple) return;
613
+ // this.filteredOptions = this.options.filter((o) => {
614
+ // if (this.returnObject) {
615
+ // return !this.value.find((v: any) => v === o);
616
+ // }
617
+ // return !this.value.find((v: any) => v === o[this.optionValue]);
618
+ // });
619
+ // }
620
+ select(option, byValue) {
621
+ const val = byValue
622
+ ? option
623
+ : this.returnObject
624
+ ? option
625
+ : option[this.optionValue];
626
+ if (this.multiple) {
627
+ let res = [];
628
+ if (this.value.includes(val)) {
629
+ res = this.value.filter((v) => v !== val);
630
+ }
631
+ else {
632
+ this.options.forEach((o) => {
633
+ const ov = this.returnObject ? o : o[this.optionValue];
634
+ if (this.value.some((v) => v === ov) || val === ov) {
635
+ res.push(ov);
636
+ }
637
+ });
638
+ }
639
+ this.updateValue(res);
640
+ }
641
+ else {
642
+ this.updateValue(val);
643
+ }
644
+ }
645
+ onOptionClick(option, dd) {
646
+ this.select(option, false);
647
+ if (!this.multiple) {
648
+ this.toggleOptions(dd, false);
649
+ }
650
+ }
651
+ toggleAll() {
652
+ let res = [];
653
+ if (this.value.length < this.options.length) {
654
+ if (this.returnObject) {
655
+ res = this.options;
656
+ }
657
+ else {
658
+ this.options.forEach((o) => {
659
+ res.push(o[this.optionValue]);
660
+ });
661
+ }
662
+ }
663
+ this.updateValue(res);
664
+ }
665
+ _checkErrors() {
666
+ var _a, _b, _c;
667
+ const errors = (_a = this._control) === null || _a === void 0 ? void 0 : _a.errors;
668
+ if (!((_c = (_b = this._control) === null || _b === void 0 ? void 0 : _b.control) === null || _c === void 0 ? void 0 : _c.touched) || !errors) {
669
+ this.error = '';
670
+ return;
671
+ }
672
+ if ('required' in errors) {
673
+ this.error = 'Field is required';
674
+ return;
675
+ }
676
+ const errArr = Object.values(errors);
677
+ if (errArr.length < 1) {
678
+ this.error = '';
679
+ return;
680
+ }
681
+ const message = errArr.find((msg) => typeof msg === 'string');
682
+ this.error = message || 'Unknown error';
683
+ }
684
+ registerOnChange(fn) {
685
+ this.onChange = fn;
686
+ }
687
+ registerOnTouched(fn) {
688
+ this.onTouched = fn;
689
+ }
690
+ _convertValue(value) {
691
+ if (!this.returnObject) {
692
+ if (this.multiple) {
693
+ if (Array.isArray(value)) {
694
+ const temp = [];
695
+ value.forEach((v) => {
696
+ if (typeof v !== 'string') {
697
+ temp.push(v ? v[this.optionValue] : '');
698
+ }
699
+ else
700
+ temp.push(v);
701
+ });
702
+ value = temp;
703
+ }
704
+ else {
705
+ if (!value)
706
+ value = [];
707
+ else {
708
+ if (typeof value !== 'string') {
709
+ value = [value[this.optionValue]];
710
+ }
711
+ else
712
+ value = [value];
713
+ }
714
+ }
715
+ }
716
+ else {
717
+ if (typeof value !== 'string') {
718
+ value = value ? value[this.optionValue] : '';
719
+ }
720
+ }
721
+ }
722
+ else {
723
+ if (this.multiple) {
724
+ if (!Array.isArray(value)) {
725
+ value = [value];
726
+ }
727
+ }
728
+ }
729
+ return value;
730
+ }
731
+ writeValue(value) {
732
+ value = this._convertValue(value);
733
+ this.value = value;
734
+ }
735
+ updateValue(value) {
736
+ this.writeValue(value);
737
+ this.onChange(value);
738
+ this.valueChanged.emit(value);
739
+ }
740
+ clear(dd, event) {
741
+ var _a;
742
+ event.stopPropagation();
743
+ if ((!this.multiple && this.value) ||
744
+ (this.multiple && ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0)) {
745
+ if (this.openOnClear) {
746
+ this.toggleOptions(dd, true);
747
+ }
748
+ const val = this.multiple ? [] : this.returnObject ? undefined : '';
749
+ this.updateValue(val);
750
+ }
751
+ }
752
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
753
+ setDisabledState(disabled) { }
754
+ onBlur() {
755
+ var _a, _b;
756
+ (_b = (_a = this._control) === null || _a === void 0 ? void 0 : _a.control) === null || _b === void 0 ? void 0 : _b.markAsTouched();
757
+ this._checkErrors();
758
+ }
759
+ focus() {
760
+ var _a, _b, _c;
761
+ (_b = (_a = this.selectContainer) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.focus();
762
+ this.toggleOptions((_c = this.selectContainer) === null || _c === void 0 ? void 0 : _c.nativeElement, true);
763
+ }
764
+ }
765
+ CpsSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsSelectComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
766
+ CpsSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CpsSelectComponent, isStandalone: true, selector: "cps-select", inputs: { label: "label", placeholder: "placeholder", hint: "hint", returnObject: "returnObject", multiple: "multiple", disabled: "disabled", width: "width", selectAll: "selectAll", chips: "chips", closableChips: "closableChips", clearable: "clearable", openOnClear: "openOnClear", options: "options", optionLabel: "optionLabel", optionValue: "optionValue", optionInfo: "optionInfo", hideDetails: "hideDetails", _value: ["value", "_value"] }, outputs: { valueChanged: "valueChanged" }, viewQueries: [{ propertyName: "selectContainer", first: true, predicate: ["selectContainer"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n [ngStyle]=\"{ width: cvtWidth }\"\n class=\"cps-select\"\n tabindex=\"0\"\n [ngClass]=\"{ disabled: disabled, error: error }\"\n #selectContainer\n (keydown.escape)=\"toggleOptions(selectContainer, false)\"\n (blur)=\"onBlur()\"\n>\n <label *ngIf=\"label\" class=\"cps-select-label\">{{ label }}</label>\n <div\n [class.focused]=\"isOpened\"\n (clickOutside)=\"toggleOptions(selectContainer, false)\"\n >\n <div class=\"cps-select-box\" (click)=\"toggleOptions(selectContainer)\">\n <div\n class=\"cps-select-box-placeholder\"\n *ngIf=\"(!value && !multiple) || (value?.length < 1 && multiple)\"\n >\n {{ placeholder }}\n </div>\n <div\n class=\"cps-select-box-items\"\n *ngIf=\"(value && !multiple) || (value?.length > 0 && multiple)\"\n >\n <span *ngIf=\"!multiple\" class=\"single-item\">\n {{\n returnObject\n ? value[optionLabel]\n : (value | labelByValue : options : optionValue : optionLabel)\n }}</span\n >\n <div *ngIf=\"multiple && !chips\" class=\"text-group\">\n <span>\n {{\n value\n | combineLabels\n : options\n : optionValue\n : optionLabel\n : returnObject\n }}</span\n >\n </div>\n\n <div *ngIf=\"multiple && chips\" class=\"chips-group\">\n <cps-chip\n *ngFor=\"let val of value\"\n [disabled]=\"disabled\"\n [closable]=\"closableChips\"\n (closed)=\"select(val, true)\"\n [label]=\"\n returnObject\n ? val[optionLabel]\n : (val | labelByValue : options : optionValue : optionLabel)\n \"\n >\n </cps-chip>\n </div>\n </div>\n <span class=\"cps-select-box-icons\">\n <span *ngIf=\"clearable && !disabled\" class=\"cps-select-box-clear-icon\">\n <cps-icon\n icon=\"delete\"\n size=\"small\"\n (click)=\"clear(selectContainer, $event)\"\n ></cps-icon>\n </span>\n <span class=\"cps-select-box-chevron\">\n <cps-icon\n icon=\"chevron-down\"\n size=\"small\"\n color=\"text-dark\"\n ></cps-icon>\n </span>\n </span>\n </div>\n\n <div class=\"cps-select-options\">\n <div\n class=\"cps-select-options-option select-all-option\"\n [class.allselected]=\"value?.length === options.length\"\n *ngIf=\"multiple && selectAll\"\n (click)=\"toggleAll()\"\n >\n <span>\n <span *ngIf=\"multiple\" class=\"cps-select-options-option-check\">\n </span>\n <span class=\"cps-select-options-option-label\">Select all</span>\n </span>\n </div>\n <div\n class=\"cps-select-options-option\"\n *ngFor=\"let option of options\"\n (click)=\"onOptionClick(option, selectContainer)\"\n [class.selected]=\"\n multiple\n ? returnObject\n ? value?.includes(option)\n : value?.includes(option[optionValue])\n : returnObject\n ? option === value\n : option[optionValue] === value\n \"\n >\n <span>\n <span *ngIf=\"multiple\" class=\"cps-select-options-option-check\">\n </span>\n <span class=\"cps-select-options-option-label\">{{\n option[optionLabel]\n }}</span>\n </span>\n\n <span class=\"cps-select-options-option-info\">{{\n option[optionInfo]\n }}</span>\n </div>\n </div>\n </div>\n <div *ngIf=\"!error && !hideDetails\" class=\"cps-select-hint\">{{ hint }}</div>\n <div *ngIf=\"error && !hideDetails\" class=\"cps-select-error\">{{ error }}</div>\n</div>\n", styles: [":host{display:flex}:host .cps-select{position:relative;width:100%;outline:none;font-family:Source Sans Pro,sans-serif}:host .cps-select.active .cps-select-options{display:block}:host .cps-select.active .cps-select-box{border:1px solid var(--cps-color-calm)}:host .cps-select .cps-select-label{display:inline-block;margin-bottom:.2rem;color:var(--cps-color-text-dark);font-size:.875rem}:host .cps-select .cps-select-box{overflow:hidden;justify-content:space-between;min-height:38px;width:100%;cursor:pointer;background:white;font-size:1rem;outline:none;padding:0 12px;border-radius:4px;align-items:center;display:flex;border:1px solid var(--cps-color-text-lightest);transition-duration:.2s}:host .cps-select .cps-select-box-placeholder{color:var(--cps-color-text-lightest);font-style:italic}:host .cps-select .cps-select-box-items .text-group,:host .cps-select .cps-select-box-items .single-item{color:var(--cps-color-text-dark);padding-top:3px;padding-bottom:3px}:host .cps-select .cps-select-box-items .chips-group cps-chip{padding-bottom:3px;padding-top:3px;padding-right:4px}text-group :host .cps-select .cps-select-box:hover{border:1px solid var(--cps-color-calm)}:host .cps-select .cps-select-box .cps-select-box-icons{display:flex}:host .cps-select .cps-select-box .cps-select-box-icons .cps-select-box-clear-icon{display:flex;color:var(--cps-color-calm);margin-left:8px}:host .cps-select .cps-select-box .cps-select-box-icons .cps-select-box-clear-icon cps-icon{opacity:.5;transition-duration:.2s}:host .cps-select .cps-select-box .cps-select-box-icons .cps-select-box-clear-icon cps-icon:hover{opacity:1}:host .cps-select .cps-select-box .cps-select-box-icons .cps-select-box-chevron{display:flex;margin-left:8px;transition-duration:.2s}:host .cps-select.active .cps-select-box-chevron{top:22px;transform:rotate(180deg)}:host .cps-select .cps-select-options{z-index:1001;position:absolute;width:100%;background:white;box-shadow:0 5px 20px #0000000d;border-radius:4px;overflow-x:hidden;display:none;max-height:240px;overflow-y:auto;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f}:host .cps-select .cps-select-options .cps-select-options-option{padding:12px;justify-content:space-between;display:flex;cursor:pointer}:host .cps-select .cps-select-options .cps-select-options-option:hover{background:#f8f4f5}:host .cps-select .cps-select-options .cps-select-options-option-label{color:var(--cps-color-text-dark)}:host .cps-select .cps-select-options .cps-select-options-option-info{color:var(--cps-color-text-light)}:host .cps-select .cps-select-options .cps-select-options-option-check{background-color:transparent;border:0;width:16px;height:16px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0,0,.2,.1),background-color 90ms cubic-bezier(0,0,.2,.1);margin-right:8px;opacity:0}:host .cps-select .cps-select-options .cps-select-options-option-check:after{color:var(--cps-color-calm);top:4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box;position:absolute;content:\"\";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0,0,.2,.1)}:host .cps-select .cps-select-options .cps-select-options-option.selected,:host .cps-select .cps-select-options .cps-select-options-option.allselected{font-weight:600}:host .cps-select .cps-select-options .cps-select-options-option.selected .cps-select-options-option-label,:host .cps-select .cps-select-options .cps-select-options-option.allselected .cps-select-options-option-label{color:var(--cps-color-calm)}:host .cps-select .cps-select-options .cps-select-options-option.selected .cps-select-options-option-check,:host .cps-select .cps-select-options .cps-select-options-option.allselected .cps-select-options-option-check{opacity:1}:host .cps-select .cps-select-options .cps-select-options-option.selected{background:#efe4e7}:host .cps-select .cps-select-hint{color:var(--cps-color-text-mild);font-size:.75rem;min-height:1.125rem;cursor:default;margin-top:.2rem}:host .cps-select .cps-select-error{color:#c33;font-weight:700;font-size:.75rem;min-height:1.125rem;cursor:default;margin-top:.2rem}:host .cps-select.disabled{pointer-events:none}:host .cps-select.disabled .cps-select-box{background:#f7f7f7}:host .cps-select.disabled .cps-select-box-items{color:var(--cps-color-text-light)}:host .cps-select.disabled .cps-select-box-items .text-group,:host .cps-select.disabled .cps-select-box-items .single-item{color:var(--cps-color-text-light)}:host .cps-select.disabled .cps-select-label{color:var(--cps-color-text-mild)}:host .cps-select.error .cps-select-box{border-color:#c33!important;background:#fef3f2!important}:host .cps-select .select-all-option{border-bottom:1px solid lightgrey;font-weight:600}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: ClickOutsideDirective, selector: "[clickOutside]", outputs: ["clickOutside"] }, { kind: "component", type: CpsIconComponent, selector: "cps-icon", inputs: ["icon", "size", "color"] }, { kind: "component", type: CpsChipComponent, selector: "cps-chip", inputs: ["label", "icon", "iconPosition", "closable", "disabled"], outputs: ["closed"] }, { kind: "pipe", type: LabelByValuePipe, name: "labelByValue" }, { kind: "pipe", type: CombineLabelsPipe, name: "combineLabels" }] });
767
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsSelectComponent, decorators: [{
768
+ type: Component,
769
+ args: [{ standalone: true, imports: [
770
+ CommonModule,
771
+ FormsModule,
772
+ ClickOutsideDirective,
773
+ CpsIconComponent,
774
+ CpsChipComponent,
775
+ LabelByValuePipe,
776
+ CombineLabelsPipe
777
+ ], selector: 'cps-select', template: "<div\n [ngStyle]=\"{ width: cvtWidth }\"\n class=\"cps-select\"\n tabindex=\"0\"\n [ngClass]=\"{ disabled: disabled, error: error }\"\n #selectContainer\n (keydown.escape)=\"toggleOptions(selectContainer, false)\"\n (blur)=\"onBlur()\"\n>\n <label *ngIf=\"label\" class=\"cps-select-label\">{{ label }}</label>\n <div\n [class.focused]=\"isOpened\"\n (clickOutside)=\"toggleOptions(selectContainer, false)\"\n >\n <div class=\"cps-select-box\" (click)=\"toggleOptions(selectContainer)\">\n <div\n class=\"cps-select-box-placeholder\"\n *ngIf=\"(!value && !multiple) || (value?.length < 1 && multiple)\"\n >\n {{ placeholder }}\n </div>\n <div\n class=\"cps-select-box-items\"\n *ngIf=\"(value && !multiple) || (value?.length > 0 && multiple)\"\n >\n <span *ngIf=\"!multiple\" class=\"single-item\">\n {{\n returnObject\n ? value[optionLabel]\n : (value | labelByValue : options : optionValue : optionLabel)\n }}</span\n >\n <div *ngIf=\"multiple && !chips\" class=\"text-group\">\n <span>\n {{\n value\n | combineLabels\n : options\n : optionValue\n : optionLabel\n : returnObject\n }}</span\n >\n </div>\n\n <div *ngIf=\"multiple && chips\" class=\"chips-group\">\n <cps-chip\n *ngFor=\"let val of value\"\n [disabled]=\"disabled\"\n [closable]=\"closableChips\"\n (closed)=\"select(val, true)\"\n [label]=\"\n returnObject\n ? val[optionLabel]\n : (val | labelByValue : options : optionValue : optionLabel)\n \"\n >\n </cps-chip>\n </div>\n </div>\n <span class=\"cps-select-box-icons\">\n <span *ngIf=\"clearable && !disabled\" class=\"cps-select-box-clear-icon\">\n <cps-icon\n icon=\"delete\"\n size=\"small\"\n (click)=\"clear(selectContainer, $event)\"\n ></cps-icon>\n </span>\n <span class=\"cps-select-box-chevron\">\n <cps-icon\n icon=\"chevron-down\"\n size=\"small\"\n color=\"text-dark\"\n ></cps-icon>\n </span>\n </span>\n </div>\n\n <div class=\"cps-select-options\">\n <div\n class=\"cps-select-options-option select-all-option\"\n [class.allselected]=\"value?.length === options.length\"\n *ngIf=\"multiple && selectAll\"\n (click)=\"toggleAll()\"\n >\n <span>\n <span *ngIf=\"multiple\" class=\"cps-select-options-option-check\">\n </span>\n <span class=\"cps-select-options-option-label\">Select all</span>\n </span>\n </div>\n <div\n class=\"cps-select-options-option\"\n *ngFor=\"let option of options\"\n (click)=\"onOptionClick(option, selectContainer)\"\n [class.selected]=\"\n multiple\n ? returnObject\n ? value?.includes(option)\n : value?.includes(option[optionValue])\n : returnObject\n ? option === value\n : option[optionValue] === value\n \"\n >\n <span>\n <span *ngIf=\"multiple\" class=\"cps-select-options-option-check\">\n </span>\n <span class=\"cps-select-options-option-label\">{{\n option[optionLabel]\n }}</span>\n </span>\n\n <span class=\"cps-select-options-option-info\">{{\n option[optionInfo]\n }}</span>\n </div>\n </div>\n </div>\n <div *ngIf=\"!error && !hideDetails\" class=\"cps-select-hint\">{{ hint }}</div>\n <div *ngIf=\"error && !hideDetails\" class=\"cps-select-error\">{{ error }}</div>\n</div>\n", styles: [":host{display:flex}:host .cps-select{position:relative;width:100%;outline:none;font-family:Source Sans Pro,sans-serif}:host .cps-select.active .cps-select-options{display:block}:host .cps-select.active .cps-select-box{border:1px solid var(--cps-color-calm)}:host .cps-select .cps-select-label{display:inline-block;margin-bottom:.2rem;color:var(--cps-color-text-dark);font-size:.875rem}:host .cps-select .cps-select-box{overflow:hidden;justify-content:space-between;min-height:38px;width:100%;cursor:pointer;background:white;font-size:1rem;outline:none;padding:0 12px;border-radius:4px;align-items:center;display:flex;border:1px solid var(--cps-color-text-lightest);transition-duration:.2s}:host .cps-select .cps-select-box-placeholder{color:var(--cps-color-text-lightest);font-style:italic}:host .cps-select .cps-select-box-items .text-group,:host .cps-select .cps-select-box-items .single-item{color:var(--cps-color-text-dark);padding-top:3px;padding-bottom:3px}:host .cps-select .cps-select-box-items .chips-group cps-chip{padding-bottom:3px;padding-top:3px;padding-right:4px}text-group :host .cps-select .cps-select-box:hover{border:1px solid var(--cps-color-calm)}:host .cps-select .cps-select-box .cps-select-box-icons{display:flex}:host .cps-select .cps-select-box .cps-select-box-icons .cps-select-box-clear-icon{display:flex;color:var(--cps-color-calm);margin-left:8px}:host .cps-select .cps-select-box .cps-select-box-icons .cps-select-box-clear-icon cps-icon{opacity:.5;transition-duration:.2s}:host .cps-select .cps-select-box .cps-select-box-icons .cps-select-box-clear-icon cps-icon:hover{opacity:1}:host .cps-select .cps-select-box .cps-select-box-icons .cps-select-box-chevron{display:flex;margin-left:8px;transition-duration:.2s}:host .cps-select.active .cps-select-box-chevron{top:22px;transform:rotate(180deg)}:host .cps-select .cps-select-options{z-index:1001;position:absolute;width:100%;background:white;box-shadow:0 5px 20px #0000000d;border-radius:4px;overflow-x:hidden;display:none;max-height:240px;overflow-y:auto;box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f}:host .cps-select .cps-select-options .cps-select-options-option{padding:12px;justify-content:space-between;display:flex;cursor:pointer}:host .cps-select .cps-select-options .cps-select-options-option:hover{background:#f8f4f5}:host .cps-select .cps-select-options .cps-select-options-option-label{color:var(--cps-color-text-dark)}:host .cps-select .cps-select-options .cps-select-options-option-info{color:var(--cps-color-text-light)}:host .cps-select .cps-select-options .cps-select-options-option-check{background-color:transparent;border:0;width:16px;height:16px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0,0,.2,.1),background-color 90ms cubic-bezier(0,0,.2,.1);margin-right:8px;opacity:0}:host .cps-select .cps-select-options .cps-select-options-option-check:after{color:var(--cps-color-calm);top:4px;left:1px;width:8px;height:3px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box;position:absolute;content:\"\";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0,0,.2,.1)}:host .cps-select .cps-select-options .cps-select-options-option.selected,:host .cps-select .cps-select-options .cps-select-options-option.allselected{font-weight:600}:host .cps-select .cps-select-options .cps-select-options-option.selected .cps-select-options-option-label,:host .cps-select .cps-select-options .cps-select-options-option.allselected .cps-select-options-option-label{color:var(--cps-color-calm)}:host .cps-select .cps-select-options .cps-select-options-option.selected .cps-select-options-option-check,:host .cps-select .cps-select-options .cps-select-options-option.allselected .cps-select-options-option-check{opacity:1}:host .cps-select .cps-select-options .cps-select-options-option.selected{background:#efe4e7}:host .cps-select .cps-select-hint{color:var(--cps-color-text-mild);font-size:.75rem;min-height:1.125rem;cursor:default;margin-top:.2rem}:host .cps-select .cps-select-error{color:#c33;font-weight:700;font-size:.75rem;min-height:1.125rem;cursor:default;margin-top:.2rem}:host .cps-select.disabled{pointer-events:none}:host .cps-select.disabled .cps-select-box{background:#f7f7f7}:host .cps-select.disabled .cps-select-box-items{color:var(--cps-color-text-light)}:host .cps-select.disabled .cps-select-box-items .text-group,:host .cps-select.disabled .cps-select-box-items .single-item{color:var(--cps-color-text-light)}:host .cps-select.disabled .cps-select-label{color:var(--cps-color-text-mild)}:host .cps-select.error .cps-select-box{border-color:#c33!important;background:#fef3f2!important}:host .cps-select .select-all-option{border-bottom:1px solid lightgrey;font-weight:600}\n"] }]
778
+ }], ctorParameters: function () {
779
+ return [{ type: i1.NgControl, decorators: [{
780
+ type: Self
781
+ }, {
782
+ type: Optional
783
+ }] }];
784
+ }, propDecorators: { label: [{
785
+ type: Input
786
+ }], placeholder: [{
787
+ type: Input
788
+ }], hint: [{
789
+ type: Input
790
+ }], returnObject: [{
791
+ type: Input
792
+ }], multiple: [{
793
+ type: Input
794
+ }], disabled: [{
795
+ type: Input
796
+ }], width: [{
797
+ type: Input
798
+ }], selectAll: [{
799
+ type: Input
800
+ }], chips: [{
801
+ type: Input
802
+ }], closableChips: [{
803
+ type: Input
804
+ }], clearable: [{
805
+ type: Input
806
+ }], openOnClear: [{
807
+ type: Input
808
+ }], options: [{
809
+ type: Input
810
+ }], optionLabel: [{
811
+ type: Input
812
+ }], optionValue: [{
813
+ type: Input
814
+ }], optionInfo: [{
815
+ type: Input
816
+ }], hideDetails: [{
817
+ type: Input
818
+ }], _value: [{
819
+ type: Input,
820
+ args: ['value']
821
+ }], valueChanged: [{
822
+ type: Output
823
+ }], selectContainer: [{
824
+ type: ViewChild,
825
+ args: ['selectContainer']
826
+ }] } });
827
+
828
+ class CpsButtonComponent {
829
+ constructor() {
830
+ this.color = 'calm';
831
+ this.contentColor = 'white'; // works only with solid type
832
+ this.type = 'solid';
833
+ this.label = '';
834
+ this.icon = '';
835
+ this.iconPosition = 'before';
836
+ this.size = 'normal';
837
+ this.width = 0;
838
+ this.height = 0;
839
+ this.disabled = false;
840
+ this.loading = false;
841
+ this.clicked = new EventEmitter();
842
+ this.buttonColor = '';
843
+ this.textColor = '';
844
+ this.cvtWidth = '';
845
+ this.cvtHeight = '';
846
+ this.cvtFontSize = '';
847
+ this.cvtIconSize = '';
848
+ this.classesList = [];
849
+ }
850
+ ngOnInit() {
851
+ this.buttonColor = getCSSColor(this.color);
852
+ this.textColor =
853
+ this.type === 'solid' ? getCSSColor(this.contentColor) : this.buttonColor;
854
+ this.setClasses();
855
+ }
856
+ setClasses() {
857
+ this.classesList = ['button'];
858
+ if (this.width) {
859
+ this.cvtWidth = convertSize(this.width);
860
+ }
861
+ if (this.height) {
862
+ this.cvtHeight = convertSize(this.height);
863
+ if (this.cvtHeight) {
864
+ const parsedHeight = parseSize(this.cvtHeight);
865
+ const unit = parsedHeight.unit;
866
+ const size = parsedHeight.value * 0.4;
867
+ const isPx = unit === 'px';
868
+ this.cvtFontSize = `${isPx ? Math.floor(size) : size}${unit}`;
869
+ this.cvtIconSize = `${isPx ? Math.ceil(size) : size}${unit}`;
870
+ }
871
+ }
872
+ else {
873
+ switch (this.size) {
874
+ case 'normal': {
875
+ this.classesList.push('button--normal');
876
+ break;
877
+ }
878
+ case 'large': {
879
+ this.classesList.push('button--large');
880
+ break;
881
+ }
882
+ case 'small': {
883
+ this.classesList.push('button--small');
884
+ break;
885
+ }
886
+ case 'xsmall': {
887
+ this.classesList.push('button--xsmall');
888
+ break;
889
+ }
890
+ }
891
+ }
892
+ switch (this.type) {
893
+ case 'solid': {
894
+ this.classesList.push('button--solid');
895
+ break;
896
+ }
897
+ case 'outlined': {
898
+ this.classesList.push('button--outlined');
899
+ break;
900
+ }
901
+ case 'borderless': {
902
+ this.classesList.push('button--borderless');
903
+ break;
904
+ }
905
+ }
906
+ if (this.icon && this.label) {
907
+ switch (this.iconPosition) {
908
+ case 'before': {
909
+ this.classesList.push('button--icon-before');
910
+ break;
911
+ }
912
+ case 'after': {
913
+ this.classesList.push('button--icon-after');
914
+ break;
915
+ }
916
+ }
917
+ }
918
+ }
919
+ onClick(event) {
920
+ this.clicked.emit(event);
921
+ }
922
+ }
923
+ CpsButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
924
+ CpsButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CpsButtonComponent, isStandalone: true, selector: "cps-button", inputs: { color: "color", contentColor: "contentColor", type: "type", label: "label", icon: "icon", iconPosition: "iconPosition", size: "size", width: "width", height: "height", disabled: "disabled", loading: "loading" }, outputs: { clicked: "clicked" }, host: { properties: { "style.width": "this.cvtWidth" } }, ngImport: i0, template: "<div>\n <button\n type=\"button\"\n [ngClass]=\"classesList\"\n [disabled]=\"disabled || loading\"\n [class.spinner]=\"loading\"\n (click)=\"onClick($event)\"\n [ngStyle]=\"{\n 'background-color': type==='solid' ? buttonColor : 'transparent',\n color: textColor,\n height: cvtHeight || 'none',\n }\"\n >\n <div class=\"button__content\">\n <cps-icon\n *ngIf=\"icon\"\n class=\"button__icon\"\n [icon]=\"icon\"\n [color]=\"disabled ? 'text-light' : textColor\"\n [size]=\"cvtIconSize\"\n >\n </cps-icon>\n <span\n class=\"button__text\"\n *ngIf=\"label\"\n [ngStyle]=\"{ 'font-size': cvtFontSize || null }\"\n >{{ label }}</span\n >\n </div>\n </button>\n</div>\n", styles: [":host{width:-moz-fit-content;width:fit-content;display:inline-block}:host .button{width:100%;letter-spacing:normal;display:inline-flex;align-items:center;justify-content:center;position:relative;border-radius:4px;border:none;cursor:pointer;outline:none;padding:0 16px;font-weight:500}:host .button:hover:not(:active):not(:disabled){background-image:linear-gradient(hsla(0,0%,100%,.1) 0 0);box-shadow:0 2px 4px #0c0c0d33}:host .button:active:not(:disabled){background-image:linear-gradient(hsla(0,0%,0%,.1) 0 0)}:host .button__content{display:inline-flex}:host .button__icon{align-self:center}:host .button:disabled{cursor:default}:host .button--solid{border:0}:host .button--solid:disabled{background-color:var(--cps-color-line-mid)!important;color:var(--cps-color-text-light)!important}:host .button--outlined{border:2px solid;box-sizing:border-box}:host .button--outlined:disabled{border-color:var(--cps-color-line-dark)!important;color:var(--cps-color-text-light)!important}:host .button--borderless:disabled{color:var(--cps-color-text-light)!important}:host .button--borderless:hover:not(:active):not(:disabled){box-shadow:0 1px 4px #0c0c0d1a}:host .button--large{min-height:48px}:host .button--large .button__icon{width:20px;height:20px}:host .button--large .button__text{font-size:20px}:host .button--large.spinner{min-width:56px}:host .button--large.spinner:after{width:22px;height:22px}:host .button--normal{min-height:40px}:host .button--normal .button__icon{width:16px;height:16px}:host .button--normal .button__text{font-size:16px}:host .button--normal.spinner{min-width:48px}:host .button--small{min-height:32px}:host .button--small .button__icon{width:14px;height:14px}:host .button--small .button__text{font-size:14px}:host .button--small.spinner{min-width:40px}:host .button--small.spinner:after{width:14px;height:14px}:host .button--xsmall{min-height:24px}:host .button--xsmall .button__icon{width:12px;height:12px}:host .button--xsmall .button__text{font-size:12px}:host .button--xsmall.spinner{min-width:32px}:host .button--xsmall.spinner:after{width:10px;height:10px}:host .button.button--icon-before .button__icon{margin-right:8px}:host .button.button--icon-after .button__icon{margin-left:8px;order:1}:host .spinner{position:relative}:host .spinner:after{content:\"\";position:absolute;border-radius:100%;width:18px;height:18px;border:2px solid transparent;border-left-color:currentColor;border-top-color:currentColor;animation:spin .75s linear infinite;inset:0;margin:auto}:host .spinner .button__content{visibility:hidden}@keyframes spin{to{transform:rotate(1turn)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: CpsIconComponent, selector: "cps-icon", inputs: ["icon", "size", "color"] }] });
925
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsButtonComponent, decorators: [{
926
+ type: Component,
927
+ args: [{ standalone: true, imports: [CommonModule, CpsIconComponent], selector: 'cps-button', template: "<div>\n <button\n type=\"button\"\n [ngClass]=\"classesList\"\n [disabled]=\"disabled || loading\"\n [class.spinner]=\"loading\"\n (click)=\"onClick($event)\"\n [ngStyle]=\"{\n 'background-color': type==='solid' ? buttonColor : 'transparent',\n color: textColor,\n height: cvtHeight || 'none',\n }\"\n >\n <div class=\"button__content\">\n <cps-icon\n *ngIf=\"icon\"\n class=\"button__icon\"\n [icon]=\"icon\"\n [color]=\"disabled ? 'text-light' : textColor\"\n [size]=\"cvtIconSize\"\n >\n </cps-icon>\n <span\n class=\"button__text\"\n *ngIf=\"label\"\n [ngStyle]=\"{ 'font-size': cvtFontSize || null }\"\n >{{ label }}</span\n >\n </div>\n </button>\n</div>\n", styles: [":host{width:-moz-fit-content;width:fit-content;display:inline-block}:host .button{width:100%;letter-spacing:normal;display:inline-flex;align-items:center;justify-content:center;position:relative;border-radius:4px;border:none;cursor:pointer;outline:none;padding:0 16px;font-weight:500}:host .button:hover:not(:active):not(:disabled){background-image:linear-gradient(hsla(0,0%,100%,.1) 0 0);box-shadow:0 2px 4px #0c0c0d33}:host .button:active:not(:disabled){background-image:linear-gradient(hsla(0,0%,0%,.1) 0 0)}:host .button__content{display:inline-flex}:host .button__icon{align-self:center}:host .button:disabled{cursor:default}:host .button--solid{border:0}:host .button--solid:disabled{background-color:var(--cps-color-line-mid)!important;color:var(--cps-color-text-light)!important}:host .button--outlined{border:2px solid;box-sizing:border-box}:host .button--outlined:disabled{border-color:var(--cps-color-line-dark)!important;color:var(--cps-color-text-light)!important}:host .button--borderless:disabled{color:var(--cps-color-text-light)!important}:host .button--borderless:hover:not(:active):not(:disabled){box-shadow:0 1px 4px #0c0c0d1a}:host .button--large{min-height:48px}:host .button--large .button__icon{width:20px;height:20px}:host .button--large .button__text{font-size:20px}:host .button--large.spinner{min-width:56px}:host .button--large.spinner:after{width:22px;height:22px}:host .button--normal{min-height:40px}:host .button--normal .button__icon{width:16px;height:16px}:host .button--normal .button__text{font-size:16px}:host .button--normal.spinner{min-width:48px}:host .button--small{min-height:32px}:host .button--small .button__icon{width:14px;height:14px}:host .button--small .button__text{font-size:14px}:host .button--small.spinner{min-width:40px}:host .button--small.spinner:after{width:14px;height:14px}:host .button--xsmall{min-height:24px}:host .button--xsmall .button__icon{width:12px;height:12px}:host .button--xsmall .button__text{font-size:12px}:host .button--xsmall.spinner{min-width:32px}:host .button--xsmall.spinner:after{width:10px;height:10px}:host .button.button--icon-before .button__icon{margin-right:8px}:host .button.button--icon-after .button__icon{margin-left:8px;order:1}:host .spinner{position:relative}:host .spinner:after{content:\"\";position:absolute;border-radius:100%;width:18px;height:18px;border:2px solid transparent;border-left-color:currentColor;border-top-color:currentColor;animation:spin .75s linear infinite;inset:0;margin:auto}:host .spinner .button__content{visibility:hidden}@keyframes spin{to{transform:rotate(1turn)}}\n"] }]
928
+ }], propDecorators: { color: [{
929
+ type: Input
930
+ }], contentColor: [{
931
+ type: Input
932
+ }], type: [{
933
+ type: Input
934
+ }], label: [{
935
+ type: Input
936
+ }], icon: [{
937
+ type: Input
938
+ }], iconPosition: [{
939
+ type: Input
940
+ }], size: [{
941
+ type: Input
942
+ }], width: [{
943
+ type: Input
944
+ }], height: [{
945
+ type: Input
946
+ }], disabled: [{
947
+ type: Input
948
+ }], loading: [{
949
+ type: Input
950
+ }], clicked: [{
951
+ type: Output
952
+ }], cvtWidth: [{
953
+ type: HostBinding,
954
+ args: ['style.width']
955
+ }] } });
956
+
957
+ class CpsCheckboxComponent {
958
+ set value(value) {
959
+ this._value = value;
960
+ this.onChange(value);
961
+ }
962
+ get value() {
963
+ return this._value;
964
+ }
965
+ constructor(_control, _elementRef) {
966
+ this._control = _control;
967
+ this._elementRef = _elementRef;
968
+ this.label = '';
969
+ this.disabled = false;
970
+ this.valueChanged = new EventEmitter();
971
+ this._value = false;
972
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
973
+ this.onChange = (event) => { };
974
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
975
+ this.onTouched = () => { };
976
+ if (this._control) {
977
+ this._control.valueAccessor = this;
978
+ }
979
+ }
980
+ registerOnChange(fn) {
981
+ this.onChange = fn;
982
+ }
983
+ registerOnTouched(fn) {
984
+ this.onTouched = fn;
985
+ }
986
+ writeValue(value) {
987
+ this.value = value;
988
+ }
989
+ updateValueEvent(event) {
990
+ event.preventDefault();
991
+ if (this.disabled)
992
+ return;
993
+ this._updateValue(!this.value);
994
+ }
995
+ _updateValue(value) {
996
+ this.writeValue(value);
997
+ this.onChange(value);
998
+ this.valueChanged.emit(value);
999
+ }
1000
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1001
+ setDisabledState(disabled) { }
1002
+ focus() {
1003
+ var _a, _b, _c;
1004
+ (_c = (_b = (_a = this._elementRef) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.querySelector('input')) === null || _c === void 0 ? void 0 : _c.focus();
1005
+ }
1006
+ }
1007
+ CpsCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsCheckboxComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1008
+ CpsCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CpsCheckboxComponent, isStandalone: true, selector: "cps-checkbox", inputs: { label: "label", disabled: "disabled", value: "value" }, outputs: { valueChanged: "valueChanged" }, ngImport: i0, template: "<div class=\"checkbox-container\">\n <label\n class=\"checkbox\"\n [ngStyle]=\"{ cursor: disabled ? 'default' : 'pointer' }\"\n >\n <span class=\"label\" [ngClass]=\"{ 'label-disabled': disabled }\">{{\n label\n }}</span>\n <input\n type=\"checkbox\"\n [disabled]=\"disabled\"\n [checked]=\"value\"\n (change)=\"updateValueEvent($event)\"\n />\n <span class=\"indicator\"></span>\n </label>\n</div>\n", styles: [":host{min-width:max-content;display:inline-block}:host .checkbox-container{line-height:normal}:host .checkbox-container label.checkbox{padding-left:1.75rem;position:relative;-webkit-user-select:none;user-select:none}:host .checkbox-container label.checkbox input[type=checkbox]{display:none}:host .checkbox-container label.checkbox input[type=checkbox]:hover:not(:disabled)~.indicator{border-color:var(--cps-color-calm)}:host .checkbox-container label.checkbox input[type=checkbox]:checked~.indicator{color:#fff;background:var(--cps-color-calm) url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+DQo8c3ZnIHdpZHRoPSIxMiIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgMTIgOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCiAgPHBhdGggZD0iTTQuNTc1IDguOTc3cy0uNDA0LS4wMDctLjUzNi0uMTY1TC4wNTcgNS42NGwuODI5LTEuMjI3TDQuNDcgNy4yNjggMTAuOTIxLjA4NmwuOTIzIDEuMTAzLTYuODYzIDcuNjRjLS4xMzQtLjAwMy0uNDA2LjE0OC0uNDA2LjE0OHoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KPC9zdmc+) 50% 40% no-repeat;border:2px solid var(--cps-color-calm)}:host .checkbox-container label.checkbox input[type=checkbox]:disabled:checked~.indicator{background:var(--cps-color-text-lightest) url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+DQo8c3ZnIHdpZHRoPSIxMiIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgMTIgOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCiAgPHBhdGggZD0iTTQuNTc1IDguOTc3cy0uNDA0LS4wMDctLjUzNi0uMTY1TC4wNTcgNS42NGwuODI5LTEuMjI3TDQuNDcgNy4yNjggMTAuOTIxLjA4NmwuOTIzIDEuMTAzLTYuODYzIDcuNjRjLS4xMzQtLjAwMy0uNDA2LjE0OC0uNDA2LjE0OHoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KPC9zdmc+) 50% 40% no-repeat;border-color:var(--cps-color-text-lightest)}:host .checkbox-container label.checkbox input[type=checkbox]:disabled~.indicator{border-color:var(--cps-color-text-light)}:host .checkbox-container label.checkbox .label{top:1px;position:relative;color:var(--cps-color-text-dark)}:host .checkbox-container label.checkbox .label-disabled{color:var(--cps-color-text-light)}:host .checkbox-container label.checkbox .indicator{border-radius:2px;position:absolute;left:0;width:18px;height:18px;border:2px solid var(--cps-color-text-dark);pointer-events:none;-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1009
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsCheckboxComponent, decorators: [{
1010
+ type: Component,
1011
+ args: [{ standalone: true, imports: [CommonModule], selector: 'cps-checkbox', template: "<div class=\"checkbox-container\">\n <label\n class=\"checkbox\"\n [ngStyle]=\"{ cursor: disabled ? 'default' : 'pointer' }\"\n >\n <span class=\"label\" [ngClass]=\"{ 'label-disabled': disabled }\">{{\n label\n }}</span>\n <input\n type=\"checkbox\"\n [disabled]=\"disabled\"\n [checked]=\"value\"\n (change)=\"updateValueEvent($event)\"\n />\n <span class=\"indicator\"></span>\n </label>\n</div>\n", styles: [":host{min-width:max-content;display:inline-block}:host .checkbox-container{line-height:normal}:host .checkbox-container label.checkbox{padding-left:1.75rem;position:relative;-webkit-user-select:none;user-select:none}:host .checkbox-container label.checkbox input[type=checkbox]{display:none}:host .checkbox-container label.checkbox input[type=checkbox]:hover:not(:disabled)~.indicator{border-color:var(--cps-color-calm)}:host .checkbox-container label.checkbox input[type=checkbox]:checked~.indicator{color:#fff;background:var(--cps-color-calm) url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+DQo8c3ZnIHdpZHRoPSIxMiIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgMTIgOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCiAgPHBhdGggZD0iTTQuNTc1IDguOTc3cy0uNDA0LS4wMDctLjUzNi0uMTY1TC4wNTcgNS42NGwuODI5LTEuMjI3TDQuNDcgNy4yNjggMTAuOTIxLjA4NmwuOTIzIDEuMTAzLTYuODYzIDcuNjRjLS4xMzQtLjAwMy0uNDA2LjE0OC0uNDA2LjE0OHoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KPC9zdmc+) 50% 40% no-repeat;border:2px solid var(--cps-color-calm)}:host .checkbox-container label.checkbox input[type=checkbox]:disabled:checked~.indicator{background:var(--cps-color-text-lightest) url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+DQo8c3ZnIHdpZHRoPSIxMiIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgMTIgOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCiAgPHBhdGggZD0iTTQuNTc1IDguOTc3cy0uNDA0LS4wMDctLjUzNi0uMTY1TC4wNTcgNS42NGwuODI5LTEuMjI3TDQuNDcgNy4yNjggMTAuOTIxLjA4NmwuOTIzIDEuMTAzLTYuODYzIDcuNjRjLS4xMzQtLjAwMy0uNDA2LjE0OC0uNDA2LjE0OHoiIGZpbGw9IiNGRkYiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KPC9zdmc+) 50% 40% no-repeat;border-color:var(--cps-color-text-lightest)}:host .checkbox-container label.checkbox input[type=checkbox]:disabled~.indicator{border-color:var(--cps-color-text-light)}:host .checkbox-container label.checkbox .label{top:1px;position:relative;color:var(--cps-color-text-dark)}:host .checkbox-container label.checkbox .label-disabled{color:var(--cps-color-text-light)}:host .checkbox-container label.checkbox .indicator{border-radius:2px;position:absolute;left:0;width:18px;height:18px;border:2px solid var(--cps-color-text-dark);pointer-events:none;-webkit-user-select:none;user-select:none}\n"] }]
1012
+ }], ctorParameters: function () {
1013
+ return [{ type: i1.NgControl, decorators: [{
1014
+ type: Self
1015
+ }, {
1016
+ type: Optional
1017
+ }] }, { type: i0.ElementRef }];
1018
+ }, propDecorators: { label: [{
1019
+ type: Input
1020
+ }], disabled: [{
1021
+ type: Input
1022
+ }], value: [{
1023
+ type: Input
1024
+ }], valueChanged: [{
1025
+ type: Output
1026
+ }] } });
1027
+
1028
+ class CpsRadioComponent {
1029
+ set value(value) {
1030
+ this._value = value;
1031
+ this.onChange(value);
1032
+ }
1033
+ get value() {
1034
+ return this._value;
1035
+ }
1036
+ constructor(_control) {
1037
+ this._control = _control;
1038
+ this.options = [];
1039
+ this.groupLabel = '';
1040
+ this.vertical = false;
1041
+ this.disabled = false;
1042
+ this.valueChanged = new EventEmitter();
1043
+ this._value = undefined;
1044
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1045
+ this.onChange = (event) => { };
1046
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1047
+ this.onTouched = () => { };
1048
+ if (this._control) {
1049
+ this._control.valueAccessor = this;
1050
+ }
1051
+ }
1052
+ registerOnChange(fn) {
1053
+ this.onChange = fn;
1054
+ }
1055
+ registerOnTouched(fn) {
1056
+ this.onTouched = fn;
1057
+ }
1058
+ writeValue(value) {
1059
+ this.value = value;
1060
+ }
1061
+ updateValueEvent(event) {
1062
+ var _a;
1063
+ event.preventDefault();
1064
+ if (this.disabled)
1065
+ return;
1066
+ const value = ((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value) || '';
1067
+ this._updateValue(value);
1068
+ }
1069
+ _updateValue(value) {
1070
+ this.writeValue(value);
1071
+ this.onChange(value);
1072
+ this.valueChanged.emit(value);
1073
+ }
1074
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1075
+ setDisabledState(disabled) { }
1076
+ }
1077
+ CpsRadioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsRadioComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
1078
+ CpsRadioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CpsRadioComponent, isStandalone: true, selector: "cps-radio", inputs: { options: "options", groupLabel: "groupLabel", vertical: "vertical", disabled: "disabled", value: "value" }, outputs: { valueChanged: "valueChanged" }, ngImport: i0, template: "<div class=\"radio-group\">\n <div class=\"radio-group-label\" *ngIf=\"groupLabel\">\n <span>{{ groupLabel }}</span>\n </div>\n <div\n class=\"radio-group-content\"\n [ngClass]=\"\n vertical\n ? 'radio-group-content-vertical'\n : 'radio-group-content-horizontal'\n \"\n >\n <label\n *ngFor=\"let option of options\"\n class=\"radio-group-content-button\"\n [ngStyle]=\"{\n cursor: option.disabled || disabled ? 'default' : 'pointer'\n }\"\n >\n <input\n type=\"radio\"\n [disabled]=\"option.disabled || disabled\"\n [value]=\"option.value\"\n [checked]=\"value === option.value\"\n (change)=\"updateValueEvent($event)\"\n />\n <span class=\"radio-group-content-button-label\">{{ option.label }}</span>\n </label>\n </div>\n</div>\n", styles: [":host{width:-moz-fit-content;width:fit-content;display:inline-block}:host .radio-group-label{color:var(--cps-color-text-dark);margin-bottom:.75rem}:host .radio-group-content{margin-left:.5rem;gap:1.25rem}:host .radio-group-content-vertical{display:grid}:host .radio-group-content-horizontal{display:flex;flex-direction:row;flex-wrap:wrap}:host .radio-group-content-button{display:grid;grid-template-columns:1em auto;gap:.75em}:host .radio-group-content-button-label{font-size:1rem;align-self:center;color:var(--cps-color-text-dark)}:host .radio-group-content-button input[type=radio]{-webkit-appearance:none;appearance:none;background-color:transparent;margin:0;cursor:pointer;font:inherit;color:var(--cps-color-text-dark);width:1.25em;height:1.25em;border:.15em solid currentColor;border-radius:50%;transform:translateY(-.075em);display:grid;place-content:center}:host .radio-group-content-button input[type=radio]:hover,:host .radio-group-content-button input[type=radio]:checked{color:var(--cps-color-calm)}:host .radio-group-content-button input[type=radio]:disabled{color:var(--cps-color-text-lightest);cursor:default}:host .radio-group-content-button input[type=radio]:before{content:\"\";width:.625em;height:.625em;border-radius:50%;transform:scale(0);transition:.12s transform ease-in-out;box-shadow:inset 1em 1em var(--cps-color-calm);background-color:CanvasText}:host .radio-group-content-button input[type=radio][disabled]:before{box-shadow:inset 1em 1em var(--cps-color-text-lightest)}:host .radio-group-content-button input[type=radio]:disabled+.radio-group-content-button-label{color:var(--cps-color-text-light)}:host .radio-group-content-button input[type=radio]:checked:before{transform:scale(1)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1079
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsRadioComponent, decorators: [{
1080
+ type: Component,
1081
+ args: [{ standalone: true, imports: [CommonModule], selector: 'cps-radio', template: "<div class=\"radio-group\">\n <div class=\"radio-group-label\" *ngIf=\"groupLabel\">\n <span>{{ groupLabel }}</span>\n </div>\n <div\n class=\"radio-group-content\"\n [ngClass]=\"\n vertical\n ? 'radio-group-content-vertical'\n : 'radio-group-content-horizontal'\n \"\n >\n <label\n *ngFor=\"let option of options\"\n class=\"radio-group-content-button\"\n [ngStyle]=\"{\n cursor: option.disabled || disabled ? 'default' : 'pointer'\n }\"\n >\n <input\n type=\"radio\"\n [disabled]=\"option.disabled || disabled\"\n [value]=\"option.value\"\n [checked]=\"value === option.value\"\n (change)=\"updateValueEvent($event)\"\n />\n <span class=\"radio-group-content-button-label\">{{ option.label }}</span>\n </label>\n </div>\n</div>\n", styles: [":host{width:-moz-fit-content;width:fit-content;display:inline-block}:host .radio-group-label{color:var(--cps-color-text-dark);margin-bottom:.75rem}:host .radio-group-content{margin-left:.5rem;gap:1.25rem}:host .radio-group-content-vertical{display:grid}:host .radio-group-content-horizontal{display:flex;flex-direction:row;flex-wrap:wrap}:host .radio-group-content-button{display:grid;grid-template-columns:1em auto;gap:.75em}:host .radio-group-content-button-label{font-size:1rem;align-self:center;color:var(--cps-color-text-dark)}:host .radio-group-content-button input[type=radio]{-webkit-appearance:none;appearance:none;background-color:transparent;margin:0;cursor:pointer;font:inherit;color:var(--cps-color-text-dark);width:1.25em;height:1.25em;border:.15em solid currentColor;border-radius:50%;transform:translateY(-.075em);display:grid;place-content:center}:host .radio-group-content-button input[type=radio]:hover,:host .radio-group-content-button input[type=radio]:checked{color:var(--cps-color-calm)}:host .radio-group-content-button input[type=radio]:disabled{color:var(--cps-color-text-lightest);cursor:default}:host .radio-group-content-button input[type=radio]:before{content:\"\";width:.625em;height:.625em;border-radius:50%;transform:scale(0);transition:.12s transform ease-in-out;box-shadow:inset 1em 1em var(--cps-color-calm);background-color:CanvasText}:host .radio-group-content-button input[type=radio][disabled]:before{box-shadow:inset 1em 1em var(--cps-color-text-lightest)}:host .radio-group-content-button input[type=radio]:disabled+.radio-group-content-button-label{color:var(--cps-color-text-light)}:host .radio-group-content-button input[type=radio]:checked:before{transform:scale(1)}\n"] }]
1082
+ }], ctorParameters: function () {
1083
+ return [{ type: i1.NgControl, decorators: [{
1084
+ type: Self
1085
+ }, {
1086
+ type: Optional
1087
+ }] }];
1088
+ }, propDecorators: { options: [{
1089
+ type: Input
1090
+ }], groupLabel: [{
1091
+ type: Input
1092
+ }], vertical: [{
1093
+ type: Input
1094
+ }], disabled: [{
1095
+ type: Input
1096
+ }], value: [{
1097
+ type: Input
1098
+ }], valueChanged: [{
1099
+ type: Output
1100
+ }] } });
1101
+
1102
+ class CpsTagComponent {
1103
+ set value(value) {
1104
+ this._value = value;
1105
+ this.onChange(value);
1106
+ }
1107
+ get value() {
1108
+ return this._value;
1109
+ }
1110
+ constructor(_control) {
1111
+ this._control = _control;
1112
+ this.type = 'custom'; // higher precedence over color
1113
+ this.label = '';
1114
+ this.color = '';
1115
+ this.disabled = false;
1116
+ this.selectable = false;
1117
+ this.valueChanged = new EventEmitter();
1118
+ this.classesList = [];
1119
+ this.tagColor = '';
1120
+ this._value = false;
1121
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1122
+ this.onChange = (event) => { };
1123
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1124
+ this.onTouched = () => { };
1125
+ if (this._control) {
1126
+ this._control.valueAccessor = this;
1127
+ }
1128
+ }
1129
+ ngOnChanges() {
1130
+ this.setClasses();
1131
+ }
1132
+ setClasses() {
1133
+ this.classesList = ['tag'];
1134
+ if (this.selectable) {
1135
+ this.classesList.push('tag--selectable');
1136
+ }
1137
+ if (this.disabled) {
1138
+ this.classesList.push('tag--disabled');
1139
+ }
1140
+ switch (this.type) {
1141
+ case 'security': {
1142
+ this.classesList.push('tag--security');
1143
+ break;
1144
+ }
1145
+ case 'classification': {
1146
+ this.classesList.push('tag--classification');
1147
+ break;
1148
+ }
1149
+ default:
1150
+ if (this.color)
1151
+ this.tagColor = getCSSColor(this.color);
1152
+ }
1153
+ }
1154
+ registerOnChange(fn) {
1155
+ this.onChange = fn;
1156
+ }
1157
+ registerOnTouched(fn) {
1158
+ this.onTouched = fn;
1159
+ }
1160
+ writeValue(value) {
1161
+ this.value = value;
1162
+ }
1163
+ toggleSelected() {
1164
+ if (this.disabled || !this.selectable)
1165
+ return;
1166
+ this._updateValue(!this.value);
1167
+ }
1168
+ _updateValue(value) {
1169
+ this.writeValue(value);
1170
+ this.onChange(value);
1171
+ this.valueChanged.emit(value);
1172
+ }
1173
+ }
1174
+ CpsTagComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsTagComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
1175
+ CpsTagComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CpsTagComponent, isStandalone: true, selector: "cps-tag", inputs: { type: "type", label: "label", color: "color", disabled: "disabled", selectable: "selectable", value: "value" }, outputs: { valueChanged: "valueChanged" }, usesOnChanges: true, ngImport: i0, template: "<div\n [ngClass]=\"classesList\"\n [class.unselected]=\"!value && selectable\"\n [ngStyle]=\"{ 'border-color': tagColor || 'none' }\"\n (click)=\"toggleSelected()\"\n>\n <p>{{ label }}</p>\n</div>\n", styles: [":host{width:-moz-fit-content;width:fit-content;display:inline-block;-webkit-user-select:none;user-select:none}:host .tag{min-height:25px;align-items:center;padding:0 10px;background-color:#fff;display:inline-flex;cursor:default;border:solid 1px;border-left:solid 4px}:host .tag.tag--security{border-color:var(--cps-color-warn)}:host .tag.tag--classification{border-color:var(--cps-color-info)}:host .tag.tag--selectable{cursor:pointer}:host .tag.tag--selectable:hover:not(:active):not(:disabled){box-shadow:1px 3px 4px #0000001a}:host .tag.tag--disabled{pointer-events:none;border-color:var(--cps-color-line-dark)!important}:host .tag.tag--disabled p{color:var(--cps-color-text-light)}:host .tag.unselected{border-color:var(--cps-color-text-light)!important}:host .tag p{margin:0;font-size:11px;color:var(--cps-color-text-dark)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1176
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CpsTagComponent, decorators: [{
1177
+ type: Component,
1178
+ args: [{ standalone: true, imports: [CommonModule], selector: 'cps-tag', template: "<div\n [ngClass]=\"classesList\"\n [class.unselected]=\"!value && selectable\"\n [ngStyle]=\"{ 'border-color': tagColor || 'none' }\"\n (click)=\"toggleSelected()\"\n>\n <p>{{ label }}</p>\n</div>\n", styles: [":host{width:-moz-fit-content;width:fit-content;display:inline-block;-webkit-user-select:none;user-select:none}:host .tag{min-height:25px;align-items:center;padding:0 10px;background-color:#fff;display:inline-flex;cursor:default;border:solid 1px;border-left:solid 4px}:host .tag.tag--security{border-color:var(--cps-color-warn)}:host .tag.tag--classification{border-color:var(--cps-color-info)}:host .tag.tag--selectable{cursor:pointer}:host .tag.tag--selectable:hover:not(:active):not(:disabled){box-shadow:1px 3px 4px #0000001a}:host .tag.tag--disabled{pointer-events:none;border-color:var(--cps-color-line-dark)!important}:host .tag.tag--disabled p{color:var(--cps-color-text-light)}:host .tag.unselected{border-color:var(--cps-color-text-light)!important}:host .tag p{margin:0;font-size:11px;color:var(--cps-color-text-dark)}\n"] }]
1179
+ }], ctorParameters: function () {
1180
+ return [{ type: i1.NgControl, decorators: [{
1181
+ type: Self
1182
+ }, {
1183
+ type: Optional
1184
+ }] }];
1185
+ }, propDecorators: { type: [{
1186
+ type: Input
1187
+ }], label: [{
1188
+ type: Input
1189
+ }], color: [{
1190
+ type: Input
1191
+ }], disabled: [{
1192
+ type: Input
1193
+ }], selectable: [{
1194
+ type: Input
1195
+ }], value: [{
1196
+ type: Input
1197
+ }], valueChanged: [{
1198
+ type: Output
1199
+ }] } });
1200
+
1201
+ /*
1202
+ * Public API Surface of cps-ui-kit
1203
+ */
1204
+
1205
+ /**
1206
+ * Generated bundle index. Do not edit.
1207
+ */
1208
+
1209
+ export { CpsButtonComponent, CpsCheckboxComponent, CpsChipComponent, CpsIconComponent, CpsInputComponent, CpsRadioComponent, CpsSelectComponent, CpsTagComponent, iconNames };
1210
+ //# sourceMappingURL=cps-ui-kit.mjs.map