@testgorilla/tgo-ui 9.3.3 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs +8 -8
- package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs +15 -15
- package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs +23 -23
- package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs +23 -23
- package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs +84 -84
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs +21 -21
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +10 -10
- package/fesm2022/testgorilla-tgo-ui-components-badge.mjs +10 -10
- package/fesm2022/testgorilla-tgo-ui-components-badge.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs +20 -20
- package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-button.mjs +8 -8
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs +8 -8
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs +12 -12
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs +15 -15
- package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs +44 -44
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs +20 -20
- package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs +25 -25
- package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-divider.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs +10 -10
- package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +11 -11
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs +14 -14
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs +10 -10
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +20 -20
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs +8 -8
- package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-icon.mjs +23 -15
- package/fesm2022/testgorilla-tgo-ui-components-icon.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs +369 -0
- package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs.map +1 -0
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +33 -33
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-logo.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs +3 -3
- package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs +3 -3
- package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs +23 -23
- package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs +14 -14
- package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs +10 -10
- package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs +8 -8
- package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs +12 -12
- package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-popover.mjs +15 -15
- package/fesm2022/testgorilla-tgo-ui-components-popover.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs +42 -42
- package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-rating.mjs +10 -10
- package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs +8 -8
- package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs +8 -8
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs +17 -17
- package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs +14 -14
- package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs +31 -31
- package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs +12 -12
- package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs +12 -12
- package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs +3 -3
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs +12 -12
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs +10 -10
- package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs +21 -21
- package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-table.mjs +11 -11
- package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs +25 -25
- package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs +26 -26
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs +10 -10
- package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs +17 -17
- package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs +7 -7
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs +40 -40
- package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs.map +1 -1
- package/fesm2022/testgorilla-tgo-ui.mjs +7 -7
- package/mcp/catalog.json +1 -1
- package/package.json +96 -101
- package/projects/tgo-canopy-ui/assets/icons/rebrand/Grid-list-view-filled.svg +3 -0
- package/projects/tgo-canopy-ui/assets/icons/rebrand/Grid-list-view-in-line.svg +3 -0
- package/projects/tgo-canopy-ui/assets/icons/rebrand/Table-view-filled.svg +3 -0
- package/projects/tgo-canopy-ui/assets/icons/rebrand/Table-view-in-line.svg +3 -0
- package/{components/icon/index.d.ts → types/testgorilla-tgo-ui-components-icon.d.ts} +1 -1
- package/types/testgorilla-tgo-ui-components-infinite-scroll-table.d.ts +225 -0
- package/{components/inline-field/index.d.ts → types/testgorilla-tgo-ui-components-inline-field.d.ts} +8 -7
- package/{components/side-sheet/index.d.ts → types/testgorilla-tgo-ui-components-side-sheet.d.ts} +1 -1
- /package/{components/accordion/index.d.ts → types/testgorilla-tgo-ui-components-accordion.d.ts} +0 -0
- /package/{components/ai-audio-circle/index.d.ts → types/testgorilla-tgo-ui-components-ai-audio-circle.d.ts} +0 -0
- /package/{components/ai-caveat/index.d.ts → types/testgorilla-tgo-ui-components-ai-caveat.d.ts} +0 -0
- /package/{components/ai-feedback/index.d.ts → types/testgorilla-tgo-ui-components-ai-feedback.d.ts} +0 -0
- /package/{components/alert-banner/index.d.ts → types/testgorilla-tgo-ui-components-alert-banner.d.ts} +0 -0
- /package/{components/audio-waveform/index.d.ts → types/testgorilla-tgo-ui-components-audio-waveform.d.ts} +0 -0
- /package/{components/autocomplete-v2/index.d.ts → types/testgorilla-tgo-ui-components-autocomplete-v2.d.ts} +0 -0
- /package/{components/autocomplete/index.d.ts → types/testgorilla-tgo-ui-components-autocomplete.d.ts} +0 -0
- /package/{components/avatar/index.d.ts → types/testgorilla-tgo-ui-components-avatar.d.ts} +0 -0
- /package/{components/badge/index.d.ts → types/testgorilla-tgo-ui-components-badge.d.ts} +0 -0
- /package/{components/breadcrumb/index.d.ts → types/testgorilla-tgo-ui-components-breadcrumb.d.ts} +0 -0
- /package/{components/button/index.d.ts → types/testgorilla-tgo-ui-components-button.d.ts} +0 -0
- /package/{components/card/index.d.ts → types/testgorilla-tgo-ui-components-card.d.ts} +0 -0
- /package/{components/checkbox/index.d.ts → types/testgorilla-tgo-ui-components-checkbox.d.ts} +0 -0
- /package/{components/checklist/index.d.ts → types/testgorilla-tgo-ui-components-checklist.d.ts} +0 -0
- /package/{components/core/index.d.ts → types/testgorilla-tgo-ui-components-core.d.ts} +0 -0
- /package/{components/datepicker/index.d.ts → types/testgorilla-tgo-ui-components-datepicker.d.ts} +0 -0
- /package/{components/dialog/index.d.ts → types/testgorilla-tgo-ui-components-dialog.d.ts} +0 -0
- /package/{components/divider/index.d.ts → types/testgorilla-tgo-ui-components-divider.d.ts} +0 -0
- /package/{components/donut-chart/index.d.ts → types/testgorilla-tgo-ui-components-donut-chart.d.ts} +0 -0
- /package/{components/dropdown/index.d.ts → types/testgorilla-tgo-ui-components-dropdown.d.ts} +0 -0
- /package/{components/elevation-shadow/index.d.ts → types/testgorilla-tgo-ui-components-elevation-shadow.d.ts} +0 -0
- /package/{components/empty-state/index.d.ts → types/testgorilla-tgo-ui-components-empty-state.d.ts} +0 -0
- /package/{components/field/index.d.ts → types/testgorilla-tgo-ui-components-field.d.ts} +0 -0
- /package/{components/file-upload/index.d.ts → types/testgorilla-tgo-ui-components-file-upload.d.ts} +0 -0
- /package/{components/filter-button/index.d.ts → types/testgorilla-tgo-ui-components-filter-button.d.ts} +0 -0
- /package/{components/gaussian-chart/index.d.ts → types/testgorilla-tgo-ui-components-gaussian-chart.d.ts} +0 -0
- /package/{components/icon-label/index.d.ts → types/testgorilla-tgo-ui-components-icon-label.d.ts} +0 -0
- /package/{components/logo/index.d.ts → types/testgorilla-tgo-ui-components-logo.d.ts} +0 -0
- /package/{components/media-card/index.d.ts → types/testgorilla-tgo-ui-components-media-card.d.ts} +0 -0
- /package/{components/media-dialog/index.d.ts → types/testgorilla-tgo-ui-components-media-dialog.d.ts} +0 -0
- /package/{components/multi-input/index.d.ts → types/testgorilla-tgo-ui-components-multi-input.d.ts} +0 -0
- /package/{components/navbar/index.d.ts → types/testgorilla-tgo-ui-components-navbar.d.ts} +0 -0
- /package/{components/overflow-menu/index.d.ts → types/testgorilla-tgo-ui-components-overflow-menu.d.ts} +0 -0
- /package/{components/page-header/index.d.ts → types/testgorilla-tgo-ui-components-page-header.d.ts} +0 -0
- /package/{components/paginator/index.d.ts → types/testgorilla-tgo-ui-components-paginator.d.ts} +0 -0
- /package/{components/password-criteria/index.d.ts → types/testgorilla-tgo-ui-components-password-criteria.d.ts} +0 -0
- /package/{components/password-strength/index.d.ts → types/testgorilla-tgo-ui-components-password-strength.d.ts} +0 -0
- /package/{components/phone-input/index.d.ts → types/testgorilla-tgo-ui-components-phone-input.d.ts} +0 -0
- /package/{components/popover/index.d.ts → types/testgorilla-tgo-ui-components-popover.d.ts} +0 -0
- /package/{components/progress-bar/index.d.ts → types/testgorilla-tgo-ui-components-progress-bar.d.ts} +0 -0
- /package/{components/prompt/index.d.ts → types/testgorilla-tgo-ui-components-prompt.d.ts} +0 -0
- /package/{components/radial-progress/index.d.ts → types/testgorilla-tgo-ui-components-radial-progress.d.ts} +0 -0
- /package/{components/radio-button/index.d.ts → types/testgorilla-tgo-ui-components-radio-button.d.ts} +0 -0
- /package/{components/rating/index.d.ts → types/testgorilla-tgo-ui-components-rating.d.ts} +0 -0
- /package/{components/scale-table/index.d.ts → types/testgorilla-tgo-ui-components-scale-table.d.ts} +0 -0
- /package/{components/scale/index.d.ts → types/testgorilla-tgo-ui-components-scale.d.ts} +0 -0
- /package/{components/segmented-bar/index.d.ts → types/testgorilla-tgo-ui-components-segmented-bar.d.ts} +0 -0
- /package/{components/segmented-button/index.d.ts → types/testgorilla-tgo-ui-components-segmented-button.d.ts} +0 -0
- /package/{components/segmented-toggle/index.d.ts → types/testgorilla-tgo-ui-components-segmented-toggle.d.ts} +0 -0
- /package/{components/selectable-card/index.d.ts → types/testgorilla-tgo-ui-components-selectable-card.d.ts} +0 -0
- /package/{components/side-navigation/index.d.ts → types/testgorilla-tgo-ui-components-side-navigation.d.ts} +0 -0
- /package/{components/side-panel/index.d.ts → types/testgorilla-tgo-ui-components-side-panel.d.ts} +0 -0
- /package/{components/skeleton/index.d.ts → types/testgorilla-tgo-ui-components-skeleton.d.ts} +0 -0
- /package/{components/slider/index.d.ts → types/testgorilla-tgo-ui-components-slider.d.ts} +0 -0
- /package/{components/snackbar/index.d.ts → types/testgorilla-tgo-ui-components-snackbar.d.ts} +0 -0
- /package/{components/spider-chart/index.d.ts → types/testgorilla-tgo-ui-components-spider-chart.d.ts} +0 -0
- /package/{components/spinner/index.d.ts → types/testgorilla-tgo-ui-components-spinner.d.ts} +0 -0
- /package/{components/stepper/index.d.ts → types/testgorilla-tgo-ui-components-stepper.d.ts} +0 -0
- /package/{components/table/index.d.ts → types/testgorilla-tgo-ui-components-table.d.ts} +0 -0
- /package/{components/tabs/index.d.ts → types/testgorilla-tgo-ui-components-tabs.d.ts} +0 -0
- /package/{components/tag/index.d.ts → types/testgorilla-tgo-ui-components-tag.d.ts} +0 -0
- /package/{components/toggle/index.d.ts → types/testgorilla-tgo-ui-components-toggle.d.ts} +0 -0
- /package/{components/tooltip/index.d.ts → types/testgorilla-tgo-ui-components-tooltip.d.ts} +0 -0
- /package/{components/universal-skills/index.d.ts → types/testgorilla-tgo-ui-components-universal-skills.d.ts} +0 -0
- /package/{components/validation-error/index.d.ts → types/testgorilla-tgo-ui-components-validation-error.d.ts} +0 -0
- /package/{components/write-with-ai/index.d.ts → types/testgorilla-tgo-ui-components-write-with-ai.d.ts} +0 -0
- /package/{index.d.ts → types/testgorilla-tgo-ui.d.ts} +0 -0
|
@@ -18,7 +18,7 @@ class ScaleTableComponent {
|
|
|
18
18
|
* @type {ApplicationTheme}
|
|
19
19
|
* @memberof ScaleTableComponent
|
|
20
20
|
*/
|
|
21
|
-
this.applicationTheme = input('light', ...(ngDevMode ? [{ debugName: "applicationTheme" }] : []));
|
|
21
|
+
this.applicationTheme = input('light', ...(ngDevMode ? [{ debugName: "applicationTheme" }] : /* istanbul ignore next */ []));
|
|
22
22
|
/**
|
|
23
23
|
*
|
|
24
24
|
* Defines items with their text and it's values
|
|
@@ -26,7 +26,7 @@ class ScaleTableComponent {
|
|
|
26
26
|
* @type {ScaleTable}
|
|
27
27
|
* @memberof ScaleTableComponent
|
|
28
28
|
*/
|
|
29
|
-
this.scaleItems = model.required(...(ngDevMode ? [{ debugName: "scaleItems" }] : []));
|
|
29
|
+
this.scaleItems = model.required(...(ngDevMode ? [{ debugName: "scaleItems" }] : /* istanbul ignore next */ []));
|
|
30
30
|
/**
|
|
31
31
|
*
|
|
32
32
|
* Defines description of scales
|
|
@@ -34,10 +34,10 @@ class ScaleTableComponent {
|
|
|
34
34
|
* @type {string[]}
|
|
35
35
|
* @memberof ScaleTableComponent
|
|
36
36
|
*/
|
|
37
|
-
this.labels = input.required(...(ngDevMode ? [{ debugName: "labels" }] : []));
|
|
38
|
-
this.hideBetterExperience = model(false, ...(ngDevMode ? [{ debugName: "hideBetterExperience" }] : []));
|
|
37
|
+
this.labels = input.required(...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
38
|
+
this.hideBetterExperience = model(false, ...(ngDevMode ? [{ debugName: "hideBetterExperience" }] : /* istanbul ignore next */ []));
|
|
39
39
|
this.scaleItemChange = output();
|
|
40
|
-
this.scaleCount = computed(() => this.labels().length, ...(ngDevMode ? [{ debugName: "scaleCount" }] : []));
|
|
40
|
+
this.scaleCount = computed(() => this.labels().length, ...(ngDevMode ? [{ debugName: "scaleCount" }] : /* istanbul ignore next */ []));
|
|
41
41
|
this.translationContext = 'SCALE_TABLE.';
|
|
42
42
|
}
|
|
43
43
|
select(scaleItemIndex, scaleIndex) {
|
|
@@ -50,10 +50,10 @@ class ScaleTableComponent {
|
|
|
50
50
|
return [...items];
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
54
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
53
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ScaleTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
54
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ScaleTableComponent, isStandalone: true, selector: "ui-scale-table", inputs: { applicationTheme: { classPropertyName: "applicationTheme", publicName: "applicationTheme", isSignal: true, isRequired: false, transformFunction: null }, scaleItems: { classPropertyName: "scaleItems", publicName: "scaleItems", isSignal: true, isRequired: true, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: true, transformFunction: null }, hideBetterExperience: { classPropertyName: "hideBetterExperience", publicName: "hideBetterExperience", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { scaleItems: "scaleItemsChange", hideBetterExperience: "hideBetterExperienceChange", scaleItemChange: "scaleItemChange" }, host: { properties: { "style.--scale-count": "scaleCount()" } }, ngImport: i0, template: "<div class=\"scale-table\">\n <div class=\"better-experience\" [class.hide]=\"hideBetterExperience()\">\n <ui-icon [size]=\"'24'\" [name]=\"'Device-rotate-in-line'\" class=\"mobile-landscape-icon\" />\n <p>{{ 'SCALE_TABLE.ROTATE_DEVICE' | uiTranslate | async }}</p>\n <ui-button\n iconName=\"Close\"\n variant=\"icon-button\"\n size=\"small\"\n [justIcon]=\"true\"\n [tooltip]=\"('COMMON.CLOSE' | uiTranslate | async)!\"\n (click)=\"hideBetterExperience.set(true)\"\n />\n </div>\n <!-- Header -->\n <div tabindex=\"0\" [attr.aria-label]=\"'scale header'\" class=\"scale-table-header\">\n @for (label of labels(); track $index) {\n <div\n tabindex=\"0\"\n role=\"heading\"\n [attr.aria-level]=\"3\"\n [attr.aria-label]=\"label + ' as ' + ($index + 1)\"\n class=\"scale-size\"\n >\n {{ label }}\n </div>\n }\n </div>\n <!-- Scale Items -->\n @for (scale of scaleItems(); track scale.text) {\n <div class=\"scale-table-row\" tabindex=\"0\" role=\"radiogroup\" [attr.aria-label]=\"scale.text\">\n <div class=\"scale-text\">{{ scale.text }}</div>\n <ui-scale\n [selectedIndex]=\"scale.value ?? null\"\n [length]=\"scale.length ?? labels().length\"\n [applicationTheme]=\"applicationTheme()\"\n (selectedIndexChange)=\"select($index, $event)\"\n />\n </div>\n }\n</div>\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}:host{font:\"ModernGothic\",serif;position:relative;display:flex;overflow:auto;align-items:start}.scale-table{display:flex;flex-direction:column;width:100%}.scale-table-header{display:flex;flex-direction:row;align-items:center;justify-content:end;min-width:fit-content;position:sticky;top:0;border-bottom:1px solid #d3d3d3;background-color:#fff;align-items:baseline;box-shadow:0 4px 16px #24242414;padding-inline-start:16px;padding-inline-end:8px;padding-top:4px}.scale-table-row{display:flex;justify-content:space-between;gap:8px;align-items:center;padding-top:8px;padding-bottom:8px;padding-inline-start:16px;padding-inline-end:8px;min-width:fit-content;border-bottom:1px solid #d3d3d3}.scale-size{width:80px;text-align:center;flex-shrink:0;color:#242424;font-size:12px;font-family:ModernGothic;align-self:stretch;padding:4px}ui-scale{width:calc(var(--scale-count, 5) * 80px);flex-shrink:0}.scale-text{font-weight:400;font-size:16px;line-height:24px;letter-spacing:0%;vertical-align:middle;text-align:justify;font-family:ModernGothic;max-width:800px}.border-bottom{border-bottom:1px solid #d3d3d3}.better-experience{display:none;flex-direction:row;align-items:center;gap:8px;border-radius:10px;padding:12px 16px;background:#d9e8ff;justify-content:center}.better-experience p{flex:1 1 0%;font-size:14px;line-height:22px;font-weight:400;font-size:16px;line-height:24px;letter-spacing:0%;vertical-align:middle;margin:0}.background-white{background-color:#fff}@media(max-width:960px){.scale-table-header{padding-left:0;padding-right:0;justify-content:start}.scale-table-row{padding-left:0;padding-right:0;flex-direction:column;align-items:start}.scale-size{width:calc(100% / var(--scale-count));min-width:40px;padding:0}ui-scale{width:100%;min-width:calc(var(--scale-count) * 40px);align-self:center}}@media screen and (min-width:1280px){.scale-size{width:104px;min-width:104px}ui-scale{min-width:calc(var(--scale-count) * 104px);align-self:center}}@media screen and (orientation:portrait)and (max-width:560px){.better-experience{display:flex}}.hide{display:none}\n"], dependencies: [{ kind: "ngmodule", type: ScaleComponentModule }, { kind: "component", type: i1.ScaleComponent, selector: "ui-scale", inputs: ["selectedIndex", "length", "applicationTheme", "companyColor"], outputs: ["selectedIndexChange"] }, { kind: "ngmodule", type: IconComponentModule }, { kind: "component", type: i2.IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }, { kind: "ngmodule", type: ButtonComponentModule }, { kind: "component", type: i3.ButtonComponent, selector: "ui-button", inputs: ["size", "variant", "label", "iconPosition", "justIcon", "iconName", "disabled", "loading", "loadingWithLabel", "fullWidth", "url", "urlTarget", "value", "tooltip", "isPremium", "type", "companyColor", "buttonBadgeConfig", "applicationTheme", "disabledScaleOnClick", "ariaLabel", "ariaExpanded", "ariaControls", "ariaPressed", "ariaRequired", "ariaLabelledby", "ariaDescribedby", "preventDefault", "hasBackground", "tooltipPosition", "role", "iconFilled"], outputs: ["buttonClickEvent", "buttonHoverEvent"] }, { kind: "pipe", type: UiTranslatePipe, name: "uiTranslate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
55
55
|
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ScaleTableComponent, decorators: [{
|
|
57
57
|
type: Component,
|
|
58
58
|
args: [{ selector: 'ui-scale-table', changeDetection: ChangeDetectionStrategy.OnPush, imports: [UiTranslatePipe, ScaleComponentModule, AsyncPipe, IconComponentModule, ButtonComponentModule], host: {
|
|
59
59
|
'[style.--scale-count]': 'scaleCount()',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testgorilla-tgo-ui-components-scale-table.mjs","sources":["../../../components/scale-table/scale-table.component.ts","../../../components/scale-table/scale-table.component.html","../../../components/scale-table/testgorilla-tgo-ui-components-scale-table.ts"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input, model, output } from '@angular/core';\n\nimport { ButtonComponentModule } from '@testgorilla/tgo-ui/components/button';\nimport { ApplicationTheme, UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { ScaleComponentModule } from '@testgorilla/tgo-ui/components/scale';\n\nimport { ScaleItem } from './scale-table.model';\n\n@Component({\n selector: 'ui-scale-table',\n templateUrl: './scale-table.component.html',\n styleUrls: ['./scale-table.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [UiTranslatePipe, ScaleComponentModule, AsyncPipe, IconComponentModule, ButtonComponentModule],\n host: {\n '[style.--scale-count]': 'scaleCount()',\n },\n})\nexport class ScaleTableComponent {\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof ScaleTableComponent\n */\n public applicationTheme = input<ApplicationTheme>('light');\n\n /**\n *\n * Defines items with their text and it's values\n *\n * @type {ScaleTable}\n * @memberof ScaleTableComponent\n */\n public scaleItems = model.required<ScaleItem[]>();\n\n /**\n *\n * Defines description of scales\n *\n * @type {string[]}\n * @memberof ScaleTableComponent\n */\n public labels = input.required<string[]>();\n public hideBetterExperience = model(false);\n public scaleItemChange = output<{\n item: ScaleItem;\n label: string;\n }>();\n scaleCount = computed(() => this.labels().length);\n\n protected readonly translationContext = 'SCALE_TABLE.';\n\n public select(scaleItemIndex: number, scaleIndex: number): void {\n this.scaleItems.update(items => {\n items[scaleItemIndex].value = scaleIndex;\n this.scaleItemChange.emit({\n item: items[scaleItemIndex],\n label: this.labels()[scaleIndex],\n });\n return [...items];\n });\n }\n}\n","<div class=\"scale-table\">\n <div class=\"better-experience\" [class.hide]=\"hideBetterExperience()\">\n <ui-icon [size]=\"'24'\" [name]=\"'Device-rotate-in-line'\" class=\"mobile-landscape-icon\" />\n <p>{{ 'SCALE_TABLE.ROTATE_DEVICE' | uiTranslate | async }}</p>\n <ui-button\n iconName=\"Close\"\n variant=\"icon-button\"\n size=\"small\"\n [justIcon]=\"true\"\n [tooltip]=\"('COMMON.CLOSE' | uiTranslate | async)!\"\n (click)=\"hideBetterExperience.set(true)\"\n />\n </div>\n <!-- Header -->\n <div tabindex=\"0\" [attr.aria-label]=\"'scale header'\" class=\"scale-table-header\">\n @for (label of labels(); track $index) {\n <div\n tabindex=\"0\"\n role=\"heading\"\n [attr.aria-level]=\"3\"\n [attr.aria-label]=\"label + ' as ' + ($index + 1)\"\n class=\"scale-size\"\n >\n {{ label }}\n </div>\n }\n </div>\n <!-- Scale Items -->\n @for (scale of scaleItems(); track scale.text) {\n <div class=\"scale-table-row\" tabindex=\"0\" role=\"radiogroup\" [attr.aria-label]=\"scale.text\">\n <div class=\"scale-text\">{{ scale.text }}</div>\n <ui-scale\n [selectedIndex]=\"scale.value ?? null\"\n [length]=\"scale.length ?? labels().length\"\n [applicationTheme]=\"applicationTheme()\"\n (selectedIndexChange)=\"select($index, $event)\"\n />\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;MAoBa,mBAAmB,CAAA;AAVhC,IAAA,WAAA,GAAA;AAWE;;;;;;AAMG;AACI,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAAmB,OAAO,
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui-components-scale-table.mjs","sources":["../../../components/scale-table/scale-table.component.ts","../../../components/scale-table/scale-table.component.html","../../../components/scale-table/testgorilla-tgo-ui-components-scale-table.ts"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input, model, output } from '@angular/core';\n\nimport { ButtonComponentModule } from '@testgorilla/tgo-ui/components/button';\nimport { ApplicationTheme, UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { ScaleComponentModule } from '@testgorilla/tgo-ui/components/scale';\n\nimport { ScaleItem } from './scale-table.model';\n\n@Component({\n selector: 'ui-scale-table',\n templateUrl: './scale-table.component.html',\n styleUrls: ['./scale-table.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [UiTranslatePipe, ScaleComponentModule, AsyncPipe, IconComponentModule, ButtonComponentModule],\n host: {\n '[style.--scale-count]': 'scaleCount()',\n },\n})\nexport class ScaleTableComponent {\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof ScaleTableComponent\n */\n public applicationTheme = input<ApplicationTheme>('light');\n\n /**\n *\n * Defines items with their text and it's values\n *\n * @type {ScaleTable}\n * @memberof ScaleTableComponent\n */\n public scaleItems = model.required<ScaleItem[]>();\n\n /**\n *\n * Defines description of scales\n *\n * @type {string[]}\n * @memberof ScaleTableComponent\n */\n public labels = input.required<string[]>();\n public hideBetterExperience = model(false);\n public scaleItemChange = output<{\n item: ScaleItem;\n label: string;\n }>();\n scaleCount = computed(() => this.labels().length);\n\n protected readonly translationContext = 'SCALE_TABLE.';\n\n public select(scaleItemIndex: number, scaleIndex: number): void {\n this.scaleItems.update(items => {\n items[scaleItemIndex].value = scaleIndex;\n this.scaleItemChange.emit({\n item: items[scaleItemIndex],\n label: this.labels()[scaleIndex],\n });\n return [...items];\n });\n }\n}\n","<div class=\"scale-table\">\n <div class=\"better-experience\" [class.hide]=\"hideBetterExperience()\">\n <ui-icon [size]=\"'24'\" [name]=\"'Device-rotate-in-line'\" class=\"mobile-landscape-icon\" />\n <p>{{ 'SCALE_TABLE.ROTATE_DEVICE' | uiTranslate | async }}</p>\n <ui-button\n iconName=\"Close\"\n variant=\"icon-button\"\n size=\"small\"\n [justIcon]=\"true\"\n [tooltip]=\"('COMMON.CLOSE' | uiTranslate | async)!\"\n (click)=\"hideBetterExperience.set(true)\"\n />\n </div>\n <!-- Header -->\n <div tabindex=\"0\" [attr.aria-label]=\"'scale header'\" class=\"scale-table-header\">\n @for (label of labels(); track $index) {\n <div\n tabindex=\"0\"\n role=\"heading\"\n [attr.aria-level]=\"3\"\n [attr.aria-label]=\"label + ' as ' + ($index + 1)\"\n class=\"scale-size\"\n >\n {{ label }}\n </div>\n }\n </div>\n <!-- Scale Items -->\n @for (scale of scaleItems(); track scale.text) {\n <div class=\"scale-table-row\" tabindex=\"0\" role=\"radiogroup\" [attr.aria-label]=\"scale.text\">\n <div class=\"scale-text\">{{ scale.text }}</div>\n <ui-scale\n [selectedIndex]=\"scale.value ?? null\"\n [length]=\"scale.length ?? labels().length\"\n [applicationTheme]=\"applicationTheme()\"\n (selectedIndexChange)=\"select($index, $event)\"\n />\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;MAoBa,mBAAmB,CAAA;AAVhC,IAAA,WAAA,GAAA;AA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EAAE,cAAc;AACxC,qBAAA,EAAA,QAAA,EAAA,s5CAAA,EAAA,MAAA,EAAA,CAAA,ooIAAA,CAAA,EAAA;;;AElBH;;AAEG;;;;"}
|
|
@@ -42,7 +42,7 @@ class ScaleComponent {
|
|
|
42
42
|
*/
|
|
43
43
|
this.companyColor = '';
|
|
44
44
|
this.selectedIndexChange = new EventEmitter();
|
|
45
|
-
this.styles = signal({ '--hover-color': '#FFB3EE', '--selected-color': '#D410AA' }, ...(ngDevMode ? [{ debugName: "styles" }] : []));
|
|
45
|
+
this.styles = signal({ '--hover-color': '#FFB3EE', '--selected-color': '#D410AA' }, ...(ngDevMode ? [{ debugName: "styles" }] : /* istanbul ignore next */ []));
|
|
46
46
|
if (defaultAppTheme) {
|
|
47
47
|
this.applicationTheme = defaultAppTheme;
|
|
48
48
|
}
|
|
@@ -107,10 +107,10 @@ class ScaleComponent {
|
|
|
107
107
|
this.select(0);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
111
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
110
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ScaleComponent, deps: [{ token: 'CANOPYUI_DEFAULT_APPLICATION_THEME', optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
111
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: ScaleComponent, isStandalone: true, selector: "ui-scale", inputs: { selectedIndex: "selectedIndex", length: "length", applicationTheme: "applicationTheme", companyColor: "companyColor" }, outputs: { selectedIndexChange: "selectedIndexChange" }, viewQueries: [{ propertyName: "scaleItems", predicate: ["scaleItem"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n [style.--scale-count]=\"items.length\"\n class=\"scale\"\n [ngStyle]=\"styles()\"\n [ngClass]=\"{ 'scale-classic': applicationTheme === 'classic' }\"\n>\n @for (item of items; track item) {\n <div\n class=\"scale-item\"\n (click)=\"select(item)\"\n #scaleItem\n role=\"radio\"\n (keydown)=\"onKeyDown($event, item)\"\n (focus)=\"onFocus(item)\"\n [class.scale-item-focus-prev]=\"selectedIndex && selectedIndex > 0 ? item === selectedIndex - 1 : false\"\n [attr.tabindex]=\"selectedIndex === null ? (item === 0 ? '0' : '-1') : item === selectedIndex ? '0' : '-1'\"\n [attr.aria-checked]=\"\n selectedIndex === null ? (item === 0 ? 'true' : 'false') : item === selectedIndex ? 'true' : 'false'\n \"\n [attr.aria-label]=\"getAriaLabel(item)\"\n [ngClass]=\"{ 'scale-item-selected': item === selectedIndex }\"\n >\n {{ item + 1 }}\n </div>\n }\n</div>\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}.scale{display:flex;align-content:center;justify-content:flex-start;align-items:center;width:100%}.scale-item{display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;width:calc(100% / var(--scale-count));min-width:24px;height:48px;border:1px solid #919191;border-left:0;cursor:pointer;font-size:16px;font-weight:400;font-family:ModernGothic,serif;background-color:#fff}.scale-item:hover:not(.scale-item-selected){background-color:var(--hover-color)}.scale-item:first-child{border-radius:10px 0 0 10px;border-left:1px solid #919191}.scale-item:last-child{border-radius:0 10px 10px 0}.scale-item-selected{background-color:var(--selected-color);color:#fff;font-weight:700}@keyframes focus-ring-animation{0%{box-shadow:0 0 0 4px #242424}to{box-shadow:0 0 0 2px #242424}}.scale-item.scale-item-focus-prev{border-right:none}.scale-item:focus-visible{outline:none;border-radius:8px;border:2px solid #ffffff;box-shadow:0 0 0 2px #242424;z-index:1;animation:focus-ring-animation .4s forwards}.scale-classic .scale-item{border-color:#e0e0e0;font-family:Open Sans,serif}.scale-classic .scale-item:first-child{border-radius:4px 0 0 4px;border-left:1px solid #e0e0e0}.scale-classic .scale-item:last-child{border-radius:0 4px 4px 0}.scale-classic .scale-item:not(.scale-item-selected){color:#242424}.scale-classic .scale-item:hover:not(.scale-item-selected){background-color:#b5ddd5}.scale-classic .scale-item-selected{background-color:#46a997}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
112
112
|
}
|
|
113
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ScaleComponent, decorators: [{
|
|
114
114
|
type: Component,
|
|
115
115
|
args: [{ selector: 'ui-scale', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgStyle, NgClass], template: "<div\n [style.--scale-count]=\"items.length\"\n class=\"scale\"\n [ngStyle]=\"styles()\"\n [ngClass]=\"{ 'scale-classic': applicationTheme === 'classic' }\"\n>\n @for (item of items; track item) {\n <div\n class=\"scale-item\"\n (click)=\"select(item)\"\n #scaleItem\n role=\"radio\"\n (keydown)=\"onKeyDown($event, item)\"\n (focus)=\"onFocus(item)\"\n [class.scale-item-focus-prev]=\"selectedIndex && selectedIndex > 0 ? item === selectedIndex - 1 : false\"\n [attr.tabindex]=\"selectedIndex === null ? (item === 0 ? '0' : '-1') : item === selectedIndex ? '0' : '-1'\"\n [attr.aria-checked]=\"\n selectedIndex === null ? (item === 0 ? 'true' : 'false') : item === selectedIndex ? 'true' : 'false'\n \"\n [attr.aria-label]=\"getAriaLabel(item)\"\n [ngClass]=\"{ 'scale-item-selected': item === selectedIndex }\"\n >\n {{ item + 1 }}\n </div>\n }\n</div>\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}.scale{display:flex;align-content:center;justify-content:flex-start;align-items:center;width:100%}.scale-item{display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;width:calc(100% / var(--scale-count));min-width:24px;height:48px;border:1px solid #919191;border-left:0;cursor:pointer;font-size:16px;font-weight:400;font-family:ModernGothic,serif;background-color:#fff}.scale-item:hover:not(.scale-item-selected){background-color:var(--hover-color)}.scale-item:first-child{border-radius:10px 0 0 10px;border-left:1px solid #919191}.scale-item:last-child{border-radius:0 10px 10px 0}.scale-item-selected{background-color:var(--selected-color);color:#fff;font-weight:700}@keyframes focus-ring-animation{0%{box-shadow:0 0 0 4px #242424}to{box-shadow:0 0 0 2px #242424}}.scale-item.scale-item-focus-prev{border-right:none}.scale-item:focus-visible{outline:none;border-radius:8px;border:2px solid #ffffff;box-shadow:0 0 0 2px #242424;z-index:1;animation:focus-ring-animation .4s forwards}.scale-classic .scale-item{border-color:#e0e0e0;font-family:Open Sans,serif}.scale-classic .scale-item:first-child{border-radius:4px 0 0 4px;border-left:1px solid #e0e0e0}.scale-classic .scale-item:last-child{border-radius:0 4px 4px 0}.scale-classic .scale-item:not(.scale-item-selected){color:#242424}.scale-classic .scale-item:hover:not(.scale-item-selected){background-color:#b5ddd5}.scale-classic .scale-item-selected{background-color:#46a997}\n"] }]
|
|
116
116
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
@@ -134,11 +134,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
134
134
|
}] } });
|
|
135
135
|
|
|
136
136
|
class ScaleComponentModule {
|
|
137
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
138
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
139
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
137
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ScaleComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
138
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.18", ngImport: i0, type: ScaleComponentModule, imports: [CommonModule, ScaleComponent], exports: [ScaleComponent] }); }
|
|
139
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ScaleComponentModule, imports: [CommonModule] }); }
|
|
140
140
|
}
|
|
141
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
141
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: ScaleComponentModule, decorators: [{
|
|
142
142
|
type: NgModule,
|
|
143
143
|
args: [{
|
|
144
144
|
imports: [CommonModule, ScaleComponent],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testgorilla-tgo-ui-components-scale.mjs","sources":["../../../components/scale/scale.component.ts","../../../components/scale/scale.component.html","../../../components/scale/scale.component.module.ts","../../../components/scale/testgorilla-tgo-ui-components-scale.ts"],"sourcesContent":["import { NgStyle, NgClass } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n OnChanges,\n OnInit,\n Optional,\n Output,\n QueryList,\n signal,\n SimpleChanges,\n ViewChildren,\n} from '@angular/core';\n\nimport { ApplicationTheme, hexToRgbWithAlpha } from '@testgorilla/tgo-ui/components/core';\n\n@Component({\n selector: 'ui-scale',\n templateUrl: './scale.component.html',\n styleUrls: ['./scale.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgStyle, NgClass],\n})\nexport class ScaleComponent implements OnInit, OnChanges {\n private readonly MIN_LENGTH = 1;\n private readonly DEFAULT_LENGTH = 5;\n protected items: number[] = [];\n\n @ViewChildren('scaleItem') scaleItems!: QueryList<ElementRef<HTMLElement>>;\n\n /**\n * The value representing the selected item of the scale.\n * @type {number}\n * @memberof ScaleComponent\n */\n @Input() selectedIndex: number | null = null;\n\n /**\n * The max number of items in the scale.\n * @type {number}\n * @memberof ScaleComponent\n */\n @Input() set length(length: number) {\n this.items = Array(Math.max(length, this.MIN_LENGTH))\n .fill(0)\n .map((_, i) => i);\n }\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof ScaleComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n * Color of the option hover.\n * Defaults to Test Gorilla primary color.\n *\n * @type {string}\n * @memberof ScaleComponent\n */\n @Input() companyColor = '';\n\n @Output() selectedIndexChange = new EventEmitter<number>();\n\n styles = signal({ '--hover-color': '#FFB3EE', '--selected-color': '#D410AA' });\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n this.length = this.DEFAULT_LENGTH;\n }\n\n ngOnInit() {\n if (this.companyColor) {\n this.setCompanyColor();\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['companyColor']) {\n this.setCompanyColor();\n }\n }\n\n protected select(index: number): void {\n this.selectedIndex = index;\n this.selectedIndexChange.emit(this.selectedIndex);\n }\n\n onKeyDown(event: KeyboardEvent, index: number) {\n this.selectedIndex ??= 0;\n if (event.key === 'ArrowRight' || event.key === 'ArrowDown') {\n // Move to the next item (wrap around)\n this.select((index + 1) % this.items.length);\n this.focusItem(this.selectedIndex);\n } else if (event.key === 'ArrowLeft' || event.key === 'ArrowUp') {\n // Move to the previous item (wrap around)\n this.select((index - 1 + this.items.length) % this.items.length);\n this.focusItem(this.selectedIndex);\n } else if (event.key === ' ' || event.key === 'Enter') {\n // Select the current item\n this.select(index);\n this.focusItem(this.selectedIndex);\n }\n }\n\n focusItem(index: number) {\n const element = this.scaleItems?.toArray()[index]?.nativeElement;\n if (element) {\n element.focus();\n }\n }\n\n getAriaLabel(index: number): string {\n if (index === 0) {\n return '1 - Not at all important';\n } else if (index === 4) {\n return '5 - Very important';\n }\n return '';\n }\n\n private setCompanyColor(): void {\n const styles = this.styles();\n styles['--hover-color'] = hexToRgbWithAlpha(this.companyColor);\n styles['--selected-color'] = this.companyColor;\n this.styles.set(styles);\n }\n\n onFocus(item: number): void {\n // If no item is selected when the component receives focus, select the first item\n if (this.selectedIndex === null && item === 0) {\n this.select(0);\n }\n }\n}\n","<div\n [style.--scale-count]=\"items.length\"\n class=\"scale\"\n [ngStyle]=\"styles()\"\n [ngClass]=\"{ 'scale-classic': applicationTheme === 'classic' }\"\n>\n @for (item of items; track item) {\n <div\n class=\"scale-item\"\n (click)=\"select(item)\"\n #scaleItem\n role=\"radio\"\n (keydown)=\"onKeyDown($event, item)\"\n (focus)=\"onFocus(item)\"\n [class.scale-item-focus-prev]=\"selectedIndex && selectedIndex > 0 ? item === selectedIndex - 1 : false\"\n [attr.tabindex]=\"selectedIndex === null ? (item === 0 ? '0' : '-1') : item === selectedIndex ? '0' : '-1'\"\n [attr.aria-checked]=\"\n selectedIndex === null ? (item === 0 ? 'true' : 'false') : item === selectedIndex ? 'true' : 'false'\n \"\n [attr.aria-label]=\"getAriaLabel(item)\"\n [ngClass]=\"{ 'scale-item-selected': item === selectedIndex }\"\n >\n {{ item + 1 }}\n </div>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ScaleComponent } from './scale.component';\n\n@NgModule({\n imports: [CommonModule, ScaleComponent],\n exports: [ScaleComponent],\n})\nexport class ScaleComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MA2Ba,cAAc,CAAA;AAczB;;;;AAIG;IACH,IAAa,MAAM,CAAC,MAAc,EAAA;AAChC,QAAA,IAAI,CAAC,KAAK,GAAG,K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CAAA;;4FAGX,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC;oBACvC,OAAO,EAAE,CAAC,cAAc,CAAC;AAC1B,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui-components-scale.mjs","sources":["../../../components/scale/scale.component.ts","../../../components/scale/scale.component.html","../../../components/scale/scale.component.module.ts","../../../components/scale/testgorilla-tgo-ui-components-scale.ts"],"sourcesContent":["import { NgStyle, NgClass } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n Inject,\n Input,\n OnChanges,\n OnInit,\n Optional,\n Output,\n QueryList,\n signal,\n SimpleChanges,\n ViewChildren,\n} from '@angular/core';\n\nimport { ApplicationTheme, hexToRgbWithAlpha } from '@testgorilla/tgo-ui/components/core';\n\n@Component({\n selector: 'ui-scale',\n templateUrl: './scale.component.html',\n styleUrls: ['./scale.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgStyle, NgClass],\n})\nexport class ScaleComponent implements OnInit, OnChanges {\n private readonly MIN_LENGTH = 1;\n private readonly DEFAULT_LENGTH = 5;\n protected items: number[] = [];\n\n @ViewChildren('scaleItem') scaleItems!: QueryList<ElementRef<HTMLElement>>;\n\n /**\n * The value representing the selected item of the scale.\n * @type {number}\n * @memberof ScaleComponent\n */\n @Input() selectedIndex: number | null = null;\n\n /**\n * The max number of items in the scale.\n * @type {number}\n * @memberof ScaleComponent\n */\n @Input() set length(length: number) {\n this.items = Array(Math.max(length, this.MIN_LENGTH))\n .fill(0)\n .map((_, i) => i);\n }\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof ScaleComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n * Color of the option hover.\n * Defaults to Test Gorilla primary color.\n *\n * @type {string}\n * @memberof ScaleComponent\n */\n @Input() companyColor = '';\n\n @Output() selectedIndexChange = new EventEmitter<number>();\n\n styles = signal({ '--hover-color': '#FFB3EE', '--selected-color': '#D410AA' });\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n this.length = this.DEFAULT_LENGTH;\n }\n\n ngOnInit() {\n if (this.companyColor) {\n this.setCompanyColor();\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['companyColor']) {\n this.setCompanyColor();\n }\n }\n\n protected select(index: number): void {\n this.selectedIndex = index;\n this.selectedIndexChange.emit(this.selectedIndex);\n }\n\n onKeyDown(event: KeyboardEvent, index: number) {\n this.selectedIndex ??= 0;\n if (event.key === 'ArrowRight' || event.key === 'ArrowDown') {\n // Move to the next item (wrap around)\n this.select((index + 1) % this.items.length);\n this.focusItem(this.selectedIndex);\n } else if (event.key === 'ArrowLeft' || event.key === 'ArrowUp') {\n // Move to the previous item (wrap around)\n this.select((index - 1 + this.items.length) % this.items.length);\n this.focusItem(this.selectedIndex);\n } else if (event.key === ' ' || event.key === 'Enter') {\n // Select the current item\n this.select(index);\n this.focusItem(this.selectedIndex);\n }\n }\n\n focusItem(index: number) {\n const element = this.scaleItems?.toArray()[index]?.nativeElement;\n if (element) {\n element.focus();\n }\n }\n\n getAriaLabel(index: number): string {\n if (index === 0) {\n return '1 - Not at all important';\n } else if (index === 4) {\n return '5 - Very important';\n }\n return '';\n }\n\n private setCompanyColor(): void {\n const styles = this.styles();\n styles['--hover-color'] = hexToRgbWithAlpha(this.companyColor);\n styles['--selected-color'] = this.companyColor;\n this.styles.set(styles);\n }\n\n onFocus(item: number): void {\n // If no item is selected when the component receives focus, select the first item\n if (this.selectedIndex === null && item === 0) {\n this.select(0);\n }\n }\n}\n","<div\n [style.--scale-count]=\"items.length\"\n class=\"scale\"\n [ngStyle]=\"styles()\"\n [ngClass]=\"{ 'scale-classic': applicationTheme === 'classic' }\"\n>\n @for (item of items; track item) {\n <div\n class=\"scale-item\"\n (click)=\"select(item)\"\n #scaleItem\n role=\"radio\"\n (keydown)=\"onKeyDown($event, item)\"\n (focus)=\"onFocus(item)\"\n [class.scale-item-focus-prev]=\"selectedIndex && selectedIndex > 0 ? item === selectedIndex - 1 : false\"\n [attr.tabindex]=\"selectedIndex === null ? (item === 0 ? '0' : '-1') : item === selectedIndex ? '0' : '-1'\"\n [attr.aria-checked]=\"\n selectedIndex === null ? (item === 0 ? 'true' : 'false') : item === selectedIndex ? 'true' : 'false'\n \"\n [attr.aria-label]=\"getAriaLabel(item)\"\n [ngClass]=\"{ 'scale-item-selected': item === selectedIndex }\"\n >\n {{ item + 1 }}\n </div>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ScaleComponent } from './scale.component';\n\n@NgModule({\n imports: [CommonModule, ScaleComponent],\n exports: [ScaleComponent],\n})\nexport class ScaleComponentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MA2Ba,cAAc,CAAA;AAczB;;;;AAIG;IACH,IAAa,MAAM,CAAC,MAAc,EAAA;AAChC,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;aACjD,IAAI,CAAC,CAAC;aACN,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACrB;AAwBA,IAAA,WAAA,CAC6E,eAAiC,EAAA;QAAjC,IAAA,CAAA,eAAe,GAAf,eAAe;QA/C3E,IAAA,CAAA,UAAU,GAAG,CAAC;QACd,IAAA,CAAA,cAAc,GAAG,CAAC;QACzB,IAAA,CAAA,KAAK,GAAa,EAAE;AAI9B;;;;AAIG;QACM,IAAA,CAAA,aAAa,GAA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ngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
89
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
88
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: SegmentedBarComponent, deps: [{ token: 'CANOPYUI_DEFAULT_APPLICATION_THEME', optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
89
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: SegmentedBarComponent, isStandalone: true, 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 @for (segment of segmentList; track segment) {\n @if (segment.value) {\n <div\n class=\"segmented-bar\"\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 @if (segment.icon) {\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"segment.icon\"></ui-icon>\n }\n <span>{{ segment.value }}</span>\n </div>\n }\n }\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 </div>\n</ng-template>\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:#d4f2c3}.segmented-bar-container[theme=dark] .segmented-bar.teal,.segmented-bar-container[theme=light] .segmented-bar.teal{background:#d4f2c3}.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;--mat-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:#d4f2c3}.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:#d4f2c3}.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: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: TooltipTemplateDirective, selector: "[uiTooltipTemplate]", inputs: ["tooltipPosition", "showTooltip", "uiTooltipTemplate"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: IconComponentModule }, { kind: "component", type: i1.IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
90
90
|
}
|
|
91
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: SegmentedBarComponent, decorators: [{
|
|
92
92
|
type: Component,
|
|
93
93
|
args: [{ selector: 'ui-segmented-bar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, TooltipTemplateDirective, NgStyle, MatTooltip, IconComponentModule], 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 @for (segment of segmentList; track segment) {\n @if (segment.value) {\n <div\n class=\"segmented-bar\"\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 @if (segment.icon) {\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"segment.icon\"></ui-icon>\n }\n <span>{{ segment.value }}</span>\n </div>\n }\n }\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 </div>\n</ng-template>\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:#d4f2c3}.segmented-bar-container[theme=dark] .segmented-bar.teal,.segmented-bar-container[theme=light] .segmented-bar.teal{background:#d4f2c3}.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;--mat-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:#d4f2c3}.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:#d4f2c3}.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"] }]
|
|
94
94
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
@@ -114,21 +114,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
114
114
|
}] } });
|
|
115
115
|
|
|
116
116
|
class SegmentedBarComponentModule {
|
|
117
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
118
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
117
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: SegmentedBarComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
118
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.18", ngImport: i0, type: SegmentedBarComponentModule, imports: [CommonModule,
|
|
119
119
|
MatTooltipModule,
|
|
120
120
|
MatInputModule,
|
|
121
121
|
IconComponentModule,
|
|
122
122
|
TooltipComponentModule,
|
|
123
123
|
SegmentedBarComponent], exports: [SegmentedBarComponent] }); }
|
|
124
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
124
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: SegmentedBarComponentModule, imports: [CommonModule,
|
|
125
125
|
MatTooltipModule,
|
|
126
126
|
MatInputModule,
|
|
127
127
|
IconComponentModule,
|
|
128
128
|
TooltipComponentModule,
|
|
129
129
|
SegmentedBarComponent] }); }
|
|
130
130
|
}
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: SegmentedBarComponentModule, decorators: [{
|
|
132
132
|
type: NgModule,
|
|
133
133
|
args: [{
|
|
134
134
|
imports: [
|
|
@@ -70,8 +70,8 @@ class SegmentedButtonComponent {
|
|
|
70
70
|
this.value = value;
|
|
71
71
|
this.buttonSelected.emit(value);
|
|
72
72
|
}
|
|
73
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
74
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
73
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: SegmentedButtonComponent, deps: [{ token: 'CANOPYUI_DEFAULT_APPLICATION_THEME', optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
74
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: SegmentedButtonComponent, isStandalone: true, selector: "ui-segmented-button", inputs: { buttonConfig: "buttonConfig", disabled: "disabled", fullWidth: "fullWidth", value: "value", applicationTheme: "applicationTheme" }, outputs: { buttonSelected: "buttonSelected" }, providers: [
|
|
75
75
|
{
|
|
76
76
|
provide: NG_VALUE_ACCESSOR,
|
|
77
77
|
useExisting: forwardRef(() => SegmentedButtonComponent),
|
|
@@ -79,7 +79,7 @@ class SegmentedButtonComponent {
|
|
|
79
79
|
},
|
|
80
80
|
], 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 @for (button of buttonConfig; track button) {\n <mat-button-toggle\n [disableRipple]=\"true\"\n [value]=\"button.value\"\n [ngClass]=\"{ disabled: button.disabled }\"\n [matTooltip]=\"button.tooltip ?? ''\"\n >\n @if (button.template) {\n <ng-container [ngTemplateOutlet]=\"button.template\"></ng-container>\n } @else {\n {{ button.label }}\n }\n </mat-button-toggle>\n }\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:#d410aa}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: MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: 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: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
81
81
|
}
|
|
82
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
82
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: SegmentedButtonComponent, decorators: [{
|
|
83
83
|
type: Component,
|
|
84
84
|
args: [{ selector: 'ui-segmented-button', providers: [
|
|
85
85
|
{
|
|
@@ -109,11 +109,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
109
109
|
}] } });
|
|
110
110
|
|
|
111
111
|
class SegmentedButtonComponentModule {
|
|
112
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
113
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
114
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: SegmentedButtonComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
113
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.18", ngImport: i0, type: SegmentedButtonComponentModule, imports: [CommonModule, MatButtonToggleModule, FormsModule, MatTooltipModule, SegmentedButtonComponent], exports: [SegmentedButtonComponent] }); }
|
|
114
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: SegmentedButtonComponentModule, imports: [CommonModule, MatButtonToggleModule, FormsModule, MatTooltipModule, SegmentedButtonComponent] }); }
|
|
115
115
|
}
|
|
116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: SegmentedButtonComponentModule, decorators: [{
|
|
117
117
|
type: NgModule,
|
|
118
118
|
args: [{
|
|
119
119
|
exports: [SegmentedButtonComponent],
|
|
@@ -7,28 +7,28 @@ class SegmentedToggleComponent {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
this.hostRef = inject(ElementRef);
|
|
9
9
|
this.destroyRef = inject(DestroyRef);
|
|
10
|
-
this.options = input.required(...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
11
|
-
this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
|
|
12
|
-
this.disabled = input(false, ...(ngDevMode ?
|
|
13
|
-
this.ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : []));
|
|
14
|
-
this.applicationTheme = input(undefined, ...(ngDevMode ? [{ debugName: "applicationTheme" }] : []));
|
|
10
|
+
this.options = input.required(...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
11
|
+
this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
|
|
12
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
13
|
+
this.ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
14
|
+
this.applicationTheme = input(undefined, ...(ngDevMode ? [{ debugName: "applicationTheme" }] : /* istanbul ignore next */ []));
|
|
15
15
|
this.defaultAppTheme = inject('CANOPYUI_DEFAULT_APPLICATION_THEME', {
|
|
16
16
|
optional: true,
|
|
17
17
|
});
|
|
18
|
-
this.theme = computed(() => this.applicationTheme() ?? this.defaultAppTheme ?? 'light', ...(ngDevMode ? [{ debugName: "theme" }] : []));
|
|
18
|
+
this.theme = computed(() => this.applicationTheme() ?? this.defaultAppTheme ?? 'light', ...(ngDevMode ? [{ debugName: "theme" }] : /* istanbul ignore next */ []));
|
|
19
19
|
/** One ElementRef per segment button; used to measure the active pill geometry. */
|
|
20
|
-
this.optionButtons = viewChildren('optionButton', ...(ngDevMode ? [{ debugName: "optionButtons" }] : []));
|
|
20
|
+
this.optionButtons = viewChildren('optionButton', ...(ngDevMode ? [{ debugName: "optionButtons" }] : /* istanbul ignore next */ []));
|
|
21
21
|
/** Index of the selected option; -1 when value() matches no option. */
|
|
22
|
-
this.selectedIndex = computed(() => this.options().findIndex(option => option.value === this.value()), ...(ngDevMode ? [{ debugName: "selectedIndex" }] : []));
|
|
22
|
+
this.selectedIndex = computed(() => this.options().findIndex(option => option.value === this.value()), ...(ngDevMode ? [{ debugName: "selectedIndex" }] : /* istanbul ignore next */ []));
|
|
23
23
|
/** True when the currently-selected option is flagged `brand: true`. */
|
|
24
|
-
this.selectedOptionIsBrand = computed(() => this.options()[this.selectedIndex()]?.brand === true, ...(ngDevMode ? [{ debugName: "selectedOptionIsBrand" }] : []));
|
|
24
|
+
this.selectedOptionIsBrand = computed(() => this.options()[this.selectedIndex()]?.brand === true, ...(ngDevMode ? [{ debugName: "selectedOptionIsBrand" }] : /* istanbul ignore next */ []));
|
|
25
25
|
/** Measured pixel geometry of the active button, driving the sliding indicator. */
|
|
26
|
-
this.indicatorOffset = signal(0, ...(ngDevMode ? [{ debugName: "indicatorOffset" }] : []));
|
|
27
|
-
this.indicatorTop = signal(0, ...(ngDevMode ? [{ debugName: "indicatorTop" }] : []));
|
|
28
|
-
this.indicatorWidth = signal(0, ...(ngDevMode ? [{ debugName: "indicatorWidth" }] : []));
|
|
29
|
-
this.indicatorHeight = signal(0, ...(ngDevMode ? [{ debugName: "indicatorHeight" }] : []));
|
|
26
|
+
this.indicatorOffset = signal(0, ...(ngDevMode ? [{ debugName: "indicatorOffset" }] : /* istanbul ignore next */ []));
|
|
27
|
+
this.indicatorTop = signal(0, ...(ngDevMode ? [{ debugName: "indicatorTop" }] : /* istanbul ignore next */ []));
|
|
28
|
+
this.indicatorWidth = signal(0, ...(ngDevMode ? [{ debugName: "indicatorWidth" }] : /* istanbul ignore next */ []));
|
|
29
|
+
this.indicatorHeight = signal(0, ...(ngDevMode ? [{ debugName: "indicatorHeight" }] : /* istanbul ignore next */ []));
|
|
30
30
|
/** Enables the slide transition only after the initial position is painted. */
|
|
31
|
-
this.animated = signal(false, ...(ngDevMode ? [{ debugName: "animated" }] : []));
|
|
31
|
+
this.animated = signal(false, ...(ngDevMode ? [{ debugName: "animated" }] : /* istanbul ignore next */ []));
|
|
32
32
|
// Re-measure after every render that follows a selection or options change.
|
|
33
33
|
afterRenderEffect(() => {
|
|
34
34
|
// Read these so the effect re-runs (post-render) whenever selection changes.
|
|
@@ -82,10 +82,10 @@ class SegmentedToggleComponent {
|
|
|
82
82
|
this.indicatorWidth.set(button.offsetWidth);
|
|
83
83
|
this.indicatorHeight.set(button.offsetHeight);
|
|
84
84
|
}
|
|
85
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
86
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
85
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: SegmentedToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
86
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.18", type: SegmentedToggleComponent, isStandalone: true, selector: "ui-segmented-toggle", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, applicationTheme: { classPropertyName: "applicationTheme", publicName: "applicationTheme", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.theme": "theme()", "class.ui-segmented-toggle--brand-active": "selectedOptionIsBrand()", "class.ui-segmented-toggle--disabled": "disabled()" } }, viewQueries: [{ propertyName: "optionButtons", predicate: ["optionButton"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ui-segmented-toggle__group\" role=\"group\" [attr.aria-label]=\"ariaLabel()\">\n <span\n class=\"ui-segmented-toggle__indicator\"\n [class.ui-segmented-toggle__indicator--hidden]=\"selectedIndex() < 0\"\n [class.ui-segmented-toggle__indicator--animated]=\"animated()\"\n aria-hidden=\"true\"\n [style.transform]=\"'translateX(' + indicatorOffset() + 'px) translateY(' + indicatorTop() + 'px)'\"\n [style.width.px]=\"indicatorWidth()\"\n [style.height.px]=\"indicatorHeight()\"\n ></span>\n\n @for (option of options(); track option.value) {\n <button\n #optionButton\n type=\"button\"\n class=\"ui-segmented-toggle__option\"\n [attr.aria-pressed]=\"isSelected(option.value)\"\n [attr.aria-label]=\"fallbackAriaLabel(option)\"\n [disabled]=\"disabled()\"\n (click)=\"select(option.value)\"\n >\n @if (option.icon) {\n <ui-icon\n class=\"ui-segmented-toggle__icon\"\n [name]=\"option.icon\"\n size=\"16\"\n [attr.aria-hidden]=\"option.iconAriaLabel ? null : 'true'\"\n ></ui-icon>\n @if (option.iconAriaLabel) {\n <span class=\"ui-segmented-toggle__sr-only\">{{ option.iconAriaLabel }}</span>\n }\n }\n @if (option.label) {\n <span class=\"ui-segmented-toggle__label\">{{ option.label }}</span>\n }\n </button>\n }\n</div>\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}:host{display:inline-flex}.ui-segmented-toggle__group{position:relative;display:flex;align-items:center;gap:0;padding:4px;box-shadow:inset 0 0 0 1px #242424;border-radius:999px;background:#fff}.ui-segmented-toggle__indicator{position:absolute;top:0;left:0;z-index:0;border-radius:999px;background:#242424}.ui-segmented-toggle__indicator--hidden{opacity:0}.ui-segmented-toggle__indicator--animated{transition:transform .2s ease,width .2s ease}.ui-segmented-toggle__option{--cnp-icon-color: #242424;position:relative;z-index:1;display:inline-flex;flex:0 0 auto;gap:4px;align-items:center;justify-content:center;margin:0;padding:3px 16px;border:0;border-radius:999px;background:transparent;color:#242424;font:inherit;white-space:nowrap;cursor:pointer}.ui-segmented-toggle__option[aria-pressed=true]{--cnp-icon-color: #ffffff;color:#fff}.ui-segmented-toggle__option[aria-pressed=true] .ui-segmented-toggle__label{font-weight:700}:host(.ui-segmented-toggle--brand-active) .ui-segmented-toggle__indicator{background:#d410aa}:host(.ui-segmented-toggle--brand-active) .ui-segmented-toggle__option[aria-pressed=true]{--cnp-icon-color: #ffe6fa;color:#ffe6fa}:host(.ui-segmented-toggle--disabled) .ui-segmented-toggle__group{box-shadow:inset 0 0 0 1px #919191}:host(.ui-segmented-toggle--disabled) .ui-segmented-toggle__indicator{background:#e9e9e9}:host(.ui-segmented-toggle--disabled) .ui-segmented-toggle__option,:host(.ui-segmented-toggle--disabled) .ui-segmented-toggle__option[aria-pressed=true]{--cnp-icon-color: #919191;color:#919191;cursor:not-allowed}.ui-segmented-toggle__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}@media(prefers-reduced-motion:reduce){.ui-segmented-toggle__indicator--animated{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: IconComponentModule }, { kind: "component", type: i1.IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
87
87
|
}
|
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.18", ngImport: i0, type: SegmentedToggleComponent, decorators: [{
|
|
89
89
|
type: Component,
|
|
90
90
|
args: [{ selector: 'ui-segmented-toggle', standalone: true, imports: [IconComponentModule], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
91
91
|
'[attr.theme]': 'theme()',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testgorilla-tgo-ui-components-segmented-toggle.mjs","sources":["../../../components/segmented-toggle/segmented-toggle.component.ts","../../../components/segmented-toggle/segmented-toggle.component.html","../../../components/segmented-toggle/testgorilla-tgo-ui-components-segmented-toggle.ts"],"sourcesContent":["import {\n afterNextRender,\n afterRenderEffect,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n model,\n signal,\n viewChildren,\n} from '@angular/core';\n\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\n\nimport { SegmentedToggleOption } from './segmented-toggle.model';\n\n@Component({\n selector: 'ui-segmented-toggle',\n standalone: true,\n imports: [IconComponentModule],\n templateUrl: './segmented-toggle.component.html',\n styleUrls: ['./segmented-toggle.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.theme]': 'theme()',\n '[class.ui-segmented-toggle--brand-active]': 'selectedOptionIsBrand()',\n '[class.ui-segmented-toggle--disabled]': 'disabled()',\n },\n})\nexport class SegmentedToggleComponent<T> {\n private readonly hostRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n\n readonly options = input.required<SegmentedToggleOption<T>[]>();\n readonly value = model<T>();\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly ariaLabel = input<string>();\n readonly applicationTheme = input<ApplicationTheme | undefined>(undefined);\n private readonly defaultAppTheme = inject<ApplicationTheme>('CANOPYUI_DEFAULT_APPLICATION_THEME' as never, {\n optional: true,\n });\n readonly theme = computed<ApplicationTheme>(() => this.applicationTheme() ?? this.defaultAppTheme ?? 'light');\n\n /** One ElementRef per segment button; used to measure the active pill geometry. */\n private readonly optionButtons = viewChildren<ElementRef<HTMLButtonElement>>('optionButton');\n\n /** Index of the selected option; -1 when value() matches no option. */\n protected readonly selectedIndex = computed(() => this.options().findIndex(option => option.value === this.value()));\n\n /** True when the currently-selected option is flagged `brand: true`. */\n protected readonly selectedOptionIsBrand = computed(() => this.options()[this.selectedIndex()]?.brand === true);\n\n /** Measured pixel geometry of the active button, driving the sliding indicator. */\n protected readonly indicatorOffset = signal(0);\n protected readonly indicatorTop = signal(0);\n protected readonly indicatorWidth = signal(0);\n protected readonly indicatorHeight = signal(0);\n\n /** Enables the slide transition only after the initial position is painted. */\n protected readonly animated = signal(false);\n\n constructor() {\n // Re-measure after every render that follows a selection or options change.\n afterRenderEffect(() => {\n // Read these so the effect re-runs (post-render) whenever selection changes.\n this.value();\n this.options();\n this.measureIndicator();\n });\n\n // Re-measure on container resize (width changes don't touch any signal).\n afterNextRender(() => {\n // Position the indicator for the initial selection without animating, then\n // enable the slide on the next frame so only user-driven changes animate.\n this.measureIndicator();\n requestAnimationFrame(() => this.animated.set(true));\n\n if (typeof ResizeObserver === 'undefined') {\n return;\n }\n const observer = new ResizeObserver(() => this.measureIndicator());\n observer.observe(this.hostRef.nativeElement);\n this.destroyRef.onDestroy(() => observer.disconnect());\n });\n }\n\n protected select(optionValue: T): void {\n if (this.disabled()) {\n return;\n }\n this.value.set(optionValue);\n }\n\n protected isSelected(optionValue: T): boolean {\n return optionValue === this.value();\n }\n\n /**\n * Last-resort accessible name for a segment. Used only for an icon-only option\n * that provides neither a visible `label` nor an `iconAriaLabel`, so the button\n * is never a nameless control. When a label or icon label is present those name\n * the button and this returns `null` (no `aria-label` attribute).\n */\n protected fallbackAriaLabel(option: SegmentedToggleOption<T>): string | null {\n if (option.label || option.iconAriaLabel) {\n return null;\n }\n return String(option.value);\n }\n\n /** Reads the active button's box and writes it to the indicator signals. */\n private measureIndicator(): void {\n const button = this.optionButtons()[this.selectedIndex()]?.nativeElement;\n if (!button) {\n return;\n }\n this.indicatorOffset.set(button.offsetLeft);\n this.indicatorTop.set(button.offsetTop);\n this.indicatorWidth.set(button.offsetWidth);\n this.indicatorHeight.set(button.offsetHeight);\n }\n}\n","<div class=\"ui-segmented-toggle__group\" role=\"group\" [attr.aria-label]=\"ariaLabel()\">\n <span\n class=\"ui-segmented-toggle__indicator\"\n [class.ui-segmented-toggle__indicator--hidden]=\"selectedIndex() < 0\"\n [class.ui-segmented-toggle__indicator--animated]=\"animated()\"\n aria-hidden=\"true\"\n [style.transform]=\"'translateX(' + indicatorOffset() + 'px) translateY(' + indicatorTop() + 'px)'\"\n [style.width.px]=\"indicatorWidth()\"\n [style.height.px]=\"indicatorHeight()\"\n ></span>\n\n @for (option of options(); track option.value) {\n <button\n #optionButton\n type=\"button\"\n class=\"ui-segmented-toggle__option\"\n [attr.aria-pressed]=\"isSelected(option.value)\"\n [attr.aria-label]=\"fallbackAriaLabel(option)\"\n [disabled]=\"disabled()\"\n (click)=\"select(option.value)\"\n >\n @if (option.icon) {\n <ui-icon\n class=\"ui-segmented-toggle__icon\"\n [name]=\"option.icon\"\n size=\"16\"\n [attr.aria-hidden]=\"option.iconAriaLabel ? null : 'true'\"\n ></ui-icon>\n @if (option.iconAriaLabel) {\n <span class=\"ui-segmented-toggle__sr-only\">{{ option.iconAriaLabel }}</span>\n }\n }\n @if (option.label) {\n <span class=\"ui-segmented-toggle__label\">{{ option.label }}</span>\n }\n </button>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAkCa,wBAAwB,CAAA;AAgCnC,IAAA,WAAA,GAAA;AA/BiB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAA0B,UAAU,CAAC;AACrD,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAEvC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,QAAQ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ACnB,IAAI,EAAA,OAAA,EACP,CAAC,mBAAmB,CAAC,EAAA,eAAA,EAGb,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,cAAc,EAAE,SAAS;AACzB,wBAAA,2CAA2C,EAAE,yBAAyB;AACtE,wBAAA,uCAAuC,EAAE,YAAY;AACtD,qBAAA,EAAA,QAAA,EAAA,83CAAA,EAAA,MAAA,EAAA,CAAA,k4HAAA,CAAA,EAAA;6nBAiB4E,cAAc,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEjD7F;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"testgorilla-tgo-ui-components-segmented-toggle.mjs","sources":["../../../components/segmented-toggle/segmented-toggle.component.ts","../../../components/segmented-toggle/segmented-toggle.component.html","../../../components/segmented-toggle/testgorilla-tgo-ui-components-segmented-toggle.ts"],"sourcesContent":["import {\n afterNextRender,\n afterRenderEffect,\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n model,\n signal,\n viewChildren,\n} from '@angular/core';\n\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\n\nimport { SegmentedToggleOption } from './segmented-toggle.model';\n\n@Component({\n selector: 'ui-segmented-toggle',\n standalone: true,\n imports: [IconComponentModule],\n templateUrl: './segmented-toggle.component.html',\n styleUrls: ['./segmented-toggle.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.theme]': 'theme()',\n '[class.ui-segmented-toggle--brand-active]': 'selectedOptionIsBrand()',\n '[class.ui-segmented-toggle--disabled]': 'disabled()',\n },\n})\nexport class SegmentedToggleComponent<T> {\n private readonly hostRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n\n readonly options = input.required<SegmentedToggleOption<T>[]>();\n readonly value = model<T>();\n readonly disabled = input(false, { transform: booleanAttribute });\n readonly ariaLabel = input<string>();\n readonly applicationTheme = input<ApplicationTheme | undefined>(undefined);\n private readonly defaultAppTheme = inject<ApplicationTheme>('CANOPYUI_DEFAULT_APPLICATION_THEME' as never, {\n optional: true,\n });\n readonly theme = computed<ApplicationTheme>(() => this.applicationTheme() ?? this.defaultAppTheme ?? 'light');\n\n /** One ElementRef per segment button; used to measure the active pill geometry. */\n private readonly optionButtons = viewChildren<ElementRef<HTMLButtonElement>>('optionButton');\n\n /** Index of the selected option; -1 when value() matches no option. */\n protected readonly selectedIndex = computed(() => this.options().findIndex(option => option.value === this.value()));\n\n /** True when the currently-selected option is flagged `brand: true`. */\n protected readonly selectedOptionIsBrand = computed(() => this.options()[this.selectedIndex()]?.brand === true);\n\n /** Measured pixel geometry of the active button, driving the sliding indicator. */\n protected readonly indicatorOffset = signal(0);\n protected readonly indicatorTop = signal(0);\n protected readonly indicatorWidth = signal(0);\n protected readonly indicatorHeight = signal(0);\n\n /** Enables the slide transition only after the initial position is painted. */\n protected readonly animated = signal(false);\n\n constructor() {\n // Re-measure after every render that follows a selection or options change.\n afterRenderEffect(() => {\n // Read these so the effect re-runs (post-render) whenever selection changes.\n this.value();\n this.options();\n this.measureIndicator();\n });\n\n // Re-measure on container resize (width changes don't touch any signal).\n afterNextRender(() => {\n // Position the indicator for the initial selection without animating, then\n // enable the slide on the next frame so only user-driven changes animate.\n this.measureIndicator();\n requestAnimationFrame(() => this.animated.set(true));\n\n if (typeof ResizeObserver === 'undefined') {\n return;\n }\n const observer = new ResizeObserver(() => this.measureIndicator());\n observer.observe(this.hostRef.nativeElement);\n this.destroyRef.onDestroy(() => observer.disconnect());\n });\n }\n\n protected select(optionValue: T): void {\n if (this.disabled()) {\n return;\n }\n this.value.set(optionValue);\n }\n\n protected isSelected(optionValue: T): boolean {\n return optionValue === this.value();\n }\n\n /**\n * Last-resort accessible name for a segment. Used only for an icon-only option\n * that provides neither a visible `label` nor an `iconAriaLabel`, so the button\n * is never a nameless control. When a label or icon label is present those name\n * the button and this returns `null` (no `aria-label` attribute).\n */\n protected fallbackAriaLabel(option: SegmentedToggleOption<T>): string | null {\n if (option.label || option.iconAriaLabel) {\n return null;\n }\n return String(option.value);\n }\n\n /** Reads the active button's box and writes it to the indicator signals. */\n private measureIndicator(): void {\n const button = this.optionButtons()[this.selectedIndex()]?.nativeElement;\n if (!button) {\n return;\n }\n this.indicatorOffset.set(button.offsetLeft);\n this.indicatorTop.set(button.offsetTop);\n this.indicatorWidth.set(button.offsetWidth);\n this.indicatorHeight.set(button.offsetHeight);\n }\n}\n","<div class=\"ui-segmented-toggle__group\" role=\"group\" [attr.aria-label]=\"ariaLabel()\">\n <span\n class=\"ui-segmented-toggle__indicator\"\n [class.ui-segmented-toggle__indicator--hidden]=\"selectedIndex() < 0\"\n [class.ui-segmented-toggle__indicator--animated]=\"animated()\"\n aria-hidden=\"true\"\n [style.transform]=\"'translateX(' + indicatorOffset() + 'px) translateY(' + indicatorTop() + 'px)'\"\n [style.width.px]=\"indicatorWidth()\"\n [style.height.px]=\"indicatorHeight()\"\n ></span>\n\n @for (option of options(); track option.value) {\n <button\n #optionButton\n type=\"button\"\n class=\"ui-segmented-toggle__option\"\n [attr.aria-pressed]=\"isSelected(option.value)\"\n [attr.aria-label]=\"fallbackAriaLabel(option)\"\n [disabled]=\"disabled()\"\n (click)=\"select(option.value)\"\n >\n @if (option.icon) {\n <ui-icon\n class=\"ui-segmented-toggle__icon\"\n [name]=\"option.icon\"\n size=\"16\"\n [attr.aria-hidden]=\"option.iconAriaLabel ? null : 'true'\"\n ></ui-icon>\n @if (option.iconAriaLabel) {\n <span class=\"ui-segmented-toggle__sr-only\">{{ option.iconAriaLabel }}</span>\n }\n }\n @if (option.label) {\n <span class=\"ui-segmented-toggle__label\">{{ option.label }}</span>\n }\n </button>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAk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