@progress/kendo-angular-buttons 7.0.6 → 8.0.0-dev.202204190655
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/bundles/kendo-angular-buttons.umd.js +5 -0
- package/{dist/es2015/button → button}/button.directive.d.ts +64 -62
- package/{dist/es2015/button → button}/button.module.d.ts +5 -0
- package/{dist/es2015/button → button}/button.service.d.ts +3 -0
- package/{dist/es2015/button → button}/selection-settings.d.ts +0 -0
- package/{dist/es2015/buttongroup → buttongroup}/buttongroup.component.d.ts +14 -11
- package/{dist/es2015/buttongroup → buttongroup}/buttongroup.module.d.ts +7 -0
- package/{dist/es2015/buttons.module.d.ts → buttons.module.d.ts} +10 -0
- package/{dist/es2015/chip → chip}/chip-content-click-event-args.interface.d.ts +0 -0
- package/{dist/es2015/chip → chip}/chip-list-remove-event-args.interface.d.ts +0 -0
- package/{dist/es2015/chip → chip}/chip-list.component.d.ts +8 -4
- package/{dist/es2015/chip → chip}/chip-remove-event-args.interface.d.ts +0 -0
- package/{dist/es2015/chip → chip}/chip.component.d.ts +39 -33
- package/{dist/es2015/chip → chip}/chip.module.d.ts +7 -0
- package/{dist/es2015/chip → chip}/models/selection.d.ts +0 -0
- package/{dist/es2015/common → common}/models/fillmode.d.ts +2 -2
- package/{dist/es2015/common → common}/models/rounded.d.ts +2 -2
- package/{dist/es2015/common → common}/models/size.d.ts +3 -3
- package/{dist/es2015/common → common}/models/styling-classes.d.ts +0 -0
- package/{dist/es2015/common → common}/models/theme-color.d.ts +3 -3
- package/{dist/es2015/common → common}/models.d.ts +0 -1
- package/{dist/es2015/direction.d.ts → direction.d.ts} +0 -0
- package/{dist/es2015/dropdownbutton → dropdownbutton}/dropdownbutton.component.d.ts +37 -38
- package/dropdownbutton/dropdownbutton.module.d.ts +23 -0
- package/{dist/es2015 → esm2015}/button/button.directive.js +145 -215
- package/{dist/es2015 → esm2015}/button/button.module.js +13 -10
- package/{dist/es2015 → esm2015}/button/button.service.js +8 -10
- package/{dist/es → esm2015}/button/selection-settings.js +1 -0
- package/{dist/es2015 → esm2015}/buttongroup/buttongroup.component.js +88 -111
- package/esm2015/buttongroup/buttongroup.module.js +30 -0
- package/{dist/es → esm2015}/buttons.module.js +12 -12
- package/{dist/es2015 → esm2015}/chip/chip-content-click-event-args.interface.js +1 -0
- package/{dist/es2015 → esm2015}/chip/chip-list-remove-event-args.interface.js +1 -0
- package/{dist/es2015 → esm2015}/chip/chip-list.component.js +62 -73
- package/{dist/es2015 → esm2015}/chip/chip-remove-event-args.interface.js +1 -0
- package/{dist/es2015 → esm2015}/chip/chip.component.js +171 -167
- package/{dist/es2015 → esm2015}/chip/chip.module.js +16 -11
- package/{dist/es → esm2015}/chip/models/selection.js +1 -0
- package/{dist/es → esm2015}/common/models/fillmode.js +1 -0
- package/{dist/es → esm2015}/common/models/rounded.js +1 -0
- package/{dist/es → esm2015}/common/models/size.js +1 -0
- package/{dist/es → esm2015}/common/models/styling-classes.js +1 -0
- package/{dist/es → esm2015}/common/models/theme-color.js +1 -0
- package/{dist/es → esm2015}/common/models.js +5 -0
- package/{dist/es → esm2015}/direction.js +1 -0
- package/{dist/es2015 → esm2015}/dropdownbutton/dropdownbutton.component.js +185 -214
- package/esm2015/dropdownbutton/dropdownbutton.module.js +32 -0
- package/{dist/es2015 → esm2015}/floatingactionbutton/animations/animations.js +0 -0
- package/esm2015/floatingactionbutton/dial-item.component.js +127 -0
- package/esm2015/floatingactionbutton/dial-list.component.js +90 -0
- package/{dist/es2015 → esm2015}/floatingactionbutton/floatingactionbutton.component.js +205 -210
- package/{dist/es2015 → esm2015}/floatingactionbutton/floatingactionbutton.module.js +19 -11
- package/{dist/es → esm2015}/floatingactionbutton/models/align.js +1 -0
- package/{dist/es → esm2015}/floatingactionbutton/models/item-animation.interface.js +1 -0
- package/{dist/es → esm2015}/floatingactionbutton/models/item-click.event.js +1 -0
- package/{dist/es → esm2015}/floatingactionbutton/models/item.interface.js +1 -0
- package/{dist/es → esm2015}/floatingactionbutton/models/offset.js +1 -0
- package/{dist/es → esm2015}/floatingactionbutton/models/position-mode.js +1 -0
- package/esm2015/floatingactionbutton/templates/dial-item-template.directive.js +27 -0
- package/esm2015/floatingactionbutton/templates/fab-template.directive.js +27 -0
- package/{dist/es2015 → esm2015}/floatingactionbutton/utils.js +0 -0
- package/{dist/es2015 → esm2015}/focusable/focus.service.js +8 -10
- package/{dist/es2015 → esm2015}/focusable/focusable.directive.js +20 -27
- package/{dist/es2015/listbutton/list.module.d.ts → esm2015/kendo-angular-buttons.js} +2 -3
- package/{dist/es2015 → esm2015}/listbutton/button-item-template.directive.js +12 -12
- package/{dist/es2015 → esm2015}/listbutton/list-button.js +30 -37
- package/{dist/es → esm2015}/listbutton/list-item-model.js +1 -0
- package/esm2015/listbutton/list.component.js +140 -0
- package/esm2015/listbutton/list.module.js +39 -0
- package/{dist/es → esm2015}/listbutton/popup-settings.js +1 -0
- package/esm2015/listbutton/template-context.directive.js +34 -0
- package/{dist/es2015 → esm2015}/main.js +7 -0
- package/{dist/es → esm2015}/navigation/key-events.js +0 -0
- package/{dist/es2015 → esm2015}/navigation/navigation-action.js +1 -0
- package/{dist/es2015 → esm2015}/navigation/navigation-config.js +0 -0
- package/{dist/es2015 → esm2015}/navigation/navigation.service.js +11 -9
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/{dist/es2015 → esm2015}/preventable-event.js +0 -0
- package/esm2015/splitbutton/localization/custom-messages.component.js +37 -0
- package/esm2015/splitbutton/localization/localized-messages.directive.js +36 -0
- package/esm2015/splitbutton/localization/messages.js +23 -0
- package/{dist/es2015 → esm2015}/splitbutton/splitbutton.component.js +221 -209
- package/esm2015/splitbutton/splitbutton.module.js +34 -0
- package/{dist/es2015 → esm2015}/util.js +7 -7
- package/{dist/fesm2015/index.js → fesm2015/kendo-angular-buttons.js} +1885 -1941
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/animations/animations.d.ts +0 -0
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/dial-item.component.d.ts +8 -5
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/dial-list.component.d.ts +5 -2
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/floatingactionbutton.component.d.ts +50 -51
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/floatingactionbutton.module.d.ts +13 -0
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/models/align.d.ts +0 -0
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/models/item-animation.interface.d.ts +0 -0
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/models/item-click.event.d.ts +0 -0
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/models/item.interface.d.ts +0 -0
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/models/offset.d.ts +0 -0
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/models/position-mode.d.ts +0 -0
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/templates/dial-item-template.directive.d.ts +3 -0
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/templates/fab-template.directive.d.ts +3 -0
- package/{dist/es2015/floatingactionbutton → floatingactionbutton}/utils.d.ts +0 -0
- package/{dist/es2015/focusable → focusable}/focus.service.d.ts +5 -1
- package/{dist/es2015/focusable → focusable}/focusable.directive.d.ts +4 -2
- package/{dist/es2015/common/models/shape.d.ts → kendo-angular-buttons.d.ts} +3 -3
- package/{dist/es2015/listbutton → listbutton}/button-item-template.directive.d.ts +3 -0
- package/{dist/es2015/listbutton → listbutton}/list-button.d.ts +7 -13
- package/{dist/es2015/listbutton → listbutton}/list-item-model.d.ts +0 -0
- package/{dist/es2015/listbutton → listbutton}/list.component.d.ts +4 -1
- package/listbutton/list.module.d.ts +18 -0
- package/{dist/es2015/listbutton → listbutton}/popup-settings.d.ts +0 -0
- package/{dist/es2015/listbutton → listbutton}/template-context.directive.d.ts +4 -1
- package/{dist/es2015/main.d.ts → main.d.ts} +7 -1
- package/{dist/es2015/navigation → navigation}/key-events.d.ts +0 -0
- package/{dist/es2015/navigation → navigation}/navigation-action.d.ts +0 -0
- package/{dist/es2015/navigation → navigation}/navigation-config.d.ts +0 -0
- package/{dist/es2015/navigation → navigation}/navigation.service.d.ts +3 -0
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +38 -113
- package/{dist/es2015/preventable-event.d.ts → preventable-event.d.ts} +0 -0
- package/schematics/ngAdd/index.js +5 -2
- package/schematics/ngAdd/index.js.map +1 -1
- package/{dist/es2015/splitbutton → splitbutton}/localization/custom-messages.component.d.ts +4 -1
- package/{dist/es2015/splitbutton → splitbutton}/localization/localized-messages.directive.d.ts +3 -0
- package/{dist/es2015/splitbutton → splitbutton}/localization/messages.d.ts +3 -0
- package/{dist/es2015/splitbutton → splitbutton}/splitbutton.component.d.ts +39 -27
- package/splitbutton/splitbutton.module.d.ts +25 -0
- package/{dist/es2015/util.d.ts → util.d.ts} +0 -0
- package/dist/cdn/js/kendo-angular-buttons.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/button/button.directive.js +0 -775
- package/dist/es/button/button.module.js +0 -50
- package/dist/es/button/button.service.js +0 -24
- package/dist/es/buttongroup/buttongroup.component.js +0 -353
- package/dist/es/buttongroup/buttongroup.module.js +0 -30
- package/dist/es/chip/chip-content-click-event-args.interface.js +0 -4
- package/dist/es/chip/chip-list-remove-event-args.interface.js +0 -4
- package/dist/es/chip/chip-list.component.js +0 -214
- package/dist/es/chip/chip-remove-event-args.interface.js +0 -4
- package/dist/es/chip/chip.component.js +0 -449
- package/dist/es/chip/chip.module.js +0 -55
- package/dist/es/common/models/shape.js +0 -4
- package/dist/es/dropdownbutton/dropdownbutton.component.js +0 -704
- package/dist/es/dropdownbutton/dropdownbutton.module.js +0 -32
- package/dist/es/floatingactionbutton/animations/animations.js +0 -33
- package/dist/es/floatingactionbutton/dial-item.component.js +0 -143
- package/dist/es/floatingactionbutton/dial-list.component.js +0 -76
- package/dist/es/floatingactionbutton/floatingactionbutton.component.js +0 -903
- package/dist/es/floatingactionbutton/floatingactionbutton.module.js +0 -65
- package/dist/es/floatingactionbutton/templates/dial-item-template.directive.js +0 -26
- package/dist/es/floatingactionbutton/templates/fab-template.directive.js +0 -26
- package/dist/es/floatingactionbutton/utils.js +0 -38
- package/dist/es/focusable/focus.service.js +0 -43
- package/dist/es/focusable/focusable.directive.js +0 -68
- package/dist/es/index.js +0 -22
- package/dist/es/listbutton/button-item-template.directive.js +0 -68
- package/dist/es/listbutton/list-button.js +0 -243
- package/dist/es/listbutton/list.component.js +0 -85
- package/dist/es/listbutton/list.module.js +0 -33
- package/dist/es/listbutton/template-context.directive.js +0 -40
- package/dist/es/main.js +0 -22
- package/dist/es/navigation/navigation-action.js +0 -19
- package/dist/es/navigation/navigation-config.js +0 -9
- package/dist/es/navigation/navigation.service.js +0 -114
- package/dist/es/package-metadata.js +0 -15
- package/dist/es/preventable-event.js +0 -29
- package/dist/es/splitbutton/localization/custom-messages.component.js +0 -44
- package/dist/es/splitbutton/localization/localized-messages.directive.js +0 -35
- package/dist/es/splitbutton/localization/messages.js +0 -22
- package/dist/es/splitbutton/splitbutton.component.js +0 -830
- package/dist/es/splitbutton/splitbutton.module.js +0 -34
- package/dist/es/util.js +0 -108
- package/dist/es2015/button/selection-settings.js +0 -4
- package/dist/es2015/buttongroup/buttongroup.module.js +0 -27
- package/dist/es2015/buttons.module.js +0 -51
- package/dist/es2015/chip/models/selection.js +0 -4
- package/dist/es2015/common/models/fillmode.js +0 -4
- package/dist/es2015/common/models/rounded.js +0 -4
- package/dist/es2015/common/models/shape.js +0 -4
- package/dist/es2015/common/models/size.js +0 -4
- package/dist/es2015/common/models/styling-classes.js +0 -4
- package/dist/es2015/common/models/theme-color.js +0 -4
- package/dist/es2015/common/models.js +0 -4
- package/dist/es2015/direction.js +0 -4
- package/dist/es2015/dropdownbutton/dropdownbutton.module.d.ts +0 -14
- package/dist/es2015/dropdownbutton/dropdownbutton.module.js +0 -29
- package/dist/es2015/floatingactionbutton/dial-item.component.js +0 -133
- package/dist/es2015/floatingactionbutton/dial-list.component.js +0 -81
- package/dist/es2015/floatingactionbutton/models/align.js +0 -4
- package/dist/es2015/floatingactionbutton/models/item-animation.interface.js +0 -4
- package/dist/es2015/floatingactionbutton/models/item-click.event.js +0 -4
- package/dist/es2015/floatingactionbutton/models/item.interface.js +0 -4
- package/dist/es2015/floatingactionbutton/models/offset.js +0 -4
- package/dist/es2015/floatingactionbutton/models/position-mode.js +0 -4
- package/dist/es2015/floatingactionbutton/templates/dial-item-template.directive.js +0 -25
- package/dist/es2015/floatingactionbutton/templates/fab-template.directive.js +0 -25
- package/dist/es2015/index.d.ts +0 -22
- package/dist/es2015/index.js +0 -22
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/listbutton/list-item-model.js +0 -4
- package/dist/es2015/listbutton/list.component.js +0 -115
- package/dist/es2015/listbutton/list.module.js +0 -30
- package/dist/es2015/listbutton/popup-settings.js +0 -4
- package/dist/es2015/listbutton/template-context.directive.js +0 -35
- package/dist/es2015/navigation/key-events.js +0 -13
- package/dist/es2015/splitbutton/localization/custom-messages.component.js +0 -36
- package/dist/es2015/splitbutton/localization/localized-messages.directive.js +0 -31
- package/dist/es2015/splitbutton/localization/messages.js +0 -16
- package/dist/es2015/splitbutton/splitbutton.module.d.ts +0 -14
- package/dist/es2015/splitbutton/splitbutton.module.js +0 -31
- package/dist/fesm5/index.js +0 -5577
- package/dist/npm/button/button.directive.js +0 -777
- package/dist/npm/button/button.module.js +0 -52
- package/dist/npm/button/button.service.js +0 -26
- package/dist/npm/button/selection-settings.js +0 -6
- package/dist/npm/buttongroup/buttongroup.component.js +0 -355
- package/dist/npm/buttongroup/buttongroup.module.js +0 -32
- package/dist/npm/buttons.module.js +0 -56
- package/dist/npm/chip/chip-content-click-event-args.interface.js +0 -6
- package/dist/npm/chip/chip-list-remove-event-args.interface.js +0 -6
- package/dist/npm/chip/chip-list.component.js +0 -216
- package/dist/npm/chip/chip-remove-event-args.interface.js +0 -6
- package/dist/npm/chip/chip.component.js +0 -451
- package/dist/npm/chip/chip.module.js +0 -57
- package/dist/npm/chip/models/selection.js +0 -6
- package/dist/npm/common/models/fillmode.js +0 -6
- package/dist/npm/common/models/rounded.js +0 -6
- package/dist/npm/common/models/shape.js +0 -6
- package/dist/npm/common/models/size.js +0 -6
- package/dist/npm/common/models/styling-classes.js +0 -6
- package/dist/npm/common/models/theme-color.js +0 -6
- package/dist/npm/common/models.js +0 -6
- package/dist/npm/direction.js +0 -6
- package/dist/npm/dropdownbutton/dropdownbutton.component.js +0 -706
- package/dist/npm/dropdownbutton/dropdownbutton.module.js +0 -34
- package/dist/npm/floatingactionbutton/animations/animations.js +0 -37
- package/dist/npm/floatingactionbutton/dial-item.component.js +0 -145
- package/dist/npm/floatingactionbutton/dial-list.component.js +0 -78
- package/dist/npm/floatingactionbutton/floatingactionbutton.component.js +0 -905
- package/dist/npm/floatingactionbutton/floatingactionbutton.module.js +0 -67
- package/dist/npm/floatingactionbutton/models/align.js +0 -6
- package/dist/npm/floatingactionbutton/models/item-animation.interface.js +0 -6
- package/dist/npm/floatingactionbutton/models/item-click.event.js +0 -6
- package/dist/npm/floatingactionbutton/models/item.interface.js +0 -6
- package/dist/npm/floatingactionbutton/models/offset.js +0 -6
- package/dist/npm/floatingactionbutton/models/position-mode.js +0 -6
- package/dist/npm/floatingactionbutton/templates/dial-item-template.directive.js +0 -28
- package/dist/npm/floatingactionbutton/templates/fab-template.directive.js +0 -28
- package/dist/npm/floatingactionbutton/utils.js +0 -42
- package/dist/npm/focusable/focus.service.js +0 -45
- package/dist/npm/focusable/focusable.directive.js +0 -70
- package/dist/npm/index.js +0 -39
- package/dist/npm/listbutton/button-item-template.directive.js +0 -70
- package/dist/npm/listbutton/list-button.js +0 -245
- package/dist/npm/listbutton/list-item-model.js +0 -6
- package/dist/npm/listbutton/list.component.js +0 -87
- package/dist/npm/listbutton/list.module.js +0 -35
- package/dist/npm/listbutton/popup-settings.js +0 -6
- package/dist/npm/listbutton/template-context.directive.js +0 -42
- package/dist/npm/main.js +0 -45
- package/dist/npm/navigation/key-events.js +0 -15
- package/dist/npm/navigation/navigation-action.js +0 -21
- package/dist/npm/navigation/navigation-config.js +0 -11
- package/dist/npm/navigation/navigation.service.js +0 -116
- package/dist/npm/package-metadata.js +0 -17
- package/dist/npm/preventable-event.js +0 -31
- package/dist/npm/splitbutton/localization/custom-messages.component.js +0 -46
- package/dist/npm/splitbutton/localization/localized-messages.directive.js +0 -37
- package/dist/npm/splitbutton/localization/messages.js +0 -24
- package/dist/npm/splitbutton/splitbutton.component.js +0 -832
- package/dist/npm/splitbutton/splitbutton.module.js +0 -36
- package/dist/npm/util.js +0 -111
- package/dist/systemjs/kendo-angular-buttons.js +0 -5
|
@@ -1,50 +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 * as tslib_1 from "tslib";
|
|
6
|
-
import { NgModule } from '@angular/core';
|
|
7
|
-
import { ButtonDirective } from './button.directive';
|
|
8
|
-
/**
|
|
9
|
-
* Represents the [NgModule]({{ site.data.urls.angular['ngmodules'] }})
|
|
10
|
-
* definition for the Button directive.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
*
|
|
14
|
-
* ```ts-no-run
|
|
15
|
-
* // Import the Button module
|
|
16
|
-
* import { ButtonModule } from '@progress/kendo-angular-buttons';
|
|
17
|
-
*
|
|
18
|
-
* // The browser platform with a compiler
|
|
19
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
20
|
-
*
|
|
21
|
-
* import { NgModule } from '@angular/core';
|
|
22
|
-
*
|
|
23
|
-
* // Import the app component
|
|
24
|
-
* import { AppComponent } from './app.component';
|
|
25
|
-
*
|
|
26
|
-
* // Define the app module
|
|
27
|
-
* _@NgModule({
|
|
28
|
-
* declarations: [AppComponent], // declare app component
|
|
29
|
-
* imports: [BrowserModule, ButtonModule], // import Button module
|
|
30
|
-
* bootstrap: [AppComponent]
|
|
31
|
-
* })
|
|
32
|
-
* export class AppModule {}
|
|
33
|
-
*
|
|
34
|
-
* // Compile and launch the module
|
|
35
|
-
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
36
|
-
*
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
var ButtonModule = /** @class */ (function () {
|
|
40
|
-
function ButtonModule() {
|
|
41
|
-
}
|
|
42
|
-
ButtonModule = tslib_1.__decorate([
|
|
43
|
-
NgModule({
|
|
44
|
-
declarations: [ButtonDirective],
|
|
45
|
-
exports: [ButtonDirective]
|
|
46
|
-
})
|
|
47
|
-
], ButtonModule);
|
|
48
|
-
return ButtonModule;
|
|
49
|
-
}());
|
|
50
|
-
export { ButtonModule };
|
|
@@ -1,24 +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 * as tslib_1 from "tslib";
|
|
6
|
-
import { Injectable } from '@angular/core';
|
|
7
|
-
import { Subject } from 'rxjs';
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
var KendoButtonService = /** @class */ (function () {
|
|
12
|
-
function KendoButtonService() {
|
|
13
|
-
this.buttonClicked = new Subject();
|
|
14
|
-
this.buttonClicked$ = this.buttonClicked.asObservable();
|
|
15
|
-
}
|
|
16
|
-
KendoButtonService.prototype.click = function (button) {
|
|
17
|
-
this.buttonClicked.next(button);
|
|
18
|
-
};
|
|
19
|
-
KendoButtonService = tslib_1.__decorate([
|
|
20
|
-
Injectable()
|
|
21
|
-
], KendoButtonService);
|
|
22
|
-
return KendoButtonService;
|
|
23
|
-
}());
|
|
24
|
-
export { KendoButtonService };
|
|
@@ -1,353 +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 * as tslib_1 from "tslib";
|
|
6
|
-
import { ButtonDirective } from '../button/button.directive';
|
|
7
|
-
import { Component, EventEmitter, Output, Input, ContentChildren, QueryList, HostBinding, HostListener, isDevMode, ElementRef } from '@angular/core';
|
|
8
|
-
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
9
|
-
import { isChanged, Keys } from '@progress/kendo-angular-common';
|
|
10
|
-
import { KendoButtonService } from '../button/button.service';
|
|
11
|
-
import { isPresent } from '../util';
|
|
12
|
-
import { PreventableEvent } from '../preventable-event';
|
|
13
|
-
import { packageMetadata } from '../package-metadata';
|
|
14
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*/
|
|
18
|
-
var tabindex = 'tabindex';
|
|
19
|
-
/**
|
|
20
|
-
* Represents the Kendo UI ButtonGroup component for Angular.
|
|
21
|
-
*/
|
|
22
|
-
var ButtonGroupComponent = /** @class */ (function () {
|
|
23
|
-
function ButtonGroupComponent(service, localization, element) {
|
|
24
|
-
var _this = this;
|
|
25
|
-
this.service = service;
|
|
26
|
-
this.element = element;
|
|
27
|
-
/**
|
|
28
|
-
* By default, the selection mode of the ButtonGroup is set to `multiple`.
|
|
29
|
-
*/
|
|
30
|
-
this.selection = 'multiple';
|
|
31
|
-
/**
|
|
32
|
-
* Fires every time keyboard navigation occurs.
|
|
33
|
-
*/
|
|
34
|
-
this.navigate = new EventEmitter();
|
|
35
|
-
this._tabIndex = 0;
|
|
36
|
-
this.currentTabIndex = 0;
|
|
37
|
-
validatePackage(packageMetadata);
|
|
38
|
-
this.localizationChangeSubscription = localization.changes.subscribe(function (_a) {
|
|
39
|
-
var rtl = _a.rtl;
|
|
40
|
-
return _this.direction = rtl ? 'rtl' : 'ltr';
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "tabIndex", {
|
|
44
|
-
get: function () {
|
|
45
|
-
return this._tabIndex;
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
49
|
-
*/
|
|
50
|
-
set: function (value) {
|
|
51
|
-
this._tabIndex = value;
|
|
52
|
-
this.currentTabIndex = value;
|
|
53
|
-
},
|
|
54
|
-
enumerable: true,
|
|
55
|
-
configurable: true
|
|
56
|
-
});
|
|
57
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "wrapperClass", {
|
|
58
|
-
get: function () {
|
|
59
|
-
return true;
|
|
60
|
-
},
|
|
61
|
-
enumerable: true,
|
|
62
|
-
configurable: true
|
|
63
|
-
});
|
|
64
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "disabledClass", {
|
|
65
|
-
get: function () {
|
|
66
|
-
return this.disabled;
|
|
67
|
-
},
|
|
68
|
-
enumerable: true,
|
|
69
|
-
configurable: true
|
|
70
|
-
});
|
|
71
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "stretchedClass", {
|
|
72
|
-
get: function () {
|
|
73
|
-
return !!this.width;
|
|
74
|
-
},
|
|
75
|
-
enumerable: true,
|
|
76
|
-
configurable: true
|
|
77
|
-
});
|
|
78
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "getRole", {
|
|
79
|
-
get: function () {
|
|
80
|
-
return this.isSelectionSingle() ? 'radiogroup' : 'group';
|
|
81
|
-
},
|
|
82
|
-
enumerable: true,
|
|
83
|
-
configurable: true
|
|
84
|
-
});
|
|
85
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "dir", {
|
|
86
|
-
get: function () {
|
|
87
|
-
return this.direction;
|
|
88
|
-
},
|
|
89
|
-
enumerable: true,
|
|
90
|
-
configurable: true
|
|
91
|
-
});
|
|
92
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "ariaDisabled", {
|
|
93
|
-
get: function () {
|
|
94
|
-
return this.disabled;
|
|
95
|
-
},
|
|
96
|
-
enumerable: true,
|
|
97
|
-
configurable: true
|
|
98
|
-
});
|
|
99
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "wrapperWidth", {
|
|
100
|
-
get: function () {
|
|
101
|
-
return this.width;
|
|
102
|
-
},
|
|
103
|
-
enumerable: true,
|
|
104
|
-
configurable: true
|
|
105
|
-
});
|
|
106
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "wrapperTabIndex", {
|
|
107
|
-
get: function () {
|
|
108
|
-
return this.disabled ? undefined : this.currentTabIndex;
|
|
109
|
-
},
|
|
110
|
-
enumerable: true,
|
|
111
|
-
configurable: true
|
|
112
|
-
});
|
|
113
|
-
/**
|
|
114
|
-
* @hidden
|
|
115
|
-
*/
|
|
116
|
-
ButtonGroupComponent.prototype.keydown = function (event) {
|
|
117
|
-
if (!this.disabled) {
|
|
118
|
-
this.navigateFocus(event);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* @hidden
|
|
123
|
-
*/
|
|
124
|
-
ButtonGroupComponent.prototype.onFocus = function () {
|
|
125
|
-
this.currentTabIndex = -1;
|
|
126
|
-
var focusedIndex = this.buttons.toArray().findIndex(function (current) { return current.element.tabIndex !== -1; });
|
|
127
|
-
var index = focusedIndex === -1 ? 0 : focusedIndex;
|
|
128
|
-
this.focus(this.buttons.filter(function (_current, i) {
|
|
129
|
-
return i === index;
|
|
130
|
-
}));
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* @hidden
|
|
134
|
-
*/
|
|
135
|
-
ButtonGroupComponent.prototype.focusout = function (event) {
|
|
136
|
-
if (event.relatedTarget && event.relatedTarget.parentNode !== this.element.nativeElement) {
|
|
137
|
-
this.defocus(this.buttons.toArray());
|
|
138
|
-
this.currentTabIndex = this.tabIndex;
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
ButtonGroupComponent.prototype.ngOnInit = function () {
|
|
142
|
-
var _this = this;
|
|
143
|
-
this.subscription = this.service.buttonClicked$.subscribe(function (button) {
|
|
144
|
-
var newSelectionValue;
|
|
145
|
-
if (_this.isSelectionSingle()) {
|
|
146
|
-
newSelectionValue = true;
|
|
147
|
-
_this.deactivate(_this.buttons.filter(function (current) { return current !== button; }));
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
_this.defocus(_this.buttons.toArray());
|
|
151
|
-
newSelectionValue = !button.selected;
|
|
152
|
-
}
|
|
153
|
-
if (button.togglable) {
|
|
154
|
-
button.setSelected(newSelectionValue);
|
|
155
|
-
}
|
|
156
|
-
button.setAttribute(tabindex, '0');
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
ButtonGroupComponent.prototype.ngOnChanges = function (change) {
|
|
160
|
-
var _this = this;
|
|
161
|
-
if (isChanged('disabled', change)) {
|
|
162
|
-
this.buttons.forEach(function (button) {
|
|
163
|
-
if (isPresent(_this.disabled)) {
|
|
164
|
-
button.disabled = _this.disabled;
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
ButtonGroupComponent.prototype.ngAfterContentInit = function () {
|
|
170
|
-
this.buttons.forEach(function (button) {
|
|
171
|
-
if (button.selected) {
|
|
172
|
-
button.setAttribute(tabindex, '0');
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
button.setAttribute(tabindex, '-1');
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
};
|
|
179
|
-
ButtonGroupComponent.prototype.ngAfterViewChecked = function () {
|
|
180
|
-
if (this.buttons.length) {
|
|
181
|
-
this.buttons.first.renderer.addClass(this.buttons.first.element, 'k-group-start');
|
|
182
|
-
this.buttons.last.renderer.addClass(this.buttons.last.element, 'k-group-end');
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
ButtonGroupComponent.prototype.ngOnDestroy = function () {
|
|
186
|
-
this.subscription.unsubscribe();
|
|
187
|
-
this.localizationChangeSubscription.unsubscribe();
|
|
188
|
-
};
|
|
189
|
-
ButtonGroupComponent.prototype.ngAfterContentChecked = function () {
|
|
190
|
-
this.verifySettings();
|
|
191
|
-
};
|
|
192
|
-
ButtonGroupComponent.prototype.navigateFocus = function (event) {
|
|
193
|
-
var focusedIndex = this.buttons.toArray().findIndex(function (current) { return current.element.tabIndex !== -1; });
|
|
194
|
-
var firstIndex = 0;
|
|
195
|
-
var lastIndex = this.buttons.length - 1;
|
|
196
|
-
var eventArgs = new PreventableEvent();
|
|
197
|
-
if (event.keyCode === Keys.ArrowRight && focusedIndex < lastIndex) {
|
|
198
|
-
this.navigate.emit(eventArgs);
|
|
199
|
-
if (!eventArgs.isDefaultPrevented()) {
|
|
200
|
-
this.defocus(this.buttons.toArray());
|
|
201
|
-
this.focus(this.buttons.filter(function (_current, index) {
|
|
202
|
-
return index === focusedIndex + 1;
|
|
203
|
-
}));
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
if (event.keyCode === Keys.ArrowLeft && focusedIndex > firstIndex) {
|
|
207
|
-
this.navigate.emit(eventArgs);
|
|
208
|
-
if (!eventArgs.isDefaultPrevented()) {
|
|
209
|
-
this.defocus(this.buttons.toArray());
|
|
210
|
-
this.focus(this.buttons.filter(function (_current, index) {
|
|
211
|
-
return index === focusedIndex - 1;
|
|
212
|
-
}));
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
ButtonGroupComponent.prototype.deactivate = function (buttons) {
|
|
217
|
-
buttons.forEach(function (button) {
|
|
218
|
-
button.setSelected(false);
|
|
219
|
-
button.setAttribute(tabindex, '-1');
|
|
220
|
-
});
|
|
221
|
-
};
|
|
222
|
-
ButtonGroupComponent.prototype.activate = function (buttons) {
|
|
223
|
-
buttons.forEach(function (button) {
|
|
224
|
-
button.setSelected(true);
|
|
225
|
-
button.setAttribute(tabindex, '0');
|
|
226
|
-
button.focus();
|
|
227
|
-
});
|
|
228
|
-
};
|
|
229
|
-
ButtonGroupComponent.prototype.defocus = function (buttons) {
|
|
230
|
-
buttons.forEach(function (button) {
|
|
231
|
-
button.setAttribute(tabindex, '-1');
|
|
232
|
-
});
|
|
233
|
-
};
|
|
234
|
-
ButtonGroupComponent.prototype.focus = function (buttons) {
|
|
235
|
-
buttons.forEach(function (button) {
|
|
236
|
-
button.setAttribute(tabindex, '0');
|
|
237
|
-
button.focus();
|
|
238
|
-
});
|
|
239
|
-
};
|
|
240
|
-
ButtonGroupComponent.prototype.verifySettings = function () {
|
|
241
|
-
if (isDevMode()) {
|
|
242
|
-
if (this.isSelectionSingle() && this.buttons.filter(function (button) { return button.selected; }).length > 1) {
|
|
243
|
-
throw new Error('Having multiple selected buttons with single selection mode is not supported');
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
ButtonGroupComponent.prototype.isSelectionSingle = function () {
|
|
248
|
-
return this.selection === 'single';
|
|
249
|
-
};
|
|
250
|
-
tslib_1.__decorate([
|
|
251
|
-
Input('disabled'),
|
|
252
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
253
|
-
], ButtonGroupComponent.prototype, "disabled", void 0);
|
|
254
|
-
tslib_1.__decorate([
|
|
255
|
-
Input('selection'),
|
|
256
|
-
tslib_1.__metadata("design:type", String)
|
|
257
|
-
], ButtonGroupComponent.prototype, "selection", void 0);
|
|
258
|
-
tslib_1.__decorate([
|
|
259
|
-
Input('width'),
|
|
260
|
-
tslib_1.__metadata("design:type", String)
|
|
261
|
-
], ButtonGroupComponent.prototype, "width", void 0);
|
|
262
|
-
tslib_1.__decorate([
|
|
263
|
-
Input(),
|
|
264
|
-
tslib_1.__metadata("design:type", Number),
|
|
265
|
-
tslib_1.__metadata("design:paramtypes", [Number])
|
|
266
|
-
], ButtonGroupComponent.prototype, "tabIndex", null);
|
|
267
|
-
tslib_1.__decorate([
|
|
268
|
-
Output(),
|
|
269
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
270
|
-
], ButtonGroupComponent.prototype, "navigate", void 0);
|
|
271
|
-
tslib_1.__decorate([
|
|
272
|
-
ContentChildren(ButtonDirective),
|
|
273
|
-
tslib_1.__metadata("design:type", QueryList)
|
|
274
|
-
], ButtonGroupComponent.prototype, "buttons", void 0);
|
|
275
|
-
tslib_1.__decorate([
|
|
276
|
-
HostBinding('class.k-button-group'),
|
|
277
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
278
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
279
|
-
], ButtonGroupComponent.prototype, "wrapperClass", null);
|
|
280
|
-
tslib_1.__decorate([
|
|
281
|
-
HostBinding('class.k-disabled'),
|
|
282
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
283
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
284
|
-
], ButtonGroupComponent.prototype, "disabledClass", null);
|
|
285
|
-
tslib_1.__decorate([
|
|
286
|
-
HostBinding('class.k-button-group-stretched'),
|
|
287
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
288
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
289
|
-
], ButtonGroupComponent.prototype, "stretchedClass", null);
|
|
290
|
-
tslib_1.__decorate([
|
|
291
|
-
HostBinding('attr.role'),
|
|
292
|
-
tslib_1.__metadata("design:type", String),
|
|
293
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
294
|
-
], ButtonGroupComponent.prototype, "getRole", null);
|
|
295
|
-
tslib_1.__decorate([
|
|
296
|
-
HostBinding('attr.dir'),
|
|
297
|
-
tslib_1.__metadata("design:type", String),
|
|
298
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
299
|
-
], ButtonGroupComponent.prototype, "dir", null);
|
|
300
|
-
tslib_1.__decorate([
|
|
301
|
-
HostBinding('attr.aria-disabled'),
|
|
302
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
303
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
304
|
-
], ButtonGroupComponent.prototype, "ariaDisabled", null);
|
|
305
|
-
tslib_1.__decorate([
|
|
306
|
-
HostBinding('style.width'),
|
|
307
|
-
tslib_1.__metadata("design:type", String),
|
|
308
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
309
|
-
], ButtonGroupComponent.prototype, "wrapperWidth", null);
|
|
310
|
-
tslib_1.__decorate([
|
|
311
|
-
HostBinding('attr.tabindex'),
|
|
312
|
-
tslib_1.__metadata("design:type", Number),
|
|
313
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
314
|
-
], ButtonGroupComponent.prototype, "wrapperTabIndex", null);
|
|
315
|
-
tslib_1.__decorate([
|
|
316
|
-
HostListener('keydown', ['$event']),
|
|
317
|
-
tslib_1.__metadata("design:type", Function),
|
|
318
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
319
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
320
|
-
], ButtonGroupComponent.prototype, "keydown", null);
|
|
321
|
-
tslib_1.__decorate([
|
|
322
|
-
HostListener('focus'),
|
|
323
|
-
tslib_1.__metadata("design:type", Function),
|
|
324
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
325
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
326
|
-
], ButtonGroupComponent.prototype, "onFocus", null);
|
|
327
|
-
tslib_1.__decorate([
|
|
328
|
-
HostListener('focusout', ['$event']),
|
|
329
|
-
tslib_1.__metadata("design:type", Function),
|
|
330
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
331
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
332
|
-
], ButtonGroupComponent.prototype, "focusout", null);
|
|
333
|
-
ButtonGroupComponent = tslib_1.__decorate([
|
|
334
|
-
Component({
|
|
335
|
-
exportAs: 'kendoButtonGroup',
|
|
336
|
-
providers: [
|
|
337
|
-
KendoButtonService,
|
|
338
|
-
LocalizationService,
|
|
339
|
-
{
|
|
340
|
-
provide: L10N_PREFIX,
|
|
341
|
-
useValue: 'kendo.buttongroup'
|
|
342
|
-
}
|
|
343
|
-
],
|
|
344
|
-
selector: 'kendo-buttongroup',
|
|
345
|
-
template: "\n <ng-content select=\"[kendoButton]\"></ng-content>\n "
|
|
346
|
-
}),
|
|
347
|
-
tslib_1.__metadata("design:paramtypes", [KendoButtonService,
|
|
348
|
-
LocalizationService,
|
|
349
|
-
ElementRef])
|
|
350
|
-
], ButtonGroupComponent);
|
|
351
|
-
return ButtonGroupComponent;
|
|
352
|
-
}());
|
|
353
|
-
export { ButtonGroupComponent };
|
|
@@ -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 * as tslib_1 from "tslib";
|
|
6
|
-
import { NgModule } from '@angular/core';
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
8
|
-
import { ButtonModule } from '../button/button.module';
|
|
9
|
-
import { ButtonGroupComponent } from './buttongroup.component';
|
|
10
|
-
/**
|
|
11
|
-
* @hidden
|
|
12
|
-
*
|
|
13
|
-
* The exported package module.
|
|
14
|
-
*
|
|
15
|
-
* The package exports:
|
|
16
|
-
* - `ButtonGroupComponent`—The ButtonGroupComponent component class.
|
|
17
|
-
*/
|
|
18
|
-
var ButtonGroupModule = /** @class */ (function () {
|
|
19
|
-
function ButtonGroupModule() {
|
|
20
|
-
}
|
|
21
|
-
ButtonGroupModule = tslib_1.__decorate([
|
|
22
|
-
NgModule({
|
|
23
|
-
declarations: [ButtonGroupComponent],
|
|
24
|
-
exports: [ButtonGroupComponent],
|
|
25
|
-
imports: [CommonModule, ButtonModule]
|
|
26
|
-
})
|
|
27
|
-
], ButtonGroupModule);
|
|
28
|
-
return ButtonGroupModule;
|
|
29
|
-
}());
|
|
30
|
-
export { ButtonGroupModule };
|
|
@@ -1,4 +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
|
-
*-------------------------------------------------------------------------------------------*/
|
|
@@ -1,4 +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
|
-
*-------------------------------------------------------------------------------------------*/
|
|
@@ -1,214 +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 * as tslib_1 from "tslib";
|
|
6
|
-
import { Component, Input, HostBinding, ContentChildren, QueryList, EventEmitter, Output, HostListener, Renderer2, ElementRef } from '@angular/core';
|
|
7
|
-
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
8
|
-
import { ChipComponent } from './chip.component';
|
|
9
|
-
import { closest, getStylingClasses } from '../util';
|
|
10
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
11
|
-
import { packageMetadata } from '../package-metadata';
|
|
12
|
-
var ChipListComponent = /** @class */ (function () {
|
|
13
|
-
function ChipListComponent(localizationService, renderer, element) {
|
|
14
|
-
this.localizationService = localizationService;
|
|
15
|
-
this.renderer = renderer;
|
|
16
|
-
this.element = element;
|
|
17
|
-
this.hostClass = true;
|
|
18
|
-
/**
|
|
19
|
-
* Sets the selection mode of the ChipList.
|
|
20
|
-
*
|
|
21
|
-
* The available values are:
|
|
22
|
-
* * `none` (default)
|
|
23
|
-
* * `single`
|
|
24
|
-
* * `multiple`
|
|
25
|
-
*/
|
|
26
|
-
this.selection = 'none';
|
|
27
|
-
/**
|
|
28
|
-
* Fires each time when the ChipList selection is changed.
|
|
29
|
-
*/
|
|
30
|
-
this.selectedChange = new EventEmitter();
|
|
31
|
-
/**
|
|
32
|
-
* Fires each time the user clicks on the remove icon of the Chip.
|
|
33
|
-
*/
|
|
34
|
-
this.remove = new EventEmitter();
|
|
35
|
-
this.role = 'listbox';
|
|
36
|
-
this._size = 'medium';
|
|
37
|
-
validatePackage(packageMetadata);
|
|
38
|
-
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
39
|
-
}
|
|
40
|
-
Object.defineProperty(ChipListComponent.prototype, "size", {
|
|
41
|
-
get: function () {
|
|
42
|
-
return this._size;
|
|
43
|
-
},
|
|
44
|
-
/**
|
|
45
|
-
* The size property specifies the gap between the Chips in the ChipList
|
|
46
|
-
* ([see example]({% slug appearance_chiplist %}#toc-size)).
|
|
47
|
-
*
|
|
48
|
-
* The possible values are:
|
|
49
|
-
* * `'small'`
|
|
50
|
-
* * `'medium'` (default)
|
|
51
|
-
* * `'large'`
|
|
52
|
-
* * `null`
|
|
53
|
-
*/
|
|
54
|
-
set: function (size) {
|
|
55
|
-
this.handleClasses(size, 'size');
|
|
56
|
-
this._size = size;
|
|
57
|
-
},
|
|
58
|
-
enumerable: true,
|
|
59
|
-
configurable: true
|
|
60
|
-
});
|
|
61
|
-
Object.defineProperty(ChipListComponent.prototype, "single", {
|
|
62
|
-
get: function () {
|
|
63
|
-
return this.selection === 'single';
|
|
64
|
-
},
|
|
65
|
-
enumerable: true,
|
|
66
|
-
configurable: true
|
|
67
|
-
});
|
|
68
|
-
Object.defineProperty(ChipListComponent.prototype, "multiple", {
|
|
69
|
-
get: function () {
|
|
70
|
-
return this.selection === 'multiple';
|
|
71
|
-
},
|
|
72
|
-
enumerable: true,
|
|
73
|
-
configurable: true
|
|
74
|
-
});
|
|
75
|
-
/**
|
|
76
|
-
* @hidden
|
|
77
|
-
*/
|
|
78
|
-
ChipListComponent.prototype.onClick = function ($event) {
|
|
79
|
-
var target = $event.target;
|
|
80
|
-
var isRemoveClicked = closest(target, '.k-chip-remove-action');
|
|
81
|
-
var clickedChip = closest(target, '.k-chip');
|
|
82
|
-
var chip = this.chips.find(function (chip) { return clickedChip === chip.element.nativeElement; });
|
|
83
|
-
if (isRemoveClicked && clickedChip) {
|
|
84
|
-
var removeEventArgs = { sender: this, originalEvent: $event, removedChip: chip };
|
|
85
|
-
this.remove.emit(removeEventArgs);
|
|
86
|
-
}
|
|
87
|
-
if (this.selection !== 'none' && clickedChip && !isRemoveClicked) {
|
|
88
|
-
this.setSelection(chip);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
ChipListComponent.prototype.ngOnInit = function () {
|
|
92
|
-
var _this = this;
|
|
93
|
-
this.dynamicRTLSubscription = this.localizationService.changes
|
|
94
|
-
.subscribe(function (_a) {
|
|
95
|
-
var rtl = _a.rtl;
|
|
96
|
-
return _this.direction = rtl ? 'rtl' : 'ltr';
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
ChipListComponent.prototype.ngAfterViewInit = function () {
|
|
100
|
-
var _this = this;
|
|
101
|
-
var stylingInputs = ['size'];
|
|
102
|
-
stylingInputs.forEach(function (input) {
|
|
103
|
-
_this.handleClasses(_this[input], input);
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
ChipListComponent.prototype.ngAfterContentInit = function () {
|
|
107
|
-
var _this = this;
|
|
108
|
-
this.chips.forEach(function (chip) {
|
|
109
|
-
_this.renderer.setAttribute(chip.element.nativeElement, 'role', 'option');
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
ChipListComponent.prototype.ngOnDestroy = function () {
|
|
113
|
-
if (this.dynamicRTLSubscription) {
|
|
114
|
-
this.dynamicRTLSubscription.unsubscribe();
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
ChipListComponent.prototype.selectedChips = function () {
|
|
118
|
-
return this.chips.reduce(function (acc, cur, idx) { return cur.selected ? acc.concat(idx) : acc; }, []);
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Updates the selection on click of a Chip. Emits events.
|
|
122
|
-
*/
|
|
123
|
-
ChipListComponent.prototype.setSelection = function (chip) {
|
|
124
|
-
if (this.selection === 'single') {
|
|
125
|
-
this.clearSelection(chip);
|
|
126
|
-
}
|
|
127
|
-
chip.selected = !chip.selected;
|
|
128
|
-
this.selectedChange.emit(this.selectedChips());
|
|
129
|
-
};
|
|
130
|
-
ChipListComponent.prototype.clearSelection = function (chip) {
|
|
131
|
-
this.chips.forEach(function (c) {
|
|
132
|
-
if (chip !== c) {
|
|
133
|
-
c.selected = false;
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
};
|
|
137
|
-
ChipListComponent.prototype.handleClasses = function (value, input) {
|
|
138
|
-
var elem = this.element.nativeElement;
|
|
139
|
-
var classes = getStylingClasses('chip-list', input, this[input], value);
|
|
140
|
-
if (classes.toRemove) {
|
|
141
|
-
this.renderer.removeClass(elem, classes.toRemove);
|
|
142
|
-
}
|
|
143
|
-
if (classes.toAdd) {
|
|
144
|
-
this.renderer.addClass(elem, classes.toAdd);
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
tslib_1.__decorate([
|
|
148
|
-
HostBinding('class.k-chip-list'),
|
|
149
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
150
|
-
], ChipListComponent.prototype, "hostClass", void 0);
|
|
151
|
-
tslib_1.__decorate([
|
|
152
|
-
HostBinding('attr.dir'),
|
|
153
|
-
tslib_1.__metadata("design:type", String)
|
|
154
|
-
], ChipListComponent.prototype, "direction", void 0);
|
|
155
|
-
tslib_1.__decorate([
|
|
156
|
-
Input(),
|
|
157
|
-
tslib_1.__metadata("design:type", String)
|
|
158
|
-
], ChipListComponent.prototype, "selection", void 0);
|
|
159
|
-
tslib_1.__decorate([
|
|
160
|
-
Input(),
|
|
161
|
-
tslib_1.__metadata("design:type", String),
|
|
162
|
-
tslib_1.__metadata("design:paramtypes", [String])
|
|
163
|
-
], ChipListComponent.prototype, "size", null);
|
|
164
|
-
tslib_1.__decorate([
|
|
165
|
-
Output(),
|
|
166
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
167
|
-
], ChipListComponent.prototype, "selectedChange", void 0);
|
|
168
|
-
tslib_1.__decorate([
|
|
169
|
-
Output(),
|
|
170
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
171
|
-
], ChipListComponent.prototype, "remove", void 0);
|
|
172
|
-
tslib_1.__decorate([
|
|
173
|
-
ContentChildren(ChipComponent),
|
|
174
|
-
tslib_1.__metadata("design:type", QueryList)
|
|
175
|
-
], ChipListComponent.prototype, "chips", void 0);
|
|
176
|
-
tslib_1.__decorate([
|
|
177
|
-
HostBinding('class.k-selection-single'),
|
|
178
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
179
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
180
|
-
], ChipListComponent.prototype, "single", null);
|
|
181
|
-
tslib_1.__decorate([
|
|
182
|
-
HostBinding('class.k-selection-multiple'),
|
|
183
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
184
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
185
|
-
], ChipListComponent.prototype, "multiple", null);
|
|
186
|
-
tslib_1.__decorate([
|
|
187
|
-
HostBinding('attr.role'),
|
|
188
|
-
tslib_1.__metadata("design:type", String)
|
|
189
|
-
], ChipListComponent.prototype, "role", void 0);
|
|
190
|
-
tslib_1.__decorate([
|
|
191
|
-
HostListener('click', ['$event']),
|
|
192
|
-
tslib_1.__metadata("design:type", Function),
|
|
193
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
194
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
195
|
-
], ChipListComponent.prototype, "onClick", null);
|
|
196
|
-
ChipListComponent = tslib_1.__decorate([
|
|
197
|
-
Component({
|
|
198
|
-
selector: 'kendo-chiplist, kendo-chip-list',
|
|
199
|
-
template: "\n <ng-content></ng-content>\n ",
|
|
200
|
-
providers: [
|
|
201
|
-
LocalizationService,
|
|
202
|
-
{
|
|
203
|
-
provide: L10N_PREFIX,
|
|
204
|
-
useValue: 'kendo.chiplist'
|
|
205
|
-
}
|
|
206
|
-
]
|
|
207
|
-
}),
|
|
208
|
-
tslib_1.__metadata("design:paramtypes", [LocalizationService,
|
|
209
|
-
Renderer2,
|
|
210
|
-
ElementRef])
|
|
211
|
-
], ChipListComponent);
|
|
212
|
-
return ChipListComponent;
|
|
213
|
-
}());
|
|
214
|
-
export { ChipListComponent };
|