@cuby-ui/core 0.0.194 → 0.0.195
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/animations/animations.d.ts +36 -36
- package/animations/index.d.ts +1 -1
- package/classes/accessors.d.ts +17 -17
- package/classes/driver.d.ts +16 -16
- package/classes/index.d.ts +3 -3
- package/classes/vehicle.d.ts +6 -6
- package/components/accordion/accordion-item/accordion-item.component.d.ts +11 -11
- package/components/accordion/accordion.component.d.ts +5 -5
- package/components/accordion/accordion.module.d.ts +11 -11
- package/components/accordion/index.d.ts +3 -3
- package/components/alert/alert.component.d.ts +13 -13
- package/components/alert/alert.interfaces.d.ts +9 -9
- package/components/alert/alert.module.d.ts +11 -11
- package/components/alert/alert.service.d.ts +7 -7
- package/components/alert/alert.tokens.d.ts +16 -16
- package/components/alert/alert.types.d.ts +3 -3
- package/components/alert/alerts.component.d.ts +17 -17
- package/components/alert/index.d.ts +8 -8
- package/components/badge/badge.component.d.ts +10 -10
- package/components/badge/badge.module.d.ts +8 -8
- package/components/badge/badge.options.d.ts +8 -8
- package/components/badge/index.d.ts +2 -2
- package/components/banner/banner.component.d.ts +21 -21
- package/components/banner/banner.module.d.ts +11 -11
- package/components/banner/banner.options.d.ts +13 -13
- package/components/banner/index.d.ts +3 -3
- package/components/breadcrumbs/breadcrumb/breadcrumb.component.d.ts +6 -6
- package/components/breadcrumbs/breadcrumbs.component.d.ts +7 -7
- package/components/breadcrumbs/breadcrumbs.module.d.ts +10 -10
- package/components/breadcrumbs/index.d.ts +3 -3
- package/components/button/button.component.d.ts +38 -38
- package/components/button/button.module.d.ts +9 -9
- package/components/button/button.options.d.ts +9 -9
- package/components/button/index.d.ts +3 -3
- package/components/button-group/button-group.component.d.ts +5 -5
- package/components/button-group/button-group.module.d.ts +7 -7
- package/components/button-group/index.d.ts +2 -2
- package/components/checkbox/checkbox.component.d.ts +5 -5
- package/components/checkbox/checkbox.module.d.ts +7 -7
- package/components/checkbox/index.d.ts +2 -2
- package/components/context-menu/context-menu.component.d.ts +39 -39
- package/components/context-menu/context-menu.module.d.ts +9 -9
- package/components/context-menu/index.d.ts +2 -2
- package/components/dialog/dialog-actions/dialog-actions.component.d.ts +5 -5
- package/components/dialog/dialog-header/dialog-header.component.d.ts +13 -13
- package/components/dialog/dialog.component.d.ts +33 -33
- package/components/dialog/dialog.interfaces.d.ts +11 -11
- package/components/dialog/dialog.module.d.ts +14 -14
- package/components/dialog/dialog.service.d.ts +7 -7
- package/components/dialog/dialog.tokens.d.ts +8 -8
- package/components/dialog/dialogs.component.d.ts +18 -18
- package/components/dialog/index.d.ts +8 -8
- package/components/form-field/form-field.component.d.ts +5 -5
- package/components/form-field/form-field.module.d.ts +7 -7
- package/components/form-field/index.d.ts +2 -2
- package/components/hint/hint.component.d.ts +7 -7
- package/components/hint/hint.module.d.ts +7 -7
- package/components/hint/index.d.ts +2 -2
- package/components/icon-button/icon-button.component.d.ts +13 -13
- package/components/icon-button/icon-button.module.d.ts +9 -9
- package/components/icon-button/index.d.ts +2 -2
- package/components/index.d.ts +26 -26
- package/components/input-number/index.d.ts +2 -2
- package/components/input-number/input-number.component.d.ts +38 -38
- package/components/input-number/input-number.module.d.ts +12 -12
- package/components/input-password/index.d.ts +2 -2
- package/components/input-password/input-password.component.d.ts +31 -31
- package/components/input-password/input-password.module.d.ts +11 -11
- package/components/input-text/index.d.ts +2 -2
- package/components/input-text/input-text.component.d.ts +31 -31
- package/components/input-text/input-text.module.d.ts +11 -11
- package/components/input-time/index.d.ts +3 -3
- package/components/input-time/input-time.component.d.ts +36 -36
- package/components/input-time/input-time.module.d.ts +12 -12
- package/components/input-time/input-time.options.d.ts +7 -7
- package/components/label/index.d.ts +2 -2
- package/components/label/label.component.d.ts +6 -6
- package/components/label/label.module.d.ts +8 -8
- package/components/notification/index.d.ts +3 -3
- package/components/notification/notification.component.d.ts +18 -18
- package/components/notification/notification.module.d.ts +9 -9
- package/components/notification/notification.options.d.ts +17 -17
- package/components/radio/index.d.ts +2 -2
- package/components/radio/radio.component.d.ts +5 -5
- package/components/radio/radio.module.d.ts +7 -7
- package/components/root/index.d.ts +3 -3
- package/components/root/root.component.d.ts +11 -11
- package/components/root/root.module.d.ts +11 -11
- package/components/root/root.options.d.ts +1 -1
- package/components/select/index.d.ts +2 -2
- package/components/select/select.component.d.ts +53 -53
- package/components/select/select.module.d.ts +11 -11
- package/components/svg/index.d.ts +2 -2
- package/components/svg/svg.component.d.ts +16 -16
- package/components/svg/svg.module.d.ts +8 -8
- package/components/tabs/index.d.ts +3 -3
- package/components/tabs/tab/index.d.ts +1 -1
- package/components/tabs/tab/tab.component.d.ts +8 -8
- package/components/tabs/tabs.component.d.ts +16 -16
- package/components/tabs/tabs.module.d.ts +8 -8
- package/components/textarea/index.d.ts +2 -2
- package/components/textarea/textarea.component.d.ts +10 -10
- package/components/textarea/textarea.module.d.ts +7 -7
- package/components/toggle/index.d.ts +2 -2
- package/components/toggle/toggle.component.d.ts +5 -5
- package/components/toggle/toggle.module.d.ts +7 -7
- package/directives/index.d.ts +2 -2
- package/directives/text-field-controller/index.d.ts +8 -8
- package/directives/text-field-controller/text-field-controller.module.d.ts +11 -11
- package/directives/text-field-controller/text-field-controller.provider.d.ts +4 -4
- package/directives/text-field-controller/text-field-icon-left.directive.d.ts +9 -9
- package/directives/text-field-controller/text-field-id.directive.d.ts +8 -8
- package/directives/text-field-controller/text-field-is-error.directive.d.ts +8 -8
- package/directives/text-field-controller/text-field-placeholder.directive.d.ts +8 -8
- package/directives/text-field-controller/text-field-size.directive.d.ts +9 -9
- package/directives/text-field-controller/text-field.controller.d.ts +20 -20
- package/directives/tooltip/index.d.ts +16 -16
- package/directives/tooltip/tooltip-describe.directive.d.ts +16 -16
- package/directives/tooltip/tooltip-driver.directive.d.ts +7 -7
- package/directives/tooltip/tooltip-host.directive.d.ts +9 -9
- package/directives/tooltip/tooltip-hover.directive.d.ts +21 -21
- package/directives/tooltip/tooltip-manual.directive.d.ts +13 -13
- package/directives/tooltip/tooltip-options.directive.d.ts +36 -36
- package/directives/tooltip/tooltip-overflow.directive.d.ts +8 -8
- package/directives/tooltip/tooltip-pointer.directive.d.ts +10 -10
- package/directives/tooltip/tooltip-position.directive.d.ts +20 -20
- package/directives/tooltip/tooltip-unstyled.component.d.ts +17 -17
- package/directives/tooltip/tooltip.component.d.ts +33 -33
- package/directives/tooltip/tooltip.d.ts +13 -13
- package/directives/tooltip/tooltip.directive.d.ts +26 -26
- package/directives/tooltip/tooltip.providers.d.ts +5 -5
- package/directives/tooltip/tooltip.service.d.ts +13 -13
- package/directives/tooltip/tooltips.component.d.ts +12 -12
- package/esm2022/animations/animations.mjs +271 -271
- package/esm2022/animations/index.mjs +1 -1
- package/esm2022/classes/accessors.mjs +30 -30
- package/esm2022/classes/driver.mjs +34 -34
- package/esm2022/classes/index.mjs +3 -3
- package/esm2022/classes/vehicle.mjs +6 -6
- package/esm2022/components/accordion/accordion-item/accordion-item.component.mjs +27 -27
- package/esm2022/components/accordion/accordion.component.mjs +10 -10
- package/esm2022/components/accordion/accordion.module.mjs +36 -36
- package/esm2022/components/accordion/index.mjs +3 -3
- package/esm2022/components/alert/alert.component.mjs +35 -35
- package/esm2022/components/alert/alert.interfaces.mjs +1 -1
- package/esm2022/components/alert/alert.module.mjs +39 -39
- package/esm2022/components/alert/alert.service.mjs +16 -16
- package/esm2022/components/alert/alert.tokens.mjs +19 -19
- package/esm2022/components/alert/alert.types.mjs +1 -1
- package/esm2022/components/alert/alerts.component.mjs +35 -35
- package/esm2022/components/alert/index.mjs +8 -8
- package/esm2022/components/badge/badge.component.mjs +30 -30
- package/esm2022/components/badge/badge.module.mjs +17 -17
- package/esm2022/components/badge/badge.options.mjs +7 -7
- package/esm2022/components/badge/index.mjs +2 -2
- package/esm2022/components/banner/banner.component.mjs +67 -67
- package/esm2022/components/banner/banner.module.mjs +30 -30
- package/esm2022/components/banner/banner.options.mjs +5 -5
- package/esm2022/components/banner/index.mjs +3 -3
- package/esm2022/components/breadcrumbs/breadcrumb/breadcrumb.component.mjs +15 -15
- package/esm2022/components/breadcrumbs/breadcrumbs.component.mjs +16 -16
- package/esm2022/components/breadcrumbs/breadcrumbs.module.mjs +32 -32
- package/esm2022/components/breadcrumbs/index.mjs +3 -3
- package/esm2022/components/button/button.component.mjs +137 -137
- package/esm2022/components/button/button.module.mjs +23 -23
- package/esm2022/components/button/button.options.mjs +9 -9
- package/esm2022/components/button/index.mjs +3 -3
- package/esm2022/components/button-group/button-group.component.mjs +10 -10
- package/esm2022/components/button-group/button-group.module.mjs +15 -15
- package/esm2022/components/button-group/index.mjs +2 -2
- package/esm2022/components/checkbox/checkbox.component.mjs +10 -10
- package/esm2022/components/checkbox/checkbox.module.mjs +15 -15
- package/esm2022/components/checkbox/index.mjs +2 -2
- package/esm2022/components/context-menu/context-menu.component.mjs +147 -147
- package/esm2022/components/context-menu/context-menu.module.mjs +23 -23
- package/esm2022/components/context-menu/index.mjs +2 -2
- package/esm2022/components/dialog/dialog-actions/dialog-actions.component.mjs +10 -10
- package/esm2022/components/dialog/dialog-header/dialog-header.component.mjs +27 -27
- package/esm2022/components/dialog/dialog.component.mjs +66 -66
- package/esm2022/components/dialog/dialog.interfaces.mjs +1 -1
- package/esm2022/components/dialog/dialog.module.mjs +48 -48
- package/esm2022/components/dialog/dialog.service.mjs +16 -16
- package/esm2022/components/dialog/dialog.tokens.mjs +11 -11
- package/esm2022/components/dialog/dialogs.component.mjs +50 -50
- package/esm2022/components/dialog/index.mjs +8 -8
- package/esm2022/components/form-field/form-field.component.mjs +10 -10
- package/esm2022/components/form-field/form-field.module.mjs +15 -15
- package/esm2022/components/form-field/index.mjs +2 -2
- package/esm2022/components/hint/hint.component.mjs +18 -18
- package/esm2022/components/hint/hint.module.mjs +15 -15
- package/esm2022/components/hint/index.mjs +2 -2
- package/esm2022/components/icon-button/icon-button.component.mjs +31 -31
- package/esm2022/components/icon-button/icon-button.module.mjs +23 -23
- package/esm2022/components/icon-button/index.mjs +2 -2
- package/esm2022/components/index.mjs +26 -26
- package/esm2022/components/input-number/index.mjs +2 -2
- package/esm2022/components/input-number/input-number.component.mjs +112 -112
- package/esm2022/components/input-number/input-number.module.mjs +35 -35
- package/esm2022/components/input-password/index.mjs +2 -2
- package/esm2022/components/input-password/input-password.component.mjs +88 -88
- package/esm2022/components/input-password/input-password.module.mjs +32 -32
- package/esm2022/components/input-text/index.mjs +2 -2
- package/esm2022/components/input-text/input-text.component.mjs +86 -86
- package/esm2022/components/input-text/input-text.module.mjs +32 -32
- package/esm2022/components/input-time/index.mjs +3 -3
- package/esm2022/components/input-time/input-time.component.mjs +98 -98
- package/esm2022/components/input-time/input-time.module.mjs +35 -35
- package/esm2022/components/input-time/input-time.options.mjs +7 -7
- package/esm2022/components/label/index.mjs +2 -2
- package/esm2022/components/label/label.component.mjs +16 -16
- package/esm2022/components/label/label.module.mjs +17 -17
- package/esm2022/components/notification/index.mjs +3 -3
- package/esm2022/components/notification/notification.component.mjs +46 -46
- package/esm2022/components/notification/notification.module.mjs +23 -23
- package/esm2022/components/notification/notification.options.mjs +52 -52
- package/esm2022/components/radio/index.mjs +2 -2
- package/esm2022/components/radio/radio.component.mjs +10 -10
- package/esm2022/components/radio/radio.module.mjs +15 -15
- package/esm2022/components/root/index.mjs +3 -3
- package/esm2022/components/root/root.component.mjs +31 -31
- package/esm2022/components/root/root.module.mjs +30 -30
- package/esm2022/components/root/root.options.mjs +1 -1
- package/esm2022/components/select/index.mjs +2 -2
- package/esm2022/components/select/select.component.mjs +171 -171
- package/esm2022/components/select/select.module.mjs +31 -31
- package/esm2022/components/svg/index.mjs +2 -2
- package/esm2022/components/svg/svg.component.mjs +49 -49
- package/esm2022/components/svg/svg.module.mjs +17 -17
- package/esm2022/components/tabs/index.mjs +3 -3
- package/esm2022/components/tabs/tab/index.mjs +1 -1
- package/esm2022/components/tabs/tab/tab.component.mjs +20 -20
- package/esm2022/components/tabs/tabs.component.mjs +48 -48
- package/esm2022/components/tabs/tabs.module.mjs +17 -17
- package/esm2022/components/textarea/index.mjs +2 -2
- package/esm2022/components/textarea/textarea.component.mjs +34 -34
- package/esm2022/components/textarea/textarea.module.mjs +15 -15
- package/esm2022/components/toggle/index.mjs +2 -2
- package/esm2022/components/toggle/toggle.component.mjs +10 -10
- package/esm2022/components/toggle/toggle.module.mjs +15 -15
- package/esm2022/cuby-ui-core.mjs +4 -4
- package/esm2022/directives/index.mjs +2 -2
- package/esm2022/directives/text-field-controller/index.mjs +8 -8
- package/esm2022/directives/text-field-controller/text-field-controller.module.mjs +39 -39
- package/esm2022/directives/text-field-controller/text-field-controller.provider.mjs +23 -23
- package/esm2022/directives/text-field-controller/text-field-icon-left.directive.mjs +20 -20
- package/esm2022/directives/text-field-controller/text-field-id.directive.mjs +20 -20
- package/esm2022/directives/text-field-controller/text-field-is-error.directive.mjs +23 -23
- package/esm2022/directives/text-field-controller/text-field-placeholder.directive.mjs +20 -20
- package/esm2022/directives/text-field-controller/text-field-size.directive.mjs +23 -23
- package/esm2022/directives/text-field-controller/text-field.controller.mjs +24 -24
- package/esm2022/directives/tooltip/index.mjs +16 -16
- package/esm2022/directives/tooltip/tooltip-describe.directive.mjs +44 -44
- package/esm2022/directives/tooltip/tooltip-driver.directive.mjs +17 -17
- package/esm2022/directives/tooltip/tooltip-host.directive.mjs +25 -25
- package/esm2022/directives/tooltip/tooltip-hover.directive.mjs +52 -52
- package/esm2022/directives/tooltip/tooltip-manual.directive.mjs +30 -30
- package/esm2022/directives/tooltip/tooltip-options.directive.mjs +82 -82
- package/esm2022/directives/tooltip/tooltip-overflow.directive.mjs +30 -30
- package/esm2022/directives/tooltip/tooltip-pointer.directive.mjs +30 -30
- package/esm2022/directives/tooltip/tooltip-position.directive.mjs +96 -96
- package/esm2022/directives/tooltip/tooltip-unstyled.component.mjs +39 -39
- package/esm2022/directives/tooltip/tooltip.component.mjs +98 -98
- package/esm2022/directives/tooltip/tooltip.directive.mjs +91 -91
- package/esm2022/directives/tooltip/tooltip.mjs +26 -26
- package/esm2022/directives/tooltip/tooltip.providers.mjs +6 -6
- package/esm2022/directives/tooltip/tooltip.service.mjs +27 -27
- package/esm2022/directives/tooltip/tooltips.component.mjs +32 -32
- package/esm2022/index.mjs +8 -7
- package/esm2022/interceptors/index.mjs +2 -0
- package/esm2022/interceptors/x-ndjson.interceptor.mjs +48 -0
- package/esm2022/interfaces/context-menu-item.mjs +1 -1
- package/esm2022/interfaces/index.mjs +3 -3
- package/esm2022/interfaces/option.mjs +1 -1
- package/esm2022/services/index.mjs +4 -4
- package/esm2022/services/position.service.mjs +22 -22
- package/esm2022/services/theme.options.mjs +5 -5
- package/esm2022/services/theme.service.mjs +29 -29
- package/esm2022/services/visual-viewport.service.mjs +27 -27
- package/esm2022/tokens/animations-speed.mjs +7 -7
- package/esm2022/tokens/index.mjs +3 -3
- package/esm2022/tokens/reduced-motion.mjs +5 -5
- package/esm2022/tokens/viewport.mjs +30 -30
- package/esm2022/types/appearance.mjs +1 -1
- package/esm2022/types/hint-type.mjs +1 -1
- package/esm2022/types/index.mjs +9 -9
- package/esm2022/types/point.mjs +1 -1
- package/esm2022/types/portal-item.mjs +1 -1
- package/esm2022/types/position.mjs +1 -1
- package/esm2022/types/resizing.mjs +1 -1
- package/esm2022/types/shape.mjs +1 -1
- package/esm2022/types/size.mjs +1 -1
- package/esm2022/types/status.mjs +1 -1
- package/esm2022/utils/format/index.mjs +2 -2
- package/esm2022/utils/format/remove-spaces.mjs +3 -3
- package/esm2022/utils/format/replace.mjs +4 -4
- package/esm2022/utils/index.mjs +2 -2
- package/esm2022/utils/miscellaneous/index.mjs +3 -3
- package/esm2022/utils/miscellaneous/is-obscured.mjs +7 -7
- package/esm2022/utils/miscellaneous/override-options.mjs +10 -10
- package/esm2022/utils/miscellaneous/to-animation-options.mjs +13 -13
- package/fesm2022/cuby-ui-core.mjs +3230 -3183
- package/fesm2022/cuby-ui-core.mjs.map +1 -1
- package/index.d.ts +7 -6
- package/interceptors/index.d.ts +1 -0
- package/interceptors/x-ndjson.interceptor.d.ts +2 -0
- package/interfaces/context-menu-item.d.ts +7 -7
- package/interfaces/index.d.ts +2 -2
- package/interfaces/option.d.ts +5 -5
- package/package.json +6 -6
- package/services/index.d.ts +4 -4
- package/services/position.service.d.ts +10 -10
- package/services/theme.options.d.ts +5 -5
- package/services/theme.service.d.ts +12 -12
- package/services/visual-viewport.service.d.ts +9 -9
- package/styles/reset.scss +111 -0
- package/tokens/animations-speed.d.ts +4 -4
- package/tokens/index.d.ts +3 -3
- package/tokens/reduced-motion.d.ts +1 -1
- package/tokens/viewport.d.ts +7 -7
- package/types/appearance.d.ts +8 -8
- package/types/hint-type.d.ts +1 -1
- package/types/index.d.ts +9 -9
- package/types/point.d.ts +1 -1
- package/types/portal-item.d.ts +9 -9
- package/types/position.d.ts +2 -2
- package/types/resizing.d.ts +2 -2
- package/types/shape.d.ts +1 -1
- package/types/size.d.ts +4 -4
- package/types/status.d.ts +1 -1
- package/utils/format/index.d.ts +2 -2
- package/utils/format/remove-spaces.d.ts +1 -1
- package/utils/format/replace.d.ts +1 -1
- package/utils/index.d.ts +2 -2
- package/utils/miscellaneous/index.d.ts +3 -3
- package/utils/miscellaneous/is-obscured.d.ts +4 -4
- package/utils/miscellaneous/override-options.d.ts +1 -1
- package/utils/miscellaneous/to-animation-options.d.ts +4 -4
|
@@ -1,172 +1,172 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, Input, ElementRef, ViewChild, HostBinding, ViewContainerRef, HostListener } from '@angular/core';
|
|
2
|
-
import { DOCUMENT } from '@angular/common';
|
|
3
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
-
import { CuiDestroyService } from '@cuby-ui/cdk';
|
|
5
|
-
import { cuiProvide, CuiClickOutsideDirective } from '@cuby-ui/cdk';
|
|
6
|
-
import { takeUntil } from 'rxjs';
|
|
7
|
-
import { CUI_TEXT_FIELD_CONTROLLER, CUI_TEXT_FILED_CONTROLLER_PROVIDER } from '../../directives';
|
|
8
|
-
import { CUI_ROOT_SELECTOR } from '../root';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
import * as i1 from "@cuby-ui/cdk";
|
|
11
|
-
import * as i2 from "@angular/common";
|
|
12
|
-
import * as i3 from "../svg/svg.component";
|
|
13
|
-
export class CuiSelectComponent {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.element = inject(ElementRef).nativeElement;
|
|
16
|
-
this.document = inject(DOCUMENT);
|
|
17
|
-
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
18
|
-
this.viewContainerRef = inject(ViewContainerRef);
|
|
19
|
-
this.destroy$ = inject(CuiDestroyService, { self: true });
|
|
20
|
-
this.cuiTextFieldController = inject(CUI_TEXT_FIELD_CONTROLLER);
|
|
21
|
-
this.cuiClickOutsideDirective = inject(CuiClickOutsideDirective, { self: true });
|
|
22
|
-
this.SPACE_BETWEEN_BUTTON_AND_OPTIONS = 3;
|
|
23
|
-
this.isOpened = false;
|
|
24
|
-
this.isOptionsListAbove = false;
|
|
25
|
-
this.gap = `${this.SPACE_BETWEEN_BUTTON_AND_OPTIONS}px`;
|
|
26
|
-
}
|
|
27
|
-
get id() {
|
|
28
|
-
return this.cuiTextFieldController.id;
|
|
29
|
-
}
|
|
30
|
-
get size() {
|
|
31
|
-
return this.cuiTextFieldController.size;
|
|
32
|
-
}
|
|
33
|
-
get placeholder() {
|
|
34
|
-
return this.cuiTextFieldController.placeholder;
|
|
35
|
-
}
|
|
36
|
-
get isError() {
|
|
37
|
-
return this.cuiTextFieldController.isError;
|
|
38
|
-
}
|
|
39
|
-
trackByFn(_, item) {
|
|
40
|
-
return item.label;
|
|
41
|
-
}
|
|
42
|
-
writeValue(value) {
|
|
43
|
-
this.value = value;
|
|
44
|
-
// TODO: Непонятно, зачем нужно в construction вторая часть выражения
|
|
45
|
-
this.selectedOption = this.options.find(option => option.value === value) ?? value;
|
|
46
|
-
this.changeDetectorRef.markForCheck();
|
|
47
|
-
}
|
|
48
|
-
registerOnChange(fn) {
|
|
49
|
-
this.onChange = fn;
|
|
50
|
-
}
|
|
51
|
-
registerOnTouched(fn) {
|
|
52
|
-
this.onTouched = fn;
|
|
53
|
-
}
|
|
54
|
-
ngOnInit() {
|
|
55
|
-
this.initClickOutsideSubscription();
|
|
56
|
-
}
|
|
57
|
-
ngOnDestroy() {
|
|
58
|
-
this.clearViewContainerRef();
|
|
59
|
-
}
|
|
60
|
-
setDisabledState(isDisabled) {
|
|
61
|
-
this.isDisabled = isDisabled;
|
|
62
|
-
this.changeDetectorRef.markForCheck();
|
|
63
|
-
}
|
|
64
|
-
onSelect(event, option) {
|
|
65
|
-
event.stopPropagation();
|
|
66
|
-
if (option.isDisabled) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
this.value = option.value;
|
|
70
|
-
this.selectedOption = option;
|
|
71
|
-
this.onChange(this.value);
|
|
72
|
-
this.onSwitch();
|
|
73
|
-
this.onTouched();
|
|
74
|
-
this.changeDetectorRef.markForCheck();
|
|
75
|
-
}
|
|
76
|
-
onSwitch() {
|
|
77
|
-
if (!this.options.length && !this.defaultOptionText) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
if (!this.isOpened) {
|
|
81
|
-
this.open();
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
this.close();
|
|
85
|
-
}
|
|
86
|
-
onClose() {
|
|
87
|
-
this.close();
|
|
88
|
-
}
|
|
89
|
-
onWindowResize() {
|
|
90
|
-
this.button.nativeElement.blur();
|
|
91
|
-
this.close();
|
|
92
|
-
}
|
|
93
|
-
initClickOutsideSubscription() {
|
|
94
|
-
this.cuiClickOutsideDirective.cuiClickOutside
|
|
95
|
-
.pipe(takeUntil(this.destroy$))
|
|
96
|
-
.subscribe(() => {
|
|
97
|
-
if (this.isOpened) {
|
|
98
|
-
this.onTouched();
|
|
99
|
-
}
|
|
100
|
-
this.close();
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
open() {
|
|
104
|
-
this.isOpened = true;
|
|
105
|
-
const rootElement = this.document.querySelector(CUI_ROOT_SELECTOR);
|
|
106
|
-
const { top: elementRectTop, left: elementRectLeft, bottom: elementRectBottom } = this.element.getBoundingClientRect();
|
|
107
|
-
const distanceToBottom = this.document.documentElement.clientHeight
|
|
108
|
-
- (elementRectBottom + this.SPACE_BETWEEN_BUTTON_AND_OPTIONS);
|
|
109
|
-
const embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.optionsWrapper);
|
|
110
|
-
const node = embeddedViewRef.rootNodes[0];
|
|
111
|
-
const nodeStyles = node.style;
|
|
112
|
-
this.isOptionsListAbove = distanceToBottom < this.getOptionsListHeightContainer.nativeElement.offsetHeight;
|
|
113
|
-
embeddedViewRef.detectChanges();
|
|
114
|
-
nodeStyles.width = this.element.offsetWidth + 'px';
|
|
115
|
-
nodeStyles.left = window.scrollX + elementRectLeft + 'px';
|
|
116
|
-
if (this.isOptionsListAbove) {
|
|
117
|
-
nodeStyles.top = window.scrollY + elementRectTop
|
|
118
|
-
- this.getOptionsListHeightContainer.nativeElement.offsetHeight
|
|
119
|
-
- this.SPACE_BETWEEN_BUTTON_AND_OPTIONS
|
|
120
|
-
+ 'px';
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
nodeStyles.top = window.scrollY + elementRectBottom + this.SPACE_BETWEEN_BUTTON_AND_OPTIONS + 'px';
|
|
124
|
-
}
|
|
125
|
-
rootElement.appendChild(this.viewContainerRef.createEmbeddedView(this.backdrop).rootNodes[0]);
|
|
126
|
-
rootElement.appendChild(embeddedViewRef.rootNodes[0]);
|
|
127
|
-
}
|
|
128
|
-
close() {
|
|
129
|
-
this.isOpened = false;
|
|
130
|
-
this.clearViewContainerRef();
|
|
131
|
-
}
|
|
132
|
-
clearViewContainerRef() {
|
|
133
|
-
this.viewContainerRef.clear();
|
|
134
|
-
}
|
|
135
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
136
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CuiSelectComponent, selector: "cui-select[options]", inputs: { options: "options", defaultOptionText: "defaultOptionText" }, host: { listeners: { "window:resize": "onWindowResize()" }, properties: { "style.--c-gap": "this.gap" } }, providers: [
|
|
137
|
-
CUI_TEXT_FILED_CONTROLLER_PROVIDER,
|
|
138
|
-
cuiProvide(NG_VALUE_ACCESSOR, CuiSelectComponent, true),
|
|
139
|
-
CuiDestroyService
|
|
140
|
-
], viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }, { propertyName: "getOptionsListHeightContainer", first: true, predicate: ["getOptionsListHeightContainer"], descendants: true }, { propertyName: "backdrop", first: true, predicate: ["backdrop"], descendants: true }, { propertyName: "optionsWrapper", first: true, predicate: ["optionsWrapper"], descendants: true }], hostDirectives: [{ directive: i1.CuiClickOutsideDirective }], ngImport: i0, template: "<button\r\n #button\r\n type=\"button\"\r\n [attr.id]=\"id\"\r\n [attr.data-size]=\"size\"\r\n [disabled]=\"isDisabled\"\r\n class=\"c-button\"\r\n [class.c-button_active]=\"isOpened\"\r\n [class.c-button_with-error]=\"isError\"\r\n (click)=\"onSwitch()\"\r\n>\r\n <ng-container *ngIf=\"selectedOption; else placeholderTemplate\">\r\n {{ selectedOption.label }}\r\n </ng-container>\r\n <ng-template #placeholderTemplate>\r\n <span class=\"c-placeholder\">{{ placeholder }}</span>\r\n </ng-template>\r\n <cui-svg\r\n icon=\"cuiIconChevronDown\"\r\n color=\"var(--cui-base-500)\"\r\n />\r\n</button>\r\n<ng-template #backdrop>\r\n <div class=\"c-backdrop\"></div>\r\n</ng-template>\r\n<ng-template #optionsWrapper>\r\n <div\r\n cuiFocusTrap\r\n class=\"c-options__wrapper\"\r\n [class.c-options__wrapper_top]=\"isOptionsListAbove\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"optionsList\"/>\r\n </div>\r\n</ng-template>\r\n<div\r\n #getOptionsListHeightContainer\r\n class=\"c-get-options-list-height-container\"\r\n>\r\n <ng-container *ngTemplateOutlet=\"optionsList\"/>\r\n</div>\r\n<ng-template #optionsList>\r\n <ul\r\n class=\"c-options\"\r\n [class.c-options_top]=\"isOptionsListAbove\"\r\n >\r\n <ng-container *ngIf=\"options.length; else empty\">\r\n <li *ngFor=\"let option of options; trackBy: trackByFn\">\r\n <button\r\n type=\"button\"\r\n class=\"c-option-button\"\r\n [class.c-option-button_selected]=\"selectedOption === option\"\r\n [disabled]=\"option.isDisabled\"\r\n (click)=\"onSelect($event, option)\"\r\n >\r\n <span>{{ option.label }}</span>\r\n <cui-svg\r\n *ngIf=\"selectedOption === option\"\r\n icon=\"cuiIconCheckSm\"\r\n color=\"var(--cui-info)\"\r\n class=\"c-option-button__icon\"\r\n />\r\n </button>\r\n </li>\r\n </ng-container>\r\n <ng-template #empty>\r\n <li *ngIf=\"defaultOptionText\">\r\n <button\r\n type=\"button\"\r\n class=\"c-option-button\"\r\n (click)=\"onClose()\"\r\n >\r\n {{ defaultOptionText }}\r\n </button>\r\n </li>\r\n </ng-template>\r\n </ul>\r\n</ng-template>\r\n", styles: [":host{display:block;font-family:var(--cui-main-font);position:relative}.c-button{border:0;flex-shrink:0;outline:none;appearance:none;color:inherit;font:inherit;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;padding:0 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;border:1px solid var(--cui-base-200);border-radius:8px;cursor:pointer;background:var(--cui-input);color:var(--cui-base-900);font-family:var(--cui-main-font);text-align:start}.c-button:hover{border-color:var(--cui-base-300)}.c-button_active.c-button_active,.c-button:focus{box-shadow:0 0 0 2px var(--cui-focus);border-color:var(--cui-info)}.c-button:disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}.c-button[data-size=sm]{padding-top:7px;padding-bottom:7px}.c-button[data-size=md]{padding-top:8px;padding-bottom:8px}.c-button_with-error{border-color:var(--cui-danger)}.c-button_with-error:focus{box-shadow:0 0 0 2px #d92d2040;border-color:var(--cui-danger)}.c-placeholder{color:var(--cui-base-400)}.c-backdrop{position:fixed;inset:0}.c-options__wrapper{position:absolute;font-family:var(--cui-main-font);z-index:1}.c-get-options-list-height-container{position:fixed;visibility:hidden}.c-options{padding:7px 0;margin:0;list-style:none;font-weight:400;font-size:14px;line-height:20px;box-shadow:0 1px 4px #0000000a,0 1px 4px #0000000a;overflow:auto;max-height:180px;border:1px solid var(--cui-base-200);border-radius:8px;background:var(--cui-base-0);color:var(--cui-base-900)}.c-option-button{padding:8px 11px 8px 0;border:0;flex-shrink:0;outline:none;cursor:pointer;appearance:none;color:inherit;font:inherit;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;padding:8px 11px;width:100%;display:flex;align-items:center;gap:12px;text-align:start}.c-option-button:active{background:var(--cui-base-50)}@media (hover: hover){.c-option-button:hover{background:var(--cui-base-50)}}.c-option-button_selected{background:var(--cui-base-50)}.c-option-button:disabled{background:unset;opacity:50%}.c-option-button__icon{margin-left:auto}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { kind: "directive", type: i1.CuiFocusTrapDirective, selector: "[cuiFocusTrap]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
141
|
-
}
|
|
142
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSelectComponent, decorators: [{
|
|
143
|
-
type: Component,
|
|
144
|
-
args: [{ selector: 'cui-select[options]', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
145
|
-
CUI_TEXT_FILED_CONTROLLER_PROVIDER,
|
|
146
|
-
cuiProvide(NG_VALUE_ACCESSOR, CuiSelectComponent, true),
|
|
147
|
-
CuiDestroyService
|
|
148
|
-
], hostDirectives: [CuiClickOutsideDirective], template: "<button\r\n #button\r\n type=\"button\"\r\n [attr.id]=\"id\"\r\n [attr.data-size]=\"size\"\r\n [disabled]=\"isDisabled\"\r\n class=\"c-button\"\r\n [class.c-button_active]=\"isOpened\"\r\n [class.c-button_with-error]=\"isError\"\r\n (click)=\"onSwitch()\"\r\n>\r\n <ng-container *ngIf=\"selectedOption; else placeholderTemplate\">\r\n {{ selectedOption.label }}\r\n </ng-container>\r\n <ng-template #placeholderTemplate>\r\n <span class=\"c-placeholder\">{{ placeholder }}</span>\r\n </ng-template>\r\n <cui-svg\r\n icon=\"cuiIconChevronDown\"\r\n color=\"var(--cui-base-500)\"\r\n />\r\n</button>\r\n<ng-template #backdrop>\r\n <div class=\"c-backdrop\"></div>\r\n</ng-template>\r\n<ng-template #optionsWrapper>\r\n <div\r\n cuiFocusTrap\r\n class=\"c-options__wrapper\"\r\n [class.c-options__wrapper_top]=\"isOptionsListAbove\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"optionsList\"/>\r\n </div>\r\n</ng-template>\r\n<div\r\n #getOptionsListHeightContainer\r\n class=\"c-get-options-list-height-container\"\r\n>\r\n <ng-container *ngTemplateOutlet=\"optionsList\"/>\r\n</div>\r\n<ng-template #optionsList>\r\n <ul\r\n class=\"c-options\"\r\n [class.c-options_top]=\"isOptionsListAbove\"\r\n >\r\n <ng-container *ngIf=\"options.length; else empty\">\r\n <li *ngFor=\"let option of options; trackBy: trackByFn\">\r\n <button\r\n type=\"button\"\r\n class=\"c-option-button\"\r\n [class.c-option-button_selected]=\"selectedOption === option\"\r\n [disabled]=\"option.isDisabled\"\r\n (click)=\"onSelect($event, option)\"\r\n >\r\n <span>{{ option.label }}</span>\r\n <cui-svg\r\n *ngIf=\"selectedOption === option\"\r\n icon=\"cuiIconCheckSm\"\r\n color=\"var(--cui-info)\"\r\n class=\"c-option-button__icon\"\r\n />\r\n </button>\r\n </li>\r\n </ng-container>\r\n <ng-template #empty>\r\n <li *ngIf=\"defaultOptionText\">\r\n <button\r\n type=\"button\"\r\n class=\"c-option-button\"\r\n (click)=\"onClose()\"\r\n >\r\n {{ defaultOptionText }}\r\n </button>\r\n </li>\r\n </ng-template>\r\n </ul>\r\n</ng-template>\r\n", styles: [":host{display:block;font-family:var(--cui-main-font);position:relative}.c-button{border:0;flex-shrink:0;outline:none;appearance:none;color:inherit;font:inherit;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;padding:0 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;border:1px solid var(--cui-base-200);border-radius:8px;cursor:pointer;background:var(--cui-input);color:var(--cui-base-900);font-family:var(--cui-main-font);text-align:start}.c-button:hover{border-color:var(--cui-base-300)}.c-button_active.c-button_active,.c-button:focus{box-shadow:0 0 0 2px var(--cui-focus);border-color:var(--cui-info)}.c-button:disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}.c-button[data-size=sm]{padding-top:7px;padding-bottom:7px}.c-button[data-size=md]{padding-top:8px;padding-bottom:8px}.c-button_with-error{border-color:var(--cui-danger)}.c-button_with-error:focus{box-shadow:0 0 0 2px #d92d2040;border-color:var(--cui-danger)}.c-placeholder{color:var(--cui-base-400)}.c-backdrop{position:fixed;inset:0}.c-options__wrapper{position:absolute;font-family:var(--cui-main-font);z-index:1}.c-get-options-list-height-container{position:fixed;visibility:hidden}.c-options{padding:7px 0;margin:0;list-style:none;font-weight:400;font-size:14px;line-height:20px;box-shadow:0 1px 4px #0000000a,0 1px 4px #0000000a;overflow:auto;max-height:180px;border:1px solid var(--cui-base-200);border-radius:8px;background:var(--cui-base-0);color:var(--cui-base-900)}.c-option-button{padding:8px 11px 8px 0;border:0;flex-shrink:0;outline:none;cursor:pointer;appearance:none;color:inherit;font:inherit;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;padding:8px 11px;width:100%;display:flex;align-items:center;gap:12px;text-align:start}.c-option-button:active{background:var(--cui-base-50)}@media (hover: hover){.c-option-button:hover{background:var(--cui-base-50)}}.c-option-button_selected{background:var(--cui-base-50)}.c-option-button:disabled{background:unset;opacity:50%}.c-option-button__icon{margin-left:auto}\n"] }]
|
|
149
|
-
}], propDecorators: { options: [{
|
|
150
|
-
type: Input
|
|
151
|
-
}], defaultOptionText: [{
|
|
152
|
-
type: Input
|
|
153
|
-
}], button: [{
|
|
154
|
-
type: ViewChild,
|
|
155
|
-
args: ['button']
|
|
156
|
-
}], getOptionsListHeightContainer: [{
|
|
157
|
-
type: ViewChild,
|
|
158
|
-
args: ['getOptionsListHeightContainer']
|
|
159
|
-
}], backdrop: [{
|
|
160
|
-
type: ViewChild,
|
|
161
|
-
args: ['backdrop']
|
|
162
|
-
}], optionsWrapper: [{
|
|
163
|
-
type: ViewChild,
|
|
164
|
-
args: ['optionsWrapper']
|
|
165
|
-
}], gap: [{
|
|
166
|
-
type: HostBinding,
|
|
167
|
-
args: ['style.--c-gap']
|
|
168
|
-
}], onWindowResize: [{
|
|
169
|
-
type: HostListener,
|
|
170
|
-
args: ['window:resize']
|
|
171
|
-
}] } });
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, Input, ElementRef, ViewChild, HostBinding, ViewContainerRef, HostListener } from '@angular/core';
|
|
2
|
+
import { DOCUMENT } from '@angular/common';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { CuiDestroyService } from '@cuby-ui/cdk';
|
|
5
|
+
import { cuiProvide, CuiClickOutsideDirective } from '@cuby-ui/cdk';
|
|
6
|
+
import { takeUntil } from 'rxjs';
|
|
7
|
+
import { CUI_TEXT_FIELD_CONTROLLER, CUI_TEXT_FILED_CONTROLLER_PROVIDER } from '../../directives';
|
|
8
|
+
import { CUI_ROOT_SELECTOR } from '../root';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
import * as i1 from "@cuby-ui/cdk";
|
|
11
|
+
import * as i2 from "@angular/common";
|
|
12
|
+
import * as i3 from "../svg/svg.component";
|
|
13
|
+
export class CuiSelectComponent {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.element = inject(ElementRef).nativeElement;
|
|
16
|
+
this.document = inject(DOCUMENT);
|
|
17
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
18
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
19
|
+
this.destroy$ = inject(CuiDestroyService, { self: true });
|
|
20
|
+
this.cuiTextFieldController = inject(CUI_TEXT_FIELD_CONTROLLER);
|
|
21
|
+
this.cuiClickOutsideDirective = inject(CuiClickOutsideDirective, { self: true });
|
|
22
|
+
this.SPACE_BETWEEN_BUTTON_AND_OPTIONS = 3;
|
|
23
|
+
this.isOpened = false;
|
|
24
|
+
this.isOptionsListAbove = false;
|
|
25
|
+
this.gap = `${this.SPACE_BETWEEN_BUTTON_AND_OPTIONS}px`;
|
|
26
|
+
}
|
|
27
|
+
get id() {
|
|
28
|
+
return this.cuiTextFieldController.id;
|
|
29
|
+
}
|
|
30
|
+
get size() {
|
|
31
|
+
return this.cuiTextFieldController.size;
|
|
32
|
+
}
|
|
33
|
+
get placeholder() {
|
|
34
|
+
return this.cuiTextFieldController.placeholder;
|
|
35
|
+
}
|
|
36
|
+
get isError() {
|
|
37
|
+
return this.cuiTextFieldController.isError;
|
|
38
|
+
}
|
|
39
|
+
trackByFn(_, item) {
|
|
40
|
+
return item.label;
|
|
41
|
+
}
|
|
42
|
+
writeValue(value) {
|
|
43
|
+
this.value = value;
|
|
44
|
+
// TODO: Непонятно, зачем нужно в construction вторая часть выражения
|
|
45
|
+
this.selectedOption = this.options.find(option => option.value === value) ?? value;
|
|
46
|
+
this.changeDetectorRef.markForCheck();
|
|
47
|
+
}
|
|
48
|
+
registerOnChange(fn) {
|
|
49
|
+
this.onChange = fn;
|
|
50
|
+
}
|
|
51
|
+
registerOnTouched(fn) {
|
|
52
|
+
this.onTouched = fn;
|
|
53
|
+
}
|
|
54
|
+
ngOnInit() {
|
|
55
|
+
this.initClickOutsideSubscription();
|
|
56
|
+
}
|
|
57
|
+
ngOnDestroy() {
|
|
58
|
+
this.clearViewContainerRef();
|
|
59
|
+
}
|
|
60
|
+
setDisabledState(isDisabled) {
|
|
61
|
+
this.isDisabled = isDisabled;
|
|
62
|
+
this.changeDetectorRef.markForCheck();
|
|
63
|
+
}
|
|
64
|
+
onSelect(event, option) {
|
|
65
|
+
event.stopPropagation();
|
|
66
|
+
if (option.isDisabled) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
this.value = option.value;
|
|
70
|
+
this.selectedOption = option;
|
|
71
|
+
this.onChange(this.value);
|
|
72
|
+
this.onSwitch();
|
|
73
|
+
this.onTouched();
|
|
74
|
+
this.changeDetectorRef.markForCheck();
|
|
75
|
+
}
|
|
76
|
+
onSwitch() {
|
|
77
|
+
if (!this.options.length && !this.defaultOptionText) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (!this.isOpened) {
|
|
81
|
+
this.open();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
this.close();
|
|
85
|
+
}
|
|
86
|
+
onClose() {
|
|
87
|
+
this.close();
|
|
88
|
+
}
|
|
89
|
+
onWindowResize() {
|
|
90
|
+
this.button.nativeElement.blur();
|
|
91
|
+
this.close();
|
|
92
|
+
}
|
|
93
|
+
initClickOutsideSubscription() {
|
|
94
|
+
this.cuiClickOutsideDirective.cuiClickOutside
|
|
95
|
+
.pipe(takeUntil(this.destroy$))
|
|
96
|
+
.subscribe(() => {
|
|
97
|
+
if (this.isOpened) {
|
|
98
|
+
this.onTouched();
|
|
99
|
+
}
|
|
100
|
+
this.close();
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
open() {
|
|
104
|
+
this.isOpened = true;
|
|
105
|
+
const rootElement = this.document.querySelector(CUI_ROOT_SELECTOR);
|
|
106
|
+
const { top: elementRectTop, left: elementRectLeft, bottom: elementRectBottom } = this.element.getBoundingClientRect();
|
|
107
|
+
const distanceToBottom = this.document.documentElement.clientHeight
|
|
108
|
+
- (elementRectBottom + this.SPACE_BETWEEN_BUTTON_AND_OPTIONS);
|
|
109
|
+
const embeddedViewRef = this.viewContainerRef.createEmbeddedView(this.optionsWrapper);
|
|
110
|
+
const node = embeddedViewRef.rootNodes[0];
|
|
111
|
+
const nodeStyles = node.style;
|
|
112
|
+
this.isOptionsListAbove = distanceToBottom < this.getOptionsListHeightContainer.nativeElement.offsetHeight;
|
|
113
|
+
embeddedViewRef.detectChanges();
|
|
114
|
+
nodeStyles.width = this.element.offsetWidth + 'px';
|
|
115
|
+
nodeStyles.left = window.scrollX + elementRectLeft + 'px';
|
|
116
|
+
if (this.isOptionsListAbove) {
|
|
117
|
+
nodeStyles.top = window.scrollY + elementRectTop
|
|
118
|
+
- this.getOptionsListHeightContainer.nativeElement.offsetHeight
|
|
119
|
+
- this.SPACE_BETWEEN_BUTTON_AND_OPTIONS
|
|
120
|
+
+ 'px';
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
nodeStyles.top = window.scrollY + elementRectBottom + this.SPACE_BETWEEN_BUTTON_AND_OPTIONS + 'px';
|
|
124
|
+
}
|
|
125
|
+
rootElement.appendChild(this.viewContainerRef.createEmbeddedView(this.backdrop).rootNodes[0]);
|
|
126
|
+
rootElement.appendChild(embeddedViewRef.rootNodes[0]);
|
|
127
|
+
}
|
|
128
|
+
close() {
|
|
129
|
+
this.isOpened = false;
|
|
130
|
+
this.clearViewContainerRef();
|
|
131
|
+
}
|
|
132
|
+
clearViewContainerRef() {
|
|
133
|
+
this.viewContainerRef.clear();
|
|
134
|
+
}
|
|
135
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
136
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CuiSelectComponent, selector: "cui-select[options]", inputs: { options: "options", defaultOptionText: "defaultOptionText" }, host: { listeners: { "window:resize": "onWindowResize()" }, properties: { "style.--c-gap": "this.gap" } }, providers: [
|
|
137
|
+
CUI_TEXT_FILED_CONTROLLER_PROVIDER,
|
|
138
|
+
cuiProvide(NG_VALUE_ACCESSOR, CuiSelectComponent, true),
|
|
139
|
+
CuiDestroyService
|
|
140
|
+
], viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }, { propertyName: "getOptionsListHeightContainer", first: true, predicate: ["getOptionsListHeightContainer"], descendants: true }, { propertyName: "backdrop", first: true, predicate: ["backdrop"], descendants: true }, { propertyName: "optionsWrapper", first: true, predicate: ["optionsWrapper"], descendants: true }], hostDirectives: [{ directive: i1.CuiClickOutsideDirective }], ngImport: i0, template: "<button\r\n #button\r\n type=\"button\"\r\n [attr.id]=\"id\"\r\n [attr.data-size]=\"size\"\r\n [disabled]=\"isDisabled\"\r\n class=\"c-button\"\r\n [class.c-button_active]=\"isOpened\"\r\n [class.c-button_with-error]=\"isError\"\r\n (click)=\"onSwitch()\"\r\n>\r\n <ng-container *ngIf=\"selectedOption; else placeholderTemplate\">\r\n {{ selectedOption.label }}\r\n </ng-container>\r\n <ng-template #placeholderTemplate>\r\n <span class=\"c-placeholder\">{{ placeholder }}</span>\r\n </ng-template>\r\n <cui-svg\r\n icon=\"cuiIconChevronDown\"\r\n color=\"var(--cui-base-500)\"\r\n />\r\n</button>\r\n<ng-template #backdrop>\r\n <div class=\"c-backdrop\"></div>\r\n</ng-template>\r\n<ng-template #optionsWrapper>\r\n <div\r\n cuiFocusTrap\r\n class=\"c-options__wrapper\"\r\n [class.c-options__wrapper_top]=\"isOptionsListAbove\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"optionsList\"/>\r\n </div>\r\n</ng-template>\r\n<div\r\n #getOptionsListHeightContainer\r\n class=\"c-get-options-list-height-container\"\r\n>\r\n <ng-container *ngTemplateOutlet=\"optionsList\"/>\r\n</div>\r\n<ng-template #optionsList>\r\n <ul\r\n class=\"c-options\"\r\n [class.c-options_top]=\"isOptionsListAbove\"\r\n >\r\n <ng-container *ngIf=\"options.length; else empty\">\r\n <li *ngFor=\"let option of options; trackBy: trackByFn\">\r\n <button\r\n type=\"button\"\r\n class=\"c-option-button\"\r\n [class.c-option-button_selected]=\"selectedOption === option\"\r\n [disabled]=\"option.isDisabled\"\r\n (click)=\"onSelect($event, option)\"\r\n >\r\n <span>{{ option.label }}</span>\r\n <cui-svg\r\n *ngIf=\"selectedOption === option\"\r\n icon=\"cuiIconCheckSm\"\r\n color=\"var(--cui-info)\"\r\n class=\"c-option-button__icon\"\r\n />\r\n </button>\r\n </li>\r\n </ng-container>\r\n <ng-template #empty>\r\n <li *ngIf=\"defaultOptionText\">\r\n <button\r\n type=\"button\"\r\n class=\"c-option-button\"\r\n (click)=\"onClose()\"\r\n >\r\n {{ defaultOptionText }}\r\n </button>\r\n </li>\r\n </ng-template>\r\n </ul>\r\n</ng-template>\r\n", styles: [":host{display:block;font-family:var(--cui-main-font);position:relative}.c-button{border:0;flex-shrink:0;outline:none;appearance:none;color:inherit;font:inherit;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;padding:0 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;border:1px solid var(--cui-base-200);border-radius:8px;cursor:pointer;background:var(--cui-input);color:var(--cui-base-900);font-family:var(--cui-main-font);text-align:start}.c-button:hover{border-color:var(--cui-base-300)}.c-button_active.c-button_active,.c-button:focus{box-shadow:0 0 0 2px var(--cui-focus);border-color:var(--cui-info)}.c-button:disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}.c-button[data-size=sm]{padding-top:7px;padding-bottom:7px}.c-button[data-size=md]{padding-top:8px;padding-bottom:8px}.c-button_with-error{border-color:var(--cui-danger)}.c-button_with-error:focus{box-shadow:0 0 0 2px #d92d2040;border-color:var(--cui-danger)}.c-placeholder{color:var(--cui-base-400)}.c-backdrop{position:fixed;inset:0}.c-options__wrapper{position:absolute;font-family:var(--cui-main-font);z-index:1}.c-get-options-list-height-container{position:fixed;visibility:hidden}.c-options{padding:7px 0;margin:0;list-style:none;font-weight:400;font-size:14px;line-height:20px;box-shadow:0 1px 4px #0000000a,0 1px 4px #0000000a;overflow:auto;max-height:180px;border:1px solid var(--cui-base-200);border-radius:8px;background:var(--cui-base-0);color:var(--cui-base-900)}.c-option-button{padding:8px 11px 8px 0;border:0;flex-shrink:0;outline:none;cursor:pointer;appearance:none;color:inherit;font:inherit;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;padding:8px 11px;width:100%;display:flex;align-items:center;gap:12px;text-align:start}.c-option-button:active{background:var(--cui-base-50)}@media (hover: hover){.c-option-button:hover{background:var(--cui-base-50)}}.c-option-button_selected{background:var(--cui-base-50)}.c-option-button:disabled{background:unset;opacity:50%}.c-option-button__icon{margin-left:auto}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }, { kind: "directive", type: i1.CuiFocusTrapDirective, selector: "[cuiFocusTrap]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
141
|
+
}
|
|
142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSelectComponent, decorators: [{
|
|
143
|
+
type: Component,
|
|
144
|
+
args: [{ selector: 'cui-select[options]', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
145
|
+
CUI_TEXT_FILED_CONTROLLER_PROVIDER,
|
|
146
|
+
cuiProvide(NG_VALUE_ACCESSOR, CuiSelectComponent, true),
|
|
147
|
+
CuiDestroyService
|
|
148
|
+
], hostDirectives: [CuiClickOutsideDirective], template: "<button\r\n #button\r\n type=\"button\"\r\n [attr.id]=\"id\"\r\n [attr.data-size]=\"size\"\r\n [disabled]=\"isDisabled\"\r\n class=\"c-button\"\r\n [class.c-button_active]=\"isOpened\"\r\n [class.c-button_with-error]=\"isError\"\r\n (click)=\"onSwitch()\"\r\n>\r\n <ng-container *ngIf=\"selectedOption; else placeholderTemplate\">\r\n {{ selectedOption.label }}\r\n </ng-container>\r\n <ng-template #placeholderTemplate>\r\n <span class=\"c-placeholder\">{{ placeholder }}</span>\r\n </ng-template>\r\n <cui-svg\r\n icon=\"cuiIconChevronDown\"\r\n color=\"var(--cui-base-500)\"\r\n />\r\n</button>\r\n<ng-template #backdrop>\r\n <div class=\"c-backdrop\"></div>\r\n</ng-template>\r\n<ng-template #optionsWrapper>\r\n <div\r\n cuiFocusTrap\r\n class=\"c-options__wrapper\"\r\n [class.c-options__wrapper_top]=\"isOptionsListAbove\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"optionsList\"/>\r\n </div>\r\n</ng-template>\r\n<div\r\n #getOptionsListHeightContainer\r\n class=\"c-get-options-list-height-container\"\r\n>\r\n <ng-container *ngTemplateOutlet=\"optionsList\"/>\r\n</div>\r\n<ng-template #optionsList>\r\n <ul\r\n class=\"c-options\"\r\n [class.c-options_top]=\"isOptionsListAbove\"\r\n >\r\n <ng-container *ngIf=\"options.length; else empty\">\r\n <li *ngFor=\"let option of options; trackBy: trackByFn\">\r\n <button\r\n type=\"button\"\r\n class=\"c-option-button\"\r\n [class.c-option-button_selected]=\"selectedOption === option\"\r\n [disabled]=\"option.isDisabled\"\r\n (click)=\"onSelect($event, option)\"\r\n >\r\n <span>{{ option.label }}</span>\r\n <cui-svg\r\n *ngIf=\"selectedOption === option\"\r\n icon=\"cuiIconCheckSm\"\r\n color=\"var(--cui-info)\"\r\n class=\"c-option-button__icon\"\r\n />\r\n </button>\r\n </li>\r\n </ng-container>\r\n <ng-template #empty>\r\n <li *ngIf=\"defaultOptionText\">\r\n <button\r\n type=\"button\"\r\n class=\"c-option-button\"\r\n (click)=\"onClose()\"\r\n >\r\n {{ defaultOptionText }}\r\n </button>\r\n </li>\r\n </ng-template>\r\n </ul>\r\n</ng-template>\r\n", styles: [":host{display:block;font-family:var(--cui-main-font);position:relative}.c-button{border:0;flex-shrink:0;outline:none;appearance:none;color:inherit;font:inherit;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;padding:0 13px;font-weight:400;font-size:14px;line-height:20px;display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;border:1px solid var(--cui-base-200);border-radius:8px;cursor:pointer;background:var(--cui-input);color:var(--cui-base-900);font-family:var(--cui-main-font);text-align:start}.c-button:hover{border-color:var(--cui-base-300)}.c-button_active.c-button_active,.c-button:focus{box-shadow:0 0 0 2px var(--cui-focus);border-color:var(--cui-info)}.c-button:disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}.c-button[data-size=sm]{padding-top:7px;padding-bottom:7px}.c-button[data-size=md]{padding-top:8px;padding-bottom:8px}.c-button_with-error{border-color:var(--cui-danger)}.c-button_with-error:focus{box-shadow:0 0 0 2px #d92d2040;border-color:var(--cui-danger)}.c-placeholder{color:var(--cui-base-400)}.c-backdrop{position:fixed;inset:0}.c-options__wrapper{position:absolute;font-family:var(--cui-main-font);z-index:1}.c-get-options-list-height-container{position:fixed;visibility:hidden}.c-options{padding:7px 0;margin:0;list-style:none;font-weight:400;font-size:14px;line-height:20px;box-shadow:0 1px 4px #0000000a,0 1px 4px #0000000a;overflow:auto;max-height:180px;border:1px solid var(--cui-base-200);border-radius:8px;background:var(--cui-base-0);color:var(--cui-base-900)}.c-option-button{padding:8px 11px 8px 0;border:0;flex-shrink:0;outline:none;cursor:pointer;appearance:none;color:inherit;font:inherit;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;padding:8px 11px;width:100%;display:flex;align-items:center;gap:12px;text-align:start}.c-option-button:active{background:var(--cui-base-50)}@media (hover: hover){.c-option-button:hover{background:var(--cui-base-50)}}.c-option-button_selected{background:var(--cui-base-50)}.c-option-button:disabled{background:unset;opacity:50%}.c-option-button__icon{margin-left:auto}\n"] }]
|
|
149
|
+
}], propDecorators: { options: [{
|
|
150
|
+
type: Input
|
|
151
|
+
}], defaultOptionText: [{
|
|
152
|
+
type: Input
|
|
153
|
+
}], button: [{
|
|
154
|
+
type: ViewChild,
|
|
155
|
+
args: ['button']
|
|
156
|
+
}], getOptionsListHeightContainer: [{
|
|
157
|
+
type: ViewChild,
|
|
158
|
+
args: ['getOptionsListHeightContainer']
|
|
159
|
+
}], backdrop: [{
|
|
160
|
+
type: ViewChild,
|
|
161
|
+
args: ['backdrop']
|
|
162
|
+
}], optionsWrapper: [{
|
|
163
|
+
type: ViewChild,
|
|
164
|
+
args: ['optionsWrapper']
|
|
165
|
+
}], gap: [{
|
|
166
|
+
type: HostBinding,
|
|
167
|
+
args: ['style.--c-gap']
|
|
168
|
+
}], onWindowResize: [{
|
|
169
|
+
type: HostListener,
|
|
170
|
+
args: ['window:resize']
|
|
171
|
+
}] } });
|
|
172
172
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4u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gICAgPGJ1dHRvblxyXG4gICAgICAgICAgdHlwZT1cImJ1dHRvblwiXHJcbiAgICAgICAgICBjbGFzcz1cImMtb3B0aW9uLWJ1dHRvblwiXHJcbiAgICAgICAgICBbY2xhc3MuYy1vcHRpb24tYnV0dG9uX3NlbGVjdGVkXT1cInNlbGVjdGVkT3B0aW9uID09PSBvcHRpb25cIlxyXG4gICAgICAgICAgW2Rpc2FibGVkXT1cIm9wdGlvbi5pc0Rpc2FibGVkXCJcclxuICAgICAgICAgIChjbGljayk9XCJvblNlbGVjdCgkZXZlbnQsIG9wdGlvbilcIlxyXG4gICAgICAgID5cclxuICAgICAgICAgIDxzcGFuPnt7IG9wdGlvbi5sYWJlbCB9fTwvc3Bhbj5cclxuICAgICAgICAgIDxjdWktc3ZnXHJcbiAgICAgICAgICAgICpuZ0lmPVwic2VsZWN0ZWRPcHRpb24gPT09IG9wdGlvblwiXHJcbiAgICAgICAgICAgIGljb249XCJjdWlJY29uQ2hlY2tTbVwiXHJcbiAgICAgICAgICAgIGNvbG9yPVwidmFyKC0tY3VpLWluZm8pXCJcclxuICAgICAgICAgICAgY2xhc3M9XCJjLW9wdGlvbi1idXR0b25fX2ljb25cIlxyXG4gICAgICAgICAgLz5cclxuICAgICAgICA8L2J1dHRvbj5cclxuICAgICAgPC9saT5cclxuICAgIDwvbmctY29udGFpbmVyPlxyXG4gICAgPG5nLXRlbXBsYXRlICNlbXB0eT5cclxuICAgICAgPGxpICpuZ0lmPVwiZGVmYXVsdE9wdGlvblRleHRcIj5cclxuICAgICAgICA8YnV0dG9uXHJcbiAgICAgICAgICB0eXBlPVwiYnV0dG9uXCJcclxuICAgICAgICAgIGNsYXNzPVwiYy1vcHRpb24tYnV0dG9uXCJcclxuICAgICAgICAgIChjbGljayk9XCJvbkNsb3NlKClcIlxyXG4gICAgICAgID5cclxuICAgICAgICAgIHt7IGRlZmF1bHRPcHRpb25UZXh0IH19XHJcbiAgICAgICAgPC9idXR0b24+XHJcbiAgICAgIDwvbGk+XHJcbiAgICA8L25nLXRlbXBsYXRlPlxyXG4gIDwvdWw+XHJcbjwvbmctdGVtcGxhdGU+XHJcbiJdfQ==
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { CuiSelectComponent } from './select.component';
|
|
4
|
-
import { CuiSvgModule } from '../svg';
|
|
5
|
-
import { CuiTextFieldControllerModule } from '../../directives';
|
|
6
|
-
import { CuiFocusTrapDirective } from '@cuby-ui/cdk';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
export class CuiSelectModule {
|
|
9
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
10
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: CuiSelectModule, declarations: [CuiSelectComponent], imports: [CommonModule,
|
|
11
|
-
CuiSvgModule,
|
|
12
|
-
CuiFocusTrapDirective], exports: [CuiSelectComponent,
|
|
13
|
-
CuiTextFieldControllerModule] }); }
|
|
14
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSelectModule, imports: [CommonModule,
|
|
15
|
-
CuiSvgModule, CuiTextFieldControllerModule] }); }
|
|
16
|
-
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSelectModule, decorators: [{
|
|
18
|
-
type: NgModule,
|
|
19
|
-
args: [{
|
|
20
|
-
imports: [
|
|
21
|
-
CommonModule,
|
|
22
|
-
CuiSvgModule,
|
|
23
|
-
CuiFocusTrapDirective
|
|
24
|
-
],
|
|
25
|
-
declarations: [CuiSelectComponent],
|
|
26
|
-
exports: [
|
|
27
|
-
CuiSelectComponent,
|
|
28
|
-
CuiTextFieldControllerModule
|
|
29
|
-
]
|
|
30
|
-
}]
|
|
31
|
-
}] });
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { CuiSelectComponent } from './select.component';
|
|
4
|
+
import { CuiSvgModule } from '../svg';
|
|
5
|
+
import { CuiTextFieldControllerModule } from '../../directives';
|
|
6
|
+
import { CuiFocusTrapDirective } from '@cuby-ui/cdk';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export class CuiSelectModule {
|
|
9
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
10
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: CuiSelectModule, declarations: [CuiSelectComponent], imports: [CommonModule,
|
|
11
|
+
CuiSvgModule,
|
|
12
|
+
CuiFocusTrapDirective], exports: [CuiSelectComponent,
|
|
13
|
+
CuiTextFieldControllerModule] }); }
|
|
14
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSelectModule, imports: [CommonModule,
|
|
15
|
+
CuiSvgModule, CuiTextFieldControllerModule] }); }
|
|
16
|
+
}
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSelectModule, decorators: [{
|
|
18
|
+
type: NgModule,
|
|
19
|
+
args: [{
|
|
20
|
+
imports: [
|
|
21
|
+
CommonModule,
|
|
22
|
+
CuiSvgModule,
|
|
23
|
+
CuiFocusTrapDirective
|
|
24
|
+
],
|
|
25
|
+
declarations: [CuiSelectComponent],
|
|
26
|
+
exports: [
|
|
27
|
+
CuiSelectComponent,
|
|
28
|
+
CuiTextFieldControllerModule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d0JBQ2xCLDRCQUE0QjtxQkFDN0I7aUJBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBOZ01vZHVsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xyXG5pbXBvcnQgeyBDb21tb25Nb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb21tb24nO1xyXG5cclxuaW1wb3J0IHsgQ3VpU2VsZWN0Q29tcG9uZW50IH0gZnJvbSAnLi9zZWxlY3QuY29tcG9uZW50JztcclxuaW1wb3J0IHsgQ3VpU3ZnTW9kdWxlIH0gZnJvbSAnLi4vc3ZnJztcclxuaW1wb3J0IHsgQ3VpVGV4dEZpZWxkQ29udHJvbGxlck1vZHVsZSB9IGZyb20gJy4uLy4uL2RpcmVjdGl2ZXMnO1xyXG5pbXBvcnQgeyBDdWlGb2N1c1RyYXBEaXJlY3RpdmUgfSBmcm9tICdAY3VieS11aS9jZGsnO1xyXG5cclxuQE5nTW9kdWxlKHtcclxuICBpbXBvcnRzOiBbXHJcbiAgICBDb21tb25Nb2R1bGUsXHJcbiAgICBDdWlTdmdNb2R1bGUsXHJcbiAgICBDdWlGb2N1c1RyYXBEaXJlY3RpdmVcclxuICBdLFxyXG4gIGRlY2xhcmF0aW9uczogW0N1aVNlbGVjdENvbXBvbmVudF0sXHJcbiAgZXhwb3J0czogW1xyXG4gICAgQ3VpU2VsZWN0Q29tcG9uZW50LFxyXG4gICAgQ3VpVGV4dEZpZWxkQ29udHJvbGxlck1vZHVsZVxyXG4gIF1cclxufSlcclxuZXhwb3J0IGNsYXNzIEN1aVNlbGVjdE1vZHVsZSB7XHJcbn1cclxuIl19
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './svg.component';
|
|
2
|
-
export * from './svg.module';
|
|
1
|
+
export * from './svg.component';
|
|
2
|
+
export * from './svg.module';
|
|
3
3
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb3JlL2NvbXBvbmVudHMvc3ZnL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3N2Zy5jb21wb25lbnQnO1xyXG5leHBvcnQgKiBmcm9tICcuL3N2Zy5tb2R1bGUnO1xyXG4iXX0=
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, HostBinding, inject, Input } from '@angular/core';
|
|
2
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
3
|
-
import { CUI_ICONS, cuiIsIcon } from '@cuby-ui/icons';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export class CuiSvgComponent {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.domSanitizer = inject(DomSanitizer);
|
|
8
|
-
}
|
|
9
|
-
set icon(icon) {
|
|
10
|
-
// TODO: В данном случае подключаются все иконки (вероятно, можно как-то оптимизировано их подключать)
|
|
11
|
-
this.safeSvgContent = this.domSanitizer.bypassSecurityTrustHtml(cuiIsIcon(icon)
|
|
12
|
-
? CUI_ICONS[icon]
|
|
13
|
-
: icon);
|
|
14
|
-
}
|
|
15
|
-
get isWithStrokeWidth() {
|
|
16
|
-
return !!this.strokeWidth;
|
|
17
|
-
}
|
|
18
|
-
get isWithColor() {
|
|
19
|
-
return !!this.color;
|
|
20
|
-
}
|
|
21
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSvgComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
22
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: { width: "width", height: "height", strokeWidth: "strokeWidth", color: "color", icon: "icon" }, host: { properties: { "style.--stroke-width": "this.strokeWidth", "style.--color": "this.color", "class._with-stroke-width": "this.isWithStrokeWidth", "class._with-color": "this.isWithColor" } }, ngImport: i0, template: "<span\r\n [innerHTML]=\"safeSvgContent\"\r\n [style.width.px]=\"width\"\r\n [style.height.px]=\"height\"\r\n></span>", styles: [":host{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;vertical-align:middle;line-height:0}:host ::ng-deep svg{width:100%;height:100%}:host._with-stroke-width ::ng-deep [stroke-width]{stroke-width:var(--stroke-width)}:host._with-color ::ng-deep [stroke]{stroke:var(--color)}:host._with-color ::ng-deep [fill]:not([fill=none]){fill:var(--color)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
23
|
-
}
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSvgComponent, decorators: [{
|
|
25
|
-
type: Component,
|
|
26
|
-
args: [{ selector: 'cui-svg[icon]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\r\n [innerHTML]=\"safeSvgContent\"\r\n [style.width.px]=\"width\"\r\n [style.height.px]=\"height\"\r\n></span>", styles: [":host{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;vertical-align:middle;line-height:0}:host ::ng-deep svg{width:100%;height:100%}:host._with-stroke-width ::ng-deep [stroke-width]{stroke-width:var(--stroke-width)}:host._with-color ::ng-deep [stroke]{stroke:var(--color)}:host._with-color ::ng-deep [fill]:not([fill=none]){fill:var(--color)}\n"] }]
|
|
27
|
-
}], propDecorators: { width: [{
|
|
28
|
-
type: Input
|
|
29
|
-
}], height: [{
|
|
30
|
-
type: Input
|
|
31
|
-
}], strokeWidth: [{
|
|
32
|
-
type: Input
|
|
33
|
-
}, {
|
|
34
|
-
type: HostBinding,
|
|
35
|
-
args: ['style.--stroke-width']
|
|
36
|
-
}], color: [{
|
|
37
|
-
type: Input
|
|
38
|
-
}, {
|
|
39
|
-
type: HostBinding,
|
|
40
|
-
args: ['style.--color']
|
|
41
|
-
}], icon: [{
|
|
42
|
-
type: Input
|
|
43
|
-
}], isWithStrokeWidth: [{
|
|
44
|
-
type: HostBinding,
|
|
45
|
-
args: ['class._with-stroke-width']
|
|
46
|
-
}], isWithColor: [{
|
|
47
|
-
type: HostBinding,
|
|
48
|
-
args: ['class._with-color']
|
|
49
|
-
}] } });
|
|
1
|
+
import { ChangeDetectionStrategy, Component, HostBinding, inject, Input } from '@angular/core';
|
|
2
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
3
|
+
import { CUI_ICONS, cuiIsIcon } from '@cuby-ui/icons';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export class CuiSvgComponent {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.domSanitizer = inject(DomSanitizer);
|
|
8
|
+
}
|
|
9
|
+
set icon(icon) {
|
|
10
|
+
// TODO: В данном случае подключаются все иконки (вероятно, можно как-то оптимизировано их подключать)
|
|
11
|
+
this.safeSvgContent = this.domSanitizer.bypassSecurityTrustHtml(cuiIsIcon(icon)
|
|
12
|
+
? CUI_ICONS[icon]
|
|
13
|
+
: icon);
|
|
14
|
+
}
|
|
15
|
+
get isWithStrokeWidth() {
|
|
16
|
+
return !!this.strokeWidth;
|
|
17
|
+
}
|
|
18
|
+
get isWithColor() {
|
|
19
|
+
return !!this.color;
|
|
20
|
+
}
|
|
21
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSvgComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
22
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: { width: "width", height: "height", strokeWidth: "strokeWidth", color: "color", icon: "icon" }, host: { properties: { "style.--stroke-width": "this.strokeWidth", "style.--color": "this.color", "class._with-stroke-width": "this.isWithStrokeWidth", "class._with-color": "this.isWithColor" } }, ngImport: i0, template: "<span\r\n [innerHTML]=\"safeSvgContent\"\r\n [style.width.px]=\"width\"\r\n [style.height.px]=\"height\"\r\n></span>", styles: [":host{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;vertical-align:middle;line-height:0}:host ::ng-deep svg{width:100%;height:100%}:host._with-stroke-width ::ng-deep [stroke-width]{stroke-width:var(--stroke-width)}:host._with-color ::ng-deep [stroke]{stroke:var(--color)}:host._with-color ::ng-deep [fill]:not([fill=none]){fill:var(--color)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
23
|
+
}
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CuiSvgComponent, decorators: [{
|
|
25
|
+
type: Component,
|
|
26
|
+
args: [{ selector: 'cui-svg[icon]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\r\n [innerHTML]=\"safeSvgContent\"\r\n [style.width.px]=\"width\"\r\n [style.height.px]=\"height\"\r\n></span>", styles: [":host{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;vertical-align:middle;line-height:0}:host ::ng-deep svg{width:100%;height:100%}:host._with-stroke-width ::ng-deep [stroke-width]{stroke-width:var(--stroke-width)}:host._with-color ::ng-deep [stroke]{stroke:var(--color)}:host._with-color ::ng-deep [fill]:not([fill=none]){fill:var(--color)}\n"] }]
|
|
27
|
+
}], propDecorators: { width: [{
|
|
28
|
+
type: Input
|
|
29
|
+
}], height: [{
|
|
30
|
+
type: Input
|
|
31
|
+
}], strokeWidth: [{
|
|
32
|
+
type: Input
|
|
33
|
+
}, {
|
|
34
|
+
type: HostBinding,
|
|
35
|
+
args: ['style.--stroke-width']
|
|
36
|
+
}], color: [{
|
|
37
|
+
type: Input
|
|
38
|
+
}, {
|
|
39
|
+
type: HostBinding,
|
|
40
|
+
args: ['style.--color']
|
|
41
|
+
}], icon: [{
|
|
42
|
+
type: Input
|
|
43
|
+
}], isWithStrokeWidth: [{
|
|
44
|
+
type: HostBinding,
|
|
45
|
+
args: ['class._with-stroke-width']
|
|
46
|
+
}], isWithColor: [{
|
|
47
|
+
type: HostBinding,
|
|
48
|
+
args: ['class._with-color']
|
|
49
|
+
}] } });
|
|
50
50
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3ZnLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NvcmUvY29tcG9uZW50cy9zdmcvc3ZnLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NvcmUvY29tcG9uZW50cy9zdmcvc3ZnLnRlbXBsYXRlLmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixTQUFTLEVBQ1QsV0FBVyxFQUNYLE1BQU0sRUFDTixLQUFLLEVBQ04sTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFFLFlBQVksRUFBWSxNQUFNLDJCQUEyQixDQUFDO0FBR25FLE9BQU8sRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7O0FBUXRELE1BQU0sT0FBTyxlQUFlO0lBTjVCO1FBT21CLGlCQUFZLEdBQUcsTUFBTSxDQUFDLFlBQVksQ0FBQyxDQUFDO0tBbUN0RDtJQWpCQyxJQUNXLElBQUksQ0FBQyxJQUFzQjtRQUNwQyxzR0FBc0c7UUFDdEcsSUFBSSxDQUFDLGNBQWMsR0FBRyxJQUFJLENBQUMsWUFBWSxDQUFDLHVCQUF1QixDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUM7WUFDN0UsQ0FBQyxDQUFDLFNBQVMsQ0FBQyxJQUFJL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