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