1 | import * as i0 from '@angular/core';
|
---|
2 | import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, ViewChild, NgModule } from '@angular/core';
|
---|
3 | import * as i2 from '@angular/common';
|
---|
4 | import { CommonModule } from '@angular/common';
|
---|
5 | import * as i3 from 'primeng/button';
|
---|
6 | import { ButtonModule } from 'primeng/button';
|
---|
7 | import * as i1 from 'primeng/menu';
|
---|
8 | import { MenuModule } from 'primeng/menu';
|
---|
9 |
|
---|
10 | class SplitButton {
|
---|
11 | constructor() {
|
---|
12 | this.iconPos = 'left';
|
---|
13 | this.onClick = new EventEmitter();
|
---|
14 | this.onDropdownClick = new EventEmitter();
|
---|
15 | this.showTransitionOptions = '.12s cubic-bezier(0, 0, 0.2, 1)';
|
---|
16 | this.hideTransitionOptions = '.1s linear';
|
---|
17 | }
|
---|
18 | onDefaultButtonClick(event) {
|
---|
19 | this.onClick.emit(event);
|
---|
20 | }
|
---|
21 | onDropdownButtonClick(event) {
|
---|
22 | this.onDropdownClick.emit(event);
|
---|
23 | this.menu.toggle({ currentTarget: this.containerViewChild.nativeElement, relativeAlign: this.appendTo == null });
|
---|
24 | }
|
---|
25 | }
|
---|
26 | SplitButton.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: SplitButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
---|
27 | SplitButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: SplitButton, selector: "p-splitButton", inputs: { model: "model", icon: "icon", iconPos: "iconPos", label: "label", style: "style", styleClass: "styleClass", menuStyle: "menuStyle", menuStyleClass: "menuStyleClass", disabled: "disabled", tabindex: "tabindex", appendTo: "appendTo", dir: "dir", expandAriaLabel: "expandAriaLabel", showTransitionOptions: "showTransitionOptions", hideTransitionOptions: "hideTransitionOptions" }, outputs: { onClick: "onClick", onDropdownClick: "onDropdownClick" }, host: { classAttribute: "p-element" }, viewQueries: [{ propertyName: "containerViewChild", first: true, predicate: ["container"], descendants: true }, { propertyName: "buttonViewChild", first: true, predicate: ["defaultbtn"], descendants: true }, { propertyName: "menu", first: true, predicate: ["menu"], descendants: true }], ngImport: i0, template: `
|
---|
28 | <div #container [ngClass]="'p-splitbutton p-component'" [ngStyle]="style" [class]="styleClass">
|
---|
29 | <button #defaultbtn class="p-splitbutton-defaultbutton" type="button" pButton [icon]="icon" [iconPos]="iconPos" [label]="label" (click)="onDefaultButtonClick($event)" [disabled]="disabled" [attr.tabindex]="tabindex"></button>
|
---|
30 | <button type="button" pButton class="p-splitbutton-menubutton" icon="pi pi-chevron-down" (click)="onDropdownButtonClick($event)" [disabled]="disabled" [attr.aria-label]="expandAriaLabel"></button>
|
---|
31 | <p-menu #menu [popup]="true" [model]="model" [style]="menuStyle" [styleClass]="menuStyleClass" [appendTo]="appendTo"
|
---|
32 | [showTransitionOptions]="showTransitionOptions" [hideTransitionOptions]="hideTransitionOptions"></p-menu>
|
---|
33 | </div>
|
---|
34 | `, isInline: true, styles: [".p-splitbutton{display:inline-flex;position:relative}.p-splitbutton .p-splitbutton-defaultbutton{flex:1 1 auto;border-top-right-radius:0;border-bottom-right-radius:0;border-right:0 none}.p-splitbutton-menubutton{display:flex;align-items:center;justify-content:center;border-top-left-radius:0;border-bottom-left-radius:0}.p-splitbutton .p-menu{min-width:100%}.p-fluid .p-splitbutton{display:flex}\n"], components: [{ type: i1.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
---|
35 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: SplitButton, decorators: [{
|
---|
36 | type: Component,
|
---|
37 | args: [{ selector: 'p-splitButton', template: `
|
---|
38 | <div #container [ngClass]="'p-splitbutton p-component'" [ngStyle]="style" [class]="styleClass">
|
---|
39 | <button #defaultbtn class="p-splitbutton-defaultbutton" type="button" pButton [icon]="icon" [iconPos]="iconPos" [label]="label" (click)="onDefaultButtonClick($event)" [disabled]="disabled" [attr.tabindex]="tabindex"></button>
|
---|
40 | <button type="button" pButton class="p-splitbutton-menubutton" icon="pi pi-chevron-down" (click)="onDropdownButtonClick($event)" [disabled]="disabled" [attr.aria-label]="expandAriaLabel"></button>
|
---|
41 | <p-menu #menu [popup]="true" [model]="model" [style]="menuStyle" [styleClass]="menuStyleClass" [appendTo]="appendTo"
|
---|
42 | [showTransitionOptions]="showTransitionOptions" [hideTransitionOptions]="hideTransitionOptions"></p-menu>
|
---|
43 | </div>
|
---|
44 | `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
---|
45 | 'class': 'p-element'
|
---|
46 | }, styles: [".p-splitbutton{display:inline-flex;position:relative}.p-splitbutton .p-splitbutton-defaultbutton{flex:1 1 auto;border-top-right-radius:0;border-bottom-right-radius:0;border-right:0 none}.p-splitbutton-menubutton{display:flex;align-items:center;justify-content:center;border-top-left-radius:0;border-bottom-left-radius:0}.p-splitbutton .p-menu{min-width:100%}.p-fluid .p-splitbutton{display:flex}\n"] }]
|
---|
47 | }], propDecorators: { model: [{
|
---|
48 | type: Input
|
---|
49 | }], icon: [{
|
---|
50 | type: Input
|
---|
51 | }], iconPos: [{
|
---|
52 | type: Input
|
---|
53 | }], label: [{
|
---|
54 | type: Input
|
---|
55 | }], onClick: [{
|
---|
56 | type: Output
|
---|
57 | }], onDropdownClick: [{
|
---|
58 | type: Output
|
---|
59 | }], style: [{
|
---|
60 | type: Input
|
---|
61 | }], styleClass: [{
|
---|
62 | type: Input
|
---|
63 | }], menuStyle: [{
|
---|
64 | type: Input
|
---|
65 | }], menuStyleClass: [{
|
---|
66 | type: Input
|
---|
67 | }], disabled: [{
|
---|
68 | type: Input
|
---|
69 | }], tabindex: [{
|
---|
70 | type: Input
|
---|
71 | }], appendTo: [{
|
---|
72 | type: Input
|
---|
73 | }], dir: [{
|
---|
74 | type: Input
|
---|
75 | }], expandAriaLabel: [{
|
---|
76 | type: Input
|
---|
77 | }], showTransitionOptions: [{
|
---|
78 | type: Input
|
---|
79 | }], hideTransitionOptions: [{
|
---|
80 | type: Input
|
---|
81 | }], containerViewChild: [{
|
---|
82 | type: ViewChild,
|
---|
83 | args: ['container']
|
---|
84 | }], buttonViewChild: [{
|
---|
85 | type: ViewChild,
|
---|
86 | args: ['defaultbtn']
|
---|
87 | }], menu: [{
|
---|
88 | type: ViewChild,
|
---|
89 | args: ['menu']
|
---|
90 | }] } });
|
---|
91 | class SplitButtonModule {
|
---|
92 | }
|
---|
93 | SplitButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: SplitButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
---|
94 | SplitButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: SplitButtonModule, declarations: [SplitButton], imports: [CommonModule, ButtonModule, MenuModule], exports: [SplitButton, ButtonModule] });
|
---|
95 | SplitButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: SplitButtonModule, imports: [[CommonModule, ButtonModule, MenuModule], ButtonModule] });
|
---|
96 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: SplitButtonModule, decorators: [{
|
---|
97 | type: NgModule,
|
---|
98 | args: [{
|
---|
99 | imports: [CommonModule, ButtonModule, MenuModule],
|
---|
100 | exports: [SplitButton, ButtonModule],
|
---|
101 | declarations: [SplitButton]
|
---|
102 | }]
|
---|
103 | }] });
|
---|
104 |
|
---|
105 | /**
|
---|
106 | * Generated bundle index. Do not edit.
|
---|
107 | */
|
---|
108 |
|
---|
109 | export { SplitButton, SplitButtonModule };
|
---|