@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
|
@@ -0,0 +1,832 @@
|
|
|
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
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
var tslib_1 = require("tslib");
|
|
8
|
+
/* tslint:disable:no-access-missing-member */
|
|
9
|
+
var core_1 = require("@angular/core");
|
|
10
|
+
var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
|
|
11
|
+
var kendo_angular_popup_1 = require("@progress/kendo-angular-popup");
|
|
12
|
+
var list_button_1 = require("./../listbutton/list-button");
|
|
13
|
+
var button_item_template_directive_1 = require("./../listbutton/button-item-template.directive");
|
|
14
|
+
var focus_service_1 = require("./../focusable/focus.service");
|
|
15
|
+
var navigation_service_1 = require("./../navigation/navigation.service");
|
|
16
|
+
var navigation_config_1 = require("./../navigation/navigation-config");
|
|
17
|
+
var kendo_angular_common_1 = require("@progress/kendo-angular-common");
|
|
18
|
+
var util_1 = require("./../util");
|
|
19
|
+
var preventable_event_1 = require("../preventable-event");
|
|
20
|
+
var kendo_angular_common_2 = require("@progress/kendo-angular-common");
|
|
21
|
+
var util_2 = require("../util");
|
|
22
|
+
var NAVIGATION_SETTINGS = {
|
|
23
|
+
useLeftRightArrows: true
|
|
24
|
+
};
|
|
25
|
+
var ɵ0 = NAVIGATION_SETTINGS;
|
|
26
|
+
exports.ɵ0 = ɵ0;
|
|
27
|
+
var NAVIGATION_SETTINGS_PROVIDER = {
|
|
28
|
+
provide: navigation_config_1.NAVIGATION_CONFIG,
|
|
29
|
+
useValue: ɵ0
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Represents the Kendo UI SplitButton component for Angular.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* _@Component({
|
|
37
|
+
* selector: 'my-app',
|
|
38
|
+
* template: `
|
|
39
|
+
* <kendo-splitbutton [data]="data" icon="paste"
|
|
40
|
+
* (itemClick)="onSplitButtonItemClick($event)"
|
|
41
|
+
* (buttonClick)="onSplitButtonClick()">Paste</kendo-splitbutton>
|
|
42
|
+
* `
|
|
43
|
+
* })
|
|
44
|
+
*
|
|
45
|
+
* class AppComponent {
|
|
46
|
+
* public data: Array<any> = [{
|
|
47
|
+
* text: 'Keep Text Only',
|
|
48
|
+
* icon: 'paste-plain-text',
|
|
49
|
+
* click: () => { console.log('Keep Text Only click handler'); }
|
|
50
|
+
* }, {
|
|
51
|
+
* text: 'Paste as HTML',
|
|
52
|
+
* icon: 'paste-as-html'
|
|
53
|
+
* }, {
|
|
54
|
+
* text: 'Paste Markdown',
|
|
55
|
+
* icon: 'paste-markdown'
|
|
56
|
+
* }, {
|
|
57
|
+
* text: 'Set Default Paste'
|
|
58
|
+
* }];
|
|
59
|
+
*
|
|
60
|
+
* public onSplitButtonClick(dataItem: any): void {
|
|
61
|
+
* console.log('Paste');
|
|
62
|
+
* }
|
|
63
|
+
*
|
|
64
|
+
* public onSplitButtonItemClick(dataItem: any): void {
|
|
65
|
+
* if (dataItem) {
|
|
66
|
+
* console.log(dataItem.text);
|
|
67
|
+
* }
|
|
68
|
+
* }
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
var SplitButtonComponent = /** @class */ (function (_super) {
|
|
73
|
+
tslib_1.__extends(SplitButtonComponent, _super);
|
|
74
|
+
function SplitButtonComponent(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr, renderer) {
|
|
75
|
+
var _this = _super.call(this, focusService, navigationService, wrapperRef, zone, localization, cdr) || this;
|
|
76
|
+
_this.popupService = popupService;
|
|
77
|
+
_this.elRef = elRef;
|
|
78
|
+
_this.localization = localization;
|
|
79
|
+
_this.renderer = renderer;
|
|
80
|
+
/**
|
|
81
|
+
* Sets the text of the SplitButton.
|
|
82
|
+
*/
|
|
83
|
+
_this.text = '';
|
|
84
|
+
/**
|
|
85
|
+
* Defines an icon to be rendered next to the button text
|
|
86
|
+
* ([see example]({% slug databinding_splitbutton %}#toc-arrays-of-complex-data)).
|
|
87
|
+
*/
|
|
88
|
+
_this.icon = '';
|
|
89
|
+
/**
|
|
90
|
+
* Defines an icon with a custom CSS class to be rendered next to the button text
|
|
91
|
+
* ([see example]({% slug databinding_splitbutton %}#toc-arrays-of-complex-data)).
|
|
92
|
+
*/
|
|
93
|
+
_this.iconClass = '';
|
|
94
|
+
/**
|
|
95
|
+
* Defines the type attribute of the main button
|
|
96
|
+
*/
|
|
97
|
+
_this.type = 'button';
|
|
98
|
+
/**
|
|
99
|
+
* Defines the location of an image to be displayed next to the button text
|
|
100
|
+
* ([see example]({% slug databinding_splitbutton %}#toc-arrays-of-complex-data)).
|
|
101
|
+
*/
|
|
102
|
+
_this.imageUrl = '';
|
|
103
|
+
/**
|
|
104
|
+
* The size property specifies the padding of the SplitButton
|
|
105
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-size)).
|
|
106
|
+
*
|
|
107
|
+
* The possible values are:
|
|
108
|
+
* * `'small'`
|
|
109
|
+
* * `'medium'` (default)
|
|
110
|
+
* * `'large'`
|
|
111
|
+
* * `null`
|
|
112
|
+
*/
|
|
113
|
+
_this.size = 'medium';
|
|
114
|
+
/**
|
|
115
|
+
* The SplitButton allows you to specify predefined theme colors.
|
|
116
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
117
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-themeColor)).
|
|
118
|
+
*
|
|
119
|
+
* The possible values are:
|
|
120
|
+
* * `base` —Applies coloring based on the `base` theme color. (default)
|
|
121
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
122
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
123
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
124
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
125
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
126
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
127
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
128
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
129
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
130
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
131
|
+
*/
|
|
132
|
+
_this.themeColor = 'base';
|
|
133
|
+
/**
|
|
134
|
+
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
135
|
+
*/
|
|
136
|
+
_this.tabIndex = 0;
|
|
137
|
+
/**
|
|
138
|
+
* Specifies the name of the [font icon]({% slug icons %}#toc-list-of-font-icons) that will
|
|
139
|
+
* be rendered for the button which opens the popup.
|
|
140
|
+
*/
|
|
141
|
+
_this.arrowButtonIcon = 'arrow-s';
|
|
142
|
+
/**
|
|
143
|
+
* Fires each time the user clicks the main button.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```ts
|
|
147
|
+
* _@Component({
|
|
148
|
+
* selector: 'my-app',
|
|
149
|
+
* template: `
|
|
150
|
+
* <kendo-splitbutton (buttonClick)="onSplitButtonClick()" [data]="data">
|
|
151
|
+
* Reply
|
|
152
|
+
* </kendo-splitbutton>
|
|
153
|
+
* `
|
|
154
|
+
* })
|
|
155
|
+
* class AppComponent {
|
|
156
|
+
* public data: Array<any> = ['Reply All', 'Forward', 'Reply & Delete'];
|
|
157
|
+
*
|
|
158
|
+
* public onSplitButtonClick(): void {
|
|
159
|
+
* console.log('SplitButton click');
|
|
160
|
+
* }
|
|
161
|
+
* }
|
|
162
|
+
* ```
|
|
163
|
+
*
|
|
164
|
+
*/
|
|
165
|
+
_this.buttonClick = new core_1.EventEmitter();
|
|
166
|
+
/**
|
|
167
|
+
* Fires each time the user clicks on the drop-down list. The event data contains the data item bound to the clicked list item.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```ts
|
|
171
|
+
* _@Component({
|
|
172
|
+
* selector: 'my-app',
|
|
173
|
+
* template: `
|
|
174
|
+
* <kendo-splitbutton (itemClick)="onSplitButtonItemClick($event)" [data]="data">
|
|
175
|
+
* Reply
|
|
176
|
+
* </kendo-splitbutton>
|
|
177
|
+
* `
|
|
178
|
+
* })
|
|
179
|
+
* class AppComponent {
|
|
180
|
+
* public data: Array<any> = ['Reply All', 'Forward', 'Reply & Delete'];
|
|
181
|
+
*
|
|
182
|
+
* public onSplitButtonItemClick(dataItem?: string): void {
|
|
183
|
+
* if (dataItem) {
|
|
184
|
+
* console.log(dataItem);
|
|
185
|
+
* }
|
|
186
|
+
* }
|
|
187
|
+
* }
|
|
188
|
+
* ```
|
|
189
|
+
*
|
|
190
|
+
*/
|
|
191
|
+
_this.itemClick = new core_1.EventEmitter();
|
|
192
|
+
/**
|
|
193
|
+
* Fires each time the SplitButton gets focused.
|
|
194
|
+
*/
|
|
195
|
+
_this.onFocus = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename
|
|
196
|
+
/**
|
|
197
|
+
* Fires each time the SplitButton gets blurred.
|
|
198
|
+
*/
|
|
199
|
+
_this.onBlur = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename
|
|
200
|
+
/**
|
|
201
|
+
* Fires each time the popup is about to open.
|
|
202
|
+
* This event is preventable. If you cancel the event, the popup will remain closed.
|
|
203
|
+
*/
|
|
204
|
+
_this.open = new core_1.EventEmitter();
|
|
205
|
+
/**
|
|
206
|
+
* Fires each time the popup is about to close.
|
|
207
|
+
* This event is preventable. If you cancel the event, the popup will remain open.
|
|
208
|
+
*/
|
|
209
|
+
_this.close = new core_1.EventEmitter();
|
|
210
|
+
/**
|
|
211
|
+
* @hidden
|
|
212
|
+
*/
|
|
213
|
+
_this.activeArrow = false;
|
|
214
|
+
_this.listId = kendo_angular_common_1.guid();
|
|
215
|
+
_this.buttonText = '';
|
|
216
|
+
_this.lockFocus = false;
|
|
217
|
+
_this._rounded = 'medium';
|
|
218
|
+
_this._fillMode = "solid";
|
|
219
|
+
_this._itemClick = _this.itemClick;
|
|
220
|
+
_this._blur = _this.onBlur;
|
|
221
|
+
return _this;
|
|
222
|
+
}
|
|
223
|
+
Object.defineProperty(SplitButtonComponent.prototype, "rounded", {
|
|
224
|
+
get: function () {
|
|
225
|
+
return this._rounded;
|
|
226
|
+
},
|
|
227
|
+
/**
|
|
228
|
+
* The rounded property specifies the border radius of the SplitButton
|
|
229
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-rounded)).
|
|
230
|
+
*
|
|
231
|
+
* The possible values are:
|
|
232
|
+
* * `'small'`
|
|
233
|
+
* * `'medium'` (default)
|
|
234
|
+
* * `'large'`
|
|
235
|
+
* * `'full'`
|
|
236
|
+
* * `null`
|
|
237
|
+
*/
|
|
238
|
+
set: function (rounded) {
|
|
239
|
+
this.handleClasses(rounded, 'rounded');
|
|
240
|
+
this._rounded = rounded;
|
|
241
|
+
},
|
|
242
|
+
enumerable: true,
|
|
243
|
+
configurable: true
|
|
244
|
+
});
|
|
245
|
+
Object.defineProperty(SplitButtonComponent.prototype, "fillMode", {
|
|
246
|
+
get: function () {
|
|
247
|
+
return this._fillMode;
|
|
248
|
+
},
|
|
249
|
+
/**
|
|
250
|
+
* The fillMode property specifies the background and border styles of the SplitButton
|
|
251
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-fillMode)).
|
|
252
|
+
*
|
|
253
|
+
* The available values are:
|
|
254
|
+
* * `solid` (default)
|
|
255
|
+
* * `flat`
|
|
256
|
+
* * `outline`
|
|
257
|
+
* * `link`
|
|
258
|
+
*/
|
|
259
|
+
set: function (fillMode) {
|
|
260
|
+
this._fillMode = fillMode === 'clear' ? 'flat' : fillMode;
|
|
261
|
+
},
|
|
262
|
+
enumerable: true,
|
|
263
|
+
configurable: true
|
|
264
|
+
});
|
|
265
|
+
Object.defineProperty(SplitButtonComponent.prototype, "disabled", {
|
|
266
|
+
get: function () {
|
|
267
|
+
return this._disabled;
|
|
268
|
+
},
|
|
269
|
+
/**
|
|
270
|
+
* When set to `true`, disables a SplitButton item
|
|
271
|
+
* ([see example]({% slug databinding_splitbutton %}#toc-arrays-of-complex-data)).
|
|
272
|
+
*/
|
|
273
|
+
set: function (value) {
|
|
274
|
+
if (this.isOpen) {
|
|
275
|
+
this.toggle(false);
|
|
276
|
+
}
|
|
277
|
+
this._disabled = value;
|
|
278
|
+
},
|
|
279
|
+
enumerable: true,
|
|
280
|
+
configurable: true
|
|
281
|
+
});
|
|
282
|
+
Object.defineProperty(SplitButtonComponent.prototype, "popupSettings", {
|
|
283
|
+
get: function () {
|
|
284
|
+
return this._popupSettings;
|
|
285
|
+
},
|
|
286
|
+
/**
|
|
287
|
+
* Configures the popup of the SplitButton.
|
|
288
|
+
*
|
|
289
|
+
* The available options are:
|
|
290
|
+
* - `animate: Boolean`—Controls the popup animation. By default, the open and close animations are enabled.
|
|
291
|
+
* - `popupClass: String`—Specifies a list of CSS classes that are used to style the popup.
|
|
292
|
+
* - `appendTo: "root" | "component" | ViewContainerRef`—Specifies the component to which the popup will be appended.
|
|
293
|
+
* - `align: "left" | "center" | "right"`—Specifies the alignment of the popup.
|
|
294
|
+
*/
|
|
295
|
+
set: function (settings) {
|
|
296
|
+
this._popupSettings = Object.assign({ animate: true, popupClass: '' }, settings);
|
|
297
|
+
},
|
|
298
|
+
enumerable: true,
|
|
299
|
+
configurable: true
|
|
300
|
+
});
|
|
301
|
+
Object.defineProperty(SplitButtonComponent.prototype, "data", {
|
|
302
|
+
get: function () {
|
|
303
|
+
if (!this._data) {
|
|
304
|
+
this.data = [];
|
|
305
|
+
}
|
|
306
|
+
return this._data;
|
|
307
|
+
},
|
|
308
|
+
/**
|
|
309
|
+
* Sets the data of the SplitButton.
|
|
310
|
+
*
|
|
311
|
+
* > The data has to be provided in an array-like list.
|
|
312
|
+
*/
|
|
313
|
+
set: function (data) {
|
|
314
|
+
this._data = data || [];
|
|
315
|
+
},
|
|
316
|
+
enumerable: true,
|
|
317
|
+
configurable: true
|
|
318
|
+
});
|
|
319
|
+
Object.defineProperty(SplitButtonComponent.prototype, "openState", {
|
|
320
|
+
/**
|
|
321
|
+
* @hidden
|
|
322
|
+
*/
|
|
323
|
+
get: function () {
|
|
324
|
+
return this._open;
|
|
325
|
+
},
|
|
326
|
+
/**
|
|
327
|
+
* @hidden
|
|
328
|
+
*/
|
|
329
|
+
set: function (open) {
|
|
330
|
+
if (this.disabled) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
var eventArgs = new preventable_event_1.PreventableEvent();
|
|
334
|
+
if (open) {
|
|
335
|
+
this.open.emit(eventArgs);
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
this.close.emit(eventArgs);
|
|
339
|
+
}
|
|
340
|
+
if (eventArgs.isDefaultPrevented()) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
this._toggle(open);
|
|
344
|
+
},
|
|
345
|
+
enumerable: true,
|
|
346
|
+
configurable: true
|
|
347
|
+
});
|
|
348
|
+
Object.defineProperty(SplitButtonComponent.prototype, "active", {
|
|
349
|
+
/**
|
|
350
|
+
* @hidden
|
|
351
|
+
*/
|
|
352
|
+
get: function () {
|
|
353
|
+
return this._active;
|
|
354
|
+
},
|
|
355
|
+
enumerable: true,
|
|
356
|
+
configurable: true
|
|
357
|
+
});
|
|
358
|
+
Object.defineProperty(SplitButtonComponent.prototype, "componentTabIndex", {
|
|
359
|
+
/**
|
|
360
|
+
* @hidden
|
|
361
|
+
*/
|
|
362
|
+
get: function () {
|
|
363
|
+
return this.disabled ? -1 : this.tabIndex;
|
|
364
|
+
},
|
|
365
|
+
enumerable: true,
|
|
366
|
+
configurable: true
|
|
367
|
+
});
|
|
368
|
+
Object.defineProperty(SplitButtonComponent.prototype, "isFocused", {
|
|
369
|
+
get: function () {
|
|
370
|
+
return this._isFocused && !this._disabled;
|
|
371
|
+
},
|
|
372
|
+
set: function (value) {
|
|
373
|
+
this._isFocused = value;
|
|
374
|
+
},
|
|
375
|
+
enumerable: true,
|
|
376
|
+
configurable: true
|
|
377
|
+
});
|
|
378
|
+
Object.defineProperty(SplitButtonComponent.prototype, "widgetClasses", {
|
|
379
|
+
get: function () {
|
|
380
|
+
return true;
|
|
381
|
+
},
|
|
382
|
+
enumerable: true,
|
|
383
|
+
configurable: true
|
|
384
|
+
});
|
|
385
|
+
Object.defineProperty(SplitButtonComponent.prototype, "dir", {
|
|
386
|
+
get: function () {
|
|
387
|
+
return this.direction;
|
|
388
|
+
},
|
|
389
|
+
enumerable: true,
|
|
390
|
+
configurable: true
|
|
391
|
+
});
|
|
392
|
+
Object.defineProperty(SplitButtonComponent.prototype, "ariaLabel", {
|
|
393
|
+
/**
|
|
394
|
+
* @hidden
|
|
395
|
+
*/
|
|
396
|
+
get: function () {
|
|
397
|
+
var localizationMsg = this.localization.get('splitButtonLabel') || '';
|
|
398
|
+
return util_2.replaceMessagePlaceholder(localizationMsg, 'buttonText', this.buttonText);
|
|
399
|
+
},
|
|
400
|
+
enumerable: true,
|
|
401
|
+
configurable: true
|
|
402
|
+
});
|
|
403
|
+
/**
|
|
404
|
+
* @hidden
|
|
405
|
+
*/
|
|
406
|
+
SplitButtonComponent.prototype.onButtonFocus = function () {
|
|
407
|
+
if (!this.isFocused) {
|
|
408
|
+
this._isFocused = true;
|
|
409
|
+
this.onFocus.emit();
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
/**
|
|
413
|
+
* @hidden
|
|
414
|
+
*/
|
|
415
|
+
SplitButtonComponent.prototype.onArrowButtonClick = function () {
|
|
416
|
+
this.lockFocus = true;
|
|
417
|
+
this.togglePopupVisibility();
|
|
418
|
+
};
|
|
419
|
+
/**
|
|
420
|
+
* @hidden
|
|
421
|
+
*/
|
|
422
|
+
SplitButtonComponent.prototype.toggleButtonActiveState = function (enable) {
|
|
423
|
+
this._active = enable;
|
|
424
|
+
};
|
|
425
|
+
/**
|
|
426
|
+
* @hidden
|
|
427
|
+
*/
|
|
428
|
+
SplitButtonComponent.prototype.toggleArrowButtonActiveState = function (enable) {
|
|
429
|
+
this.activeArrow = enable;
|
|
430
|
+
};
|
|
431
|
+
/**
|
|
432
|
+
* @hidden
|
|
433
|
+
*/
|
|
434
|
+
SplitButtonComponent.prototype.onButtonClick = function () {
|
|
435
|
+
this.lockFocus = true;
|
|
436
|
+
this.buttonClick.emit();
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* @hidden
|
|
440
|
+
*/
|
|
441
|
+
SplitButtonComponent.prototype.onButtonBlur = function () {
|
|
442
|
+
if (!this.isOpen && !this.lockFocus) {
|
|
443
|
+
this.blurWrapper();
|
|
444
|
+
}
|
|
445
|
+
this.lockFocus = false;
|
|
446
|
+
};
|
|
447
|
+
/**
|
|
448
|
+
* @hidden
|
|
449
|
+
*/
|
|
450
|
+
SplitButtonComponent.prototype.keydown = function (event) {
|
|
451
|
+
this.keyDownHandler(event);
|
|
452
|
+
if (event.keyCode === kendo_angular_common_2.Keys.Space) {
|
|
453
|
+
this._active = true;
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* @hidden
|
|
458
|
+
*/
|
|
459
|
+
SplitButtonComponent.prototype.keypress = function (event) {
|
|
460
|
+
this.keyPressHandler(event);
|
|
461
|
+
};
|
|
462
|
+
/**
|
|
463
|
+
* @hidden
|
|
464
|
+
*/
|
|
465
|
+
SplitButtonComponent.prototype.keyup = function (event) {
|
|
466
|
+
this._active = false;
|
|
467
|
+
if (event.keyCode !== kendo_angular_common_2.Keys.Space) {
|
|
468
|
+
this.keyUpHandler(event);
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
/**
|
|
472
|
+
* @hidden
|
|
473
|
+
*/
|
|
474
|
+
SplitButtonComponent.prototype.ngAfterViewInit = function () {
|
|
475
|
+
this.updateButtonText();
|
|
476
|
+
this.handleClasses(this.rounded, 'rounded');
|
|
477
|
+
};
|
|
478
|
+
/**
|
|
479
|
+
* @hidden
|
|
480
|
+
*/
|
|
481
|
+
SplitButtonComponent.prototype.ngOnChanges = function (changes) {
|
|
482
|
+
if (changes.hasOwnProperty('text')) {
|
|
483
|
+
this.updateButtonText();
|
|
484
|
+
}
|
|
485
|
+
if (kendo_angular_common_1.isChanged("popupSettings", changes) && util_1.isPresent(this.popupRef)) {
|
|
486
|
+
var popup = this.popupRef.popup.instance;
|
|
487
|
+
var newSettings = changes.popupSettings.currentValue;
|
|
488
|
+
popup.popupClass = newSettings.popupClass;
|
|
489
|
+
popup.animate = newSettings.animate;
|
|
490
|
+
popup.popupAlign = this.popupAlign;
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
/**
|
|
494
|
+
* @hidden
|
|
495
|
+
*/
|
|
496
|
+
SplitButtonComponent.prototype.togglePopupVisibility = function () {
|
|
497
|
+
_super.prototype.togglePopupVisibility.call(this);
|
|
498
|
+
if (kendo_angular_common_1.isDocumentAvailable() && this.lockFocus) {
|
|
499
|
+
this.button.nativeElement.focus();
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
/**
|
|
503
|
+
* @hidden
|
|
504
|
+
*/
|
|
505
|
+
SplitButtonComponent.prototype.wrapperContains = function (element) {
|
|
506
|
+
return (this.wrapper === element || this.wrapper.contains(element) || (this.popupRef && this.popupRef.popupElement.contains(element)));
|
|
507
|
+
};
|
|
508
|
+
Object.defineProperty(SplitButtonComponent.prototype, "anchorAlign", {
|
|
509
|
+
/**
|
|
510
|
+
* @hidden
|
|
511
|
+
*/
|
|
512
|
+
get: function () {
|
|
513
|
+
var align = { horizontal: this.popupSettings.align || 'left', vertical: 'bottom' };
|
|
514
|
+
if (this.direction === 'rtl' && !util_1.isPresent(this.popupSettings.align)) {
|
|
515
|
+
align.horizontal = 'right';
|
|
516
|
+
}
|
|
517
|
+
return align;
|
|
518
|
+
},
|
|
519
|
+
enumerable: true,
|
|
520
|
+
configurable: true
|
|
521
|
+
});
|
|
522
|
+
Object.defineProperty(SplitButtonComponent.prototype, "popupAlign", {
|
|
523
|
+
/**
|
|
524
|
+
* @hidden
|
|
525
|
+
*/
|
|
526
|
+
get: function () {
|
|
527
|
+
var align = { horizontal: this.popupSettings.align || 'left', vertical: 'top' };
|
|
528
|
+
if (this.direction === 'rtl' && !util_1.isPresent(this.popupSettings.align)) {
|
|
529
|
+
align.horizontal = 'right';
|
|
530
|
+
}
|
|
531
|
+
return align;
|
|
532
|
+
},
|
|
533
|
+
enumerable: true,
|
|
534
|
+
configurable: true
|
|
535
|
+
});
|
|
536
|
+
/**
|
|
537
|
+
* Focuses the SplitButton component.
|
|
538
|
+
*/
|
|
539
|
+
SplitButtonComponent.prototype.focus = function () {
|
|
540
|
+
if (kendo_angular_common_1.isDocumentAvailable()) {
|
|
541
|
+
this.button.nativeElement.focus();
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
/**
|
|
545
|
+
* Blurs the SplitButton component.
|
|
546
|
+
*/
|
|
547
|
+
SplitButtonComponent.prototype.blur = function () {
|
|
548
|
+
if (kendo_angular_common_1.isDocumentAvailable()) {
|
|
549
|
+
this.button.nativeElement.blur();
|
|
550
|
+
this.blurWrapper();
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
SplitButtonComponent.prototype.ngOnDestroy = function () {
|
|
554
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
555
|
+
this.destroyPopup();
|
|
556
|
+
};
|
|
557
|
+
/**
|
|
558
|
+
* Toggles the visibility of the popup.
|
|
559
|
+
* If the `toggle` method is used to open or close the popup, the `open` and `close` events will not be fired.
|
|
560
|
+
*
|
|
561
|
+
* @param open - The state of the popup.
|
|
562
|
+
*/
|
|
563
|
+
SplitButtonComponent.prototype.toggle = function (open) {
|
|
564
|
+
var _this = this;
|
|
565
|
+
if (this.disabled) {
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
util_1.tick(function () { return _this._toggle(open === undefined ? !_this._open : open); });
|
|
569
|
+
};
|
|
570
|
+
Object.defineProperty(SplitButtonComponent.prototype, "isOpen", {
|
|
571
|
+
/**
|
|
572
|
+
* Returns the current open state of the popup.
|
|
573
|
+
*/
|
|
574
|
+
get: function () {
|
|
575
|
+
return this.openState;
|
|
576
|
+
},
|
|
577
|
+
enumerable: true,
|
|
578
|
+
configurable: true
|
|
579
|
+
});
|
|
580
|
+
SplitButtonComponent.prototype.enterHandler = function () {
|
|
581
|
+
if (this.disabled) {
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
if (this.openState) {
|
|
585
|
+
var focused = this.focusService.focused;
|
|
586
|
+
if (util_1.isPresent(focused) && focused !== -1) {
|
|
587
|
+
this.emitItemClickHandler(focused);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
this.buttonClick.emit();
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
SplitButtonComponent.prototype.updateButtonText = function () {
|
|
595
|
+
var _this = this;
|
|
596
|
+
if (kendo_angular_common_1.isDocumentAvailable()) {
|
|
597
|
+
var innerText_1 = this.wrapper.innerText
|
|
598
|
+
.split('\n')
|
|
599
|
+
.join('')
|
|
600
|
+
.trim();
|
|
601
|
+
//setTimout is needed because of `Expression has changed after it was checked.` error;
|
|
602
|
+
setTimeout(function () { return (_this.buttonText = innerText_1); }, 0);
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
Object.defineProperty(SplitButtonComponent.prototype, "appendTo", {
|
|
606
|
+
get: function () {
|
|
607
|
+
var appendTo = this.popupSettings.appendTo;
|
|
608
|
+
if (!appendTo || appendTo === 'root') {
|
|
609
|
+
return undefined;
|
|
610
|
+
}
|
|
611
|
+
return appendTo === 'component' ? this.containerRef : appendTo;
|
|
612
|
+
},
|
|
613
|
+
enumerable: true,
|
|
614
|
+
configurable: true
|
|
615
|
+
});
|
|
616
|
+
SplitButtonComponent.prototype._toggle = function (open) {
|
|
617
|
+
this._open = open;
|
|
618
|
+
this.destroyPopup();
|
|
619
|
+
if (this._open) {
|
|
620
|
+
this.createPopup();
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
SplitButtonComponent.prototype.createPopup = function () {
|
|
624
|
+
var _this = this;
|
|
625
|
+
this.popupRef = this.popupService.open({
|
|
626
|
+
anchor: this.elRef,
|
|
627
|
+
anchorAlign: this.anchorAlign,
|
|
628
|
+
animate: this.popupSettings.animate,
|
|
629
|
+
appendTo: this.appendTo,
|
|
630
|
+
content: this.popupTemplate,
|
|
631
|
+
popupAlign: this.popupAlign,
|
|
632
|
+
popupClass: this.popupClasses
|
|
633
|
+
});
|
|
634
|
+
this.popupRef.popupAnchorViewportLeave.subscribe(function () { return (_this.openState = false); });
|
|
635
|
+
this.popupRef.popupOpen.subscribe(this.focusFirstItem.bind(this));
|
|
636
|
+
};
|
|
637
|
+
SplitButtonComponent.prototype.destroyPopup = function () {
|
|
638
|
+
if (this.popupRef) {
|
|
639
|
+
this.popupRef.close();
|
|
640
|
+
this.popupRef = null;
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
SplitButtonComponent.prototype.handleClasses = function (value, input) {
|
|
644
|
+
var elem = this.wrapperRef.nativeElement;
|
|
645
|
+
var classes = util_2.getStylingClasses('button', input, this[input], value);
|
|
646
|
+
if (classes.toRemove) {
|
|
647
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
648
|
+
}
|
|
649
|
+
if (classes.toAdd) {
|
|
650
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
tslib_1.__decorate([
|
|
654
|
+
core_1.Input(),
|
|
655
|
+
tslib_1.__metadata("design:type", String)
|
|
656
|
+
], SplitButtonComponent.prototype, "text", void 0);
|
|
657
|
+
tslib_1.__decorate([
|
|
658
|
+
core_1.Input(),
|
|
659
|
+
tslib_1.__metadata("design:type", String)
|
|
660
|
+
], SplitButtonComponent.prototype, "icon", void 0);
|
|
661
|
+
tslib_1.__decorate([
|
|
662
|
+
core_1.Input(),
|
|
663
|
+
tslib_1.__metadata("design:type", String)
|
|
664
|
+
], SplitButtonComponent.prototype, "iconClass", void 0);
|
|
665
|
+
tslib_1.__decorate([
|
|
666
|
+
core_1.Input(),
|
|
667
|
+
tslib_1.__metadata("design:type", String)
|
|
668
|
+
], SplitButtonComponent.prototype, "type", void 0);
|
|
669
|
+
tslib_1.__decorate([
|
|
670
|
+
core_1.Input(),
|
|
671
|
+
tslib_1.__metadata("design:type", String)
|
|
672
|
+
], SplitButtonComponent.prototype, "imageUrl", void 0);
|
|
673
|
+
tslib_1.__decorate([
|
|
674
|
+
core_1.Input(),
|
|
675
|
+
tslib_1.__metadata("design:type", String)
|
|
676
|
+
], SplitButtonComponent.prototype, "size", void 0);
|
|
677
|
+
tslib_1.__decorate([
|
|
678
|
+
core_1.Input(),
|
|
679
|
+
tslib_1.__metadata("design:type", String),
|
|
680
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
681
|
+
], SplitButtonComponent.prototype, "rounded", null);
|
|
682
|
+
tslib_1.__decorate([
|
|
683
|
+
core_1.Input(),
|
|
684
|
+
tslib_1.__metadata("design:type", String),
|
|
685
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
686
|
+
], SplitButtonComponent.prototype, "fillMode", null);
|
|
687
|
+
tslib_1.__decorate([
|
|
688
|
+
core_1.Input(),
|
|
689
|
+
tslib_1.__metadata("design:type", String)
|
|
690
|
+
], SplitButtonComponent.prototype, "themeColor", void 0);
|
|
691
|
+
tslib_1.__decorate([
|
|
692
|
+
core_1.Input(),
|
|
693
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
694
|
+
tslib_1.__metadata("design:paramtypes", [Boolean])
|
|
695
|
+
], SplitButtonComponent.prototype, "disabled", null);
|
|
696
|
+
tslib_1.__decorate([
|
|
697
|
+
core_1.Input(),
|
|
698
|
+
tslib_1.__metadata("design:type", Object),
|
|
699
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
|
700
|
+
], SplitButtonComponent.prototype, "popupSettings", null);
|
|
701
|
+
tslib_1.__decorate([
|
|
702
|
+
core_1.Input(),
|
|
703
|
+
tslib_1.__metadata("design:type", Number)
|
|
704
|
+
], SplitButtonComponent.prototype, "tabIndex", void 0);
|
|
705
|
+
tslib_1.__decorate([
|
|
706
|
+
core_1.Input(),
|
|
707
|
+
tslib_1.__metadata("design:type", String)
|
|
708
|
+
], SplitButtonComponent.prototype, "textField", void 0);
|
|
709
|
+
tslib_1.__decorate([
|
|
710
|
+
core_1.Input(),
|
|
711
|
+
tslib_1.__metadata("design:type", Object),
|
|
712
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
|
713
|
+
], SplitButtonComponent.prototype, "data", null);
|
|
714
|
+
tslib_1.__decorate([
|
|
715
|
+
core_1.Input(),
|
|
716
|
+
tslib_1.__metadata("design:type", Object)
|
|
717
|
+
], SplitButtonComponent.prototype, "buttonClass", void 0);
|
|
718
|
+
tslib_1.__decorate([
|
|
719
|
+
core_1.Input(),
|
|
720
|
+
tslib_1.__metadata("design:type", Object)
|
|
721
|
+
], SplitButtonComponent.prototype, "arrowButtonClass", void 0);
|
|
722
|
+
tslib_1.__decorate([
|
|
723
|
+
core_1.Input(),
|
|
724
|
+
tslib_1.__metadata("design:type", String)
|
|
725
|
+
], SplitButtonComponent.prototype, "arrowButtonIcon", void 0);
|
|
726
|
+
tslib_1.__decorate([
|
|
727
|
+
core_1.Output(),
|
|
728
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
729
|
+
], SplitButtonComponent.prototype, "buttonClick", void 0);
|
|
730
|
+
tslib_1.__decorate([
|
|
731
|
+
core_1.Output(),
|
|
732
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
733
|
+
], SplitButtonComponent.prototype, "itemClick", void 0);
|
|
734
|
+
tslib_1.__decorate([
|
|
735
|
+
core_1.Output('focus'),
|
|
736
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
737
|
+
], SplitButtonComponent.prototype, "onFocus", void 0);
|
|
738
|
+
tslib_1.__decorate([
|
|
739
|
+
core_1.Output('blur'),
|
|
740
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
741
|
+
], SplitButtonComponent.prototype, "onBlur", void 0);
|
|
742
|
+
tslib_1.__decorate([
|
|
743
|
+
core_1.Output(),
|
|
744
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
745
|
+
], SplitButtonComponent.prototype, "open", void 0);
|
|
746
|
+
tslib_1.__decorate([
|
|
747
|
+
core_1.Output(),
|
|
748
|
+
tslib_1.__metadata("design:type", core_1.EventEmitter)
|
|
749
|
+
], SplitButtonComponent.prototype, "close", void 0);
|
|
750
|
+
tslib_1.__decorate([
|
|
751
|
+
core_1.ContentChild(button_item_template_directive_1.ButtonItemTemplateDirective, { static: false }),
|
|
752
|
+
tslib_1.__metadata("design:type", button_item_template_directive_1.ButtonItemTemplateDirective)
|
|
753
|
+
], SplitButtonComponent.prototype, "itemTemplate", void 0);
|
|
754
|
+
tslib_1.__decorate([
|
|
755
|
+
core_1.ViewChild('button', { static: true }),
|
|
756
|
+
tslib_1.__metadata("design:type", core_1.ElementRef)
|
|
757
|
+
], SplitButtonComponent.prototype, "button", void 0);
|
|
758
|
+
tslib_1.__decorate([
|
|
759
|
+
core_1.ViewChild('arrowButton', { static: true, read: core_1.ElementRef }),
|
|
760
|
+
tslib_1.__metadata("design:type", core_1.ElementRef)
|
|
761
|
+
], SplitButtonComponent.prototype, "arrowButton", void 0);
|
|
762
|
+
tslib_1.__decorate([
|
|
763
|
+
core_1.ViewChild('popupTemplate', { static: true }),
|
|
764
|
+
tslib_1.__metadata("design:type", core_1.TemplateRef)
|
|
765
|
+
], SplitButtonComponent.prototype, "popupTemplate", void 0);
|
|
766
|
+
tslib_1.__decorate([
|
|
767
|
+
core_1.ViewChild('container', { read: core_1.ViewContainerRef, static: true }),
|
|
768
|
+
tslib_1.__metadata("design:type", core_1.ViewContainerRef)
|
|
769
|
+
], SplitButtonComponent.prototype, "containerRef", void 0);
|
|
770
|
+
tslib_1.__decorate([
|
|
771
|
+
core_1.HostBinding('class.k-focus'),
|
|
772
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
773
|
+
tslib_1.__metadata("design:paramtypes", [Boolean])
|
|
774
|
+
], SplitButtonComponent.prototype, "isFocused", null);
|
|
775
|
+
tslib_1.__decorate([
|
|
776
|
+
core_1.HostBinding('class.k-split-button'),
|
|
777
|
+
core_1.HostBinding('class.k-button-group'),
|
|
778
|
+
tslib_1.__metadata("design:type", Boolean),
|
|
779
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
780
|
+
], SplitButtonComponent.prototype, "widgetClasses", null);
|
|
781
|
+
tslib_1.__decorate([
|
|
782
|
+
core_1.HostBinding('attr.dir'),
|
|
783
|
+
tslib_1.__metadata("design:type", String),
|
|
784
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
785
|
+
], SplitButtonComponent.prototype, "dir", null);
|
|
786
|
+
tslib_1.__decorate([
|
|
787
|
+
core_1.HostListener('keydown', ['$event']),
|
|
788
|
+
tslib_1.__metadata("design:type", Function),
|
|
789
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
790
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
791
|
+
], SplitButtonComponent.prototype, "keydown", null);
|
|
792
|
+
tslib_1.__decorate([
|
|
793
|
+
core_1.HostListener('keypress', ['$event']),
|
|
794
|
+
tslib_1.__metadata("design:type", Function),
|
|
795
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
796
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
797
|
+
], SplitButtonComponent.prototype, "keypress", null);
|
|
798
|
+
tslib_1.__decorate([
|
|
799
|
+
core_1.HostListener('keyup', ['$event']),
|
|
800
|
+
tslib_1.__metadata("design:type", Function),
|
|
801
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
802
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
803
|
+
], SplitButtonComponent.prototype, "keyup", null);
|
|
804
|
+
SplitButtonComponent = tslib_1.__decorate([
|
|
805
|
+
core_1.Component({
|
|
806
|
+
exportAs: 'kendoSplitButton',
|
|
807
|
+
providers: [
|
|
808
|
+
focus_service_1.FocusService,
|
|
809
|
+
navigation_service_1.NavigationService,
|
|
810
|
+
NAVIGATION_SETTINGS_PROVIDER,
|
|
811
|
+
kendo_angular_l10n_1.LocalizationService,
|
|
812
|
+
{
|
|
813
|
+
provide: kendo_angular_l10n_1.L10N_PREFIX,
|
|
814
|
+
useValue: 'kendo.splitbutton'
|
|
815
|
+
}
|
|
816
|
+
],
|
|
817
|
+
selector: 'kendo-splitbutton',
|
|
818
|
+
template: "\n <ng-container kendoSplitButtonLocalizedMessages\n i18n-splitButtonLabel=\"kendo.splitbutton.splitButtonLabel|The text for the SplitButton aria-label\"\n splitButtonLabel=\"{{ '{buttonText} splitbutton' }}\">\n </ng-container>\n <button\n kendoButton\n #button\n [type]=\"type\"\n [tabindex]=\"componentTabIndex\"\n [disabled]=\"disabled\"\n [size]=\"size\"\n [rounded]=\"rounded\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"themeColor\"\n [icon]=\"icon\"\n [class.k-active]=\"active\"\n [class.k-icon-button]=\"!text && icon\"\n [iconClass]=\"iconClass\"\n [imageUrl]=\"imageUrl\"\n [ngClass]=\"buttonClass\"\n (focus)=\"onButtonFocus()\"\n (click)=\"onButtonClick()\"\n (blur)=\"onButtonBlur()\"\n (mousedown)=\"toggleButtonActiveState(true)\"\n (mouseup)=\"toggleButtonActiveState(false)\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-expanded]=\"openState\"\n [attr.aria-haspopup]=\"true\"\n [attr.aria-owns]=\"listId\"\n [attr.aria-label]=\"ariaLabel\"\n >\n <span *ngIf=\"text\" class=\"k-button-text\">\n {{ text }}\n </span><ng-content></ng-content>\n </button>\n <button\n kendoButton\n #arrowButton\n type=\"button\"\n [class.k-active]=\"activeArrow\"\n [disabled]=\"disabled\"\n [icon]=\"arrowButtonIcon\"\n [size]=\"size\"\n [rounded]=\"rounded\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"fillMode ? themeColor : null\"\n [tabindex]=\"-1\"\n [ngClass]=\"arrowButtonClass\"\n (click)=\"onArrowButtonClick()\"\n (mousedown)=\"toggleArrowButtonActiveState(true)\"\n (mouseup)=\"toggleArrowButtonActiveState(false)\"\n ></button>\n <ng-template #popupTemplate>\n <kendo-button-list\n [id]=\"listId\"\n [data]=\"data\"\n [textField]=\"textField\"\n [itemTemplate]=\"itemTemplate\"\n (onItemClick)=\"onItemClick($event)\"\n (keydown)=\"keyDownHandler($event)\"\n (keypress)=\"keyPressHandler($event)\"\n (keyup)=\"keyUpHandler($event)\"\n [attr.dir]=\"dir\"\n [size]=\"size\"\n >\n </kendo-button-list>\n </ng-template>\n <ng-container #container></ng-container>\n "
|
|
819
|
+
}),
|
|
820
|
+
tslib_1.__metadata("design:paramtypes", [focus_service_1.FocusService,
|
|
821
|
+
navigation_service_1.NavigationService,
|
|
822
|
+
core_1.ElementRef,
|
|
823
|
+
core_1.NgZone,
|
|
824
|
+
kendo_angular_popup_1.PopupService,
|
|
825
|
+
core_1.ElementRef,
|
|
826
|
+
kendo_angular_l10n_1.LocalizationService,
|
|
827
|
+
core_1.ChangeDetectorRef,
|
|
828
|
+
core_1.Renderer2])
|
|
829
|
+
], SplitButtonComponent);
|
|
830
|
+
return SplitButtonComponent;
|
|
831
|
+
}(list_button_1.ListButton));
|
|
832
|
+
exports.SplitButtonComponent = SplitButtonComponent;
|