@updevs/components 1.0.0-alpha.1 → 1.0.0-alpha.3
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/README.md +5 -22
- package/assets/styles/_bootstrap-components.scss +38 -0
- package/assets/styles/_bootstrap-config.scss +7 -0
- package/assets/styles/_bootstrap-override.scss +78 -0
- package/assets/styles/_config.scss +9 -0
- package/assets/styles/_core.scss +71 -0
- package/assets/styles/_mixins.scss +2 -0
- package/assets/styles/_updevs.scss +9 -0
- package/assets/styles/_utilities.scss +98 -0
- package/assets/styles/_variables-dark.scss +17 -0
- package/assets/styles/_variables.scss +934 -0
- package/assets/styles/fonts/_webfonts.scss +15 -0
- package/assets/styles/layout/_animations.scss +62 -0
- package/assets/styles/layout/_core.scss +61 -0
- package/assets/styles/layout/_dark.scss +72 -0
- package/assets/styles/layout/_footer.scss +12 -0
- package/assets/styles/layout/_navbar.scss +380 -0
- package/assets/styles/layout/_page.scss +169 -0
- package/assets/styles/layout/_root.scss +72 -0
- package/assets/styles/mixins/_functions.scss +43 -0
- package/assets/styles/mixins/_mixins.scss +68 -0
- package/assets/styles/ui/_accordion.scss +24 -0
- package/assets/styles/ui/_alerts.scss +59 -0
- package/assets/styles/ui/_avatars.scss +118 -0
- package/assets/styles/ui/_badges.scss +79 -0
- package/assets/styles/ui/_breadcrumbs.scss +50 -0
- package/assets/styles/ui/_button-group.scss +16 -0
- package/assets/styles/ui/_buttons.scss +265 -0
- package/assets/styles/ui/_calendars.scss +104 -0
- package/assets/styles/ui/_cards.scss +586 -0
- package/assets/styles/ui/_carousel.scss +68 -0
- package/assets/styles/ui/_charts.scss +61 -0
- package/assets/styles/ui/_chips.scss +0 -0
- package/assets/styles/ui/_close.scss +7 -0
- package/assets/styles/ui/_datagrid.scss +17 -0
- package/assets/styles/ui/_dropdowns.scss +117 -0
- package/assets/styles/ui/_empty.scss +65 -0
- package/assets/styles/ui/_flags.scss +31 -0
- package/assets/styles/ui/_forms.scss +224 -0
- package/assets/styles/ui/_grid.scss +115 -0
- package/assets/styles/ui/_icons.scss +72 -0
- package/assets/styles/ui/_images.scss +15 -0
- package/assets/styles/ui/_legend.scss +12 -0
- package/assets/styles/ui/_lists.scss +127 -0
- package/assets/styles/ui/_loaders.scss +72 -0
- package/assets/styles/ui/_login.scss +3 -0
- package/assets/styles/ui/_markdown.scss +42 -0
- package/assets/styles/ui/_modals.scss +67 -0
- package/assets/styles/ui/_nav.scss +92 -0
- package/assets/styles/ui/_offcanvas.scss +17 -0
- package/assets/styles/ui/_pagination.scss +56 -0
- package/assets/styles/ui/_payments.scss +28 -0
- package/assets/styles/ui/_placeholder.scss +9 -0
- package/assets/styles/ui/_popovers.scss +2 -0
- package/assets/styles/ui/_progress.scss +107 -0
- package/assets/styles/ui/_ribbons.scss +156 -0
- package/assets/styles/ui/_stars.scss +13 -0
- package/assets/styles/ui/_status.scss +163 -0
- package/assets/styles/ui/_steps.scss +152 -0
- package/assets/styles/ui/_switch-icon.scss +211 -0
- package/assets/styles/ui/_tables.scss +150 -0
- package/assets/styles/ui/_tags.scss +57 -0
- package/assets/styles/ui/_timeline.scss +61 -0
- package/assets/styles/ui/_toasts.scss +19 -0
- package/assets/styles/ui/_toolbar.scss +10 -0
- package/assets/styles/ui/_tracking.scss +29 -0
- package/assets/styles/ui/_type.scss +169 -0
- package/assets/styles/ui/forms/_form-check.scss +91 -0
- package/assets/styles/ui/forms/_form-colorinput.scss +54 -0
- package/assets/styles/ui/forms/_form-custom.scss +28 -0
- package/assets/styles/ui/forms/_form-icon.scss +35 -0
- package/assets/styles/ui/forms/_form-imagecheck.scss +104 -0
- package/assets/styles/ui/forms/_form-selectgroup.scss +153 -0
- package/assets/styles/ui/forms/_validation.scss +13 -0
- package/assets/styles/ui/typo/_hr.scss +74 -0
- package/assets/styles/utils/_background.scss +15 -0
- package/assets/styles/utils/_colors.scss +40 -0
- package/assets/styles/utils/_opacity.scss +7 -0
- package/assets/styles/utils/_scroll.scss +47 -0
- package/assets/styles/utils/_shadow.scss +17 -0
- package/assets/styles/utils/_sizing.scss +10 -0
- package/assets/styles/utils/_text.scss +15 -0
- package/button/ng-package.json +7 -0
- package/button/src/button.component.html +8 -0
- package/button/src/button.component.scss +5 -0
- package/button/src/button.component.spec.ts +23 -0
- package/button/src/button.component.ts +154 -0
- package/button/src/index.ts +1 -0
- package/button/src/public-api.ts +2 -0
- package/button/src/upd-button.module.ts +17 -0
- package/card/ng-package.json +7 -0
- package/card/src/card.component.html +105 -0
- package/card/src/card.component.scss +47 -0
- package/card/src/card.component.spec.ts +23 -0
- package/card/src/card.component.ts +112 -0
- package/card/src/directives/card-actions.directive.spec.ts +8 -0
- package/card/src/directives/card-actions.directive.ts +11 -0
- package/card/src/directives/card-footer.directive.spec.ts +8 -0
- package/card/src/directives/card-footer.directive.ts +11 -0
- package/card/src/directives/card-header.directive.spec.ts +8 -0
- package/card/src/directives/card-header.directive.ts +11 -0
- package/card/src/directives/card-image.directive.spec.ts +8 -0
- package/card/src/directives/card-image.directive.ts +11 -0
- package/card/src/directives/public-api.ts +4 -0
- package/card/src/index.ts +1 -0
- package/card/src/public-api.ts +3 -0
- package/card/src/types/card-state.type.ts +1 -0
- package/card/src/types/card-style.type.ts +1 -0
- package/card/src/types/hover-effect.type.ts +1 -0
- package/card/src/types/public-api.ts +5 -0
- package/card/src/types/ribbon-style.type.ts +1 -0
- package/card/src/types/status-position.type.ts +1 -0
- package/card/src/upd-card.module.ts +32 -0
- package/dropdown/ng-package.json +7 -0
- package/dropdown/src/dropdown.component.html +32 -0
- package/dropdown/src/dropdown.component.scss +19 -0
- package/dropdown/src/dropdown.component.spec.ts +23 -0
- package/dropdown/src/dropdown.component.ts +182 -0
- package/dropdown/src/index.ts +1 -0
- package/dropdown/src/models/dropdown-item.ts +22 -0
- package/dropdown/src/models/dropdown-item.type.ts +1 -0
- package/dropdown/src/models/public-api.ts +2 -0
- package/dropdown/src/public-api.ts +3 -0
- package/dropdown/src/upd-dropdown.module.ts +25 -0
- package/form/ng-package.json +7 -0
- package/form/src/form.module.ts +10 -0
- package/form/src/index.ts +1 -0
- package/form/src/public-api.ts +1 -0
- package/form-controls/checkbox/ng-package.json +7 -0
- package/form-controls/checkbox/src/checkbox.component.html +7 -0
- package/form-controls/checkbox/src/checkbox.component.scss +0 -0
- package/form-controls/checkbox/src/checkbox.component.spec.ts +23 -0
- package/form-controls/checkbox/src/checkbox.component.ts +48 -0
- package/form-controls/checkbox/src/index.ts +1 -0
- package/form-controls/checkbox/src/public-api.ts +3 -0
- package/form-controls/checkbox/src/upd-checkbox.module.ts +19 -0
- package/form-controls/input/ng-package.json +7 -0
- package/form-controls/input/src/directives/input-append.directive.spec.ts +8 -0
- package/form-controls/input/src/directives/input-append.directive.ts +11 -0
- package/form-controls/input/src/directives/input-prepend.directive.spec.ts +8 -0
- package/form-controls/input/src/directives/input-prepend.directive.ts +11 -0
- package/form-controls/input/src/directives/public-api.ts +2 -0
- package/form-controls/input/src/index.ts +1 -0
- package/form-controls/input/src/input.component.html +82 -0
- package/form-controls/input/src/input.component.scss +13 -0
- package/form-controls/input/src/input.component.spec.ts +23 -0
- package/form-controls/input/src/input.component.ts +124 -0
- package/form-controls/input/src/public-api.ts +4 -0
- package/form-controls/input/src/types/input.type.ts +1 -0
- package/form-controls/input/src/types/loader-position.type.ts +1 -0
- package/form-controls/input/src/types/public-api.ts +2 -0
- package/form-controls/input/src/upd-input.module.ts +29 -0
- package/form-controls/radio/ng-package.json +7 -0
- package/form-controls/radio/src/index.ts +1 -0
- package/form-controls/radio/src/public-api.ts +2 -0
- package/form-controls/radio/src/radio.component.html +7 -0
- package/form-controls/radio/src/radio.component.scss +0 -0
- package/form-controls/radio/src/radio.component.spec.ts +23 -0
- package/form-controls/radio/src/radio.component.ts +47 -0
- package/form-controls/radio/src/upd-radio.module.ts +17 -0
- package/form-controls/select/ng-package.json +7 -0
- package/form-controls/select/src/components/multiple/select-multiple.component.html +41 -0
- package/form-controls/select/src/components/multiple/select-multiple.component.scss +6 -0
- package/form-controls/select/src/components/multiple/select-multiple.component.spec.ts +21 -0
- package/form-controls/select/src/components/multiple/select-multiple.component.ts +69 -0
- package/form-controls/select/src/components/shared.scss +40 -0
- package/form-controls/select/src/components/single/select.component.html +53 -0
- package/form-controls/select/src/components/single/select.component.scss +3 -0
- package/form-controls/select/src/components/single/select.component.spec.ts +23 -0
- package/form-controls/select/src/components/single/select.component.ts +58 -0
- package/form-controls/select/src/index.ts +1 -0
- package/form-controls/select/src/models/abstractions/base-select.component.ts +259 -0
- package/form-controls/select/src/models/public-api.ts +1 -0
- package/form-controls/select/src/models/select-item.ts +26 -0
- package/form-controls/select/src/public-api.ts +4 -0
- package/form-controls/select/src/upd-select.module.ts +32 -0
- package/form-controls/textarea/ng-package.json +7 -0
- package/form-controls/textarea/src/index.ts +1 -0
- package/form-controls/textarea/src/public-api.ts +2 -0
- package/form-controls/textarea/src/textarea.component.html +8 -0
- package/form-controls/textarea/src/textarea.component.scss +0 -0
- package/form-controls/textarea/src/textarea.component.spec.ts +23 -0
- package/form-controls/textarea/src/textarea.component.ts +47 -0
- package/form-controls/textarea/src/upd-textarea.module.ts +17 -0
- package/form-controls/time-picker/ng-package.json +7 -0
- package/form-controls/time-picker/src/assets/i18n/en.json +5 -0
- package/form-controls/time-picker/src/assets/i18n/pt.json +5 -0
- package/form-controls/time-picker/src/index.ts +1 -0
- package/form-controls/time-picker/src/public-api.ts +3 -0
- package/form-controls/time-picker/src/time-picker.component.html +17 -0
- package/form-controls/time-picker/src/time-picker.component.scss +10 -0
- package/form-controls/time-picker/src/time-picker.component.spec.ts +21 -0
- package/form-controls/time-picker/src/time-picker.component.ts +110 -0
- package/form-controls/time-picker/src/time-selector/time-selector.component.html +44 -0
- package/form-controls/time-picker/src/time-selector/time-selector.component.scss +47 -0
- package/form-controls/time-picker/src/time-selector/time-selector.component.spec.ts +21 -0
- package/form-controls/time-picker/src/time-selector/time-selector.component.ts +107 -0
- package/form-controls/time-picker/src/upd-time-picker.module.ts +39 -0
- package/layout/ng-package.json +7 -0
- package/layout/src/abstractions/base-page.component.ts +21 -0
- package/layout/src/abstractions/public-api.ts +1 -0
- package/layout/src/assets/i18n/en.json +5 -0
- package/layout/src/assets/i18n/pt.json +5 -0
- package/layout/src/index.ts +1 -0
- package/layout/src/layouts/blank-layout/blank-layout.component.html +1 -0
- package/layout/src/layouts/blank-layout/blank-layout.component.scss +0 -0
- package/layout/src/layouts/blank-layout/blank-layout.component.spec.ts +23 -0
- package/layout/src/layouts/blank-layout/blank-layout.component.ts +10 -0
- package/layout/src/layouts/blank-layout/blank-layout.module.ts +17 -0
- package/layout/src/layouts/public-api.ts +4 -0
- package/layout/src/layouts/vertical-sidebar-layout/vertical-sidebar-layout.component.html +14 -0
- package/layout/src/layouts/vertical-sidebar-layout/vertical-sidebar-layout.component.scss +0 -0
- package/layout/src/layouts/vertical-sidebar-layout/vertical-sidebar-layout.component.spec.ts +23 -0
- package/layout/src/layouts/vertical-sidebar-layout/vertical-sidebar-layout.component.ts +31 -0
- package/layout/src/layouts/vertical-sidebar-layout/vertical-sidebar-layout.module.ts +52 -0
- package/layout/src/models/public-api.ts +1 -0
- package/layout/src/models/upd-layout-config.model.ts +71 -0
- package/layout/src/models/upd-layout.config.ts +37 -0
- package/layout/src/pages/auth-flow/auth-flow-routing.module.ts +21 -0
- package/layout/src/pages/auth-flow/auth-flow.module.ts +29 -0
- package/layout/src/pages/auth-flow/logged-out/logged-out.component.html +1 -0
- package/layout/src/pages/auth-flow/logged-out/logged-out.component.scss +0 -0
- package/layout/src/pages/auth-flow/logged-out/logged-out.component.spec.ts +23 -0
- package/layout/src/pages/auth-flow/logged-out/logged-out.component.ts +10 -0
- package/layout/src/pages/auth-flow/login/login.component.html +96 -0
- package/layout/src/pages/auth-flow/login/login.component.scss +0 -0
- package/layout/src/pages/auth-flow/login/login.component.spec.ts +23 -0
- package/layout/src/pages/auth-flow/login/login.component.ts +26 -0
- package/layout/src/pages/auth-flow/oauth-callback/oauth-callback.component.html +1 -0
- package/layout/src/pages/auth-flow/oauth-callback/oauth-callback.component.scss +0 -0
- package/layout/src/pages/auth-flow/oauth-callback/oauth-callback.component.spec.ts +23 -0
- package/layout/src/pages/auth-flow/oauth-callback/oauth-callback.component.ts +10 -0
- package/layout/src/pages/auth-flow/public-api.ts +5 -0
- package/layout/src/pages/public-api.ts +1 -0
- package/layout/src/partials/footer/footer-copyright.directive.spec.ts +8 -0
- package/layout/src/partials/footer/footer-copyright.directive.ts +9 -0
- package/layout/src/partials/footer/footer.component.html +30 -0
- package/layout/src/partials/footer/footer.component.scss +0 -0
- package/{src/lib/components.component.spec.ts → layout/src/partials/footer/footer.component.spec.ts} +6 -6
- package/layout/src/partials/footer/footer.component.ts +73 -0
- package/layout/src/partials/footer/public-api.ts +2 -0
- package/layout/src/partials/header/header-style.type.ts +1 -0
- package/layout/src/partials/header/header.component.html +163 -0
- package/layout/src/partials/header/header.component.scss +0 -0
- package/layout/src/partials/header/header.component.spec.ts +23 -0
- package/layout/src/partials/header/header.component.ts +86 -0
- package/layout/src/partials/header/public-api.ts +2 -0
- package/layout/src/partials/page-header/page-header.component.html +19 -0
- package/layout/src/partials/page-header/page-header.component.scss +0 -0
- package/layout/src/partials/page-header/page-header.component.spec.ts +23 -0
- package/layout/src/partials/page-header/page-header.component.ts +11 -0
- package/layout/src/partials/page-header/public-api.ts +1 -0
- package/layout/src/partials/public-api.ts +4 -0
- package/layout/src/partials/sidebar/public-api.ts +1 -0
- package/layout/src/partials/sidebar/sidebar.component.html +62 -0
- package/layout/src/partials/sidebar/sidebar.component.scss +0 -0
- package/layout/src/partials/sidebar/sidebar.component.spec.ts +23 -0
- package/layout/src/partials/sidebar/sidebar.component.ts +161 -0
- package/layout/src/public-api.ts +7 -0
- package/layout/src/services/public-api.ts +1 -0
- package/{src/lib/components.service.spec.ts → layout/src/services/upd-layout-config.service.spec.ts} +4 -4
- package/layout/src/services/upd-layout-config.service.ts +20 -0
- package/layout/src/tools/layout.constants.ts +18 -0
- package/layout/src/upd-layout.module.ts +34 -0
- package/link/ng-package.json +7 -0
- package/link/src/index.ts +1 -0
- package/link/src/link.component.html +3 -0
- package/link/src/link.component.scss +3 -0
- package/link/src/link.component.spec.ts +23 -0
- package/link/src/link.component.ts +48 -0
- package/link/src/public-api.ts +3 -0
- package/link/src/target.type.ts +1 -0
- package/link/src/upd-link.module.ts +17 -0
- package/list/ng-package.json +7 -0
- package/list/src/assets/i18n/en.json +5 -0
- package/list/src/assets/i18n/pt.json +5 -0
- package/list/src/index.ts +1 -0
- package/list/src/list.component.html +58 -0
- package/list/src/list.component.scss +21 -0
- package/list/src/list.component.spec.ts +23 -0
- package/list/src/list.component.ts +147 -0
- package/list/src/models/badge-position.type.ts +1 -0
- package/list/src/models/list-item.model.ts +35 -0
- package/list/src/models/list-item.ts +21 -0
- package/list/src/models/public-api.ts +2 -0
- package/list/src/public-api.ts +3 -0
- package/list/src/upd-list.module.ts +30 -0
- package/ng-package.json +9 -6
- package/package.json +8 -5
- package/popover/ng-package.json +7 -0
- package/popover/src/index.ts +1 -0
- package/popover/src/popover.component.html +20 -0
- package/popover/src/popover.component.scss +8 -0
- package/popover/src/popover.component.spec.ts +23 -0
- package/popover/src/popover.component.ts +53 -0
- package/popover/src/popover.directive.spec.ts +8 -0
- package/popover/src/popover.directive.ts +128 -0
- package/popover/src/public-api.ts +3 -0
- package/popover/src/upd-popover.module.ts +20 -0
- package/src/lib/index.ts +1 -0
- package/src/lib/public-api.ts +2 -0
- package/src/lib/types/component-size.type.ts +1 -0
- package/src/lib/types/public-api.ts +2 -0
- package/src/lib/types/validation-status.type.ts +1 -0
- package/src/lib/upd-components.module.ts +6 -0
- package/src/public-api.ts +1 -7
- package/tsconfig.lib.json +11 -11
- package/src/lib/components.component.ts +0 -14
- package/src/lib/components.module.ts +0 -17
- package/src/lib/components.service.ts +0 -9
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
ViewEncapsulation,
|
|
4
|
+
Input,
|
|
5
|
+
SimpleChanges,
|
|
6
|
+
OnInit,
|
|
7
|
+
OnChanges,
|
|
8
|
+
ContentChild,
|
|
9
|
+
TemplateRef,
|
|
10
|
+
HostBinding,
|
|
11
|
+
Output,
|
|
12
|
+
EventEmitter
|
|
13
|
+
} from '@angular/core';
|
|
14
|
+
import { IconModel } from '@updevs/icons';
|
|
15
|
+
import { UpdMaskConfig } from '@updevs/sdk/mask';
|
|
16
|
+
import { ValidationStatusType, ComponentSizeType } from '@updevs/components';
|
|
17
|
+
|
|
18
|
+
import { InputType } from './types/input.type';
|
|
19
|
+
import { InputAppendDirective } from './directives/input-append.directive';
|
|
20
|
+
import { InputPrependDirective } from './directives/input-prepend.directive';
|
|
21
|
+
import { LoaderPositionType } from './types/loader-position.type';
|
|
22
|
+
|
|
23
|
+
@Component({
|
|
24
|
+
selector: 'upd-input',
|
|
25
|
+
templateUrl: './input.component.html',
|
|
26
|
+
styleUrls: ['./input.component.scss'],
|
|
27
|
+
encapsulation: ViewEncapsulation.None
|
|
28
|
+
})
|
|
29
|
+
export class InputComponent implements OnInit, OnChanges {
|
|
30
|
+
@HostBinding('class') hostWrapperClasses = '';
|
|
31
|
+
@ContentChild(InputAppendDirective) appendTemplate?: InputAppendDirective;
|
|
32
|
+
@ContentChild(InputPrependDirective) prependTemplate?: InputPrependDirective;
|
|
33
|
+
|
|
34
|
+
@Input() type: InputType = 'text';
|
|
35
|
+
@Input() placeholder = '';
|
|
36
|
+
@Input() label?: string;
|
|
37
|
+
@Input() mask?: string;
|
|
38
|
+
@Input() maskConfig?: UpdMaskConfig;
|
|
39
|
+
@Input() hint?: string;
|
|
40
|
+
@Input() hintTemplate?: TemplateRef<any>;
|
|
41
|
+
@Input() hintAsTooltip = false;
|
|
42
|
+
@Input() value?: any;
|
|
43
|
+
@Input() size: ComponentSizeType = 'default';
|
|
44
|
+
@Input() customClasses?: string;
|
|
45
|
+
@Input() wrapperClasses?: string;
|
|
46
|
+
@Input() name?: string;
|
|
47
|
+
@Input() maxLength?: number;
|
|
48
|
+
@Input() isDisabled = false;
|
|
49
|
+
@Input() isPlainText = false;
|
|
50
|
+
@Input() isReadOnly = false;
|
|
51
|
+
@Input() isLoading = false;
|
|
52
|
+
@Input() isRound = false;
|
|
53
|
+
@Input() isFlush = false;
|
|
54
|
+
@Input() isInputGroupFlat = false;
|
|
55
|
+
@Input() isPrependButton = false;
|
|
56
|
+
@Input() isAppendButton = false;
|
|
57
|
+
@Input() isFloating = false;
|
|
58
|
+
@Input() isRequired = false;
|
|
59
|
+
@Input() loaderPosition: LoaderPositionType = 'append';
|
|
60
|
+
@Input() prependIconModel?: IconModel;
|
|
61
|
+
@Input() appendIconModel?: IconModel;
|
|
62
|
+
@Input() validationStatus?: ValidationStatusType;
|
|
63
|
+
@Input() isValidationStatusLight = false;
|
|
64
|
+
@Input() invalidStatusText?: string;
|
|
65
|
+
|
|
66
|
+
@Output() readonly valueChange = new EventEmitter<any>();
|
|
67
|
+
|
|
68
|
+
classes: string[] = [];
|
|
69
|
+
get shouldDisplayInnerLabel(): boolean {
|
|
70
|
+
return !!this.label
|
|
71
|
+
&& !this.prependIconModel
|
|
72
|
+
&& !this.appendIconModel
|
|
73
|
+
&& !this.isLoading
|
|
74
|
+
&& !this.appendTemplate
|
|
75
|
+
&& !this.prependTemplate;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
ngOnInit(): void {
|
|
79
|
+
this.updateClasses();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
83
|
+
this.updateClasses();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
onInputChange(evt: Event): void {
|
|
87
|
+
if (!evt.target) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
this.valueChange.emit((evt.target as any).value);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private updateClasses(): void {
|
|
95
|
+
const lClasses: string[] = !this.isPlainText ? ['form-control'] : ['form-control-plaintext'];
|
|
96
|
+
|
|
97
|
+
if (this.isRound) {
|
|
98
|
+
lClasses.push('form-control-rounded');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (this.isFlush) {
|
|
102
|
+
lClasses.push('form-control-flush');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (this.size !== 'default') {
|
|
106
|
+
lClasses.push(`form-control-${this.size === 'large' ? 'lg' : 'sm'}`);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (!!this.validationStatus) {
|
|
110
|
+
const statusCls = `is-${this.validationStatus}`;
|
|
111
|
+
lClasses.push(statusCls);
|
|
112
|
+
|
|
113
|
+
if (this.isValidationStatusLight) {
|
|
114
|
+
lClasses.push(`${statusCls}-lite`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (this.isFloating) {
|
|
119
|
+
this.hostWrapperClasses = (this.wrapperClasses || '') + ' form-floating';
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
this.classes = [...lClasses, ...(this.customClasses || '').split(' ')];
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type InputType = 'text' | 'number' | 'email' | 'file' | 'hidden' | 'password';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type LoaderPositionType = 'append' | 'prepend';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { UpdIconsModule } from '@updevs/icons';
|
|
4
|
+
import { UpdMaskModule } from '@updevs/sdk/mask';
|
|
5
|
+
import { UpdPopoverModule } from '@updevs/components/popover';
|
|
6
|
+
|
|
7
|
+
import { InputComponent } from './input.component';
|
|
8
|
+
import { InputAppendDirective } from './directives/input-append.directive';
|
|
9
|
+
import { InputPrependDirective } from './directives/input-prepend.directive';
|
|
10
|
+
|
|
11
|
+
@NgModule({
|
|
12
|
+
imports: [
|
|
13
|
+
CommonModule,
|
|
14
|
+
UpdIconsModule,
|
|
15
|
+
UpdMaskModule,
|
|
16
|
+
UpdPopoverModule
|
|
17
|
+
],
|
|
18
|
+
declarations: [
|
|
19
|
+
InputComponent,
|
|
20
|
+
InputAppendDirective,
|
|
21
|
+
InputPrependDirective
|
|
22
|
+
],
|
|
23
|
+
exports: [
|
|
24
|
+
InputComponent,
|
|
25
|
+
InputAppendDirective,
|
|
26
|
+
InputPrependDirective
|
|
27
|
+
]
|
|
28
|
+
})
|
|
29
|
+
export class UpdInputModule {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public-api';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<label class="form-check" [class.form-check-inline]="isInline">
|
|
2
|
+
<input type="radio" (change)="selected.emit()" [disabled]="isDisabled" [ngClass]="classes" [value]="value" [attr.name]="name"
|
|
3
|
+
[attr.readonly]="isReadOnly ? '' : undefined" [checked]="isChecked">
|
|
4
|
+
<span *ngIf="!!label" class="form-check-label">{{label}}</span>
|
|
5
|
+
<span *ngIf="!!description" class="form-check-description">{{description}}</span>
|
|
6
|
+
<div *ngIf="validationStatus === 'invalid' && !!invalidStatusText" class="invalid-feedback">{{invalidStatusText}}</div>
|
|
7
|
+
</label>
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { RadioComponent } from './radio.component';
|
|
4
|
+
|
|
5
|
+
describe('RadioComponent', () => {
|
|
6
|
+
let component: RadioComponent;
|
|
7
|
+
let fixture: ComponentFixture<RadioComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ RadioComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(RadioComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Component, OnInit, OnChanges, Input, SimpleChanges, HostBinding, ViewEncapsulation, Output, EventEmitter } from '@angular/core';
|
|
2
|
+
import { ValidationStatusType } from '@updevs/components';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'upd-radio',
|
|
6
|
+
templateUrl: './radio.component.html',
|
|
7
|
+
styleUrls: ['./radio.component.scss'],
|
|
8
|
+
encapsulation: ViewEncapsulation.None
|
|
9
|
+
})
|
|
10
|
+
export class RadioComponent implements OnInit, OnChanges {
|
|
11
|
+
@HostBinding('class') @Input() wrapperClasses = '';
|
|
12
|
+
|
|
13
|
+
@Input() label?: string;
|
|
14
|
+
@Input() value?: any;
|
|
15
|
+
@Input() customClasses?: string;
|
|
16
|
+
@Input() name?: string;
|
|
17
|
+
@Input() description?: string;
|
|
18
|
+
@Input() isDisabled = false;
|
|
19
|
+
@Input() isReadOnly = false;
|
|
20
|
+
@Input() isChecked = false;
|
|
21
|
+
@Input() isInline = false;
|
|
22
|
+
@Input() validationStatus?: ValidationStatusType;
|
|
23
|
+
@Input() invalidStatusText?: string;
|
|
24
|
+
|
|
25
|
+
@Output() readonly selected = new EventEmitter<void>();
|
|
26
|
+
|
|
27
|
+
classes: string[] = [];
|
|
28
|
+
|
|
29
|
+
ngOnInit(): void {
|
|
30
|
+
this.updateClasses();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
34
|
+
this.updateClasses();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private updateClasses(): void {
|
|
38
|
+
const lClasses: string[] = ['form-check-input'];
|
|
39
|
+
|
|
40
|
+
if (!!this.validationStatus) {
|
|
41
|
+
const statusCls = `is-${this.validationStatus}`;
|
|
42
|
+
lClasses.push(statusCls);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
this.classes = [...lClasses, ...(this.customClasses || '').split(' ')];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
|
|
4
|
+
import { RadioComponent } from './radio.component';
|
|
5
|
+
|
|
6
|
+
@NgModule({
|
|
7
|
+
imports: [
|
|
8
|
+
CommonModule
|
|
9
|
+
],
|
|
10
|
+
declarations: [
|
|
11
|
+
RadioComponent
|
|
12
|
+
],
|
|
13
|
+
exports: [
|
|
14
|
+
RadioComponent
|
|
15
|
+
]
|
|
16
|
+
})
|
|
17
|
+
export class UpdRadioModule {}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<label *ngIf="!!label" class="form-label">{{label}}</label>
|
|
2
|
+
|
|
3
|
+
<div class="dropdown">
|
|
4
|
+
<div #componentBox class="input-group input-group-flat">
|
|
5
|
+
<div class="form-control" [class.remove-bottom-radius]="isDropdownOpen">
|
|
6
|
+
<ng-container *ngFor="let sel of currentSelection">
|
|
7
|
+
<span class="badge bg-primary select-multiple-value">{{sel.text}}
|
|
8
|
+
<upd-button [isIcon]="true" [shouldIgnoreBtnClass]="true" (clicked)="onRemoveItem(sel)">
|
|
9
|
+
<upd-icon tablerIcon="x"></upd-icon>
|
|
10
|
+
</upd-button></span>
|
|
11
|
+
</ng-container>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="input-group-text" [class.remove-bottom-radius]="isDropdownOpen">
|
|
14
|
+
<upd-button *ngIf="currentSelection.length > 0" [shouldIgnoreBtnClass]="true" (clicked)="clearSelection()"
|
|
15
|
+
customClasses="link-secondary">
|
|
16
|
+
<upd-icon [model]="{heroIcon:'x-mark', heroIconType: 'outline', heroIconSize:'small'}"></upd-icon>
|
|
17
|
+
</upd-button>
|
|
18
|
+
<upd-button *ngIf="!isLoading; else loadingIcon" [shouldIgnoreBtnClass]="true" (clicked)="openDropdown()"
|
|
19
|
+
customClasses="link-secondary ms-2">
|
|
20
|
+
<upd-icon [model]="{heroIcon:'chevron-down', heroIconType: 'outline', heroIconSize:'small'}"></upd-icon>
|
|
21
|
+
</upd-button>
|
|
22
|
+
<ng-template #loadingIcon>
|
|
23
|
+
<div class="select-loader-wrapper">
|
|
24
|
+
<div class="spinner-border spinner-border-sm text-muted select-loader" role="status"></div>
|
|
25
|
+
</div>
|
|
26
|
+
</ng-template>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div #searchBox>
|
|
30
|
+
<div #searchBoxChild [style.visibility]="isDropdownOpen ? 'visible' : 'hidden'" class="select-search-box">
|
|
31
|
+
<upd-input [placeholder]="placeholder" [isInputGroupFlat]="true" (click)="openDropdown()" (valueChange)="search($event)">
|
|
32
|
+
<ng-template updInputPrepend>
|
|
33
|
+
<upd-icon [model]="{heroIcon:'magnifying-glass'}"></upd-icon>
|
|
34
|
+
</ng-template>
|
|
35
|
+
</upd-input>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<upd-list #list [items]="listItems" [maxHeight]="dropdownMaxHeight + 'px'" (selectedItem)="onSelectItem($event)"
|
|
39
|
+
[wrapperClasses]="dropdownClasses" [isVisible]="isDropdownOpen" [shouldOverflow]="true" [shouldDisplayItemsCounter]="true">
|
|
40
|
+
</upd-list>
|
|
41
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { SelectMultipleComponent } from './select-multiple.component';
|
|
4
|
+
|
|
5
|
+
describe('SelectMultipleComponent', () => {
|
|
6
|
+
let component: SelectMultipleComponent;
|
|
7
|
+
let fixture: ComponentFixture<SelectMultipleComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [SelectMultipleComponent]
|
|
12
|
+
});
|
|
13
|
+
fixture = TestBed.createComponent(SelectMultipleComponent);
|
|
14
|
+
component = fixture.componentInstance;
|
|
15
|
+
fixture.detectChanges();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should create', () => {
|
|
19
|
+
expect(component).toBeTruthy();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Component, ViewEncapsulation, EventEmitter, Output } from '@angular/core';
|
|
2
|
+
import { ListItem } from '@updevs/components/list';
|
|
3
|
+
|
|
4
|
+
import { BaseSelectComponent } from '../../models/abstractions/base-select.component';
|
|
5
|
+
import { SelectItem } from '../../models/select-item';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'upd-select-multiple',
|
|
9
|
+
templateUrl: './select-multiple.component.html',
|
|
10
|
+
styleUrls: ['./select-multiple.component.scss'],
|
|
11
|
+
encapsulation: ViewEncapsulation.None
|
|
12
|
+
})
|
|
13
|
+
export class SelectMultipleComponent extends BaseSelectComponent {
|
|
14
|
+
/**
|
|
15
|
+
* Triggered when an item is selected.
|
|
16
|
+
*/
|
|
17
|
+
@Output() readonly selectedItems = new EventEmitter<SelectItem[]>();
|
|
18
|
+
|
|
19
|
+
currentSelection: SelectItem[] = [];
|
|
20
|
+
|
|
21
|
+
clearSelection(): void {
|
|
22
|
+
this.currentSelection = [];
|
|
23
|
+
this._currentTerm = undefined;
|
|
24
|
+
|
|
25
|
+
this.updateActiveItemsOnList();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
onSelectItem(item: ListItem): void {
|
|
29
|
+
const selectedItem = this.currentSelection.find(cs => cs.value === item.id);
|
|
30
|
+
|
|
31
|
+
if (!!selectedItem) {
|
|
32
|
+
this.onRemoveItem(selectedItem);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
for (const localBackupItem of this._localBackupItems) {
|
|
37
|
+
if ((localBackupItem.children?.length || 0) > 0) {
|
|
38
|
+
const child = localBackupItem.children?.find(c => c.value === item.id);
|
|
39
|
+
|
|
40
|
+
if (!!child) {
|
|
41
|
+
this.currentSelection.push(child);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
} else if (localBackupItem.value === item.id) {
|
|
45
|
+
this.currentSelection.push(localBackupItem);
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
this.updateActiveItemsOnList();
|
|
51
|
+
this.selectedItems.emit(this.currentSelection);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
onRemoveItem(item: SelectItem): void {
|
|
55
|
+
const idx = this.currentSelection.findIndex(cs => cs.value === item.value);
|
|
56
|
+
|
|
57
|
+
this.currentSelection.splice(idx, 1);
|
|
58
|
+
this.updateActiveItemsOnList();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private updateActiveItemsOnList(): void {
|
|
62
|
+
for (const backupItem of this._localBackupItems) {
|
|
63
|
+
const selectedItem = this.currentSelection.find(cs => cs.value === backupItem.value);
|
|
64
|
+
backupItem.listItem!.isActive = !!selectedItem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
this._setupLocalItems(this._localBackupItems);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.select-dropdown-content {
|
|
2
|
+
position: absolute !important;
|
|
3
|
+
background-color: var(--upd-card-bg);
|
|
4
|
+
z-index: 1;
|
|
5
|
+
border: var(--upd-card-border-width) solid var(--upd-card-border-color) !important;
|
|
6
|
+
border-radius: var(--upd-card-border-radius) !important;
|
|
7
|
+
box-shadow: 0 1px 1px rgb(0 0 0 / 18%);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.select-dropdown-content-open {
|
|
11
|
+
display: block !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.select-loader-wrapper {
|
|
15
|
+
height: 24px;
|
|
16
|
+
|
|
17
|
+
.select-loader {
|
|
18
|
+
height: 24px;
|
|
19
|
+
width: 24px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.select-search-box {
|
|
24
|
+
position: absolute;
|
|
25
|
+
z-index: 1;
|
|
26
|
+
padding: 0.5rem;
|
|
27
|
+
margin-top: -1px;
|
|
28
|
+
background: var(--upd-body-bg);
|
|
29
|
+
border: var(--upd-border-width) var(--upd-border-style) var(--upd-border-color);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.remove-bottom-radius {
|
|
33
|
+
border-bottom-left-radius: 0 !important;
|
|
34
|
+
border-bottom-right-radius: 0 !important;;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.remove-top-radius {
|
|
38
|
+
border-top-left-radius: 0 !important;;
|
|
39
|
+
border-top-right-radius: 0 !important;;
|
|
40
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<label *ngIf="!!label" class="form-label">{{label}}</label>
|
|
2
|
+
|
|
3
|
+
<ng-container *ngIf="!useSystemStyle; else defaultOsTpl">
|
|
4
|
+
<div class="dropdown">
|
|
5
|
+
<div #componentBox class="input-group input-group-flat">
|
|
6
|
+
<div class="form-control" [class.remove-bottom-radius]="isDropdownOpen">
|
|
7
|
+
<span *ngIf="!!currentSelection">{{currentSelection.text}}</span>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="input-group-text" [class.remove-bottom-radius]="isDropdownOpen">
|
|
10
|
+
<upd-button *ngIf="!!currentSelection" [shouldIgnoreBtnClass]="true" (clicked)="clearSelection()"
|
|
11
|
+
customClasses="link-secondary">
|
|
12
|
+
<upd-icon [model]="{heroIcon:'x-mark', heroIconType: 'outline', heroIconSize:'small'}"></upd-icon>
|
|
13
|
+
</upd-button>
|
|
14
|
+
<upd-button *ngIf="!isLoading; else loadingIcon" [shouldIgnoreBtnClass]="true" (clicked)="openDropdown()"
|
|
15
|
+
customClasses="link-secondary ms-2">
|
|
16
|
+
<upd-icon [model]="{heroIcon:'chevron-down', heroIconType: 'outline', heroIconSize:'small'}"></upd-icon>
|
|
17
|
+
</upd-button>
|
|
18
|
+
<ng-template #loadingIcon>
|
|
19
|
+
<div class="select-loader-wrapper">
|
|
20
|
+
<div class="spinner-border spinner-border-sm text-muted select-loader" role="status"></div>
|
|
21
|
+
</div>
|
|
22
|
+
</ng-template>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<div #searchBox>
|
|
26
|
+
<div #searchBoxChild [style.visibility]="isDropdownOpen ? 'visible' : 'hidden'" class="select-search-box">
|
|
27
|
+
<upd-input [placeholder]="placeholder" [isInputGroupFlat]="true" (click)="openDropdown()" (valueChange)="search($event)">
|
|
28
|
+
<ng-template updInputPrepend>
|
|
29
|
+
<upd-icon [model]="{heroIcon:'magnifying-glass'}"></upd-icon>
|
|
30
|
+
</ng-template>
|
|
31
|
+
</upd-input>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<upd-list #list [items]="listItems" [maxHeight]="dropdownMaxHeight + 'px'" (selectedItem)="onSelectItem($event)"
|
|
35
|
+
[wrapperClasses]="dropdownClasses" [isVisible]="isDropdownOpen" [shouldOverflow]="true" [shouldDisplayItemsCounter]="true">
|
|
36
|
+
</upd-list>
|
|
37
|
+
</div>
|
|
38
|
+
</ng-container>
|
|
39
|
+
|
|
40
|
+
<ng-template #defaultOsTpl>
|
|
41
|
+
<select class="form-select" [attr.placeholder]="placeholder">
|
|
42
|
+
<ng-container *ngFor="let item of localItems">
|
|
43
|
+
<ng-container *ngIf="(item.children?.length || 0) > 0; else defaultTpl">
|
|
44
|
+
<optgroup [label]="item.text">
|
|
45
|
+
<option *ngFor="let child of item.children" [value]="child.value">{{child.text}}</option>
|
|
46
|
+
</optgroup>
|
|
47
|
+
</ng-container>
|
|
48
|
+
<ng-template #defaultTpl>
|
|
49
|
+
<option [value]="item.value">{{item.text}}</option>
|
|
50
|
+
</ng-template>
|
|
51
|
+
</ng-container>
|
|
52
|
+
</select>
|
|
53
|
+
</ng-template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { SelectComponent } from './select.component';
|
|
4
|
+
|
|
5
|
+
describe('SelectComponent', () => {
|
|
6
|
+
let component: SelectComponent;
|
|
7
|
+
let fixture: ComponentFixture<SelectComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ SelectComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(SelectComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
Input,
|
|
4
|
+
ViewEncapsulation,
|
|
5
|
+
Output,
|
|
6
|
+
EventEmitter
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
import { ListItem } from '@updevs/components/list';
|
|
9
|
+
|
|
10
|
+
import { BaseSelectComponent } from '../../models/abstractions/base-select.component';
|
|
11
|
+
import { SelectItem } from '../../models/select-item';
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'upd-select',
|
|
15
|
+
templateUrl: './select.component.html',
|
|
16
|
+
styleUrls: ['./select.component.scss'],
|
|
17
|
+
encapsulation: ViewEncapsulation.None
|
|
18
|
+
})
|
|
19
|
+
export class SelectComponent extends BaseSelectComponent {
|
|
20
|
+
/**
|
|
21
|
+
* If true, it'll use the default style of the OS, no search capabilities.
|
|
22
|
+
*/
|
|
23
|
+
@Input() useSystemStyle = false;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Triggered when an item is selected.
|
|
27
|
+
*/
|
|
28
|
+
@Output() readonly selectedItem = new EventEmitter<SelectItem>();
|
|
29
|
+
|
|
30
|
+
currentSelection?: SelectItem;
|
|
31
|
+
|
|
32
|
+
onSelectItem(item: ListItem): void {
|
|
33
|
+
this._currentTerm = item.text;
|
|
34
|
+
this.isDropdownOpen = false;
|
|
35
|
+
|
|
36
|
+
for (const localBackupItem of this._localBackupItems) {
|
|
37
|
+
if ((localBackupItem.children?.length || 0) > 0) {
|
|
38
|
+
this.currentSelection = localBackupItem.children?.find(c => c.value === item.id);
|
|
39
|
+
|
|
40
|
+
if (!!this.currentSelection) {
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
} else if (localBackupItem.value === item.id) {
|
|
44
|
+
this.currentSelection = localBackupItem;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
this.selectedItem.emit(this.currentSelection);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
clearSelection(): void {
|
|
53
|
+
this.currentSelection = undefined;
|
|
54
|
+
this._currentTerm = undefined;
|
|
55
|
+
|
|
56
|
+
this.search();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './public-api';
|