@progress/kendo-angular-buttons 7.0.0-next.202111120840 → 7.0.2-dev.202201201235
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/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- package/dist/cdn/js/kendo-angular-buttons.js +20 -0
- package/dist/cdn/main.js +5 -0
- package/dist/es/button/button.directive.js +769 -0
- package/{esm2015 → dist/es}/button/button.module.js +13 -13
- package/dist/es/button/button.service.js +24 -0
- package/{esm2015 → dist/es}/button/selection-settings.js +0 -1
- package/dist/es/buttongroup/buttongroup.component.js +353 -0
- package/dist/es/buttongroup/buttongroup.module.js +30 -0
- package/{esm2015 → dist/es}/buttons.module.js +12 -12
- package/{esm2015 → dist/es}/chip/chip-content-click-event-args.interface.js +0 -1
- package/{esm2015 → dist/es}/chip/chip-list-remove-event-args.interface.js +0 -1
- package/dist/es/chip/chip-list.component.js +214 -0
- package/{esm2015 → dist/es}/chip/chip-remove-event-args.interface.js +0 -1
- package/dist/es/chip/chip.component.js +449 -0
- package/dist/es/chip/chip.module.js +55 -0
- package/{esm2015 → dist/es}/chip/models/selection.js +0 -1
- package/dist/es/common/models/fillmode.js +4 -0
- package/dist/es/common/models/rounded.js +4 -0
- package/{esm2015 → dist/es}/common/models/shape.js +0 -1
- package/{esm2015 → dist/es}/common/models/size.js +0 -1
- package/dist/es/common/models/styling-classes.js +4 -0
- package/{esm2015 → dist/es}/common/models/theme-color.js +0 -1
- package/{esm2015/button-look.js → dist/es/common/models.js} +0 -1
- package/{esm2015 → dist/es}/direction.js +0 -1
- package/dist/es/dropdownbutton/dropdownbutton.component.js +704 -0
- package/dist/es/dropdownbutton/dropdownbutton.module.js +32 -0
- package/dist/es/floatingactionbutton/animations/animations.js +33 -0
- package/dist/es/floatingactionbutton/dial-item.component.js +143 -0
- package/dist/es/floatingactionbutton/dial-list.component.js +76 -0
- package/dist/es/floatingactionbutton/floatingactionbutton.component.js +903 -0
- package/dist/es/floatingactionbutton/floatingactionbutton.module.js +65 -0
- package/{esm2015 → dist/es}/floatingactionbutton/models/align.js +0 -1
- package/{esm2015 → dist/es}/floatingactionbutton/models/item-animation.interface.js +0 -1
- package/{esm2015 → dist/es}/floatingactionbutton/models/item-click.event.js +0 -1
- package/{esm2015 → dist/es}/floatingactionbutton/models/item.interface.js +0 -1
- package/{esm2015 → dist/es}/floatingactionbutton/models/offset.js +0 -1
- package/{esm2015 → dist/es}/floatingactionbutton/models/position-mode.js +0 -1
- package/dist/es/floatingactionbutton/templates/dial-item-template.directive.js +26 -0
- package/dist/es/floatingactionbutton/templates/fab-template.directive.js +26 -0
- package/dist/es/floatingactionbutton/utils.js +38 -0
- package/dist/es/focusable/focus.service.js +43 -0
- package/dist/es/focusable/focusable.directive.js +68 -0
- package/dist/es/index.js +22 -0
- package/dist/es/listbutton/button-item-template.directive.js +68 -0
- package/dist/es/listbutton/list-button.js +243 -0
- package/{esm2015 → dist/es}/listbutton/list-item-model.js +0 -1
- package/dist/es/listbutton/list.component.js +85 -0
- package/dist/es/listbutton/list.module.js +33 -0
- package/{esm2015 → dist/es}/listbutton/popup-settings.js +0 -1
- package/dist/es/listbutton/template-context.directive.js +40 -0
- package/{esm2015 → dist/es}/main.js +1 -5
- package/{esm2015 → dist/es}/navigation/key-events.js +0 -0
- package/{esm2015 → dist/es}/navigation/navigation-action.js +0 -0
- package/dist/es/navigation/navigation-config.js +9 -0
- package/dist/es/navigation/navigation.service.js +114 -0
- package/dist/es/package-metadata.js +15 -0
- package/dist/es/preventable-event.js +29 -0
- package/dist/es/splitbutton/localization/custom-messages.component.js +44 -0
- package/dist/es/splitbutton/localization/localized-messages.directive.js +35 -0
- package/dist/es/splitbutton/localization/messages.js +22 -0
- package/dist/es/splitbutton/splitbutton.component.js +830 -0
- package/dist/es/splitbutton/splitbutton.module.js +34 -0
- package/dist/es/util.js +97 -0
- package/{button → dist/es2015/button}/button.directive.d.ts +101 -46
- package/dist/es2015/button/button.directive.js +671 -0
- package/{button → dist/es2015/button}/button.module.d.ts +0 -5
- package/dist/es2015/button/button.module.js +47 -0
- package/{button → dist/es2015/button}/button.service.d.ts +1 -7
- package/dist/es2015/button/button.service.js +26 -0
- package/{button → dist/es2015/button}/selection-settings.d.ts +0 -0
- package/dist/es2015/button/selection-settings.js +4 -0
- package/{buttongroup → dist/es2015/buttongroup}/buttongroup.component.d.ts +9 -28
- package/{esm2015 → dist/es2015}/buttongroup/buttongroup.component.js +116 -121
- package/dist/es2015/buttongroup/buttongroup.module.d.ts +14 -0
- package/dist/es2015/buttongroup/buttongroup.module.js +27 -0
- package/{buttons.module.d.ts → dist/es2015/buttons.module.d.ts} +0 -10
- package/dist/es2015/buttons.module.js +51 -0
- package/{chip → dist/es2015/chip}/chip-content-click-event-args.interface.d.ts +0 -0
- package/dist/es2015/chip/chip-content-click-event-args.interface.js +4 -0
- package/{chip → dist/es2015/chip}/chip-list-remove-event-args.interface.d.ts +0 -0
- package/dist/es2015/chip/chip-list-remove-event-args.interface.js +4 -0
- package/{chip → dist/es2015/chip}/chip-list.component.d.ts +21 -8
- package/dist/es2015/chip/chip-list.component.js +197 -0
- package/{chip → dist/es2015/chip}/chip-remove-event-args.interface.d.ts +0 -0
- package/dist/es2015/chip/chip-remove-event-args.interface.js +4 -0
- package/{chip → dist/es2015/chip}/chip.component.d.ts +72 -38
- package/dist/es2015/chip/chip.component.js +431 -0
- package/{chip → dist/es2015/chip}/chip.module.d.ts +0 -7
- package/{esm2015 → dist/es2015}/chip/chip.module.js +11 -16
- package/{chip → dist/es2015/chip}/models/selection.d.ts +0 -0
- package/dist/es2015/chip/models/selection.js +4 -0
- package/{util.d.ts → dist/es2015/common/models/fillmode.d.ts} +4 -8
- package/dist/es2015/common/models/fillmode.js +4 -0
- package/dist/es2015/common/models/rounded.d.ts +12 -0
- package/dist/es2015/common/models/rounded.js +4 -0
- package/dist/es2015/common/models/shape.d.ts +9 -0
- package/dist/es2015/common/models/shape.js +4 -0
- package/dist/es2015/common/models/size.d.ts +17 -0
- package/dist/es2015/common/models/size.js +4 -0
- package/{esm2015/kendo-angular-buttons.js → dist/es2015/common/models/styling-classes.d.ts} +5 -2
- package/dist/es2015/common/models/styling-classes.js +4 -0
- package/{common → dist/es2015/common}/models/theme-color.d.ts +15 -4
- package/dist/es2015/common/models/theme-color.js +4 -0
- package/{common/models/size.d.ts → dist/es2015/common/models.d.ts} +6 -10
- package/dist/es2015/common/models.js +4 -0
- package/{direction.d.ts → dist/es2015/direction.d.ts} +0 -0
- package/dist/es2015/direction.js +4 -0
- package/{dropdownbutton → dist/es2015/dropdownbutton}/dropdownbutton.component.d.ts +74 -29
- package/{esm2015 → dist/es2015}/dropdownbutton/dropdownbutton.component.js +257 -179
- package/dist/es2015/dropdownbutton/dropdownbutton.module.d.ts +14 -0
- package/dist/es2015/dropdownbutton/dropdownbutton.module.js +29 -0
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/animations/animations.d.ts +0 -0
- package/{esm2015 → dist/es2015}/floatingactionbutton/animations/animations.js +0 -0
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/dial-item.component.d.ts +5 -8
- package/dist/es2015/floatingactionbutton/dial-item.component.js +133 -0
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/dial-list.component.d.ts +2 -5
- package/dist/es2015/floatingactionbutton/dial-list.component.js +81 -0
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/floatingactionbutton.component.d.ts +47 -49
- package/{esm2015 → dist/es2015}/floatingactionbutton/floatingactionbutton.component.js +212 -192
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/floatingactionbutton.module.d.ts +0 -13
- package/{esm2015 → dist/es2015}/floatingactionbutton/floatingactionbutton.module.js +11 -19
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/models/align.d.ts +0 -0
- package/dist/es2015/floatingactionbutton/models/align.js +4 -0
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/models/item-animation.interface.d.ts +0 -0
- package/dist/es2015/floatingactionbutton/models/item-animation.interface.js +4 -0
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/models/item-click.event.d.ts +0 -0
- package/dist/es2015/floatingactionbutton/models/item-click.event.js +4 -0
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/models/item.interface.d.ts +0 -0
- package/dist/es2015/floatingactionbutton/models/item.interface.js +4 -0
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/models/offset.d.ts +0 -0
- package/dist/es2015/floatingactionbutton/models/offset.js +4 -0
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/models/position-mode.d.ts +0 -0
- package/dist/es2015/floatingactionbutton/models/position-mode.js +4 -0
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/templates/dial-item-template.directive.d.ts +0 -3
- package/dist/es2015/floatingactionbutton/templates/dial-item-template.directive.js +25 -0
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/templates/fab-template.directive.d.ts +0 -3
- package/dist/es2015/floatingactionbutton/templates/fab-template.directive.js +25 -0
- package/{floatingactionbutton → dist/es2015/floatingactionbutton}/utils.d.ts +0 -0
- package/{esm2015 → dist/es2015}/floatingactionbutton/utils.js +0 -0
- package/{focusable → dist/es2015/focusable}/focus.service.d.ts +1 -5
- package/{esm2015 → dist/es2015}/focusable/focus.service.js +10 -8
- package/{focusable → dist/es2015/focusable}/focusable.directive.d.ts +0 -3
- package/{esm2015 → dist/es2015}/focusable/focusable.directive.js +20 -19
- package/dist/es2015/index.d.ts +22 -0
- package/dist/es2015/index.js +22 -0
- package/dist/es2015/index.metadata.json +1 -0
- package/{listbutton → dist/es2015/listbutton}/button-item-template.directive.d.ts +0 -3
- package/{esm2015 → dist/es2015}/listbutton/button-item-template.directive.js +12 -13
- package/{listbutton → dist/es2015/listbutton}/list-button.d.ts +2 -6
- package/{esm2015 → dist/es2015}/listbutton/list-button.js +6 -16
- package/{listbutton → dist/es2015/listbutton}/list-item-model.d.ts +0 -0
- package/dist/es2015/listbutton/list-item-model.js +4 -0
- package/{listbutton → dist/es2015/listbutton}/list.component.d.ts +3 -3
- package/dist/es2015/listbutton/list.component.js +113 -0
- package/dist/es2015/listbutton/list.module.d.ts +9 -0
- package/dist/es2015/listbutton/list.module.js +30 -0
- package/{listbutton → dist/es2015/listbutton}/popup-settings.d.ts +0 -0
- package/dist/es2015/listbutton/popup-settings.js +4 -0
- package/{listbutton → dist/es2015/listbutton}/template-context.directive.d.ts +1 -4
- package/dist/es2015/listbutton/template-context.directive.js +35 -0
- package/{main.d.ts → dist/es2015/main.d.ts} +5 -9
- package/dist/es2015/main.js +22 -0
- package/{navigation → dist/es2015/navigation}/key-events.d.ts +0 -0
- package/dist/es2015/navigation/key-events.js +13 -0
- package/{navigation → dist/es2015/navigation}/navigation-action.d.ts +0 -0
- package/dist/es2015/navigation/navigation-action.js +19 -0
- package/{navigation → dist/es2015/navigation}/navigation-config.d.ts +0 -0
- package/{esm2015 → dist/es2015}/navigation/navigation-config.js +0 -0
- package/{navigation → dist/es2015/navigation}/navigation.service.d.ts +0 -3
- package/{esm2015 → dist/es2015}/navigation/navigation.service.js +9 -11
- package/{package-metadata.d.ts → dist/es2015/package-metadata.d.ts} +0 -0
- package/{esm2015 → dist/es2015}/package-metadata.js +1 -1
- package/{preventable-event.d.ts → dist/es2015/preventable-event.d.ts} +0 -0
- package/{esm2015 → dist/es2015}/preventable-event.js +0 -0
- package/dist/es2015/splitbutton/localization/custom-messages.component.d.ts +15 -0
- package/dist/es2015/splitbutton/localization/custom-messages.component.js +36 -0
- package/dist/es2015/splitbutton/localization/localized-messages.directive.d.ts +13 -0
- package/dist/es2015/splitbutton/localization/localized-messages.directive.js +31 -0
- package/dist/es2015/splitbutton/localization/messages.d.ts +32 -0
- package/dist/es2015/splitbutton/localization/messages.js +16 -0
- package/{splitbutton → dist/es2015/splitbutton}/splitbutton.component.d.ts +74 -34
- package/{esm2015 → dist/es2015}/splitbutton/splitbutton.component.js +288 -203
- package/dist/es2015/splitbutton/splitbutton.module.d.ts +14 -0
- package/dist/es2015/splitbutton/splitbutton.module.js +31 -0
- package/dist/es2015/util.d.ts +41 -0
- package/dist/es2015/util.js +95 -0
- package/{fesm2015/kendo-angular-buttons.js → dist/fesm2015/index.js} +2394 -1838
- package/dist/fesm5/index.js +5561 -0
- package/dist/npm/button/button.directive.js +771 -0
- package/dist/npm/button/button.module.js +52 -0
- package/dist/npm/button/button.service.js +26 -0
- package/dist/npm/button/selection-settings.js +6 -0
- package/dist/npm/buttongroup/buttongroup.component.js +355 -0
- package/dist/npm/buttongroup/buttongroup.module.js +32 -0
- package/dist/npm/buttons.module.js +56 -0
- package/dist/npm/chip/chip-content-click-event-args.interface.js +6 -0
- package/dist/npm/chip/chip-list-remove-event-args.interface.js +6 -0
- package/dist/npm/chip/chip-list.component.js +216 -0
- package/dist/npm/chip/chip-remove-event-args.interface.js +6 -0
- package/dist/npm/chip/chip.component.js +451 -0
- package/dist/npm/chip/chip.module.js +57 -0
- package/dist/npm/chip/models/selection.js +6 -0
- package/dist/npm/common/models/fillmode.js +6 -0
- package/dist/npm/common/models/rounded.js +6 -0
- package/dist/npm/common/models/shape.js +6 -0
- package/dist/npm/common/models/size.js +6 -0
- package/dist/npm/common/models/styling-classes.js +6 -0
- package/dist/npm/common/models/theme-color.js +6 -0
- package/dist/npm/common/models.js +6 -0
- package/dist/npm/direction.js +6 -0
- package/dist/npm/dropdownbutton/dropdownbutton.component.js +706 -0
- package/dist/npm/dropdownbutton/dropdownbutton.module.js +34 -0
- package/dist/npm/floatingactionbutton/animations/animations.js +37 -0
- package/dist/npm/floatingactionbutton/dial-item.component.js +145 -0
- package/dist/npm/floatingactionbutton/dial-list.component.js +78 -0
- package/dist/npm/floatingactionbutton/floatingactionbutton.component.js +905 -0
- package/dist/npm/floatingactionbutton/floatingactionbutton.module.js +67 -0
- package/dist/npm/floatingactionbutton/models/align.js +6 -0
- package/dist/npm/floatingactionbutton/models/item-animation.interface.js +6 -0
- package/dist/npm/floatingactionbutton/models/item-click.event.js +6 -0
- package/dist/npm/floatingactionbutton/models/item.interface.js +6 -0
- package/dist/npm/floatingactionbutton/models/offset.js +6 -0
- package/dist/npm/floatingactionbutton/models/position-mode.js +6 -0
- package/dist/npm/floatingactionbutton/templates/dial-item-template.directive.js +28 -0
- package/dist/npm/floatingactionbutton/templates/fab-template.directive.js +28 -0
- package/dist/npm/floatingactionbutton/utils.js +42 -0
- package/dist/npm/focusable/focus.service.js +45 -0
- package/dist/npm/focusable/focusable.directive.js +70 -0
- package/dist/npm/index.js +39 -0
- package/dist/npm/listbutton/button-item-template.directive.js +70 -0
- package/dist/npm/listbutton/list-button.js +245 -0
- package/dist/npm/listbutton/list-item-model.js +6 -0
- package/dist/npm/listbutton/list.component.js +87 -0
- package/dist/npm/listbutton/list.module.js +35 -0
- package/dist/npm/listbutton/popup-settings.js +6 -0
- package/dist/npm/listbutton/template-context.directive.js +42 -0
- package/dist/npm/main.js +45 -0
- package/dist/npm/navigation/key-events.js +15 -0
- package/dist/npm/navigation/navigation-action.js +21 -0
- package/dist/npm/navigation/navigation-config.js +11 -0
- package/dist/npm/navigation/navigation.service.js +116 -0
- package/dist/npm/package-metadata.js +17 -0
- package/dist/npm/preventable-event.js +31 -0
- package/dist/npm/splitbutton/localization/custom-messages.component.js +46 -0
- package/dist/npm/splitbutton/localization/localized-messages.directive.js +37 -0
- package/dist/npm/splitbutton/localization/messages.js +24 -0
- package/dist/npm/splitbutton/splitbutton.component.js +832 -0
- package/dist/npm/splitbutton/splitbutton.module.js +36 -0
- package/dist/npm/util.js +100 -0
- package/dist/systemjs/kendo-angular-buttons.js +5 -0
- package/package.json +110 -35
- package/schematics/ngAdd/index.js +2 -5
- package/schematics/ngAdd/index.js.map +1 -1
- package/bundles/kendo-angular-buttons.umd.js +0 -5
- package/button-look.d.ts +0 -21
- package/buttongroup/buttongroup.module.d.ts +0 -21
- package/chip/models/chip-look.d.ts +0 -18
- package/chip/models/type.d.ts +0 -21
- package/common/models/shape.d.ts +0 -16
- package/dropdownbutton/dropdownbutton.module.d.ts +0 -23
- package/esm2015/button/button.directive.js +0 -488
- package/esm2015/button/button.service.js +0 -28
- package/esm2015/buttongroup/buttongroup.module.js +0 -30
- package/esm2015/chip/chip-list.component.js +0 -145
- package/esm2015/chip/chip.component.js +0 -335
- package/esm2015/chip/models/chip-look.js +0 -5
- package/esm2015/chip/models/type.js +0 -5
- package/esm2015/dropdownbutton/dropdownbutton.module.js +0 -32
- package/esm2015/floatingactionbutton/dial-item.component.js +0 -126
- package/esm2015/floatingactionbutton/dial-list.component.js +0 -89
- package/esm2015/floatingactionbutton/templates/dial-item-template.directive.js +0 -27
- package/esm2015/floatingactionbutton/templates/fab-template.directive.js +0 -27
- package/esm2015/listbutton/list.component.js +0 -120
- package/esm2015/listbutton/list.module.js +0 -39
- package/esm2015/listbutton/template-context.directive.js +0 -33
- package/esm2015/splitbutton/splitbutton.module.js +0 -32
- package/esm2015/util.js +0 -39
- package/kendo-angular-buttons.d.ts +0 -9
- package/listbutton/list.module.d.ts +0 -18
- package/splitbutton/splitbutton.module.d.ts +0 -23
|
@@ -1,488 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, EventEmitter, HostBinding, HostListener, Input, Output, Optional } from '@angular/core';
|
|
6
|
-
import { isDocumentAvailable, isChanged, hasObservers, Keys } from '@progress/kendo-angular-common';
|
|
7
|
-
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
8
|
-
import { filter } from 'rxjs/operators';
|
|
9
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
|
-
import { packageMetadata } from '../package-metadata';
|
|
11
|
-
import * as i0 from "@angular/core";
|
|
12
|
-
import * as i1 from "./button.service";
|
|
13
|
-
import * as i2 from "@progress/kendo-angular-l10n";
|
|
14
|
-
const SPAN_TAG_NAME = 'SPAN';
|
|
15
|
-
/**
|
|
16
|
-
* Represents the Kendo UI Button component for Angular.
|
|
17
|
-
*/
|
|
18
|
-
export class ButtonDirective {
|
|
19
|
-
constructor(element, renderer, service, localization, ngZone) {
|
|
20
|
-
this.service = service;
|
|
21
|
-
this.ngZone = ngZone;
|
|
22
|
-
/**
|
|
23
|
-
* Provides visual styling that indicates if the Button is active.
|
|
24
|
-
* By default, `toggleable` is set to `false`.
|
|
25
|
-
*/
|
|
26
|
-
this.toggleable = false;
|
|
27
|
-
/**
|
|
28
|
-
* Adds visual weight to the Button and makes it primary.
|
|
29
|
-
*/
|
|
30
|
-
this.primary = false;
|
|
31
|
-
/**
|
|
32
|
-
* Changes the visual appearance by using alternative styling options
|
|
33
|
-
* ([more information and examples]({% slug appearance_button %})).
|
|
34
|
-
*
|
|
35
|
-
* The available values are:
|
|
36
|
-
* * [`ButtonLook`]({% slug api_buttons_buttonlook %}) = `flat` | `outline`
|
|
37
|
-
* * `clear`
|
|
38
|
-
*/
|
|
39
|
-
this.look = 'default';
|
|
40
|
-
/**
|
|
41
|
-
* @hidden
|
|
42
|
-
*/
|
|
43
|
-
this.role = 'button';
|
|
44
|
-
/**
|
|
45
|
-
* Fires each time the selected state of a toggleable button is changed.
|
|
46
|
-
*
|
|
47
|
-
* The event argument is the new selected state (boolean).
|
|
48
|
-
*/
|
|
49
|
-
this.selectedChange = new EventEmitter();
|
|
50
|
-
/**
|
|
51
|
-
* Fires each time the user clicks the button.
|
|
52
|
-
*/
|
|
53
|
-
this.click = new EventEmitter();
|
|
54
|
-
this.isDisabled = false;
|
|
55
|
-
this.isIcon = false;
|
|
56
|
-
this.isIconClass = false;
|
|
57
|
-
this._focused = false;
|
|
58
|
-
this.domEvents = [];
|
|
59
|
-
validatePackage(packageMetadata);
|
|
60
|
-
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
61
|
-
this.localizationChangeSubscription = localization.changes
|
|
62
|
-
.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr');
|
|
63
|
-
this.element = element.nativeElement;
|
|
64
|
-
this.renderer = renderer;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Backwards-compatible alias
|
|
68
|
-
*
|
|
69
|
-
* @hidden
|
|
70
|
-
*/
|
|
71
|
-
get togglable() {
|
|
72
|
-
return this.toggleable;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* @hidden
|
|
76
|
-
*/
|
|
77
|
-
set togglable(value) {
|
|
78
|
-
this.toggleable = value;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Sets the selected state of the Button.
|
|
82
|
-
*/
|
|
83
|
-
get selected() {
|
|
84
|
-
return this._selected || false;
|
|
85
|
-
}
|
|
86
|
-
set selected(value) {
|
|
87
|
-
this._selected = value;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* @hidden
|
|
91
|
-
*/
|
|
92
|
-
set tabIndex(index) {
|
|
93
|
-
this.element.tabIndex = index;
|
|
94
|
-
}
|
|
95
|
-
get tabIndex() {
|
|
96
|
-
return this.element.tabIndex;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Defines the name for an existing icon in a Kendo UI theme.
|
|
100
|
-
* The icon is rendered inside the Button by a `span.k-icon` element.
|
|
101
|
-
*/
|
|
102
|
-
set icon(icon) {
|
|
103
|
-
if (icon) {
|
|
104
|
-
this.iconSetter(icon, () => {
|
|
105
|
-
this.isIcon = true;
|
|
106
|
-
const classes = 'k-icon k-i-' + icon;
|
|
107
|
-
this.addIcon(classes);
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
this.isIcon = false;
|
|
112
|
-
this.updateIconNode();
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Defines a CSS class—or multiple classes separated by spaces—
|
|
117
|
-
* which are applied to a `span` element inside the Button. Allows the usage of custom icons.
|
|
118
|
-
*/
|
|
119
|
-
set iconClass(iconClassName) {
|
|
120
|
-
if (iconClassName) {
|
|
121
|
-
this.iconSetter(iconClassName, () => {
|
|
122
|
-
this.isIconClass = true;
|
|
123
|
-
this.addIcon(iconClassName);
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
this.isIconClass = false;
|
|
128
|
-
this.updateIconNode();
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Defines a URL which is used for an `img` element inside the Button.
|
|
133
|
-
* The URL can be relative or absolute. If relative, it is evaluated with relation to the web page URL.
|
|
134
|
-
*/
|
|
135
|
-
set imageUrl(imageUrl) {
|
|
136
|
-
if (imageUrl) {
|
|
137
|
-
this.iconSetter(imageUrl, this.addImgIcon.bind(this));
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
this.removeImageNode();
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* If set to `true`, it disables the Button.
|
|
145
|
-
*/
|
|
146
|
-
set disabled(disabled) {
|
|
147
|
-
this.isDisabled = disabled;
|
|
148
|
-
this.renderer.setProperty(this.element, 'disabled', disabled);
|
|
149
|
-
}
|
|
150
|
-
get disabled() {
|
|
151
|
-
return this.isDisabled;
|
|
152
|
-
}
|
|
153
|
-
set isFocused(isFocused) {
|
|
154
|
-
this.toggleClass('k-state-focused', isFocused);
|
|
155
|
-
this._focused = isFocused;
|
|
156
|
-
}
|
|
157
|
-
get isFocused() {
|
|
158
|
-
return this._focused;
|
|
159
|
-
}
|
|
160
|
-
get classButton() {
|
|
161
|
-
return true;
|
|
162
|
-
}
|
|
163
|
-
get classPrimary() {
|
|
164
|
-
return this.primary;
|
|
165
|
-
}
|
|
166
|
-
get isToggleable() {
|
|
167
|
-
return this.toggleable;
|
|
168
|
-
}
|
|
169
|
-
get isFlat() {
|
|
170
|
-
return this.look === 'flat';
|
|
171
|
-
}
|
|
172
|
-
get isBare() {
|
|
173
|
-
return this.look === 'bare';
|
|
174
|
-
}
|
|
175
|
-
get isOutline() {
|
|
176
|
-
return this.look === 'outline';
|
|
177
|
-
}
|
|
178
|
-
get isClear() {
|
|
179
|
-
return this.look === 'clear';
|
|
180
|
-
}
|
|
181
|
-
get roleSetter() {
|
|
182
|
-
return this.role;
|
|
183
|
-
}
|
|
184
|
-
get classDisabled() {
|
|
185
|
-
return this.isDisabled;
|
|
186
|
-
}
|
|
187
|
-
get classActive() {
|
|
188
|
-
return this.selected;
|
|
189
|
-
}
|
|
190
|
-
get getDirection() {
|
|
191
|
-
return this.direction;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* @hidden
|
|
195
|
-
*/
|
|
196
|
-
onFocus() {
|
|
197
|
-
this.isFocused = true;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* @hidden
|
|
201
|
-
*/
|
|
202
|
-
onBlur() {
|
|
203
|
-
this.isFocused = false;
|
|
204
|
-
}
|
|
205
|
-
ngOnInit() {
|
|
206
|
-
const isSpan = this.element.tagName === SPAN_TAG_NAME;
|
|
207
|
-
if (this.service) {
|
|
208
|
-
this.buttonLookChangeSubscription = this.service.buttonLookChange
|
|
209
|
-
.pipe(filter((look) => look !== 'default'))
|
|
210
|
-
.subscribe((look) => this.look = look);
|
|
211
|
-
}
|
|
212
|
-
if (!this.element.hasAttribute('role') && this.togglable) {
|
|
213
|
-
this.toggleAriaPressed(this.toggleable);
|
|
214
|
-
}
|
|
215
|
-
if (this.role) {
|
|
216
|
-
this.setAttribute('role', this.role);
|
|
217
|
-
}
|
|
218
|
-
this.ngZone.runOutsideAngular(() => {
|
|
219
|
-
this.domEvents.push(this.renderer.listen(this.element, 'click', this._onButtonClick.bind(this)));
|
|
220
|
-
this.domEvents.push(this.renderer.listen(this.element, 'keydown', (event) => {
|
|
221
|
-
if (isSpan && (event.keyCode === Keys.Space || event.keyCode === Keys.Enter)) {
|
|
222
|
-
this.click.emit(event);
|
|
223
|
-
this._onButtonClick();
|
|
224
|
-
}
|
|
225
|
-
}));
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
ngOnChanges(change) {
|
|
229
|
-
if (isChanged('togglable', change) || isChanged('toggleable', change)) {
|
|
230
|
-
this.toggleAriaPressed(this.toggleable);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
ngAfterViewChecked() {
|
|
234
|
-
this.setIconTextClasses();
|
|
235
|
-
}
|
|
236
|
-
ngOnDestroy() {
|
|
237
|
-
this.imageNode = null;
|
|
238
|
-
this.iconNode = null;
|
|
239
|
-
this.renderer = null;
|
|
240
|
-
this.localizationChangeSubscription.unsubscribe();
|
|
241
|
-
if (this.service && this.buttonLookChangeSubscription) {
|
|
242
|
-
this.buttonLookChangeSubscription.unsubscribe();
|
|
243
|
-
}
|
|
244
|
-
clearTimeout(this.deferTimeout);
|
|
245
|
-
this.domEvents.forEach(unbindHandler => unbindHandler());
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Focuses the Button component.
|
|
249
|
-
*/
|
|
250
|
-
focus() {
|
|
251
|
-
if (isDocumentAvailable()) {
|
|
252
|
-
this.element.focus();
|
|
253
|
-
this.isFocused = true;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Blurs the Button component.
|
|
258
|
-
*/
|
|
259
|
-
blur() {
|
|
260
|
-
if (isDocumentAvailable()) {
|
|
261
|
-
this.element.blur();
|
|
262
|
-
this.isFocused = false;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* @hidden
|
|
267
|
-
*/
|
|
268
|
-
setAttribute(attribute, value) {
|
|
269
|
-
this.renderer.setAttribute(this.element, attribute, value);
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* @hidden
|
|
273
|
-
*/
|
|
274
|
-
removeAttribute(attribute) {
|
|
275
|
-
this.renderer.removeAttribute(this.element, attribute);
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* @hidden
|
|
279
|
-
*
|
|
280
|
-
* Internal setter that triggers selectedChange
|
|
281
|
-
*/
|
|
282
|
-
setSelected(value) {
|
|
283
|
-
const changed = this.selected !== value;
|
|
284
|
-
this.selected = value;
|
|
285
|
-
this.setAttribute('aria-pressed', this.selected.toString());
|
|
286
|
-
this.toggleClass('k-state-selected', this.selected);
|
|
287
|
-
if (changed && hasObservers(this.selectedChange)) {
|
|
288
|
-
this.ngZone.run(() => {
|
|
289
|
-
this.selectedChange.emit(value);
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
toggleAriaPressed(shouldSet) {
|
|
294
|
-
if (!isDocumentAvailable()) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
if (shouldSet) {
|
|
298
|
-
this.setAttribute('aria-pressed', this.selected.toString());
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
this.removeAttribute('aria-pressed');
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
hasText() {
|
|
305
|
-
if (isDocumentAvailable()) {
|
|
306
|
-
return String(this.element.textContent).trim().length > 0;
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
return false;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
addImgIcon(imageUrl) {
|
|
313
|
-
let renderer = this.renderer;
|
|
314
|
-
if (this.imageNode) {
|
|
315
|
-
renderer.setProperty(this.imageNode, 'src', imageUrl);
|
|
316
|
-
}
|
|
317
|
-
else if (isDocumentAvailable()) {
|
|
318
|
-
this.imageNode = renderer.createElement('img');
|
|
319
|
-
renderer.setProperty(this.imageNode, 'src', imageUrl);
|
|
320
|
-
renderer.setProperty(this.imageNode, 'className', 'k-image');
|
|
321
|
-
renderer.setAttribute(this.imageNode, 'role', 'presentation');
|
|
322
|
-
this.prependChild(this.imageNode);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
addIcon(classNames) {
|
|
326
|
-
let renderer = this.renderer;
|
|
327
|
-
if (this.iconNode) {
|
|
328
|
-
renderer.setProperty(this.iconNode, 'className', classNames);
|
|
329
|
-
}
|
|
330
|
-
else if (isDocumentAvailable()) {
|
|
331
|
-
this.iconNode = renderer.createElement('span');
|
|
332
|
-
renderer.setProperty(this.iconNode, 'className', classNames);
|
|
333
|
-
renderer.setAttribute(this.iconNode, 'role', 'presentation');
|
|
334
|
-
this.prependChild(this.iconNode);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
prependChild(node) {
|
|
338
|
-
this.defer(() => {
|
|
339
|
-
if (this.renderer && node !== this.element.firstChild) {
|
|
340
|
-
this.renderer.insertBefore(this.element, node, this.element.firstChild);
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
defer(callback) {
|
|
345
|
-
this.ngZone.runOutsideAngular(() => {
|
|
346
|
-
this.deferTimeout = setTimeout(callback, 0);
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
iconSetter(icon, insertIcon) {
|
|
350
|
-
if (icon) {
|
|
351
|
-
insertIcon(icon);
|
|
352
|
-
}
|
|
353
|
-
this.setIconTextClasses();
|
|
354
|
-
}
|
|
355
|
-
removeImageNode() {
|
|
356
|
-
if (this.imageNode && this.renderer.parentNode(this.imageNode)) {
|
|
357
|
-
this.renderer.removeChild(this.element, this.imageNode);
|
|
358
|
-
this.imageNode = null;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
removeIconNode() {
|
|
362
|
-
if (this.iconNode && this.renderer.parentNode(this.iconNode)) {
|
|
363
|
-
this.renderer.removeChild(this.element, this.iconNode);
|
|
364
|
-
this.iconNode = null;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
updateIconNode() {
|
|
368
|
-
if (!this.isIcon && !this.isIconClass) {
|
|
369
|
-
this.removeIconNode();
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
setIconTextClasses() {
|
|
373
|
-
const hasIcon = this.isIcon || this.isIconClass || this.imageNode;
|
|
374
|
-
const hasText = this.hasText();
|
|
375
|
-
this.toggleClass('k-button-icon', hasIcon && !hasText);
|
|
376
|
-
this.toggleClass('k-button-icontext', hasIcon && hasText);
|
|
377
|
-
}
|
|
378
|
-
toggleClass(className, add) {
|
|
379
|
-
if (add) {
|
|
380
|
-
this.renderer.addClass(this.element, className);
|
|
381
|
-
}
|
|
382
|
-
else {
|
|
383
|
-
this.renderer.removeClass(this.element, className);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
_onButtonClick() {
|
|
387
|
-
if (!this.disabled && this.service) {
|
|
388
|
-
this.ngZone.run(() => {
|
|
389
|
-
this.service.click(this);
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
if (this.togglable && !this.service) {
|
|
393
|
-
this.setSelected(!this.selected);
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
ButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ButtonDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.KendoButtonService, optional: true }, { token: i2.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
398
|
-
ButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: { toggleable: "toggleable", togglable: "togglable", primary: "primary", look: "look", selected: "selected", tabIndex: "tabIndex", icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", disabled: "disabled", role: "role" }, outputs: { selectedChange: "selectedChange", click: "click" }, host: { listeners: { "focus": "onFocus()", "blur": "onBlur()" }, properties: { "class.k-button": "this.classButton", "class.k-primary": "this.classPrimary", "class.k-toggle-button": "this.isToggleable", "class.k-flat": "this.isFlat", "class.k-bare": "this.isBare", "class.k-outline": "this.isOutline", "class.k-button-clear": "this.isClear", "attr.role": "this.roleSetter", "attr.aria-disabled": "this.classDisabled", "class.k-state-disabled": "this.classDisabled", "class.k-state-selected": "this.classActive", "attr.dir": "this.getDirection" } }, providers: [
|
|
399
|
-
LocalizationService,
|
|
400
|
-
{
|
|
401
|
-
provide: L10N_PREFIX,
|
|
402
|
-
useValue: 'kendo.button'
|
|
403
|
-
}
|
|
404
|
-
], exportAs: ["kendoButton"], usesOnChanges: true, ngImport: i0 });
|
|
405
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ButtonDirective, decorators: [{
|
|
406
|
-
type: Directive,
|
|
407
|
-
args: [{
|
|
408
|
-
exportAs: 'kendoButton',
|
|
409
|
-
providers: [
|
|
410
|
-
LocalizationService,
|
|
411
|
-
{
|
|
412
|
-
provide: L10N_PREFIX,
|
|
413
|
-
useValue: 'kendo.button'
|
|
414
|
-
}
|
|
415
|
-
],
|
|
416
|
-
selector: 'button[kendoButton], span[kendoButton]' // eslint-disable-line
|
|
417
|
-
}]
|
|
418
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.KendoButtonService, decorators: [{
|
|
419
|
-
type: Optional
|
|
420
|
-
}] }, { type: i2.LocalizationService }, { type: i0.NgZone }]; }, propDecorators: { toggleable: [{
|
|
421
|
-
type: Input
|
|
422
|
-
}], togglable: [{
|
|
423
|
-
type: Input
|
|
424
|
-
}], primary: [{
|
|
425
|
-
type: Input
|
|
426
|
-
}], look: [{
|
|
427
|
-
type: Input
|
|
428
|
-
}], selected: [{
|
|
429
|
-
type: Input
|
|
430
|
-
}], tabIndex: [{
|
|
431
|
-
type: Input
|
|
432
|
-
}], icon: [{
|
|
433
|
-
type: Input
|
|
434
|
-
}], iconClass: [{
|
|
435
|
-
type: Input
|
|
436
|
-
}], imageUrl: [{
|
|
437
|
-
type: Input
|
|
438
|
-
}], disabled: [{
|
|
439
|
-
type: Input
|
|
440
|
-
}], role: [{
|
|
441
|
-
type: Input
|
|
442
|
-
}], selectedChange: [{
|
|
443
|
-
type: Output
|
|
444
|
-
}], click: [{
|
|
445
|
-
type: Output
|
|
446
|
-
}], classButton: [{
|
|
447
|
-
type: HostBinding,
|
|
448
|
-
args: ['class.k-button']
|
|
449
|
-
}], classPrimary: [{
|
|
450
|
-
type: HostBinding,
|
|
451
|
-
args: ['class.k-primary']
|
|
452
|
-
}], isToggleable: [{
|
|
453
|
-
type: HostBinding,
|
|
454
|
-
args: ['class.k-toggle-button']
|
|
455
|
-
}], isFlat: [{
|
|
456
|
-
type: HostBinding,
|
|
457
|
-
args: ['class.k-flat']
|
|
458
|
-
}], isBare: [{
|
|
459
|
-
type: HostBinding,
|
|
460
|
-
args: ['class.k-bare']
|
|
461
|
-
}], isOutline: [{
|
|
462
|
-
type: HostBinding,
|
|
463
|
-
args: ['class.k-outline']
|
|
464
|
-
}], isClear: [{
|
|
465
|
-
type: HostBinding,
|
|
466
|
-
args: ['class.k-button-clear']
|
|
467
|
-
}], roleSetter: [{
|
|
468
|
-
type: HostBinding,
|
|
469
|
-
args: ['attr.role']
|
|
470
|
-
}], classDisabled: [{
|
|
471
|
-
type: HostBinding,
|
|
472
|
-
args: ['attr.aria-disabled']
|
|
473
|
-
}, {
|
|
474
|
-
type: HostBinding,
|
|
475
|
-
args: ['class.k-state-disabled']
|
|
476
|
-
}], classActive: [{
|
|
477
|
-
type: HostBinding,
|
|
478
|
-
args: ['class.k-state-selected']
|
|
479
|
-
}], getDirection: [{
|
|
480
|
-
type: HostBinding,
|
|
481
|
-
args: ['attr.dir']
|
|
482
|
-
}], onFocus: [{
|
|
483
|
-
type: HostListener,
|
|
484
|
-
args: ['focus']
|
|
485
|
-
}], onBlur: [{
|
|
486
|
-
type: HostListener,
|
|
487
|
-
args: ['blur']
|
|
488
|
-
}] } });
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Injectable } from '@angular/core';
|
|
6
|
-
import { BehaviorSubject, Subject } from 'rxjs';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
export class KendoButtonService {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.buttonLookChange = new BehaviorSubject('default');
|
|
14
|
-
this.buttonClicked = new Subject();
|
|
15
|
-
this.buttonClicked$ = this.buttonClicked.asObservable();
|
|
16
|
-
}
|
|
17
|
-
click(button) {
|
|
18
|
-
this.buttonClicked.next(button);
|
|
19
|
-
}
|
|
20
|
-
setButtonLook(look) {
|
|
21
|
-
this.buttonLookChange.next(look);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
KendoButtonService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: KendoButtonService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
25
|
-
KendoButtonService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: KendoButtonService });
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: KendoButtonService, decorators: [{
|
|
27
|
-
type: Injectable
|
|
28
|
-
}] });
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { NgModule } from '@angular/core';
|
|
6
|
-
import { CommonModule } from '@angular/common';
|
|
7
|
-
import { ButtonModule } from '../button/button.module';
|
|
8
|
-
import { ButtonGroupComponent } from './buttongroup.component';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
/**
|
|
11
|
-
* @hidden
|
|
12
|
-
*
|
|
13
|
-
* The exported package module.
|
|
14
|
-
*
|
|
15
|
-
* The package exports:
|
|
16
|
-
* - `ButtonGroupComponent`—The ButtonGroupComponent component class.
|
|
17
|
-
*/
|
|
18
|
-
export class ButtonGroupModule {
|
|
19
|
-
}
|
|
20
|
-
ButtonGroupModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ButtonGroupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
21
|
-
ButtonGroupModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ButtonGroupModule, declarations: [ButtonGroupComponent], imports: [CommonModule, ButtonModule], exports: [ButtonGroupComponent] });
|
|
22
|
-
ButtonGroupModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ButtonGroupModule, imports: [[CommonModule, ButtonModule]] });
|
|
23
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ButtonGroupModule, decorators: [{
|
|
24
|
-
type: NgModule,
|
|
25
|
-
args: [{
|
|
26
|
-
declarations: [ButtonGroupComponent],
|
|
27
|
-
exports: [ButtonGroupComponent],
|
|
28
|
-
imports: [CommonModule, ButtonModule]
|
|
29
|
-
}]
|
|
30
|
-
}] });
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, Input, HostBinding, ContentChildren, EventEmitter, Output, HostListener } from '@angular/core';
|
|
6
|
-
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
7
|
-
import { ChipComponent } from './chip.component';
|
|
8
|
-
import { closest } from '../util';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
import * as i1 from "@progress/kendo-angular-l10n";
|
|
11
|
-
export class ChipListComponent {
|
|
12
|
-
constructor(localizationService, renderer) {
|
|
13
|
-
this.localizationService = localizationService;
|
|
14
|
-
this.renderer = renderer;
|
|
15
|
-
this.hostClass = true;
|
|
16
|
-
/**
|
|
17
|
-
* Sets the selection mode of the ChipList.
|
|
18
|
-
*
|
|
19
|
-
* The available values are:
|
|
20
|
-
* * `none` (default)
|
|
21
|
-
* * `single`
|
|
22
|
-
* * `multiple`
|
|
23
|
-
*/
|
|
24
|
-
this.selection = 'none';
|
|
25
|
-
/**
|
|
26
|
-
* Fires each time when the ChipList selection is changed.
|
|
27
|
-
*/
|
|
28
|
-
this.selectedChange = new EventEmitter();
|
|
29
|
-
/**
|
|
30
|
-
* Fires each time the user clicks on the remove icon of the Chip.
|
|
31
|
-
*/
|
|
32
|
-
this.remove = new EventEmitter();
|
|
33
|
-
this.role = 'listbox';
|
|
34
|
-
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
35
|
-
}
|
|
36
|
-
get single() {
|
|
37
|
-
return this.selection === 'single';
|
|
38
|
-
}
|
|
39
|
-
get multiple() {
|
|
40
|
-
return this.selection === 'multiple';
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* @hidden
|
|
44
|
-
*/
|
|
45
|
-
onClick($event) {
|
|
46
|
-
const target = $event.target;
|
|
47
|
-
const isRemoveClicked = closest(target, '.k-remove-icon');
|
|
48
|
-
const clickedChip = closest(target, '.k-chip');
|
|
49
|
-
const chip = this.chips.find((chip) => clickedChip === chip.element.nativeElement);
|
|
50
|
-
if (isRemoveClicked && clickedChip) {
|
|
51
|
-
const removeEventArgs = { sender: this, originalEvent: $event, removedChip: chip };
|
|
52
|
-
this.remove.emit(removeEventArgs);
|
|
53
|
-
}
|
|
54
|
-
if (this.selection !== 'none' && clickedChip && !isRemoveClicked) {
|
|
55
|
-
this.setSelection(chip);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
ngOnInit() {
|
|
59
|
-
this.dynamicRTLSubscription = this.localizationService.changes
|
|
60
|
-
.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr');
|
|
61
|
-
}
|
|
62
|
-
ngAfterContentInit() {
|
|
63
|
-
this.chips.forEach((chip) => {
|
|
64
|
-
this.renderer.setAttribute(chip.element.nativeElement, 'role', 'option');
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
ngOnDestroy() {
|
|
68
|
-
if (this.dynamicRTLSubscription) {
|
|
69
|
-
this.dynamicRTLSubscription.unsubscribe();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
selectedChips() {
|
|
73
|
-
return this.chips.reduce((acc, cur, idx) => { return cur.selected ? acc.concat(idx) : acc; }, []);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Updates the selection on click of a Chip. Emits events.
|
|
77
|
-
*/
|
|
78
|
-
setSelection(chip) {
|
|
79
|
-
if (this.selection === 'single') {
|
|
80
|
-
this.clearSelection(chip);
|
|
81
|
-
}
|
|
82
|
-
chip.selected = !chip.selected;
|
|
83
|
-
this.selectedChange.emit(this.selectedChips());
|
|
84
|
-
}
|
|
85
|
-
clearSelection(chip) {
|
|
86
|
-
this.chips.forEach((c) => {
|
|
87
|
-
if (chip !== c) {
|
|
88
|
-
c.selected = false;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
ChipListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ChipListComponent, deps: [{ token: i1.LocalizationService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
94
|
-
ChipListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: ChipListComponent, selector: "kendo-chip-list, kendo-chiplist", inputs: { selection: "selection" }, outputs: { selectedChange: "selectedChange", remove: "remove" }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.k-chip-list": "this.hostClass", "attr.dir": "this.direction", "class.k-selection-single": "this.single", "class.k-selection-multiple": "this.multiple", "attr.role": "this.role" } }, providers: [
|
|
95
|
-
LocalizationService,
|
|
96
|
-
{
|
|
97
|
-
provide: L10N_PREFIX,
|
|
98
|
-
useValue: 'kendo.chip-list'
|
|
99
|
-
}
|
|
100
|
-
], queries: [{ propertyName: "chips", predicate: ChipComponent }], ngImport: i0, template: `
|
|
101
|
-
<ng-content></ng-content>
|
|
102
|
-
`, isInline: true });
|
|
103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ChipListComponent, decorators: [{
|
|
104
|
-
type: Component,
|
|
105
|
-
args: [{
|
|
106
|
-
selector: 'kendo-chip-list, kendo-chiplist',
|
|
107
|
-
template: `
|
|
108
|
-
<ng-content></ng-content>
|
|
109
|
-
`,
|
|
110
|
-
providers: [
|
|
111
|
-
LocalizationService,
|
|
112
|
-
{
|
|
113
|
-
provide: L10N_PREFIX,
|
|
114
|
-
useValue: 'kendo.chip-list'
|
|
115
|
-
}
|
|
116
|
-
]
|
|
117
|
-
}]
|
|
118
|
-
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i0.Renderer2 }]; }, propDecorators: { hostClass: [{
|
|
119
|
-
type: HostBinding,
|
|
120
|
-
args: ['class.k-chip-list']
|
|
121
|
-
}], direction: [{
|
|
122
|
-
type: HostBinding,
|
|
123
|
-
args: ['attr.dir']
|
|
124
|
-
}], selection: [{
|
|
125
|
-
type: Input
|
|
126
|
-
}], selectedChange: [{
|
|
127
|
-
type: Output
|
|
128
|
-
}], remove: [{
|
|
129
|
-
type: Output
|
|
130
|
-
}], chips: [{
|
|
131
|
-
type: ContentChildren,
|
|
132
|
-
args: [ChipComponent]
|
|
133
|
-
}], single: [{
|
|
134
|
-
type: HostBinding,
|
|
135
|
-
args: ['class.k-selection-single']
|
|
136
|
-
}], multiple: [{
|
|
137
|
-
type: HostBinding,
|
|
138
|
-
args: ['class.k-selection-multiple']
|
|
139
|
-
}], role: [{
|
|
140
|
-
type: HostBinding,
|
|
141
|
-
args: ['attr.role']
|
|
142
|
-
}], onClick: [{
|
|
143
|
-
type: HostListener,
|
|
144
|
-
args: ['click', ['$event']]
|
|
145
|
-
}] } });
|