@testgorilla/tgo-ui 4.1.2-beta → 4.1.3-beta

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 (141) hide show
  1. package/components/autocomplete/autocomplete.component.d.ts +1 -1
  2. package/components/autocomplete/autocomplete.component.module.d.ts +7 -8
  3. package/components/autocomplete/index.d.ts +5 -0
  4. package/components/autocomplete/public-api.d.ts +4 -0
  5. package/components/avatar/avatar.component.module.d.ts +1 -1
  6. package/components/avatar/index.d.ts +5 -0
  7. package/components/avatar/public-api.d.ts +4 -0
  8. package/components/card/index.d.ts +5 -0
  9. package/components/card/public-api.d.ts +4 -0
  10. package/components/checkbox/checkbox.component.d.ts +1 -1
  11. package/components/checkbox/checkbox.component.module.d.ts +4 -5
  12. package/components/checkbox/index.d.ts +5 -0
  13. package/components/checkbox/public-api.d.ts +4 -0
  14. package/components/core/has-validation-error.pipe.d.ts +15 -0
  15. package/components/core/keyboard-events.model.d.ts +11 -0
  16. package/components/core/public-api.d.ts +7 -0
  17. package/components/core/select-text.directive.d.ts +19 -0
  18. package/components/datepicker/datepicker.component.module.d.ts +1 -1
  19. package/components/dropdown/dropdown.component.module.d.ts +2 -3
  20. package/components/dropdown/index.d.ts +5 -0
  21. package/components/dropdown/public-api.d.ts +4 -0
  22. package/components/empty-state/index.d.ts +5 -0
  23. package/components/empty-state/public-api.d.ts +4 -0
  24. package/components/field/field.component.d.ts +1 -1
  25. package/components/field/field.component.module.d.ts +3 -5
  26. package/components/field/index.d.ts +5 -0
  27. package/components/field/public-api.d.ts +4 -0
  28. package/components/file-upload/file-upload.component.module.d.ts +1 -1
  29. package/components/filter-button/filter-button.component.module.d.ts +3 -3
  30. package/components/filter-button/index.d.ts +5 -0
  31. package/components/filter-button/public-api.d.ts +4 -0
  32. package/components/inline-field/index.d.ts +5 -0
  33. package/components/inline-field/inline-field.component.d.ts +2 -2
  34. package/components/inline-field/inline-field.component.module.d.ts +1 -1
  35. package/components/inline-field/public-api.d.ts +4 -0
  36. package/components/logo/index.d.ts +5 -0
  37. package/components/logo/public-api.d.ts +4 -0
  38. package/components/multi-input/multi-input.component.module.d.ts +5 -6
  39. package/components/navbar/mobile-navbar-side-sheet/mobile-navbar-side-sheet.component.d.ts +1 -1
  40. package/components/navbar/navbar.component.d.ts +2 -2
  41. package/components/navbar/navbar.component.module.d.ts +2 -2
  42. package/components/paginator/index.d.ts +5 -0
  43. package/components/paginator/public-api.d.ts +3 -0
  44. package/components/password-criteria/password.component.module.d.ts +2 -2
  45. package/components/password-strength/password-strength.component.module.d.ts +1 -1
  46. package/components/phone-input/phone-input.component.module.d.ts +2 -2
  47. package/components/progress-bar/index.d.ts +5 -0
  48. package/components/progress-bar/public-api.d.ts +3 -0
  49. package/components/prompt/prompt.component.d.ts +1 -1
  50. package/components/prompt/prompt.module.d.ts +3 -3
  51. package/components/radial-progress/index.d.ts +5 -0
  52. package/components/radial-progress/public-api.d.ts +4 -0
  53. package/components/radio-button/index.d.ts +5 -0
  54. package/components/radio-button/public-api.d.ts +4 -0
  55. package/components/radio-button/radio-button.component.d.ts +1 -1
  56. package/components/radio-button/radio-button.component.module.d.ts +1 -1
  57. package/components/rating/index.d.ts +5 -0
  58. package/components/rating/public-api.d.ts +3 -0
  59. package/components/scale/index.d.ts +5 -0
  60. package/components/scale/public-api.d.ts +3 -0
  61. package/components/segmented-bar/index.d.ts +5 -0
  62. package/components/segmented-bar/public-api.d.ts +4 -0
  63. package/components/segmented-button/index.d.ts +5 -0
  64. package/components/segmented-button/public-api.d.ts +4 -0
  65. package/components/selectable-card/selectable-card.component.d.ts +1 -1
  66. package/components/selectable-card/selectable-card.component.module.d.ts +2 -2
  67. package/components/side-sheet/side-sheet.component.module.d.ts +1 -1
  68. package/components/slider/index.d.ts +5 -0
  69. package/components/slider/public-api.d.ts +4 -0
  70. package/components/spider-chart/spider-chart.module.d.ts +1 -1
  71. package/components/spinner/index.d.ts +5 -0
  72. package/components/spinner/public-api.d.ts +4 -0
  73. package/components/stepper/stepper.component.module.d.ts +1 -1
  74. package/components/table/table.component.module.d.ts +1 -1
  75. package/components/tag/index.d.ts +5 -0
  76. package/components/tag/public-api.d.ts +4 -0
  77. package/components/toggle/index.d.ts +5 -0
  78. package/components/toggle/public-api.d.ts +3 -0
  79. package/components/toggle/toggle.component.module.d.ts +1 -1
  80. package/components/universal-skills-report/universal-skills-report.component.module.d.ts +1 -1
  81. package/components/universal-skills-spider-charts/universal-skills-spider-charts.component.module.d.ts +1 -1
  82. package/components/validation-error/index.d.ts +5 -0
  83. package/components/validation-error/public-api.d.ts +3 -0
  84. package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs +1045 -0
  85. package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs.map +1 -0
  86. package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +173 -0
  87. package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs.map +1 -0
  88. package/fesm2022/testgorilla-tgo-ui-components-card.mjs +164 -0
  89. package/fesm2022/testgorilla-tgo-ui-components-card.mjs.map +1 -0
  90. package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs +402 -0
  91. package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs.map +1 -0
  92. package/fesm2022/testgorilla-tgo-ui-components-core.mjs +240 -1
  93. package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +1 -1
  94. package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +434 -0
  95. package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +1 -0
  96. package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +326 -0
  97. package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs.map +1 -0
  98. package/fesm2022/testgorilla-tgo-ui-components-field.mjs +638 -0
  99. package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +1 -0
  100. package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +314 -0
  101. package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +1 -0
  102. package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +367 -0
  103. package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +1 -0
  104. package/fesm2022/testgorilla-tgo-ui-components-logo.mjs +218 -0
  105. package/fesm2022/testgorilla-tgo-ui-components-logo.mjs.map +1 -0
  106. package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs +110 -0
  107. package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs.map +1 -0
  108. package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs +128 -0
  109. package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs.map +1 -0
  110. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +152 -0
  111. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +1 -0
  112. package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs +373 -0
  113. package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs.map +1 -0
  114. package/fesm2022/testgorilla-tgo-ui-components-rating.mjs +150 -0
  115. package/fesm2022/testgorilla-tgo-ui-components-rating.mjs.map +1 -0
  116. package/fesm2022/testgorilla-tgo-ui-components-scale.mjs +158 -0
  117. package/fesm2022/testgorilla-tgo-ui-components-scale.mjs.map +1 -0
  118. package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs +137 -0
  119. package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs.map +1 -0
  120. package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs +128 -0
  121. package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs.map +1 -0
  122. package/fesm2022/testgorilla-tgo-ui-components-slider.mjs +274 -0
  123. package/fesm2022/testgorilla-tgo-ui-components-slider.mjs.map +1 -0
  124. package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs +108 -0
  125. package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs.map +1 -0
  126. package/fesm2022/testgorilla-tgo-ui-components-tag.mjs +239 -0
  127. package/fesm2022/testgorilla-tgo-ui-components-tag.mjs.map +1 -0
  128. package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs +216 -0
  129. package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs.map +1 -0
  130. package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs +79 -0
  131. package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs.map +1 -0
  132. package/fesm2022/testgorilla-tgo-ui.mjs +3057 -9093
  133. package/fesm2022/testgorilla-tgo-ui.mjs.map +1 -1
  134. package/package.json +99 -7
  135. package/public-api.d.ts +0 -63
  136. /package/{directives → components/autocomplete}/select-text.directive.d.ts +0 -0
  137. /package/{pipes → components/avatar}/name-initials.pipe.d.ts +0 -0
  138. /package/{utils → components/core}/autocomplete-utils.d.ts +0 -0
  139. /package/{models → components/core}/checkbox.model.d.ts +0 -0
  140. /package/{directives → components/core}/digits-only.directive.d.ts +0 -0
  141. /package/{utils → components/core}/hex-to-rgb.d.ts +0 -0
@@ -0,0 +1,137 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Input, Optional, Inject, Component, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i2 from '@angular/material/tooltip';
6
+ import { MatTooltipModule } from '@angular/material/tooltip';
7
+ import * as i3 from '@testgorilla/tgo-ui/components/icon';
8
+ import { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';
9
+ import * as i4 from '@testgorilla/tgo-ui/components/tooltip';
10
+ import { TooltipComponentModule } from '@testgorilla/tgo-ui/components/tooltip';
11
+ import { MatInputModule } from '@angular/material/input';
12
+
13
+ class SegmentedBarComponent {
14
+ /**
15
+ * The segments to be displayed in the segmented bar.
16
+ * @required true
17
+ * @type {SegmentedBar}
18
+ * @memberof SegmentedBarComponent
19
+ */
20
+ set segments(segments) {
21
+ this.segmentList = this.calculatePercentages(segments);
22
+ }
23
+ constructor(defaultAppTheme) {
24
+ this.defaultAppTheme = defaultAppTheme;
25
+ /**
26
+ * The width of the segmented bar. Defaults to '100%'.
27
+ * You can use '100%' or '100px' for this field. 100 is just an example
28
+ * @default '100%'
29
+ * @type {string}
30
+ * @memberof SegmentedBarComponent
31
+ */
32
+ this.width = '100%';
33
+ /**
34
+ * The size variant of the segmented bar. Can be 'small' or 'large'.
35
+ * Defaults to 'large'.
36
+ * @default 'large'
37
+ * @type {SegmentedBarVariant}
38
+ * @memberof SegmentedBarComponent
39
+ */
40
+ this.size = 'large';
41
+ /**
42
+ *
43
+ * Defines the application theme
44
+ *
45
+ * @type {ApplicationTheme}
46
+ * @memberof SegmentedBarComponent
47
+ */
48
+ this.applicationTheme = 'light';
49
+ /**
50
+ * A string representing the ARIA requirement for accessibility.
51
+ * This attribute is used to indicate whether an input field is required for form submission.
52
+ * @type {boolean}
53
+ * @memberof SegmentedBarComponent
54
+ */
55
+ this.ariaRequired = false;
56
+ /**
57
+ * Groups the tooltips into one template
58
+ *
59
+ * @type {boolean}
60
+ * @memberof SegmentedBarComponent
61
+ */
62
+ this.tooltipStats = false;
63
+ this.segmentList = [];
64
+ if (defaultAppTheme) {
65
+ this.applicationTheme = defaultAppTheme;
66
+ }
67
+ }
68
+ calculatePercentages(segments) {
69
+ const total = segments.reduce((sum, segment) => sum + segment.value, 0);
70
+ return segments.map(segment => {
71
+ let percentage = (segment.value / total) * 100;
72
+ let percentageLabel = '';
73
+ if (percentage === 0) {
74
+ percentageLabel = '0%';
75
+ }
76
+ else if (percentage > 0 && percentage < 1) {
77
+ percentageLabel = '>1%';
78
+ }
79
+ else {
80
+ percentageLabel = `${Math.ceil(percentage)}%`;
81
+ }
82
+ return { ...segment, percentage: percentageLabel };
83
+ });
84
+ }
85
+ get accessibleValueText() {
86
+ return this.segmentList
87
+ .map((segment, index) => `${segment.tooltip || `Value ${index}`}: ${segment.value}`)
88
+ .join(', ');
89
+ }
90
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SegmentedBarComponent, deps: [{ token: 'CANOPYUI_DEFAULT_APPLICATION_THEME', optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
91
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: SegmentedBarComponent, isStandalone: false, selector: "ui-segmented-bar", inputs: { width: "width", size: "size", segments: "segments", applicationTheme: "applicationTheme", ariaLabel: "ariaLabel", ariaRequired: "ariaRequired", tooltipStats: "tooltipStats" }, ngImport: i0, template: "<div\n class=\"segmented-bar-container\"\n [attr.theme]=\"applicationTheme\"\n [ngClass]=\"'segment-size-' + size\"\n [style.width]=\"width\"\n [uiTooltipTemplate]=\"segmentedStats\"\n [showTooltip]=\"tooltipStats\"\n [attr.aria-label]=\"accessibleValueText\"\n role=\"graphics-object\"\n [tabIndex]=\"0\"\n>\n <ng-container *ngFor=\"let segment of segmentList\">\n <div\n class=\"segmented-bar\"\n *ngIf=\"segment.value\"\n [ngClass]=\"segment.color\"\n [ngStyle]=\"{ flex: segment.value }\"\n [matTooltip]=\"!tooltipStats ? segment.tooltip ?? '' : ''\"\n [matTooltipClass]=\"applicationTheme\"\n [attr.aria-hidden]=\"true\"\n [attr.aria-required]=\"ariaRequired\"\n >\n <ui-icon *ngIf=\"segment.icon\" [applicationTheme]=\"applicationTheme\" [name]=\"segment.icon\"></ui-icon>\n <span>{{ segment.value }}</span>\n </div>\n </ng-container>\n</div>\n<ng-template #segmentedStats>\n <div class=\"stats-container\">\n <div class=\"name-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <div [class]=\"'point ' + segment.color\"></div>\n <span [class]=\"'label ' + segment.color\">{{ segment.tooltip }}</span>\n </div>\n }\n </div>\n\n <div class=\"value-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <span>{{ segment.value }}</span>\n </div>\n }\n </div>\n\n <div class=\"percentage-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <span>{{ segment.percentage }}</span>\n </div>\n }\n </div>\n\n </div>\n</ng-template>\n\n<ng-template #segmentedStats>\n <div class=\"stats-container\">\n <div class=\"name-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <div [class]=\"'point ' + segment.color\"></div>\n <span [class]=\"'label ' + segment.color\">{{ segment.tooltip }}</span>\n </div>\n }\n </div>\n\n <div class=\"value-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <span>{{ segment.value }}</span>\n </div>\n }\n </div>\n\n <div class=\"percentage-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <span>{{ segment.percentage }}</span>\n </div>\n }\n </div>\n\n </div>\n</ng-template>\n\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap\";.bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.segmented-bar-container{width:100%;display:flex;flex-direction:row}.segmented-bar-container.segment-size-small{height:16px}.segmented-bar-container.segment-size-large{height:30px}.segmented-bar-container .segmented-bar{color:#000;font-weight:700;display:flex;justify-content:center;align-items:center;background:#46a997}.segmented-bar-container .segmented-bar ui-icon{margin-right:4px}.segmented-bar-container .segmented-bar.teal{background:#46a997}.segmented-bar-container .segmented-bar.rhubarb{background:#cb7b7a}.segmented-bar-container .segmented-bar.light-teal{background:#cbd6cb}.segmented-bar-container .segmented-bar.grey{background:#ededed}.segmented-bar-container[theme=dark].segment-size-small,.segmented-bar-container[theme=light].segment-size-small{font-size:12px}.segmented-bar-container[theme=dark].segment-size-large,.segmented-bar-container[theme=light].segment-size-large{font-size:14px}.segmented-bar-container[theme=dark] .segmented-bar,.segmented-bar-container[theme=light] .segmented-bar{padding:0 4px;color:#242424;background:#80d63e}.segmented-bar-container[theme=dark] .segmented-bar.teal,.segmented-bar-container[theme=light] .segmented-bar.teal{background:#80d63e}.segmented-bar-container[theme=dark] .segmented-bar.rhubarb,.segmented-bar-container[theme=light] .segmented-bar.rhubarb{background:#ffac9a}.segmented-bar-container[theme=dark] .segmented-bar.light-teal,.segmented-bar-container[theme=light] .segmented-bar.light-teal{background:#ffe1b3}.segmented-bar-container[theme=dark] .segmented-bar.grey,.segmented-bar-container[theme=light] .segmented-bar.grey{background:#e9e9e9}::ng-deep .mat-mdc-tooltip{background-color:#a9c2c9;font-family:Open Sans,serif;font-weight:400;font-size:12px;border-radius:4px;overflow:visible;max-width:248px;padding:6px 2px;--mdc-plain-tooltip-container-color: none;--mdc-plain-tooltip-supporting-text-color: $tgo-black}.stats-container{display:flex;flex-direction:row;max-width:248px}.stats-container .segment{display:flex;flex-direction:row;align-items:center}.stats-container .segment .point{margin-right:4px;width:8px;height:8px;border-radius:50%}.stats-container .segment .point.teal{background:#80d63e}.stats-container .segment .point.rhubarb{background:#ffac9a}.stats-container .segment .point.light-teal{background:#ffe1b3}.stats-container .segment .point.grey{background:#e9e9e9}.stats-container .segment .label{margin-right:8px}.stats-container .segment .label.teal{color:#80d63e}.stats-container .segment .label.rhubarb{color:#ffac9a}.stats-container .segment .label.light-teal{color:#ffe1b3}.stats-container .segment .label.grey{color:#e9e9e9}.stats-container .name-column span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}.stats-container .value-column{margin-right:8px;color:#fff;min-width:28px}.stats-container .percentage-column{min-width:28px;color:#919191}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i3.IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }, { kind: "directive", type: i4.TooltipTemplateDirective, selector: "[uiTooltipTemplate]", inputs: ["tooltipPosition", "showTooltip", "uiTooltipTemplate"] }] }); }
92
+ }
93
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SegmentedBarComponent, decorators: [{
94
+ type: Component,
95
+ args: [{ selector: 'ui-segmented-bar', standalone: false, template: "<div\n class=\"segmented-bar-container\"\n [attr.theme]=\"applicationTheme\"\n [ngClass]=\"'segment-size-' + size\"\n [style.width]=\"width\"\n [uiTooltipTemplate]=\"segmentedStats\"\n [showTooltip]=\"tooltipStats\"\n [attr.aria-label]=\"accessibleValueText\"\n role=\"graphics-object\"\n [tabIndex]=\"0\"\n>\n <ng-container *ngFor=\"let segment of segmentList\">\n <div\n class=\"segmented-bar\"\n *ngIf=\"segment.value\"\n [ngClass]=\"segment.color\"\n [ngStyle]=\"{ flex: segment.value }\"\n [matTooltip]=\"!tooltipStats ? segment.tooltip ?? '' : ''\"\n [matTooltipClass]=\"applicationTheme\"\n [attr.aria-hidden]=\"true\"\n [attr.aria-required]=\"ariaRequired\"\n >\n <ui-icon *ngIf=\"segment.icon\" [applicationTheme]=\"applicationTheme\" [name]=\"segment.icon\"></ui-icon>\n <span>{{ segment.value }}</span>\n </div>\n </ng-container>\n</div>\n<ng-template #segmentedStats>\n <div class=\"stats-container\">\n <div class=\"name-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <div [class]=\"'point ' + segment.color\"></div>\n <span [class]=\"'label ' + segment.color\">{{ segment.tooltip }}</span>\n </div>\n }\n </div>\n\n <div class=\"value-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <span>{{ segment.value }}</span>\n </div>\n }\n </div>\n\n <div class=\"percentage-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <span>{{ segment.percentage }}</span>\n </div>\n }\n </div>\n\n </div>\n</ng-template>\n\n<ng-template #segmentedStats>\n <div class=\"stats-container\">\n <div class=\"name-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <div [class]=\"'point ' + segment.color\"></div>\n <span [class]=\"'label ' + segment.color\">{{ segment.tooltip }}</span>\n </div>\n }\n </div>\n\n <div class=\"value-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <span>{{ segment.value }}</span>\n </div>\n }\n </div>\n\n <div class=\"percentage-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <span>{{ segment.percentage }}</span>\n </div>\n }\n </div>\n\n </div>\n</ng-template>\n\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap\";.bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.segmented-bar-container{width:100%;display:flex;flex-direction:row}.segmented-bar-container.segment-size-small{height:16px}.segmented-bar-container.segment-size-large{height:30px}.segmented-bar-container .segmented-bar{color:#000;font-weight:700;display:flex;justify-content:center;align-items:center;background:#46a997}.segmented-bar-container .segmented-bar ui-icon{margin-right:4px}.segmented-bar-container .segmented-bar.teal{background:#46a997}.segmented-bar-container .segmented-bar.rhubarb{background:#cb7b7a}.segmented-bar-container .segmented-bar.light-teal{background:#cbd6cb}.segmented-bar-container .segmented-bar.grey{background:#ededed}.segmented-bar-container[theme=dark].segment-size-small,.segmented-bar-container[theme=light].segment-size-small{font-size:12px}.segmented-bar-container[theme=dark].segment-size-large,.segmented-bar-container[theme=light].segment-size-large{font-size:14px}.segmented-bar-container[theme=dark] .segmented-bar,.segmented-bar-container[theme=light] .segmented-bar{padding:0 4px;color:#242424;background:#80d63e}.segmented-bar-container[theme=dark] .segmented-bar.teal,.segmented-bar-container[theme=light] .segmented-bar.teal{background:#80d63e}.segmented-bar-container[theme=dark] .segmented-bar.rhubarb,.segmented-bar-container[theme=light] .segmented-bar.rhubarb{background:#ffac9a}.segmented-bar-container[theme=dark] .segmented-bar.light-teal,.segmented-bar-container[theme=light] .segmented-bar.light-teal{background:#ffe1b3}.segmented-bar-container[theme=dark] .segmented-bar.grey,.segmented-bar-container[theme=light] .segmented-bar.grey{background:#e9e9e9}::ng-deep .mat-mdc-tooltip{background-color:#a9c2c9;font-family:Open Sans,serif;font-weight:400;font-size:12px;border-radius:4px;overflow:visible;max-width:248px;padding:6px 2px;--mdc-plain-tooltip-container-color: none;--mdc-plain-tooltip-supporting-text-color: $tgo-black}.stats-container{display:flex;flex-direction:row;max-width:248px}.stats-container .segment{display:flex;flex-direction:row;align-items:center}.stats-container .segment .point{margin-right:4px;width:8px;height:8px;border-radius:50%}.stats-container .segment .point.teal{background:#80d63e}.stats-container .segment .point.rhubarb{background:#ffac9a}.stats-container .segment .point.light-teal{background:#ffe1b3}.stats-container .segment .point.grey{background:#e9e9e9}.stats-container .segment .label{margin-right:8px}.stats-container .segment .label.teal{color:#80d63e}.stats-container .segment .label.rhubarb{color:#ffac9a}.stats-container .segment .label.light-teal{color:#ffe1b3}.stats-container .segment .label.grey{color:#e9e9e9}.stats-container .name-column span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}.stats-container .value-column{margin-right:8px;color:#fff;min-width:28px}.stats-container .percentage-column{min-width:28px;color:#919191}\n"] }]
96
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
97
+ type: Optional
98
+ }, {
99
+ type: Inject,
100
+ args: ['CANOPYUI_DEFAULT_APPLICATION_THEME']
101
+ }] }], propDecorators: { width: [{
102
+ type: Input
103
+ }], size: [{
104
+ type: Input
105
+ }], segments: [{
106
+ type: Input,
107
+ args: [{ required: true }]
108
+ }], applicationTheme: [{
109
+ type: Input
110
+ }], ariaLabel: [{
111
+ type: Input
112
+ }], ariaRequired: [{
113
+ type: Input
114
+ }], tooltipStats: [{
115
+ type: Input
116
+ }] } });
117
+
118
+ class SegmentedBarComponentModule {
119
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SegmentedBarComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
120
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: SegmentedBarComponentModule, declarations: [SegmentedBarComponent], imports: [CommonModule, MatTooltipModule, MatInputModule, IconComponentModule, TooltipComponentModule], exports: [SegmentedBarComponent] }); }
121
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SegmentedBarComponentModule, imports: [CommonModule, MatTooltipModule, MatInputModule, IconComponentModule, TooltipComponentModule] }); }
122
+ }
123
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SegmentedBarComponentModule, decorators: [{
124
+ type: NgModule,
125
+ args: [{
126
+ declarations: [SegmentedBarComponent],
127
+ imports: [CommonModule, MatTooltipModule, MatInputModule, IconComponentModule, TooltipComponentModule],
128
+ exports: [SegmentedBarComponent]
129
+ }]
130
+ }] });
131
+
132
+ /**
133
+ * Generated bundle index. Do not edit.
134
+ */
135
+
136
+ export { SegmentedBarComponent, SegmentedBarComponentModule };
137
+ //# sourceMappingURL=testgorilla-tgo-ui-components-segmented-bar.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testgorilla-tgo-ui-components-segmented-bar.mjs","sources":["../../../components/segmented-bar/segmented-bar.component.ts","../../../components/segmented-bar/segmented-bar.component.html","../../../components/segmented-bar/segmented-bar.component.module.ts","../../../components/segmented-bar/testgorilla-tgo-ui-components-segmented-bar.ts"],"sourcesContent":["import { Component, Inject, Input, Optional } from '@angular/core';\nimport { SegmentedBar, SegmentedBarVariant, SegmentedBarWithPercentage } from './segmented-bar.model';\nimport { ApplicationTheme } from \"@testgorilla/tgo-ui/components/core\";\n\n@Component({\n selector: 'ui-segmented-bar',\n templateUrl: './segmented-bar.component.html',\n styleUrls: ['./segmented-bar.component.scss'],\n standalone: false\n})\nexport class SegmentedBarComponent {\n /**\n * The width of the segmented bar. Defaults to '100%'.\n * You can use '100%' or '100px' for this field. 100 is just an example\n * @default '100%'\n * @type {string}\n * @memberof SegmentedBarComponent\n */\n @Input() width = '100%';\n\n /**\n * The size variant of the segmented bar. Can be 'small' or 'large'.\n * Defaults to 'large'.\n * @default 'large'\n * @type {SegmentedBarVariant}\n * @memberof SegmentedBarComponent\n */\n @Input() size: SegmentedBarVariant = 'large';\n\n /**\n * The segments to be displayed in the segmented bar.\n * @required true\n * @type {SegmentedBar}\n * @memberof SegmentedBarComponent\n */\n @Input({ required: true }) set segments(segments: SegmentedBar[]) {\n this.segmentList = this.calculatePercentages(segments);\n }\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof SegmentedBarComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n * A string representing the ARIA label for accessibility.\n * This label is used to provide an accessible name for the input element.\n * @type {string}\n * @memberof SegmentedBarComponent\n */\n @Input() ariaLabel: string;\n\n /**\n * A string representing the ARIA requirement for accessibility.\n * This attribute is used to indicate whether an input field is required for form submission.\n * @type {boolean}\n * @memberof SegmentedBarComponent\n */\n @Input() ariaRequired = false;\n\n /**\n * Groups the tooltips into one template\n *\n * @type {boolean}\n * @memberof SegmentedBarComponent\n */\n @Input() tooltipStats = false;\n\n segmentList: SegmentedBarWithPercentage[] = [];\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme,\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n }\n\n calculatePercentages(segments: SegmentedBar[]): SegmentedBarWithPercentage[] {\n const total = segments.reduce((sum, segment) => sum + segment.value, 0);\n return segments.map(segment => {\n let percentage = (segment.value / total) * 100;\n let percentageLabel = '';\n\n if (percentage === 0) {\n percentageLabel = '0%';\n } else if (percentage > 0 && percentage < 1) {\n percentageLabel = '>1%';\n } else {\n percentageLabel = `${Math.ceil(percentage)}%`;\n }\n\n return { ...segment, percentage: percentageLabel };\n });\n }\n\n get accessibleValueText(): string {\n return this.segmentList\n .map((segment, index) => `${segment.tooltip || `Value ${index}`}: ${segment.value}`)\n .join(', ');\n }\n}\n","<div\n class=\"segmented-bar-container\"\n [attr.theme]=\"applicationTheme\"\n [ngClass]=\"'segment-size-' + size\"\n [style.width]=\"width\"\n [uiTooltipTemplate]=\"segmentedStats\"\n [showTooltip]=\"tooltipStats\"\n [attr.aria-label]=\"accessibleValueText\"\n role=\"graphics-object\"\n [tabIndex]=\"0\"\n>\n <ng-container *ngFor=\"let segment of segmentList\">\n <div\n class=\"segmented-bar\"\n *ngIf=\"segment.value\"\n [ngClass]=\"segment.color\"\n [ngStyle]=\"{ flex: segment.value }\"\n [matTooltip]=\"!tooltipStats ? segment.tooltip ?? '' : ''\"\n [matTooltipClass]=\"applicationTheme\"\n [attr.aria-hidden]=\"true\"\n [attr.aria-required]=\"ariaRequired\"\n >\n <ui-icon *ngIf=\"segment.icon\" [applicationTheme]=\"applicationTheme\" [name]=\"segment.icon\"></ui-icon>\n <span>{{ segment.value }}</span>\n </div>\n </ng-container>\n</div>\n<ng-template #segmentedStats>\n <div class=\"stats-container\">\n <div class=\"name-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <div [class]=\"'point ' + segment.color\"></div>\n <span [class]=\"'label ' + segment.color\">{{ segment.tooltip }}</span>\n </div>\n }\n </div>\n\n <div class=\"value-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <span>{{ segment.value }}</span>\n </div>\n }\n </div>\n\n <div class=\"percentage-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <span>{{ segment.percentage }}</span>\n </div>\n }\n </div>\n\n </div>\n</ng-template>\n\n<ng-template #segmentedStats>\n <div class=\"stats-container\">\n <div class=\"name-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <div [class]=\"'point ' + segment.color\"></div>\n <span [class]=\"'label ' + segment.color\">{{ segment.tooltip }}</span>\n </div>\n }\n </div>\n\n <div class=\"value-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <span>{{ segment.value }}</span>\n </div>\n }\n </div>\n\n <div class=\"percentage-column\">\n @for (segment of segmentList; track segment.value) {\n <div class=\"segment\">\n <span>{{ segment.percentage }}</span>\n </div>\n }\n </div>\n\n </div>\n</ng-template>\n\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SegmentedBarComponent } from './segmented-bar.component';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatInputModule } from '@angular/material/input';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { TooltipComponentModule } from '@testgorilla/tgo-ui/components/tooltip';\n\n@NgModule({\n declarations: [SegmentedBarComponent],\n imports: [CommonModule, MatTooltipModule, MatInputModule, IconComponentModule, TooltipComponentModule],\n exports: [SegmentedBarComponent]\n})\nexport class SegmentedBarComponentModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;MAUa,qBAAqB,CAAA;AAmBhC;;;;;AAKG;IACH,IAA+B,QAAQ,CAAC,QAAwB,EAAA;QAC/D,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC;;AAsCvD,IAAA,WAAA,CAC6E,eAAiC,EAAA;QAAjC,IAAe,CAAA,eAAA,GAAf,eAAe;AAhE5F;;;;;;AAMG;QACM,IAAK,CAAA,K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A,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,EAJvB,YAAA,EAAA,CAAA,qBAAqB,CAC1B,EAAA,OAAA,EAAA,CAAA,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAAE,sBAAsB,aAC3F,qBAAqB,CAAA,EAAA,CAAA,CAAA;gHAEpB,2BAA2B,EAAA,OAAA,EAAA,CAH5B,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAAE,sBAAsB,CAAA,EAAA,CAAA,CAAA;;4FAG1F,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBALvC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,qBAAqB,CAAC;oBACrC,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAAE,sBAAsB,CAAC;oBACtG,OAAO,EAAE,CAAC,qBAAqB;AAChC,iBAAA;;;ACZD;;AAEG;;;;"}
@@ -0,0 +1,128 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, forwardRef, Output, Input, Optional, Inject, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
3
+ import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
4
+ import * as i1 from '@angular/common';
5
+ import { CommonModule } from '@angular/common';
6
+ import * as i2 from '@angular/material/button-toggle';
7
+ import { MatButtonToggleModule } from '@angular/material/button-toggle';
8
+ import * as i3 from '@angular/material/tooltip';
9
+ import { MatTooltipModule } from '@angular/material/tooltip';
10
+
11
+ class SegmentedButtonComponent {
12
+ /**
13
+ * Selected button
14
+ *
15
+ * @memberof SegmentedButtonComponent
16
+ */
17
+ set value(v) {
18
+ this._value = v;
19
+ this.onChange(v);
20
+ }
21
+ get value() {
22
+ return this._value;
23
+ }
24
+ constructor(defaultAppTheme) {
25
+ this.defaultAppTheme = defaultAppTheme;
26
+ /**
27
+ * Whether the component is disabled.
28
+ * Default: false.
29
+ *
30
+ * @type {boolean}
31
+ * @memberof SegmentedButtonComponent
32
+ */
33
+ this.disabled = false;
34
+ /**
35
+ * Indicator of the Segmented Button width
36
+ *
37
+ * @memberof SegmentedButtonComponent
38
+ */
39
+ this.fullWidth = false;
40
+ /**
41
+ *
42
+ * Defines the application theme
43
+ *
44
+ * @type {ApplicationTheme}
45
+ * @memberof SegmentedButtonComponent
46
+ */
47
+ this.applicationTheme = 'light';
48
+ this.buttonSelected = new EventEmitter();
49
+ this.onChange = (v) => { };
50
+ this.onTouch = () => { };
51
+ if (defaultAppTheme) {
52
+ this.applicationTheme = defaultAppTheme;
53
+ }
54
+ }
55
+ writeValue(obj) {
56
+ this.value = obj;
57
+ }
58
+ setDisabledState(isDisabled) {
59
+ this.disabled = isDisabled;
60
+ }
61
+ registerOnChange(fn) {
62
+ this.onChange = fn;
63
+ }
64
+ registerOnTouched(fn) {
65
+ this.onTouch = fn;
66
+ }
67
+ manualChangeValue({ value }) {
68
+ this.value = value;
69
+ this.buttonSelected.emit(value);
70
+ }
71
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SegmentedButtonComponent, deps: [{ token: 'CANOPYUI_DEFAULT_APPLICATION_THEME', optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
72
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: SegmentedButtonComponent, isStandalone: false, selector: "ui-segmented-button", inputs: { buttonConfig: "buttonConfig", disabled: "disabled", fullWidth: "fullWidth", value: "value", applicationTheme: "applicationTheme" }, outputs: { buttonSelected: "buttonSelected" }, providers: [
73
+ {
74
+ provide: NG_VALUE_ACCESSOR,
75
+ useExisting: forwardRef(() => SegmentedButtonComponent),
76
+ multi: true,
77
+ },
78
+ ], ngImport: i0, template: "<mat-button-toggle-group\n class=\"segmented-button-container\"\n [attr.theme]=\"applicationTheme\"\n [ngClass]=\"{ disabled, 'full-width': fullWidth }\"\n [value]=\"value\"\n [hideSingleSelectionIndicator]=\"true\"\n (change)=\"manualChangeValue($event)\"\n>\n <mat-button-toggle\n [disableRipple]=\"true\"\n *ngFor=\"let button of buttonConfig\"\n [value]=\"button.value\"\n [ngClass]=\"{ disabled: button.disabled }\"\n [matTooltip]=\"button.tooltip ?? ''\"\n >\n <ng-container *ngIf=\"button.template; else label\" [ngTemplateOutlet]=\"button.template\"></ng-container>\n <ng-template #label>{{ button.label }}</ng-template>\n </mat-button-toggle>\n</mat-button-toggle-group>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}h1,h2,h3,.h1,.h2,.h3{font-weight:400;margin:0}h4,h5,h6,.h4,.h5,.h6{font-weight:700;margin:0}h1,.h1{font-size:40px;line-height:60px;font-weight:700}h2,.h2{font-size:24px;line-height:36px}h2.bold,.h2.bold{font-weight:700}h3,.h3{font-size:20px;line-height:28px}h3.bold,.h3.bold{font-weight:700}h4,.h4{font-size:16px;line-height:24px}h5,.h5{font-size:14px;line-height:20px}h6,.h6{font-size:12px;line-height:16px;text-transform:uppercase}body{font-size:14px;line-height:20px}strong,b{font-weight:700!important}.featured{font-size:16px;line-height:24px}p .semibold,.featured .semibold,.caption .semibold{font-weight:600;color:#46a997}small{font-size:8px;line-height:12px}caption,.caption{font-size:12px;line-height:16px;display:inline-block}*[theme=dark] h1,*[theme=dark] .h1,*[theme=light] h1,*[theme=light] .h1{color:#242424;font-size:32px;line-height:48px;font-weight:400}*[theme=dark] h1.black,*[theme=dark] .h1.black,*[theme=light] h1.black,*[theme=light] .h1.black{font-family:ModernGothic,sans-serif!important;font-weight:900}*[theme=dark] h2,*[theme=dark] .h2,*[theme=light] h2,*[theme=light] .h2{color:#242424;font-size:24px;line-height:30px;font-weight:900;font-family:ModernGothic,sans-serif!important}*[theme=dark] h3,*[theme=dark] .h3,*[theme=light] h3,*[theme=light] .h3{font-size:20px;line-height:26px;font-weight:400;color:#242424}*[theme=dark] h3.bold,*[theme=dark] .h3.bold,*[theme=light] h3.bold,*[theme=light] .h3.bold{font-family:ModernGothic,sans-serif!important;font-weight:700}*[theme=dark] h4,*[theme=dark] .h4,*[theme=light] h4,*[theme=light] .h4{font-size:16px;line-height:20px;font-weight:700;color:#242424;font-family:ModernGothic,sans-serif!important}*[theme=dark] h5,*[theme=dark] .h5,*[theme=light] h5,*[theme=light] .h5{font-size:14px;line-height:18px;font-weight:700;color:#242424;font-family:ModernGothic,sans-serif!important}*[theme=dark] .body-large,*[theme=light] .body-large{font-weight:700;font-size:14px;line-height:22px}*[theme=dark] .body-large-bold,*[theme=light] .body-large-bold{font-weight:700;font-size:16px;line-height:24px}*[theme=dark] .body-large-regular,*[theme=light] .body-large-regular{font-weight:400;font-size:16px;line-height:24px}*[theme=dark] .body-small-bold,*[theme=light] .body-small-bold{font-weight:700;font-size:12px;line-height:16px}*[theme=dark] .body-small-regular,*[theme=light] .body-small-regular{font-weight:400;font-size:12px;line-height:16px}*[theme=dark] .hyperlink-large,*[theme=light] .hyperlink-large{font-weight:500;font-size:16px;line-height:24px}*[theme=dark] .hyperlink,*[theme=light] .hyperlink{font-weight:500;font-size:14px;line-height:22px}*[theme=dark] .hyperlink-small,*[theme=light] .hyperlink-small{font-weight:500;font-size:12px;line-height:16px}*[theme=dark] .button-label,*[theme=light] .button-label{font-weight:500;font-size:14px;font-feature-settings:\"capb\"}*[theme=dark] .label,*[theme=light] .label{font-weight:400;font-size:14px;font-feature-settings:\"capb\"}*[theme=dark] .large-hover-state,*[theme=light] .large-hover-state{font-weight:700;text-decoration:underline;font-size:16px;line-height:24px}*[theme=dark] .hover-state,*[theme=light] .hover-state{font-weight:700;text-decoration:underline;font-size:14px;line-height:22px}*[theme=dark] h1,*[theme=dark] .h1,*[theme=dark] h2,*[theme=dark] .h2,*[theme=dark] h3,*[theme=dark] .h3,*[theme=dark] h4,*[theme=dark] .h4,*[theme=dark] h5,*[theme=dark] .h5{color:#fff}.segmented-button-container.full-width,.segmented-button-container.full-width .mat-button-toggle{width:100%}.segmented-button-container[theme=classic] .mat-button-toggle{min-width:80px;height:40px}.segmented-button-container[theme=classic] .mat-button-toggle ::ng-deep .mat-button-toggle-button,.segmented-button-container[theme=classic] .mat-button-toggle .mat-button-toggle-label-content{height:40px;display:flex;align-items:center}.segmented-button-container[theme=classic] .mat-button-toggle.mat-button-toggle-checked{background-color:#276678;color:#fff}.segmented-button-container[theme=light],.segmented-button-container[theme=dark]{border-color:#919191;overflow:visible}.segmented-button-container[theme=light]:first-child,.segmented-button-container[theme=light] .mat-button-toggle:first-child,.segmented-button-container[theme=dark]:first-child,.segmented-button-container[theme=dark] .mat-button-toggle:first-child{border-bottom-left-radius:10px;border-top-left-radius:10px}.segmented-button-container[theme=light]:last-child,.segmented-button-container[theme=light] .mat-button-toggle:last-child,.segmented-button-container[theme=dark]:last-child,.segmented-button-container[theme=dark] .mat-button-toggle:last-child{border-bottom-right-radius:10px;border-top-right-radius:10px}.segmented-button-container[theme=light] .mat-button-toggle,.segmented-button-container[theme=dark] .mat-button-toggle{min-height:48px;min-width:80px;border-color:#919191}.segmented-button-container[theme=light] .mat-button-toggle ::ng-deep .mat-button-toggle-label-content,.segmented-button-container[theme=dark] .mat-button-toggle ::ng-deep .mat-button-toggle-label-content{color:#242424;font-weight:400;font-size:14px;font-feature-settings:\"capb\"}.segmented-button-container[theme=light] .mat-button-toggle:hover,.segmented-button-container[theme=dark] .mat-button-toggle:hover{background:#fff2fc}.segmented-button-container[theme=light] .mat-button-toggle.mat-button-toggle-checked,.segmented-button-container[theme=dark] .mat-button-toggle.mat-button-toggle-checked{background:#ffe6fa}.segmented-button-container[theme=light] .mat-button-toggle.mat-button-toggle-checked ::ng-deep .mat-button-toggle-label-content,.segmented-button-container[theme=dark] .mat-button-toggle.mat-button-toggle-checked ::ng-deep .mat-button-toggle-label-content{font-weight:700}.segmented-button-container[theme=light] .mat-button-toggle ::ng-deep .mat-button-toggle-focus-overlay,.segmented-button-container[theme=dark] .mat-button-toggle ::ng-deep .mat-button-toggle-focus-overlay{display:none}.segmented-button-container[theme=light] .mat-button-toggle.disabled,.segmented-button-container[theme=dark] .mat-button-toggle.disabled{pointer-events:none;background:#fff}.segmented-button-container[theme=light] .mat-button-toggle.disabled ::ng-deep .mat-button-toggle-label-content,.segmented-button-container[theme=dark] .mat-button-toggle.disabled ::ng-deep .mat-button-toggle-label-content{color:#919191;font-weight:400}.segmented-button-container.disabled{pointer-events:none}.segmented-button-container.disabled .mat-button-toggle{background:#fff}.segmented-button-container.disabled .mat-button-toggle ::ng-deep .mat-button-toggle-label-content{color:#919191;font-weight:400}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
79
+ }
80
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SegmentedButtonComponent, decorators: [{
81
+ type: Component,
82
+ args: [{ selector: 'ui-segmented-button', providers: [
83
+ {
84
+ provide: NG_VALUE_ACCESSOR,
85
+ useExisting: forwardRef(() => SegmentedButtonComponent),
86
+ multi: true,
87
+ },
88
+ ], changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<mat-button-toggle-group\n class=\"segmented-button-container\"\n [attr.theme]=\"applicationTheme\"\n [ngClass]=\"{ disabled, 'full-width': fullWidth }\"\n [value]=\"value\"\n [hideSingleSelectionIndicator]=\"true\"\n (change)=\"manualChangeValue($event)\"\n>\n <mat-button-toggle\n [disableRipple]=\"true\"\n *ngFor=\"let button of buttonConfig\"\n [value]=\"button.value\"\n [ngClass]=\"{ disabled: button.disabled }\"\n [matTooltip]=\"button.tooltip ?? ''\"\n >\n <ng-container *ngIf=\"button.template; else label\" [ngTemplateOutlet]=\"button.template\"></ng-container>\n <ng-template #label>{{ button.label }}</ng-template>\n </mat-button-toggle>\n</mat-button-toggle-group>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}h1,h2,h3,.h1,.h2,.h3{font-weight:400;margin:0}h4,h5,h6,.h4,.h5,.h6{font-weight:700;margin:0}h1,.h1{font-size:40px;line-height:60px;font-weight:700}h2,.h2{font-size:24px;line-height:36px}h2.bold,.h2.bold{font-weight:700}h3,.h3{font-size:20px;line-height:28px}h3.bold,.h3.bold{font-weight:700}h4,.h4{font-size:16px;line-height:24px}h5,.h5{font-size:14px;line-height:20px}h6,.h6{font-size:12px;line-height:16px;text-transform:uppercase}body{font-size:14px;line-height:20px}strong,b{font-weight:700!important}.featured{font-size:16px;line-height:24px}p .semibold,.featured .semibold,.caption .semibold{font-weight:600;color:#46a997}small{font-size:8px;line-height:12px}caption,.caption{font-size:12px;line-height:16px;display:inline-block}*[theme=dark] h1,*[theme=dark] .h1,*[theme=light] h1,*[theme=light] .h1{color:#242424;font-size:32px;line-height:48px;font-weight:400}*[theme=dark] h1.black,*[theme=dark] .h1.black,*[theme=light] h1.black,*[theme=light] .h1.black{font-family:ModernGothic,sans-serif!important;font-weight:900}*[theme=dark] h2,*[theme=dark] .h2,*[theme=light] h2,*[theme=light] .h2{color:#242424;font-size:24px;line-height:30px;font-weight:900;font-family:ModernGothic,sans-serif!important}*[theme=dark] h3,*[theme=dark] .h3,*[theme=light] h3,*[theme=light] .h3{font-size:20px;line-height:26px;font-weight:400;color:#242424}*[theme=dark] h3.bold,*[theme=dark] .h3.bold,*[theme=light] h3.bold,*[theme=light] .h3.bold{font-family:ModernGothic,sans-serif!important;font-weight:700}*[theme=dark] h4,*[theme=dark] .h4,*[theme=light] h4,*[theme=light] .h4{font-size:16px;line-height:20px;font-weight:700;color:#242424;font-family:ModernGothic,sans-serif!important}*[theme=dark] h5,*[theme=dark] .h5,*[theme=light] h5,*[theme=light] .h5{font-size:14px;line-height:18px;font-weight:700;color:#242424;font-family:ModernGothic,sans-serif!important}*[theme=dark] .body-large,*[theme=light] .body-large{font-weight:700;font-size:14px;line-height:22px}*[theme=dark] .body-large-bold,*[theme=light] .body-large-bold{font-weight:700;font-size:16px;line-height:24px}*[theme=dark] .body-large-regular,*[theme=light] .body-large-regular{font-weight:400;font-size:16px;line-height:24px}*[theme=dark] .body-small-bold,*[theme=light] .body-small-bold{font-weight:700;font-size:12px;line-height:16px}*[theme=dark] .body-small-regular,*[theme=light] .body-small-regular{font-weight:400;font-size:12px;line-height:16px}*[theme=dark] .hyperlink-large,*[theme=light] .hyperlink-large{font-weight:500;font-size:16px;line-height:24px}*[theme=dark] .hyperlink,*[theme=light] .hyperlink{font-weight:500;font-size:14px;line-height:22px}*[theme=dark] .hyperlink-small,*[theme=light] .hyperlink-small{font-weight:500;font-size:12px;line-height:16px}*[theme=dark] .button-label,*[theme=light] .button-label{font-weight:500;font-size:14px;font-feature-settings:\"capb\"}*[theme=dark] .label,*[theme=light] .label{font-weight:400;font-size:14px;font-feature-settings:\"capb\"}*[theme=dark] .large-hover-state,*[theme=light] .large-hover-state{font-weight:700;text-decoration:underline;font-size:16px;line-height:24px}*[theme=dark] .hover-state,*[theme=light] .hover-state{font-weight:700;text-decoration:underline;font-size:14px;line-height:22px}*[theme=dark] h1,*[theme=dark] .h1,*[theme=dark] h2,*[theme=dark] .h2,*[theme=dark] h3,*[theme=dark] .h3,*[theme=dark] h4,*[theme=dark] .h4,*[theme=dark] h5,*[theme=dark] .h5{color:#fff}.segmented-button-container.full-width,.segmented-button-container.full-width .mat-button-toggle{width:100%}.segmented-button-container[theme=classic] .mat-button-toggle{min-width:80px;height:40px}.segmented-button-container[theme=classic] .mat-button-toggle ::ng-deep .mat-button-toggle-button,.segmented-button-container[theme=classic] .mat-button-toggle .mat-button-toggle-label-content{height:40px;display:flex;align-items:center}.segmented-button-container[theme=classic] .mat-button-toggle.mat-button-toggle-checked{background-color:#276678;color:#fff}.segmented-button-container[theme=light],.segmented-button-container[theme=dark]{border-color:#919191;overflow:visible}.segmented-button-container[theme=light]:first-child,.segmented-button-container[theme=light] .mat-button-toggle:first-child,.segmented-button-container[theme=dark]:first-child,.segmented-button-container[theme=dark] .mat-button-toggle:first-child{border-bottom-left-radius:10px;border-top-left-radius:10px}.segmented-button-container[theme=light]:last-child,.segmented-button-container[theme=light] .mat-button-toggle:last-child,.segmented-button-container[theme=dark]:last-child,.segmented-button-container[theme=dark] .mat-button-toggle:last-child{border-bottom-right-radius:10px;border-top-right-radius:10px}.segmented-button-container[theme=light] .mat-button-toggle,.segmented-button-container[theme=dark] .mat-button-toggle{min-height:48px;min-width:80px;border-color:#919191}.segmented-button-container[theme=light] .mat-button-toggle ::ng-deep .mat-button-toggle-label-content,.segmented-button-container[theme=dark] .mat-button-toggle ::ng-deep .mat-button-toggle-label-content{color:#242424;font-weight:400;font-size:14px;font-feature-settings:\"capb\"}.segmented-button-container[theme=light] .mat-button-toggle:hover,.segmented-button-container[theme=dark] .mat-button-toggle:hover{background:#fff2fc}.segmented-button-container[theme=light] .mat-button-toggle.mat-button-toggle-checked,.segmented-button-container[theme=dark] .mat-button-toggle.mat-button-toggle-checked{background:#ffe6fa}.segmented-button-container[theme=light] .mat-button-toggle.mat-button-toggle-checked ::ng-deep .mat-button-toggle-label-content,.segmented-button-container[theme=dark] .mat-button-toggle.mat-button-toggle-checked ::ng-deep .mat-button-toggle-label-content{font-weight:700}.segmented-button-container[theme=light] .mat-button-toggle ::ng-deep .mat-button-toggle-focus-overlay,.segmented-button-container[theme=dark] .mat-button-toggle ::ng-deep .mat-button-toggle-focus-overlay{display:none}.segmented-button-container[theme=light] .mat-button-toggle.disabled,.segmented-button-container[theme=dark] .mat-button-toggle.disabled{pointer-events:none;background:#fff}.segmented-button-container[theme=light] .mat-button-toggle.disabled ::ng-deep .mat-button-toggle-label-content,.segmented-button-container[theme=dark] .mat-button-toggle.disabled ::ng-deep .mat-button-toggle-label-content{color:#919191;font-weight:400}.segmented-button-container.disabled{pointer-events:none}.segmented-button-container.disabled .mat-button-toggle{background:#fff}.segmented-button-container.disabled .mat-button-toggle ::ng-deep .mat-button-toggle-label-content{color:#919191;font-weight:400}\n"] }]
89
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
90
+ type: Optional
91
+ }, {
92
+ type: Inject,
93
+ args: ['CANOPYUI_DEFAULT_APPLICATION_THEME']
94
+ }] }], propDecorators: { buttonConfig: [{
95
+ type: Input,
96
+ args: [{ required: true }]
97
+ }], disabled: [{
98
+ type: Input
99
+ }], fullWidth: [{
100
+ type: Input
101
+ }], value: [{
102
+ type: Input
103
+ }], applicationTheme: [{
104
+ type: Input
105
+ }], buttonSelected: [{
106
+ type: Output
107
+ }] } });
108
+
109
+ class SegmentedButtonComponentModule {
110
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SegmentedButtonComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
111
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: SegmentedButtonComponentModule, declarations: [SegmentedButtonComponent], imports: [CommonModule, MatButtonToggleModule, FormsModule, MatTooltipModule], exports: [SegmentedButtonComponent] }); }
112
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SegmentedButtonComponentModule, imports: [CommonModule, MatButtonToggleModule, FormsModule, MatTooltipModule] }); }
113
+ }
114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: SegmentedButtonComponentModule, decorators: [{
115
+ type: NgModule,
116
+ args: [{
117
+ declarations: [SegmentedButtonComponent],
118
+ exports: [SegmentedButtonComponent],
119
+ imports: [CommonModule, MatButtonToggleModule, FormsModule, MatTooltipModule],
120
+ }]
121
+ }] });
122
+
123
+ /**
124
+ * Generated bundle index. Do not edit.
125
+ */
126
+
127
+ export { SegmentedButtonComponent, SegmentedButtonComponentModule };
128
+ //# sourceMappingURL=testgorilla-tgo-ui-components-segmented-button.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testgorilla-tgo-ui-components-segmented-button.mjs","sources":["../../../components/segmented-button/segmented-button.component.ts","../../../components/segmented-button/segmented-button.component.html","../../../components/segmented-button/segmented-button.component.module.ts","../../../components/segmented-button/testgorilla-tgo-ui-components-segmented-button.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n forwardRef,\n Inject,\n Input,\n Optional,\n Output\n} from '@angular/core';\nimport { SegmentedButton } from './segmented-button.model';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\n\n@Component({\n selector: 'ui-segmented-button',\n templateUrl: './segmented-button.component.html',\n styleUrls: ['./segmented-button.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SegmentedButtonComponent),\n multi: true,\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class SegmentedButtonComponent implements ControlValueAccessor {\n /**\n * Input property to set the buttons for the segmented button.\n * @type SegmentedButton\n * @memberof SegmentedButtonComponent\n */\n @Input({ required: true }) buttonConfig: SegmentedButton[];\n\n /**\n * Whether the component is disabled.\n * Default: false.\n *\n * @type {boolean}\n * @memberof SegmentedButtonComponent\n */\n @Input() disabled = false;\n\n /**\n * Indicator of the Segmented Button width\n *\n * @memberof SegmentedButtonComponent\n */\n @Input() fullWidth = false;\n\n /**\n * Selected button\n *\n * @memberof SegmentedButtonComponent\n */\n @Input() set value(v: any) {\n this._value = v;\n this.onChange(v);\n }\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof SegmentedButtonComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n @Output() buttonSelected = new EventEmitter<any>();\n\n protected _value: any;\n\n get value(): any {\n return this._value;\n }\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n }\n\n onChange = (v: any) => {};\n onTouch = () => {};\n\n writeValue(obj: any): void {\n this.value = obj;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: any): void {\n this.onTouch = fn;\n }\n\n manualChangeValue({ value }: any) {\n this.value = value;\n this.buttonSelected.emit(value);\n }\n}\n","<mat-button-toggle-group\n class=\"segmented-button-container\"\n [attr.theme]=\"applicationTheme\"\n [ngClass]=\"{ disabled, 'full-width': fullWidth }\"\n [value]=\"value\"\n [hideSingleSelectionIndicator]=\"true\"\n (change)=\"manualChangeValue($event)\"\n>\n <mat-button-toggle\n [disableRipple]=\"true\"\n *ngFor=\"let button of buttonConfig\"\n [value]=\"button.value\"\n [ngClass]=\"{ disabled: button.disabled }\"\n [matTooltip]=\"button.tooltip ?? ''\"\n >\n <ng-container *ngIf=\"button.template; else label\" [ngTemplateOutlet]=\"button.template\"></ng-container>\n <ng-template #label>{{ button.label }}</ng-template>\n </mat-button-toggle>\n</mat-button-toggle-group>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SegmentedButtonComponent } from './segmented-button.component';\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\nimport { FormsModule } from '@angular/forms';\nimport { MatTooltipModule } from '@angular/material/tooltip';\n\n@NgModule({\n declarations: [SegmentedButtonComponent],\n exports: [SegmentedButtonComponent],\n imports: [CommonModule, MatButtonToggleModule, FormsModule, MatTooltipModule],\n})\nexport class SegmentedButtonComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MA4Ba,wBAAwB,CAAA;AAwBnC;;;;AAIG;IACH,IAAa,KAAK,CAAC,CAAM,EAAA;AACvB,QAAA,IAAI,CAAC,MAAM,GAAG,CAAC;AACf,QAAA,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;;AAgBlB,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,MAAM;;AAGpB,IAAA,WAAA,CAC6E,eAAiC,EAAA;QAAjC,IAAe,CAAA,eAAA,GAAf,eAAe;AA5C5F;;;;;;AAMG;QACM,IAAQ,CAAA,QAAA,GAAG,KAAK;AAEzB;;;;AAIG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK;AAY1B;;;;;;AAMG;QACM,IA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