@energycap/components 0.41.0 → 0.41.1-ECAP-27592-angular-17.20241219-1718
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/{esm2020 → esm2022}/energycap-components.mjs +4 -4
- package/{esm2020 → esm2022}/lib/components.module.mjs +418 -418
- package/{esm2020 → esm2022}/lib/controls/banner/banner.component.mjs +109 -109
- package/{esm2020 → esm2022}/lib/controls/button/button.component.mjs +106 -106
- package/{esm2020 → esm2022}/lib/controls/button/copy-button-base.directive.mjs +67 -67
- package/{esm2020 → esm2022}/lib/controls/button/copy-button.directive.mjs +28 -28
- package/{esm2020 → esm2022}/lib/controls/button/copy-table-button.directive.mjs +43 -43
- package/{esm2020 → esm2022}/lib/controls/calendar/calendar-item.component.mjs +59 -59
- package/{esm2020 → esm2022}/lib/controls/calendar/calendar.component.mjs +200 -200
- package/{esm2020 → esm2022}/lib/controls/calendar/calendar.types.mjs +3 -3
- package/{esm2020 → esm2022}/lib/controls/checkbox/checkbox.component.mjs +140 -140
- package/{esm2020 → esm2022}/lib/controls/collapsible-toggle/collapsible-toggle.component.mjs +38 -38
- package/{esm2020 → esm2022}/lib/controls/combobox/combobox.component.mjs +879 -879
- package/{esm2020 → esm2022}/lib/controls/date-input/date-input.component.mjs +256 -256
- package/{esm2020 → esm2022}/lib/controls/dropdown/dropdown.component.mjs +243 -243
- package/{esm2020 → esm2022}/lib/controls/file-upload/file-upload.component.mjs +261 -261
- package/{esm2020 → esm2022}/lib/controls/form-control/form-control.component.mjs +104 -104
- package/{esm2020 → esm2022}/lib/controls/form-control-base.mjs +151 -151
- package/{esm2020 → esm2022}/lib/controls/form-control-label/form-control-label.component.mjs +136 -136
- package/{esm2020 → esm2022}/lib/controls/form-group/form-group.component.mjs +261 -261
- package/{esm2020 → esm2022}/lib/controls/help-popover/help-popover.component.mjs +31 -31
- package/{esm2020 → esm2022}/lib/controls/item-picker/item-picker.component.mjs +329 -329
- package/{esm2020 → esm2022}/lib/controls/link-button/link-button.component.mjs +11 -11
- package/{esm2020 → esm2022}/lib/controls/menu/menu.component.mjs +485 -485
- package/{esm2020 → esm2022}/lib/controls/navigation/link-item.mjs +1 -1
- package/{esm2020 → esm2022}/lib/controls/navigation/nav-group.mjs +38 -38
- package/{esm2020 → esm2022}/lib/controls/navigation/nav-item-active.directive.mjs +92 -92
- package/{esm2020 → esm2022}/lib/controls/navigation/nav-item.mjs +1 -1
- package/{esm2020 → esm2022}/lib/controls/numericbox/numericbox.component.mjs +372 -372
- package/{esm2020 → esm2022}/lib/controls/popover/popover.component.mjs +117 -117
- package/{esm2020 → esm2022}/lib/controls/radio-button/radio-button-option.mjs +2 -2
- package/{esm2020 → esm2022}/lib/controls/radio-button/radio-button.component.mjs +82 -82
- package/{esm2020 → esm2022}/lib/controls/select/select.component.mjs +88 -88
- package/{esm2020 → esm2022}/lib/controls/tabs/tabs.component.mjs +47 -47
- package/{esm2020 → esm2022}/lib/controls/textbox/textbox.component.mjs +155 -155
- package/{esm2020 → esm2022}/lib/core/cache.service.mjs +105 -105
- package/esm2022/lib/core/custom-validators.mjs +29 -0
- package/esm2022/lib/core/date-time-helper.mjs +220 -0
- package/{esm2020 → esm2022}/lib/core/error.service.mjs +61 -61
- package/{esm2020 → esm2022}/lib/core/router-helper.service.mjs +111 -111
- package/{esm2020 → esm2022}/lib/core/scroll.service.mjs +89 -89
- package/{esm2020 → esm2022}/lib/core/telemetry-tracker.service.mjs +16 -16
- package/{esm2020 → esm2022}/lib/core/telemetry.service.mjs +38 -38
- package/{esm2020 → esm2022}/lib/core/validation-message.service.mjs +185 -185
- package/{esm2020 → esm2022}/lib/core/validation-patterns.mjs +30 -30
- package/{esm2020 → esm2022}/lib/core/window.service.mjs +186 -186
- package/{esm2020 → esm2022}/lib/display/app-bar/app-bar.component.mjs +46 -46
- package/esm2022/lib/display/avatar/avatar.component.mjs +67 -0
- package/{esm2020 → esm2022}/lib/display/avatar/avatar.service.mjs +64 -64
- package/{esm2020 → esm2022}/lib/display/confirm/confirm.component.mjs +168 -168
- package/{esm2020 → esm2022}/lib/display/dialog/dialog-content.mjs +1 -1
- package/{esm2020 → esm2022}/lib/display/dialog/dialog-group/dialog-group.component.mjs +63 -63
- package/{esm2020 → esm2022}/lib/display/dialog/dialog-types.mjs +76 -76
- package/{esm2020 → esm2022}/lib/display/dialog/dialog.component.mjs +281 -281
- package/{esm2020 → esm2022}/lib/display/dialog/dialog.service.mjs +71 -71
- package/{esm2020 → esm2022}/lib/display/help/help-types.mjs +1 -1
- package/{esm2020 → esm2022}/lib/display/hierarchy/hierarchy-base.mjs +111 -111
- package/{esm2020 → esm2022}/lib/display/hierarchy/hierarchy-mocks.spec.mjs +53 -53
- package/{esm2020 → esm2022}/lib/display/hierarchy/hierarchy-tree/hierarchy-tree.component.mjs +61 -61
- package/{esm2020 → esm2022}/lib/display/item-display/item-display.component.mjs +81 -81
- package/{esm2020 → esm2022}/lib/display/json-display/json-display.component.mjs +47 -47
- package/{esm2020 → esm2022}/lib/display/resizable/resizable-base.mjs +120 -120
- package/{esm2020 → esm2022}/lib/display/resizable/resizable.component.mjs +52 -52
- package/{esm2020 → esm2022}/lib/display/spinner/spinner.component.mjs +12 -12
- package/{esm2020 → esm2022}/lib/display/splash/splash.component.mjs +42 -42
- package/{esm2020 → esm2022}/lib/display/splash/splash.service.mjs +35 -35
- package/{esm2020 → esm2022}/lib/display/table/resizable-column.component.mjs +20 -20
- package/{esm2020 → esm2022}/lib/display/table/resizable-table.directive.mjs +227 -227
- package/{esm2020 → esm2022}/lib/display/table/searchable-table.component.mjs +342 -342
- package/{esm2020 → esm2022}/lib/display/table/table-detail-row.component.mjs +19 -19
- package/{esm2020 → esm2022}/lib/display/table/table-locked-column.component.mjs +58 -58
- package/{esm2020 → esm2022}/lib/display/table/table-master-header-row.component.mjs +14 -14
- package/{esm2020 → esm2022}/lib/display/table/table-master-row.component.mjs +163 -163
- package/{esm2020 → esm2022}/lib/display/table/table-pagination.component.mjs +155 -155
- package/{esm2020 → esm2022}/lib/display/table/table-selectable-row.component.mjs +235 -235
- package/{esm2020 → esm2022}/lib/display/table/table.component.mjs +249 -249
- package/{esm2020 → esm2022}/lib/display/tags/tag.mjs +17 -17
- package/{esm2020 → esm2022}/lib/display/tags/tags.component.mjs +77 -77
- package/{esm2020 → esm2022}/lib/display/toast/toast/toast.component.mjs +77 -77
- package/{esm2020 → esm2022}/lib/display/toast/toast-types.mjs +7 -7
- package/{esm2020 → esm2022}/lib/display/toast/toast.service.mjs +35 -35
- package/{esm2020 → esm2022}/lib/display/toast/toaster/toaster.component.mjs +114 -114
- package/{esm2020 → esm2022}/lib/display/tooltip/tooltip.component.mjs +28 -28
- package/{esm2020 → esm2022}/lib/display/tooltip/tooltip.service.mjs +78 -78
- package/{esm2020 → esm2022}/lib/display/tooltip-directive/tooltip.directive.mjs +173 -173
- package/{esm2020 → esm2022}/lib/display/tour/tour-types.mjs +33 -33
- package/{esm2020 → esm2022}/lib/display/tour/tour.component.mjs +398 -398
- package/{esm2020 → esm2022}/lib/display/tour/tour.service.mjs +75 -75
- package/{esm2020 → esm2022}/lib/display/tree/tree.component.mjs +135 -135
- package/{esm2020 → esm2022}/lib/display/view-overlay/view-overlay.component.mjs +58 -58
- package/{esm2020 → esm2022}/lib/shared/directives/click-area-for/click-area-for.directive.mjs +32 -32
- package/{esm2020 → esm2022}/lib/shared/directives/if-viewport-width/if-viewport-width.directive.mjs +111 -111
- package/esm2022/lib/shared/directives/popup/popup-container.directive.mjs +166 -0
- package/{esm2020 → esm2022}/lib/shared/display/pipes/date-display.pipe.mjs +50 -50
- package/{esm2020 → esm2022}/lib/shared/display/pipes/highlight-text.pipe.mjs +30 -30
- package/{esm2020 → esm2022}/lib/shared/display/pipes/relative-date.pipe.mjs +62 -62
- package/{esm2020 → esm2022}/lib/shared/display/pipes/row-count.pipe.mjs +48 -48
- package/{esm2020 → esm2022}/lib/shared/display/pipes/time-display.pipe.mjs +41 -41
- package/esm2022/lib/shared/display.mjs +6 -0
- package/esm2022/lib/shared/form-group.helper.mjs +67 -0
- package/{esm2020 → esm2022}/lib/shared/json-helper.mjs +18 -18
- package/esm2022/lib/shared/lodash-helper.mjs +52 -0
- package/{esm2020 → esm2022}/lib/shared/page/page-base/page-base.component.mjs +387 -387
- package/{esm2020 → esm2022}/lib/shared/page/page-statuses.mjs +22 -22
- package/{esm2020 → esm2022}/lib/shared/page/page-title/page-title.component.mjs +23 -23
- package/{esm2020 → esm2022}/lib/shared/page/page-view/page-view.component.mjs +147 -147
- package/{esm2020 → esm2022}/lib/shared/testing/copy-button-base-test-injector-factory.spec.mjs +16 -16
- package/{esm2020 → esm2022}/lib/shared/testing/hierarchy-base-test-injector-factory.spec.mjs +16 -16
- package/{esm2020 → esm2022}/lib/shared/testing/page-base-component-test-helper.spec.mjs +37 -37
- package/esm2022/lib/shared/testing/page-base-component-test-injector-factory.spec.mjs +98 -0
- package/{esm2020 → esm2022}/lib/shared/testing/public-mocks.spec.mjs +148 -148
- package/{esm2020 → esm2022}/lib/shared/testing/spy-factory.spec.mjs +39 -39
- package/{esm2020 → esm2022}/lib/shared/testing/translation-mocks.spec.mjs +56 -56
- package/{esm2020 → esm2022}/lib/shared/user-preference.service.mjs +17 -17
- package/{esm2020 → esm2022}/lib/shared/wizard/wizard-base/wizard-base.component.mjs +246 -246
- package/{esm2020 → esm2022}/lib/shared/wizard/wizard-buttons/wizard-buttons.component.mjs +68 -68
- package/{esm2020 → esm2022}/lib/shared/wizard/wizard-progress/wizard-progress.component.mjs +18 -18
- package/{esm2020 → esm2022}/public-api.mjs +114 -114
- package/{fesm2020 → fesm2022}/energycap-components.mjs +11797 -11793
- package/fesm2022/energycap-components.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/components.module.d.ts +91 -91
- package/lib/controls/banner/banner.component.d.ts +50 -50
- package/lib/controls/button/button.component.d.ts +78 -78
- package/lib/controls/button/copy-button-base.directive.d.ts +20 -20
- package/lib/controls/button/copy-button.directive.d.ts +14 -14
- package/lib/controls/button/copy-table-button.directive.d.ts +19 -19
- package/lib/controls/calendar/calendar-item.component.d.ts +17 -17
- package/lib/controls/calendar/calendar.component.d.ts +54 -54
- package/lib/controls/calendar/calendar.types.d.ts +7 -7
- package/lib/controls/checkbox/checkbox.component.d.ts +65 -65
- package/lib/controls/collapsible-toggle/collapsible-toggle.component.d.ts +25 -25
- package/lib/controls/combobox/combobox.component.d.ts +418 -418
- package/lib/controls/date-input/date-input.component.d.ts +80 -80
- package/lib/controls/dropdown/dropdown.component.d.ts +161 -161
- package/lib/controls/file-upload/file-upload.component.d.ts +124 -124
- package/lib/controls/form-control/form-control.component.d.ts +30 -30
- package/lib/controls/form-control-base.d.ts +110 -110
- package/lib/controls/form-control-label/form-control-label.component.d.ts +73 -73
- package/lib/controls/form-group/form-group.component.d.ts +105 -105
- package/lib/controls/help-popover/help-popover.component.d.ts +11 -11
- package/lib/controls/item-picker/item-picker.component.d.ts +164 -164
- package/lib/controls/link-button/link-button.component.d.ts +5 -5
- package/lib/controls/menu/menu.component.d.ts +255 -255
- package/lib/controls/navigation/link-item.d.ts +32 -32
- package/lib/controls/navigation/nav-group.d.ts +18 -18
- package/lib/controls/navigation/nav-item-active.directive.d.ts +42 -42
- package/lib/controls/navigation/nav-item.d.ts +31 -31
- package/lib/controls/numericbox/numericbox.component.d.ts +148 -148
- package/lib/controls/popover/popover.component.d.ts +51 -51
- package/lib/controls/radio-button/radio-button-option.d.ts +19 -19
- package/lib/controls/radio-button/radio-button.component.d.ts +53 -53
- package/lib/controls/select/select.component.d.ts +44 -44
- package/lib/controls/tabs/tabs.component.d.ts +30 -30
- package/lib/controls/textbox/textbox.component.d.ts +107 -107
- package/lib/core/cache.service.d.ts +33 -33
- package/lib/core/custom-validators.d.ts +20 -20
- package/lib/core/date-time-helper.d.ts +101 -101
- package/lib/core/error.service.d.ts +20 -20
- package/lib/core/router-helper.service.d.ts +48 -48
- package/lib/core/scroll.service.d.ts +36 -36
- package/lib/core/telemetry-tracker.service.d.ts +13 -13
- package/lib/core/telemetry.service.d.ts +31 -31
- package/lib/core/validation-message.service.d.ts +26 -26
- package/lib/core/validation-patterns.d.ts +22 -22
- package/lib/core/window.service.d.ts +116 -116
- package/lib/display/app-bar/app-bar.component.d.ts +20 -20
- package/lib/display/avatar/avatar.component.d.ts +35 -35
- package/lib/display/avatar/avatar.service.d.ts +24 -24
- package/lib/display/confirm/confirm.component.d.ts +123 -123
- package/lib/display/dialog/dialog-content.d.ts +19 -19
- package/lib/display/dialog/dialog-group/dialog-group.component.d.ts +32 -32
- package/lib/display/dialog/dialog-types.d.ts +130 -130
- package/lib/display/dialog/dialog.component.d.ts +120 -120
- package/lib/display/dialog/dialog.service.d.ts +48 -48
- package/lib/display/help/help-types.d.ts +33 -33
- package/lib/display/hierarchy/hierarchy-base.d.ts +97 -97
- package/lib/display/hierarchy/hierarchy-mocks.spec.d.ts +53 -53
- package/lib/display/hierarchy/hierarchy-tree/hierarchy-tree.component.d.ts +34 -34
- package/lib/display/item-display/item-display.component.d.ts +43 -43
- package/lib/display/json-display/json-display.component.d.ts +16 -16
- package/lib/display/resizable/resizable-base.d.ts +67 -67
- package/lib/display/resizable/resizable.component.d.ts +31 -31
- package/lib/display/spinner/spinner.component.d.ts +5 -5
- package/lib/display/splash/splash.component.d.ts +16 -16
- package/lib/display/splash/splash.service.d.ts +22 -22
- package/lib/display/table/resizable-column.component.d.ts +10 -10
- package/lib/display/table/resizable-table.directive.d.ts +93 -93
- package/lib/display/table/searchable-table.component.d.ts +206 -206
- package/lib/display/table/table-detail-row.component.d.ts +8 -8
- package/lib/display/table/table-locked-column.component.d.ts +20 -20
- package/lib/display/table/table-master-header-row.component.d.ts +9 -9
- package/lib/display/table/table-master-row.component.d.ts +113 -113
- package/lib/display/table/table-pagination.component.d.ts +91 -91
- package/lib/display/table/table-selectable-row.component.d.ts +102 -102
- package/lib/display/table/table.component.d.ts +121 -121
- package/lib/display/tags/tag.d.ts +18 -18
- package/lib/display/tags/tags.component.d.ts +48 -48
- package/lib/display/toast/toast/toast.component.d.ts +23 -23
- package/lib/display/toast/toast-types.d.ts +24 -24
- package/lib/display/toast/toast.service.d.ts +20 -20
- package/lib/display/toast/toaster/toaster.component.d.ts +35 -35
- package/lib/display/tooltip/tooltip.component.d.ts +70 -70
- package/lib/display/tooltip/tooltip.service.d.ts +16 -16
- package/lib/display/tooltip-directive/tooltip.directive.d.ts +44 -44
- package/lib/display/tour/tour-types.d.ts +70 -70
- package/lib/display/tour/tour.component.d.ts +147 -147
- package/lib/display/tour/tour.service.d.ts +38 -38
- package/lib/display/tree/tree.component.d.ts +75 -75
- package/lib/display/view-overlay/view-overlay.component.d.ts +38 -38
- package/lib/shared/directives/click-area-for/click-area-for.directive.d.ts +14 -14
- package/lib/shared/directives/if-viewport-width/if-viewport-width.directive.d.ts +60 -60
- package/lib/shared/directives/popup/popup-container.directive.d.ts +101 -101
- package/lib/shared/display/pipes/date-display.pipe.d.ts +21 -21
- package/lib/shared/display/pipes/highlight-text.pipe.d.ts +9 -9
- package/lib/shared/display/pipes/relative-date.pipe.d.ts +36 -36
- package/lib/shared/display/pipes/row-count.pipe.d.ts +23 -23
- package/lib/shared/display/pipes/time-display.pipe.d.ts +18 -18
- package/lib/shared/display.d.ts +42 -42
- package/lib/shared/form-group.helper.d.ts +31 -31
- package/lib/shared/json-helper.d.ts +7 -7
- package/lib/shared/lodash-helper.d.ts +18 -18
- package/lib/shared/page/page-base/page-base.component.d.ts +259 -259
- package/lib/shared/page/page-statuses.d.ts +13 -13
- package/lib/shared/page/page-title/page-title.component.d.ts +9 -9
- package/lib/shared/page/page-view/page-view.component.d.ts +102 -102
- package/lib/shared/testing/copy-button-base-test-injector-factory.spec.d.ts +4 -4
- package/lib/shared/testing/hierarchy-base-test-injector-factory.spec.d.ts +4 -4
- package/lib/shared/testing/page-base-component-test-helper.spec.d.ts +30 -30
- package/lib/shared/testing/page-base-component-test-injector-factory.spec.d.ts +28 -28
- package/lib/shared/testing/public-mocks.spec.d.ts +90 -90
- package/lib/shared/testing/spy-factory.spec.d.ts +27 -27
- package/lib/shared/testing/translation-mocks.spec.d.ts +30 -30
- package/lib/shared/user-preference.service.d.ts +13 -13
- package/lib/shared/wizard/wizard-base/wizard-base.component.d.ts +134 -134
- package/lib/shared/wizard/wizard-buttons/wizard-buttons.component.d.ts +27 -27
- package/lib/shared/wizard/wizard-progress/wizard-progress.component.d.ts +10 -10
- package/package.json +12 -18
- package/public-api.d.ts +111 -111
- package/schematics/rxjs-7-upgrade/index.d.ts +3 -3
- package/schematics/rxjs-7-upgrade/index.js +67 -67
- package/schematics/rxjs-7-upgrade/schema.d.ts +4 -4
- package/schematics/rxjs-7-upgrade/schema.js +2 -2
- package/schematics/utilities/typescript.d.ts +7 -7
- package/schematics/utilities/typescript.js +41 -41
- package/schematics/utilities/workspace.d.ts +8 -8
- package/schematics/utilities/workspace.js +71 -71
- package/esm2020/lib/core/custom-validators.mjs +0 -29
- package/esm2020/lib/core/date-time-helper.mjs +0 -220
- package/esm2020/lib/display/avatar/avatar.component.mjs +0 -67
- package/esm2020/lib/shared/directives/popup/popup-container.directive.mjs +0 -163
- package/esm2020/lib/shared/display.mjs +0 -6
- package/esm2020/lib/shared/form-group.helper.mjs +0 -67
- package/esm2020/lib/shared/lodash-helper.mjs +0 -51
- package/esm2020/lib/shared/testing/page-base-component-test-injector-factory.spec.mjs +0 -98
- package/fesm2015/energycap-components.mjs +0 -12211
- package/fesm2015/energycap-components.mjs.map +0 -1
- package/fesm2020/energycap-components.mjs.map +0 -1
@@ -1,88 +1,88 @@
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
2
|
-
import { FormControlBase } from '../form-control-base';
|
3
|
-
import * as i0 from "@angular/core";
|
4
|
-
import * as i1 from "../../core/validation-message.service";
|
5
|
-
import * as i2 from "../../shared/form-group.helper";
|
6
|
-
import * as i3 from "@angular/common";
|
7
|
-
import * as i4 from "@angular/forms";
|
8
|
-
import * as i5 from "../help-popover/help-popover.component";
|
9
|
-
import * as i6 from "@ngx-translate/core";
|
10
|
-
export class SelectComponent extends FormControlBase {
|
11
|
-
constructor(validationMessageService, formGroupHelper, el) {
|
12
|
-
super(validationMessageService, formGroupHelper);
|
13
|
-
this.validationMessageService = validationMessageService;
|
14
|
-
this.formGroupHelper = formGroupHelper;
|
15
|
-
this.el = el;
|
16
|
-
/**
|
17
|
-
* When the component is not required, defines the label for an additional first option that sets the control to null
|
18
|
-
*/
|
19
|
-
this.placeholder = '';
|
20
|
-
/**
|
21
|
-
* When the component is not required, an additional option is added with a value of null.
|
22
|
-
*/
|
23
|
-
this.options = [];
|
24
|
-
/**
|
25
|
-
* Select a default option automatically during initialization and when options change. Default: `true`.
|
26
|
-
* * If formModel has a value
|
27
|
-
* * Make no change if the current value exists in options
|
28
|
-
* * Otherwise, set value to the first option if control is required, or null if optional and emit event
|
29
|
-
* * If formModel has no value
|
30
|
-
* * Set value to first option if control is required and emit eventSet to false to manually manage form state.
|
31
|
-
*
|
32
|
-
* Set to false to opt out of automatic state management
|
33
|
-
*/
|
34
|
-
this.autoDefault = true;
|
35
|
-
}
|
36
|
-
ngOnChanges(changes) {
|
37
|
-
if (changes.options && this.autoDefault) {
|
38
|
-
this.onOptionsChange(changes.options.firstChange);
|
39
|
-
}
|
40
|
-
super.ngOnChanges(changes);
|
41
|
-
}
|
42
|
-
ngAfterViewInit() {
|
43
|
-
if (this.autofocus) {
|
44
|
-
this.focus();
|
45
|
-
}
|
46
|
-
if (!this.autoDefault) {
|
47
|
-
console.warn(`SelectComponent#${this.id} has 'autoDefault' set to false and will not select the default option.`);
|
48
|
-
}
|
49
|
-
}
|
50
|
-
focus() {
|
51
|
-
const hostEl = this.el.nativeElement;
|
52
|
-
const selectEl = hostEl.querySelector('select');
|
53
|
-
if (selectEl) {
|
54
|
-
selectEl.focus();
|
55
|
-
}
|
56
|
-
}
|
57
|
-
/**
|
58
|
-
* If formModel has a value
|
59
|
-
* * Make no change if the current value exists in options
|
60
|
-
* * Otherwise, set value to the first option if control is required, or null if optional and emit event
|
61
|
-
* If formModel has no value
|
62
|
-
* * Set value to first option if control is required and emit event
|
63
|
-
*/
|
64
|
-
onOptionsChange(firstChange) {
|
65
|
-
if (this.formModel.value !== null && this.formModel.value !== undefined && this.formModel.value !== '') {
|
66
|
-
if (this.options.every(opt => opt.value !== this.formModel.value)) {
|
67
|
-
const value = this.required ? this.options[0]?.value : null;
|
68
|
-
this.formModel.setValue(value, { emitEvent: !firstChange });
|
69
|
-
}
|
70
|
-
}
|
71
|
-
else if (this.required) {
|
72
|
-
this.formModel.setValue(this.options[0]?.value, { emitEvent: !firstChange });
|
73
|
-
}
|
74
|
-
}
|
75
|
-
}
|
76
|
-
|
77
|
-
|
78
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
79
|
-
type: Component,
|
80
|
-
args: [{ selector: 'ec-select', template: "<div class=\"control\"\r\n [ngClass]=\"{'is-readonly': readonly, 'is-disabled': formModel.disabled}\">\r\n\r\n <label *ngIf=\"label\"\r\n for=\"{{id}}_select\">\r\n <span>{{label | translate}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n\r\n <select [attr.id]=\"inputId\"\r\n tabindex=\"{{tabindex}}\"\r\n [formControl]=\"formModel\"\r\n [attr.required]=\"required\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n <option *ngIf=\"!required\"\r\n [ngValue]=\"null\">{{placeholder}}</option>\r\n <option *ngFor=\"let option of options\"\r\n [ngValue]=\"option.value\">{{option.label}}</option>\r\n </select>\r\n <i class=\"ec-icon icon-caret-down\"></i>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host .control{position:relative}:host label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}:host select{
|
81
|
-
}], ctorParameters: function () { return [{ type: i1.ValidationMessageService }, { type: i2.FormGroupHelper }, { type: i0.ElementRef }]; }, propDecorators: { placeholder: [{
|
82
|
-
type: Input
|
83
|
-
}], options: [{
|
84
|
-
type: Input
|
85
|
-
}], autoDefault: [{
|
86
|
-
type: Input
|
87
|
-
}] } });
|
88
|
-
//# sourceMappingURL=data:application/json;base64,
|
1
|
+
import { Component, Input } from '@angular/core';
|
2
|
+
import { FormControlBase } from '../form-control-base';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "../../core/validation-message.service";
|
5
|
+
import * as i2 from "../../shared/form-group.helper";
|
6
|
+
import * as i3 from "@angular/common";
|
7
|
+
import * as i4 from "@angular/forms";
|
8
|
+
import * as i5 from "../help-popover/help-popover.component";
|
9
|
+
import * as i6 from "@ngx-translate/core";
|
10
|
+
export class SelectComponent extends FormControlBase {
|
11
|
+
constructor(validationMessageService, formGroupHelper, el) {
|
12
|
+
super(validationMessageService, formGroupHelper);
|
13
|
+
this.validationMessageService = validationMessageService;
|
14
|
+
this.formGroupHelper = formGroupHelper;
|
15
|
+
this.el = el;
|
16
|
+
/**
|
17
|
+
* When the component is not required, defines the label for an additional first option that sets the control to null
|
18
|
+
*/
|
19
|
+
this.placeholder = '';
|
20
|
+
/**
|
21
|
+
* When the component is not required, an additional option is added with a value of null.
|
22
|
+
*/
|
23
|
+
this.options = [];
|
24
|
+
/**
|
25
|
+
* Select a default option automatically during initialization and when options change. Default: `true`.
|
26
|
+
* * If formModel has a value
|
27
|
+
* * Make no change if the current value exists in options
|
28
|
+
* * Otherwise, set value to the first option if control is required, or null if optional and emit event
|
29
|
+
* * If formModel has no value
|
30
|
+
* * Set value to first option if control is required and emit eventSet to false to manually manage form state.
|
31
|
+
*
|
32
|
+
* Set to false to opt out of automatic state management
|
33
|
+
*/
|
34
|
+
this.autoDefault = true;
|
35
|
+
}
|
36
|
+
ngOnChanges(changes) {
|
37
|
+
if (changes.options && this.autoDefault) {
|
38
|
+
this.onOptionsChange(changes.options.firstChange);
|
39
|
+
}
|
40
|
+
super.ngOnChanges(changes);
|
41
|
+
}
|
42
|
+
ngAfterViewInit() {
|
43
|
+
if (this.autofocus) {
|
44
|
+
this.focus();
|
45
|
+
}
|
46
|
+
if (!this.autoDefault) {
|
47
|
+
console.warn(`SelectComponent#${this.id} has 'autoDefault' set to false and will not select the default option.`);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
focus() {
|
51
|
+
const hostEl = this.el.nativeElement;
|
52
|
+
const selectEl = hostEl.querySelector('select');
|
53
|
+
if (selectEl) {
|
54
|
+
selectEl.focus();
|
55
|
+
}
|
56
|
+
}
|
57
|
+
/**
|
58
|
+
* If formModel has a value
|
59
|
+
* * Make no change if the current value exists in options
|
60
|
+
* * Otherwise, set value to the first option if control is required, or null if optional and emit event
|
61
|
+
* If formModel has no value
|
62
|
+
* * Set value to first option if control is required and emit event
|
63
|
+
*/
|
64
|
+
onOptionsChange(firstChange) {
|
65
|
+
if (this.formModel.value !== null && this.formModel.value !== undefined && this.formModel.value !== '') {
|
66
|
+
if (this.options.every(opt => opt.value !== this.formModel.value)) {
|
67
|
+
const value = this.required ? this.options[0]?.value : null;
|
68
|
+
this.formModel.setValue(value, { emitEvent: !firstChange });
|
69
|
+
}
|
70
|
+
}
|
71
|
+
else if (this.required) {
|
72
|
+
this.formModel.setValue(this.options[0]?.value, { emitEvent: !firstChange });
|
73
|
+
}
|
74
|
+
}
|
75
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectComponent, deps: [{ token: i1.ValidationMessageService }, { token: i2.FormGroupHelper }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
76
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SelectComponent, selector: "ec-select", inputs: { placeholder: "placeholder", options: "options", autoDefault: "autoDefault" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"control\"\r\n [ngClass]=\"{'is-readonly': readonly, 'is-disabled': formModel.disabled}\">\r\n\r\n <label *ngIf=\"label\"\r\n for=\"{{id}}_select\">\r\n <span>{{label | translate}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n\r\n <select [attr.id]=\"inputId\"\r\n tabindex=\"{{tabindex}}\"\r\n [formControl]=\"formModel\"\r\n [attr.required]=\"required\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n <option *ngIf=\"!required\"\r\n [ngValue]=\"null\">{{placeholder}}</option>\r\n <option *ngFor=\"let option of options\"\r\n [ngValue]=\"option.value\">{{option.label}}</option>\r\n </select>\r\n <i class=\"ec-icon icon-caret-down\"></i>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host .control{position:relative}:host label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}:host select{appearance:none;background-color:var(--ec-form-control-background-color);border:1px solid var(--ec-form-control-border-color);border-radius:var(--ec-border-radius);background-image:none;background-clip:padding-box;width:100%;line-height:1.25rem;padding:.3125rem 1.5rem .3125rem .5rem;height:2rem}:host select::selection{background-color:var(--ec-form-control-background-color-selection);color:var(--ec-form-control-color-selection)}:host select::-webkit-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host select::-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host select:-ms-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host select:-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host select~.icon-required,:host select~.icon-invalid{color:var(--ec-form-control-border-color-invalid)}:host select:required.is-empty{background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host select.ng-invalid.ng-touched{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host select.ng-invalid.ng-touched:focus{border-color:var(--ec-form-control-background-color-invalid)}:host select.is-pending.ng-valid,:host select.is-pending.ng-invalid,:host select.is-pending.ng-pending{background-image:\"\";background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host select:focus,:host select:focus.is-empty{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}:host select:disabled{background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}:host select:disabled:required,:host select:disabled:required.is-empty{background-image:none;padding-left:.5rem;background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled)}:host select:disabled:required+.icon-required,:host select:disabled:required.is-empty+.icon-required{display:none}:host select.is-uppercase:not(.is-empty){text-transform:uppercase}:host select:focus{position:static}:host .icon-caret-down{position:absolute;right:.5rem;bottom:.5625rem;z-index:1;pointer-events:none}:host select:disabled~.icon-caret-down{opacity:var(--ec-form-control-opacity-disabled)}:host .is-readonly .icon-caret-down{display:none}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i5.HelpPopoverComponent, selector: "ec-help-popover", inputs: ["id", "text", "contentPosition", "maxWidth"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] }); }
|
77
|
+
}
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectComponent, decorators: [{
|
79
|
+
type: Component,
|
80
|
+
args: [{ selector: 'ec-select', template: "<div class=\"control\"\r\n [ngClass]=\"{'is-readonly': readonly, 'is-disabled': formModel.disabled}\">\r\n\r\n <label *ngIf=\"label\"\r\n for=\"{{id}}_select\">\r\n <span>{{label | translate}}</span>\r\n <ec-help-popover id=\"{{id}}_helpPopover\"\r\n *ngIf=\"helpPopover\"\r\n class=\"d-inline-block my-n3 mx-n1\"\r\n text=\"{{helpPopover | translate}}\"\r\n contentPosition=\"{{helpPopoverPosition}}\">\r\n </ec-help-popover>\r\n </label>\r\n\r\n <select [attr.id]=\"inputId\"\r\n tabindex=\"{{tabindex}}\"\r\n [formControl]=\"formModel\"\r\n [attr.required]=\"required\"\r\n [attr.cdkFocusInitial]=\"autofocus || null\">\r\n <option *ngIf=\"!required\"\r\n [ngValue]=\"null\">{{placeholder}}</option>\r\n <option *ngFor=\"let option of options\"\r\n [ngValue]=\"option.value\">{{option.label}}</option>\r\n </select>\r\n <i class=\"ec-icon icon-caret-down\"></i>\r\n</div>", styles: [":host{color:var(--ec-form-control-color);font-size:var(--ec-form-control-font-size);display:block;margin-bottom:1rem;width:100%}:host :host-context(.form-condensed){margin-bottom:.5rem}:host .control{width:100%;display:flex;flex-direction:column}:host .control.control-label-bottom{flex-direction:column-reverse}:host .control.control-label-left{flex-direction:row}:host .control.control-label-left label{margin-right:.25rem}:host .control.control-label-right{flex-direction:row-reverse}:host .control.control-label-right label{margin-left:.25rem}:host .control.control-label-left,:host .control.control-label-right{align-items:center}:host .control.control-label-left label,:host .control.control-label-right label{flex:1 1;margin-top:0;margin-bottom:0}:host .control.control-label-left .control-input,:host .control.control-label-right .control-input{flex:2 2}:host .control.is-readonly input,:host .control.is-readonly select,:host .control.is-readonly textarea{border-color:var(--ec-form-control-border-color-readonly);background-color:var(--ec-form-control-background-color-readonly);background-clip:border-box;background-image:none;color:var(--ec-form-control-color-readonly);opacity:1;-webkit-user-select:none;user-select:none;pointer-events:none;overflow:hidden;white-space:nowrap}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem;background-image:none}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid:focus,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid:focus{border-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-invalid,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-invalid{display:inline-flex;position:absolute;left:.5rem;top:.5rem;z-index:1}:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-invalid~.icon-required,:host .control.invalid .textbox-group-input ::ng-deep .control input.ng-valid~.icon-required{display:none}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button{background-color:var(--ec-form-control-background-color-invalid)}:host .control.invalid:not(.open) .textbox-group-btn-right ::ng-deep button:not(:focus){border-color:var(--ec-form-control-border-color-invalid)}:host .textbox-group{display:flex;position:relative}:host textarea:focus,:host input:focus,:host select:focus{outline:none}:host .control{position:relative}:host label{color:var(--ec-form-control-label-color, var(--ec-color-secondary-dark));display:block;font-size:var(--ec-font-size-label);line-height:1;margin:calc(var(--ec-font-size-label) / 2) 0}:host select{appearance:none;background-color:var(--ec-form-control-background-color);border:1px solid var(--ec-form-control-border-color);border-radius:var(--ec-border-radius);background-image:none;background-clip:padding-box;width:100%;line-height:1.25rem;padding:.3125rem 1.5rem .3125rem .5rem;height:2rem}:host select::selection{background-color:var(--ec-form-control-background-color-selection);color:var(--ec-form-control-color-selection)}:host select::-webkit-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host select::-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host select:-ms-input-placeholder{color:var(--ec-form-control-color-placeholder)}:host select:-moz-placeholder{color:var(--ec-form-control-color-placeholder);opacity:1}:host select~.icon-required,:host select~.icon-invalid{color:var(--ec-form-control-border-color-invalid)}:host select:required.is-empty{background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host select.ng-invalid.ng-touched{background-color:var(--ec-form-control-background-color-invalid);border-color:var(--ec-form-control-border-color-invalid);background-image:none;background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host select.ng-invalid.ng-touched:focus{border-color:var(--ec-form-control-background-color-invalid)}:host select.is-pending.ng-valid,:host select.is-pending.ng-invalid,:host select.is-pending.ng-pending{background-image:\"\";background-repeat:no-repeat;background-position:.5rem center;background-size:1rem,1rem;padding-left:1.75rem}:host select:focus,:host select:focus.is-empty{border-color:var(--ec-form-control-border-color-focus);box-shadow:var(--ec-form-control-box-shadow-focus);position:relative;z-index:1}:host select:disabled{background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled);color:var(--ec-form-control-color-disabled);opacity:var(--ec-form-control-opacity-disabled)}:host select:disabled:required,:host select:disabled:required.is-empty{background-image:none;padding-left:.5rem;background-color:var(--ec-form-control-background-color-disabled);border-color:var(--ec-form-control-border-color-disabled)}:host select:disabled:required+.icon-required,:host select:disabled:required.is-empty+.icon-required{display:none}:host select.is-uppercase:not(.is-empty){text-transform:uppercase}:host select:focus{position:static}:host .icon-caret-down{position:absolute;right:.5rem;bottom:.5625rem;z-index:1;pointer-events:none}:host select:disabled~.icon-caret-down{opacity:var(--ec-form-control-opacity-disabled)}:host .is-readonly .icon-caret-down{display:none}\n"] }]
|
81
|
+
}], ctorParameters: function () { return [{ type: i1.ValidationMessageService }, { type: i2.FormGroupHelper }, { type: i0.ElementRef }]; }, propDecorators: { placeholder: [{
|
82
|
+
type: Input
|
83
|
+
}], options: [{
|
84
|
+
type: Input
|
85
|
+
}], autoDefault: [{
|
86
|
+
type: Input
|
87
|
+
}] } });
|
88
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NvbXBvbmVudHMvc3JjL2xpYi9jb250cm9scy9zZWxlY3Qvc2VsZWN0LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NvbXBvbmVudHMvc3JjL2xpYi9jb250cm9scy9zZWxlY3Qvc2VsZWN0LmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBaUIsU0FBUyxFQUFjLEtBQUssRUFBaUIsTUFBTSxlQUFlLENBQUM7QUFHM0YsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHNCQUF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wb3ZlciB8IHRyYW5zbGF0ZX19XCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudFBvc2l0aW9uPVwie3toZWxwUG9wb3ZlclBvc2l0aW9ufX1cIj5cclxuICAgICAgICAgICAgICAgIDwvZWMtaGVscC1wb3BvdmVyPlxyXG4gICAgICAgIDwvbGFiZWw+XHJcblxyXG4gICAgICAgIDxzZWxlY3QgW2F0dHIuaWRdPVwiaW5wdXRJZFwiXHJcbiAgICAgICAgICAgICAgICB0YWJpbmRleD1cInt7dGFiaW5kZXh9fVwiXHJcbiAgICAgICAgICAgICAgICBbZm9ybUNvbnRyb2xdPVwiZm9ybU1vZGVsXCJcclxuICAgICAgICAgICAgICAgIFthdHRyLnJlcXVpcmVkXT1cInJlcXVpcmVkXCJcclxuICAgICAgICAgICAgICAgIFthdHRyLmNka0ZvY3VzSW5pdGlhbF09XCJhdXRvZm9jdXMgfHwgbnVsbFwiPlxyXG4gICAgICAgICAgICAgICAgPG9wdGlvbiAqbmdJZj1cIiFyZXF1aXJlZFwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIFtuZ1ZhbHVlXT1cIm51bGxcIj57e3BsYWNlaG9sZGVyfX08L29wdGlvbj5cclxuICAgICAgICAgICAgICAgIDxvcHRpb24gKm5nRm9yPVwibGV0IG9wdGlvbiBvZiBvcHRpb25zXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgW25nVmFsdWVdPVwib3B0aW9uLnZhbHVlXCI+e3tvcHRpb24ubGFiZWx9fTwvb3B0aW9uPlxyXG4gICAgICAgIDwvc2VsZWN0PlxyXG4gICAgICAgIDxpIGNsYXNzPVwiZWMtaWNvbiBpY29uLWNhcmV0LWRvd25cIj48L2k+XHJcbjwvZGl2PiJdfQ==
|
@@ -1,47 +1,47 @@
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
2
|
-
import { NavGroup } from '../navigation/nav-group';
|
3
|
-
import * as i0 from "@angular/core";
|
4
|
-
import * as i1 from "@angular/common";
|
5
|
-
import * as i2 from "@angular/router";
|
6
|
-
import * as i3 from "@ngx-translate/core";
|
7
|
-
/**
|
8
|
-
* Component to display navigation tabs
|
9
|
-
*/
|
10
|
-
export class TabsComponent {
|
11
|
-
constructor() {
|
12
|
-
/** The id of the tabs component, will be used as a prefix for each individual tab */
|
13
|
-
this.id = '';
|
14
|
-
/** The tabindex of the tabs component, will be applied to each individual tab */
|
15
|
-
this.tabindex = 0;
|
16
|
-
/** Display tabs in the default style or as pills */
|
17
|
-
this.tabStyle = 'tabs';
|
18
|
-
/** The tabs group */
|
19
|
-
this.tabs = new NavGroup();
|
20
|
-
}
|
21
|
-
/**
|
22
|
-
* Set the selected tab to the one the user clicked on pressed enter
|
23
|
-
* when focused. If the event was a keypress.enter and the tab
|
24
|
-
* has a link, navigate to that link.
|
25
|
-
*/
|
26
|
-
selectTab(event, tab) {
|
27
|
-
if (!tab.disabled && (event.type === 'click' || (event.type === 'keypress' && event.key === 'Enter'))) {
|
28
|
-
this.tabs.selected = tab;
|
29
|
-
}
|
30
|
-
}
|
31
|
-
}
|
32
|
-
|
33
|
-
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
35
|
-
type: Component,
|
36
|
-
args: [{ selector: 'ec-tabs', template: "<ul *ngIf=\"tabs?.items?.length\" class=\"{{tabStyle}}\">\r\n\r\n <li class=\"{{tab.classlist}}\" [ngClass]=\"{'icon-only': tab.icon && !tab.label}\" *ngFor=\"let tab of tabs?.items; index as i;\">\r\n\r\n <a *ngIf=\"tab.url && !tab.disabled\"\r\n tabindex=\"{{tabs?.selected === tab ? -1 : tabindex}}\"\r\n class=\"tab\"\r\n id=\"{{tab.id ? tab.id : id + '_item' + i}}\"\r\n routerLinkActive=\"active\"\r\n [routerLink]=\"tab.url\"\r\n [routerLinkActiveOptions]=\"{exact: tab.isActiveExactMatch || false}\"\r\n [queryParams]=\"tab.queryParams || null\"\r\n [queryParamsHandling]=\"tab.queryParamsHandling || ''\"\r\n (keypress)=\"selectTab($event, tab)\"\r\n (click)=\"selectTab($event, tab)\">\r\n <i class=\"ec-icon {{tab.icon}}\" *ngIf=\"tab.icon\" [class.mr-1]=\"tab.label\"></i>\r\n <span class=\"text-truncate\">{{tab.label | translate}}</span>\r\n <span *ngIf=\"tab?.indicator\" class=\"indicator ml-1\" [style.background-color]=\"tab?.indicator === true ? '' : tab?.indicator\"></span>\r\n </a>\r\n\r\n <span *ngIf=\"!tab.url || tab.disabled\"\r\n tabindex=\"{{tabs?.selected === tab || tab.disabled ? -1 : tabindex}}\"\r\n id=\"{{tab.id ? tab.id : id + '_item' + i}}\"\r\n class=\"tab\"\r\n [ngClass]=\"{'active': tabs?.selected === tab, 'is-disabled': tab.disabled}\"\r\n (keypress)=\"selectTab($event, tab)\"\r\n (click)=\"selectTab($event, tab)\">\r\n <i class=\"ec-icon {{tab.icon}}\" *ngIf=\"tab.icon\" [class.mr-1]=\"tab.label\"></i>\r\n <span class=\"text-truncate\">{{tab.label | translate}}</span>\r\n <span *ngIf=\"tab?.indicator\" class=\"indicator ml-1\" [style.background-color]=\"tab?.indicator === true ? '' : tab?.indicator\"></span>\r\n </span>\r\n </li>\r\n</ul> ", styles: [":host{display:block}ul{padding:0;margin:0;list-style:none}a{text-decoration:none}.tabs{display:flex;border-bottom:1px solid var(--ec-tab-border-color, var(--ec-border-color))}.tabs li{display:block;min-width:0}.tabs li:not(:last-child){margin-right:1rem}.tabs .tab{padding-left:0;padding-right:0;border-bottom:2px solid transparent;margin-bottom:-1px;align-items:center;color:var(--ec-tab-color, var(--ec-color-secondary-dark));cursor:pointer;font-size:var(--ec-tab-font-size, var(--ec-font-size-label));display:flex;height:2rem;min-width:2rem;justify-content:center}.tabs .tab.active{color:var(--ec-tab-color-active, var(--ec-color-interactive));border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus))}.tabs .tab:hover,.tabs .tab:focus{outline:none;border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus))}.tabs .tab.is-disabled{opacity:var(--ec-form-control-opacity-disabled);cursor:default;pointer-events:none}.pills{display:flex}.pills li{display:block;min-width:0}.pills li:not(:first-child){margin-left:-1px}.pills li .tab{border-radius:0}.pills li:first-child .tab{border-top-left-radius:var(--ec-border-radius);border-bottom-left-radius:var(--ec-border-radius)}.pills li:last-child .tab{border-top-right-radius:var(--ec-border-radius);border-bottom-right-radius:var(--ec-border-radius)}.pills .tab{padding-left:.5rem;padding-right:.5rem;border-radius:var(--ec-border-radius);border:1px solid var(--ec-tab-border-color, var(--ec-border-color));align-items:center;color:var(--ec-tab-color, var(--ec-color-secondary-dark));cursor:pointer;font-size:var(--ec-tab-font-size, var(--ec-font-size-label));display:flex;height:1.75rem;min-width:1.75rem;justify-content:center}.pills .tab.active{color:var(--ec-tab-color-active, var(--ec-color-interactive));background-color:var(--ec-tab-background-color-active, var(--ec-background-color))}.pills .tab:hover,.pills .tab:focus{outline:none;border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus));box-shadow:0 0 0 1px var(--ec-tab-border-color-active, var(--ec-border-color-focus));position:relative;z-index:1}.pills .tab.is-disabled{opacity:var(--ec-form-control-opacity-disabled);cursor:default;pointer-events:none}.icon-only .tab{padding:0;justify-content:center}.icon-only .tab .ec-icon{color:inherit}.indicator{border:solid 2px rgb(111,28,138);background-color:#6f1c8a40;display:block;width:.625rem;height:.625rem;border-radius:50%}:host(.is-condensed) .pills li,:host(.is-condensed) .tabs li{margin-right:0}:host(.is-condensed) .tab{padding-left:.25rem;padding-right:.25rem}\n"] }]
|
37
|
-
}], ctorParameters: function () { return []; }, propDecorators: { id: [{
|
38
|
-
type: Input
|
39
|
-
}], tabindex: [{
|
40
|
-
type: Input
|
41
|
-
}], tabStyle: [{
|
42
|
-
type: Input
|
43
|
-
}], tabs: [{
|
44
|
-
type: Input,
|
45
|
-
args: ['tabGroup']
|
46
|
-
}] } });
|
47
|
-
//# sourceMappingURL=data:application/json;base64,
|
1
|
+
import { Component, Input } from '@angular/core';
|
2
|
+
import { NavGroup } from '../navigation/nav-group';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "@angular/common";
|
5
|
+
import * as i2 from "@angular/router";
|
6
|
+
import * as i3 from "@ngx-translate/core";
|
7
|
+
/**
|
8
|
+
* Component to display navigation tabs
|
9
|
+
*/
|
10
|
+
export class TabsComponent {
|
11
|
+
constructor() {
|
12
|
+
/** The id of the tabs component, will be used as a prefix for each individual tab */
|
13
|
+
this.id = '';
|
14
|
+
/** The tabindex of the tabs component, will be applied to each individual tab */
|
15
|
+
this.tabindex = 0;
|
16
|
+
/** Display tabs in the default style or as pills */
|
17
|
+
this.tabStyle = 'tabs';
|
18
|
+
/** The tabs group */
|
19
|
+
this.tabs = new NavGroup();
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* Set the selected tab to the one the user clicked on pressed enter
|
23
|
+
* when focused. If the event was a keypress.enter and the tab
|
24
|
+
* has a link, navigate to that link.
|
25
|
+
*/
|
26
|
+
selectTab(event, tab) {
|
27
|
+
if (!tab.disabled && (event.type === 'click' || (event.type === 'keypress' && event.key === 'Enter'))) {
|
28
|
+
this.tabs.selected = tab;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
32
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TabsComponent, selector: "ec-tabs", inputs: { id: "id", tabindex: "tabindex", tabStyle: "tabStyle", tabs: ["tabGroup", "tabs"] }, ngImport: i0, template: "<ul *ngIf=\"tabs?.items?.length\" class=\"{{tabStyle}}\">\r\n\r\n <li class=\"{{tab.classlist}}\" [ngClass]=\"{'icon-only': tab.icon && !tab.label}\" *ngFor=\"let tab of tabs?.items; index as i;\">\r\n\r\n <a *ngIf=\"tab.url && !tab.disabled\"\r\n tabindex=\"{{tabs?.selected === tab ? -1 : tabindex}}\"\r\n class=\"tab\"\r\n id=\"{{tab.id ? tab.id : id + '_item' + i}}\"\r\n routerLinkActive=\"active\"\r\n [routerLink]=\"tab.url\"\r\n [routerLinkActiveOptions]=\"{exact: tab.isActiveExactMatch || false}\"\r\n [queryParams]=\"tab.queryParams || null\"\r\n [queryParamsHandling]=\"tab.queryParamsHandling || ''\"\r\n (keypress)=\"selectTab($event, tab)\"\r\n (click)=\"selectTab($event, tab)\">\r\n <i class=\"ec-icon {{tab.icon}}\" *ngIf=\"tab.icon\" [class.mr-1]=\"tab.label\"></i>\r\n <span class=\"text-truncate\">{{tab.label | translate}}</span>\r\n <span *ngIf=\"tab?.indicator\" class=\"indicator ml-1\" [style.background-color]=\"tab?.indicator === true ? '' : tab?.indicator\"></span>\r\n </a>\r\n\r\n <span *ngIf=\"!tab.url || tab.disabled\"\r\n tabindex=\"{{tabs?.selected === tab || tab.disabled ? -1 : tabindex}}\"\r\n id=\"{{tab.id ? tab.id : id + '_item' + i}}\"\r\n class=\"tab\"\r\n [ngClass]=\"{'active': tabs?.selected === tab, 'is-disabled': tab.disabled}\"\r\n (keypress)=\"selectTab($event, tab)\"\r\n (click)=\"selectTab($event, tab)\">\r\n <i class=\"ec-icon {{tab.icon}}\" *ngIf=\"tab.icon\" [class.mr-1]=\"tab.label\"></i>\r\n <span class=\"text-truncate\">{{tab.label | translate}}</span>\r\n <span *ngIf=\"tab?.indicator\" class=\"indicator ml-1\" [style.background-color]=\"tab?.indicator === true ? '' : tab?.indicator\"></span>\r\n </span>\r\n </li>\r\n</ul> ", styles: [":host{display:block}ul{padding:0;margin:0;list-style:none}a{text-decoration:none}.tabs{display:flex;border-bottom:1px solid var(--ec-tab-border-color, var(--ec-border-color))}.tabs li{display:block;min-width:0}.tabs li:not(:last-child){margin-right:1rem}.tabs .tab{padding-left:0;padding-right:0;border-bottom:2px solid transparent;margin-bottom:-1px;align-items:center;color:var(--ec-tab-color, var(--ec-color-secondary-dark));cursor:pointer;font-size:var(--ec-tab-font-size, var(--ec-font-size-label));display:flex;height:2rem;min-width:2rem;justify-content:center}.tabs .tab.active{color:var(--ec-tab-color-active, var(--ec-color-interactive));border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus))}.tabs .tab:hover,.tabs .tab:focus{outline:none;border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus))}.tabs .tab.is-disabled{opacity:var(--ec-form-control-opacity-disabled);cursor:default;pointer-events:none}.pills{display:flex}.pills li{display:block;min-width:0}.pills li:not(:first-child){margin-left:-1px}.pills li .tab{border-radius:0}.pills li:first-child .tab{border-top-left-radius:var(--ec-border-radius);border-bottom-left-radius:var(--ec-border-radius)}.pills li:last-child .tab{border-top-right-radius:var(--ec-border-radius);border-bottom-right-radius:var(--ec-border-radius)}.pills .tab{padding-left:.5rem;padding-right:.5rem;border-radius:var(--ec-border-radius);border:1px solid var(--ec-tab-border-color, var(--ec-border-color));align-items:center;color:var(--ec-tab-color, var(--ec-color-secondary-dark));cursor:pointer;font-size:var(--ec-tab-font-size, var(--ec-font-size-label));display:flex;height:1.75rem;min-width:1.75rem;justify-content:center}.pills .tab.active{color:var(--ec-tab-color-active, var(--ec-color-interactive));background-color:var(--ec-tab-background-color-active, var(--ec-background-color))}.pills .tab:hover,.pills .tab:focus{outline:none;border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus));box-shadow:0 0 0 1px var(--ec-tab-border-color-active, var(--ec-border-color-focus));position:relative;z-index:1}.pills .tab.is-disabled{opacity:var(--ec-form-control-opacity-disabled);cursor:default;pointer-events:none}.icon-only .tab{padding:0;justify-content:center}.icon-only .tab .ec-icon{color:inherit}.indicator{border:solid 2px rgb(111,28,138);background-color:#6f1c8a40;display:block;width:.625rem;height:.625rem;border-radius:50%}:host(.is-condensed) .pills li,:host(.is-condensed) .tabs li{margin-right:0}:host(.is-condensed) .tab{padding-left:.25rem;padding-right:.25rem}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }] }); }
|
33
|
+
}
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabsComponent, decorators: [{
|
35
|
+
type: Component,
|
36
|
+
args: [{ selector: 'ec-tabs', template: "<ul *ngIf=\"tabs?.items?.length\" class=\"{{tabStyle}}\">\r\n\r\n <li class=\"{{tab.classlist}}\" [ngClass]=\"{'icon-only': tab.icon && !tab.label}\" *ngFor=\"let tab of tabs?.items; index as i;\">\r\n\r\n <a *ngIf=\"tab.url && !tab.disabled\"\r\n tabindex=\"{{tabs?.selected === tab ? -1 : tabindex}}\"\r\n class=\"tab\"\r\n id=\"{{tab.id ? tab.id : id + '_item' + i}}\"\r\n routerLinkActive=\"active\"\r\n [routerLink]=\"tab.url\"\r\n [routerLinkActiveOptions]=\"{exact: tab.isActiveExactMatch || false}\"\r\n [queryParams]=\"tab.queryParams || null\"\r\n [queryParamsHandling]=\"tab.queryParamsHandling || ''\"\r\n (keypress)=\"selectTab($event, tab)\"\r\n (click)=\"selectTab($event, tab)\">\r\n <i class=\"ec-icon {{tab.icon}}\" *ngIf=\"tab.icon\" [class.mr-1]=\"tab.label\"></i>\r\n <span class=\"text-truncate\">{{tab.label | translate}}</span>\r\n <span *ngIf=\"tab?.indicator\" class=\"indicator ml-1\" [style.background-color]=\"tab?.indicator === true ? '' : tab?.indicator\"></span>\r\n </a>\r\n\r\n <span *ngIf=\"!tab.url || tab.disabled\"\r\n tabindex=\"{{tabs?.selected === tab || tab.disabled ? -1 : tabindex}}\"\r\n id=\"{{tab.id ? tab.id : id + '_item' + i}}\"\r\n class=\"tab\"\r\n [ngClass]=\"{'active': tabs?.selected === tab, 'is-disabled': tab.disabled}\"\r\n (keypress)=\"selectTab($event, tab)\"\r\n (click)=\"selectTab($event, tab)\">\r\n <i class=\"ec-icon {{tab.icon}}\" *ngIf=\"tab.icon\" [class.mr-1]=\"tab.label\"></i>\r\n <span class=\"text-truncate\">{{tab.label | translate}}</span>\r\n <span *ngIf=\"tab?.indicator\" class=\"indicator ml-1\" [style.background-color]=\"tab?.indicator === true ? '' : tab?.indicator\"></span>\r\n </span>\r\n </li>\r\n</ul> ", styles: [":host{display:block}ul{padding:0;margin:0;list-style:none}a{text-decoration:none}.tabs{display:flex;border-bottom:1px solid var(--ec-tab-border-color, var(--ec-border-color))}.tabs li{display:block;min-width:0}.tabs li:not(:last-child){margin-right:1rem}.tabs .tab{padding-left:0;padding-right:0;border-bottom:2px solid transparent;margin-bottom:-1px;align-items:center;color:var(--ec-tab-color, var(--ec-color-secondary-dark));cursor:pointer;font-size:var(--ec-tab-font-size, var(--ec-font-size-label));display:flex;height:2rem;min-width:2rem;justify-content:center}.tabs .tab.active{color:var(--ec-tab-color-active, var(--ec-color-interactive));border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus))}.tabs .tab:hover,.tabs .tab:focus{outline:none;border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus))}.tabs .tab.is-disabled{opacity:var(--ec-form-control-opacity-disabled);cursor:default;pointer-events:none}.pills{display:flex}.pills li{display:block;min-width:0}.pills li:not(:first-child){margin-left:-1px}.pills li .tab{border-radius:0}.pills li:first-child .tab{border-top-left-radius:var(--ec-border-radius);border-bottom-left-radius:var(--ec-border-radius)}.pills li:last-child .tab{border-top-right-radius:var(--ec-border-radius);border-bottom-right-radius:var(--ec-border-radius)}.pills .tab{padding-left:.5rem;padding-right:.5rem;border-radius:var(--ec-border-radius);border:1px solid var(--ec-tab-border-color, var(--ec-border-color));align-items:center;color:var(--ec-tab-color, var(--ec-color-secondary-dark));cursor:pointer;font-size:var(--ec-tab-font-size, var(--ec-font-size-label));display:flex;height:1.75rem;min-width:1.75rem;justify-content:center}.pills .tab.active{color:var(--ec-tab-color-active, var(--ec-color-interactive));background-color:var(--ec-tab-background-color-active, var(--ec-background-color))}.pills .tab:hover,.pills .tab:focus{outline:none;border-color:var(--ec-tab-border-color-active, var(--ec-border-color-focus));box-shadow:0 0 0 1px var(--ec-tab-border-color-active, var(--ec-border-color-focus));position:relative;z-index:1}.pills .tab.is-disabled{opacity:var(--ec-form-control-opacity-disabled);cursor:default;pointer-events:none}.icon-only .tab{padding:0;justify-content:center}.icon-only .tab .ec-icon{color:inherit}.indicator{border:solid 2px rgb(111,28,138);background-color:#6f1c8a40;display:block;width:.625rem;height:.625rem;border-radius:50%}:host(.is-condensed) .pills li,:host(.is-condensed) .tabs li{margin-right:0}:host(.is-condensed) .tab{padding-left:.25rem;padding-right:.25rem}\n"] }]
|
37
|
+
}], ctorParameters: function () { return []; }, propDecorators: { id: [{
|
38
|
+
type: Input
|
39
|
+
}], tabindex: [{
|
40
|
+
type: Input
|
41
|
+
}], tabStyle: [{
|
42
|
+
type: Input
|
43
|
+
}], tabs: [{
|
44
|
+
type: Input,
|
45
|
+
args: ['tabGroup']
|
46
|
+
}] } });
|
47
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFicy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb21wb25lbnRzL3NyYy9saWIvY29udHJvbHMvdGFicy90YWJzLmNvbXBv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