1 | import { NgModule, Component, Input, Output, EventEmitter, forwardRef, ChangeDetectionStrategy } from '@angular/core';
|
---|
2 | import { CommonModule } from '@angular/common';
|
---|
3 | import { RippleModule } from 'primeng/ripple';
|
---|
4 | import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
---|
5 | import * as i0 from "@angular/core";
|
---|
6 | import * as i1 from "primeng/ripple";
|
---|
7 | import * as i2 from "@angular/common";
|
---|
8 | export const TOGGLEBUTTON_VALUE_ACCESSOR = {
|
---|
9 | provide: NG_VALUE_ACCESSOR,
|
---|
10 | useExisting: forwardRef(() => ToggleButton),
|
---|
11 | multi: true
|
---|
12 | };
|
---|
13 | export class ToggleButton {
|
---|
14 | constructor(cd) {
|
---|
15 | this.cd = cd;
|
---|
16 | this.iconPos = 'left';
|
---|
17 | this.onChange = new EventEmitter();
|
---|
18 | this.checked = false;
|
---|
19 | this.onModelChange = () => { };
|
---|
20 | this.onModelTouched = () => { };
|
---|
21 | }
|
---|
22 | toggle(event) {
|
---|
23 | if (!this.disabled) {
|
---|
24 | this.checked = !this.checked;
|
---|
25 | this.onModelChange(this.checked);
|
---|
26 | this.onModelTouched();
|
---|
27 | this.onChange.emit({
|
---|
28 | originalEvent: event,
|
---|
29 | checked: this.checked
|
---|
30 | });
|
---|
31 | this.cd.markForCheck();
|
---|
32 | }
|
---|
33 | }
|
---|
34 | onBlur() {
|
---|
35 | this.onModelTouched();
|
---|
36 | }
|
---|
37 | writeValue(value) {
|
---|
38 | this.checked = value;
|
---|
39 | this.cd.markForCheck();
|
---|
40 | }
|
---|
41 | registerOnChange(fn) {
|
---|
42 | this.onModelChange = fn;
|
---|
43 | }
|
---|
44 | registerOnTouched(fn) {
|
---|
45 | this.onModelTouched = fn;
|
---|
46 | }
|
---|
47 | setDisabledState(val) {
|
---|
48 | this.disabled = val;
|
---|
49 | this.cd.markForCheck();
|
---|
50 | }
|
---|
51 | get hasOnLabel() {
|
---|
52 | return this.onLabel && this.onLabel.length > 0;
|
---|
53 | }
|
---|
54 | get hasOffLabel() {
|
---|
55 | return this.onLabel && this.onLabel.length > 0;
|
---|
56 | }
|
---|
57 | }
|
---|
58 | ToggleButton.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ToggleButton, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
---|
59 | ToggleButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: ToggleButton, selector: "p-toggleButton", inputs: { onLabel: "onLabel", offLabel: "offLabel", onIcon: "onIcon", offIcon: "offIcon", ariaLabelledBy: "ariaLabelledBy", disabled: "disabled", style: "style", styleClass: "styleClass", inputId: "inputId", tabindex: "tabindex", iconPos: "iconPos" }, outputs: { onChange: "onChange" }, host: { classAttribute: "p-element" }, providers: [TOGGLEBUTTON_VALUE_ACCESSOR], ngImport: i0, template: `
|
---|
60 | <div [ngClass]="{'p-button p-togglebutton p-component': true, 'p-button-icon-only': (onIcon && offIcon && !hasOnLabel && !hasOffLabel),'p-highlight': checked,'p-disabled':disabled}"
|
---|
61 | [ngStyle]="style" [class]="styleClass" (click)="toggle($event)" (keydown.enter)="toggle($event)"
|
---|
62 | [attr.tabindex]="disabled ? null : '0'" role="checkbox" [attr.aria-checked]="checked" pRipple>
|
---|
63 | <span *ngIf="onIcon||offIcon" [class]="checked ? this.onIcon : this.offIcon"
|
---|
64 | [ngClass]="{'p-button-icon': true, 'p-button-icon-left': (iconPos === 'left'), 'p-button-icon-right': (iconPos === 'right')}"></span>
|
---|
65 | <span class="p-button-label">{{checked ? hasOnLabel ? onLabel : '' : hasOffLabel ? offLabel : ''}}</span>
|
---|
66 | </div>
|
---|
67 | `, isInline: true, styles: [".p-button{margin:0;display:inline-flex;cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none;align-items:center;vertical-align:bottom;text-align:center;overflow:hidden;position:relative}.p-button-label{flex:1 1 auto}.p-button-icon-right{order:1}.p-button:disabled{cursor:default}.p-button-icon-only{justify-content:center}.p-button-icon-only .p-button-label{visibility:hidden;width:0;flex:0 0 auto}.p-button-vertical{flex-direction:column}.p-button-icon-bottom{order:2}.p-buttonset .p-button{margin:0}.p-buttonset .p-button:not(:last-child){border-right:0 none}.p-buttonset .p-button:not(:first-of-type):not(:last-of-type){border-radius:0}.p-buttonset .p-button:first-of-type{border-top-right-radius:0;border-bottom-right-radius:0}.p-buttonset .p-button:last-of-type{border-top-left-radius:0;border-bottom-left-radius:0}.p-buttonset .p-button:focus{position:relative;z-index:1}.p-button-label{transition:all .2s}\n"], directives: [{ type: i1.Ripple, selector: "[pRipple]" }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
---|
68 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ToggleButton, decorators: [{
|
---|
69 | type: Component,
|
---|
70 | args: [{ selector: 'p-toggleButton', template: `
|
---|
71 | <div [ngClass]="{'p-button p-togglebutton p-component': true, 'p-button-icon-only': (onIcon && offIcon && !hasOnLabel && !hasOffLabel),'p-highlight': checked,'p-disabled':disabled}"
|
---|
72 | [ngStyle]="style" [class]="styleClass" (click)="toggle($event)" (keydown.enter)="toggle($event)"
|
---|
73 | [attr.tabindex]="disabled ? null : '0'" role="checkbox" [attr.aria-checked]="checked" pRipple>
|
---|
74 | <span *ngIf="onIcon||offIcon" [class]="checked ? this.onIcon : this.offIcon"
|
---|
75 | [ngClass]="{'p-button-icon': true, 'p-button-icon-left': (iconPos === 'left'), 'p-button-icon-right': (iconPos === 'right')}"></span>
|
---|
76 | <span class="p-button-label">{{checked ? hasOnLabel ? onLabel : '' : hasOffLabel ? offLabel : ''}}</span>
|
---|
77 | </div>
|
---|
78 | `, providers: [TOGGLEBUTTON_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
---|
79 | 'class': 'p-element'
|
---|
80 | }, styles: [".p-button{margin:0;display:inline-flex;cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none;align-items:center;vertical-align:bottom;text-align:center;overflow:hidden;position:relative}.p-button-label{flex:1 1 auto}.p-button-icon-right{order:1}.p-button:disabled{cursor:default}.p-button-icon-only{justify-content:center}.p-button-icon-only .p-button-label{visibility:hidden;width:0;flex:0 0 auto}.p-button-vertical{flex-direction:column}.p-button-icon-bottom{order:2}.p-buttonset .p-button{margin:0}.p-buttonset .p-button:not(:last-child){border-right:0 none}.p-buttonset .p-button:not(:first-of-type):not(:last-of-type){border-radius:0}.p-buttonset .p-button:first-of-type{border-top-right-radius:0;border-bottom-right-radius:0}.p-buttonset .p-button:last-of-type{border-top-left-radius:0;border-bottom-left-radius:0}.p-buttonset .p-button:focus{position:relative;z-index:1}.p-button-label{transition:all .2s}\n"] }]
|
---|
81 | }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { onLabel: [{
|
---|
82 | type: Input
|
---|
83 | }], offLabel: [{
|
---|
84 | type: Input
|
---|
85 | }], onIcon: [{
|
---|
86 | type: Input
|
---|
87 | }], offIcon: [{
|
---|
88 | type: Input
|
---|
89 | }], ariaLabelledBy: [{
|
---|
90 | type: Input
|
---|
91 | }], disabled: [{
|
---|
92 | type: Input
|
---|
93 | }], style: [{
|
---|
94 | type: Input
|
---|
95 | }], styleClass: [{
|
---|
96 | type: Input
|
---|
97 | }], inputId: [{
|
---|
98 | type: Input
|
---|
99 | }], tabindex: [{
|
---|
100 | type: Input
|
---|
101 | }], iconPos: [{
|
---|
102 | type: Input
|
---|
103 | }], onChange: [{
|
---|
104 | type: Output
|
---|
105 | }] } });
|
---|
106 | export class ToggleButtonModule {
|
---|
107 | }
|
---|
108 | ToggleButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ToggleButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
---|
109 | ToggleButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ToggleButtonModule, declarations: [ToggleButton], imports: [CommonModule, RippleModule], exports: [ToggleButton] });
|
---|
110 | ToggleButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ToggleButtonModule, imports: [[CommonModule, RippleModule]] });
|
---|
111 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ToggleButtonModule, decorators: [{
|
---|
112 | type: NgModule,
|
---|
113 | args: [{
|
---|
114 | imports: [CommonModule, RippleModule],
|
---|
115 | exports: [ToggleButton],
|
---|
116 | declarations: [ToggleButton]
|
---|
117 | }]
|
---|
118 | }] });
|
---|
119 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9nZ2xlYnV0dG9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2FwcC9jb21wb25lbnRzL3RvZ2dsZWJ1dHRvbi90b2dnbGVidXR0b24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLFFBQVEsRUFBQyxTQUFTLEVBQUMsS0FBSyxFQUFDLE1BQU0sRUFBQyxZQUFZLEVBQUMsVUFBVSxFQUFDLHVCQUF1QixFQUFtQixNQUFNLGVBQWUsQ0FBQztBQUNoSSxPQUFPLEVBQUMsWUFBWSxFQUFDLE1BQU0saUJBQWlCLENBQUM7QUFDN0MsT0FBTyxFQUFDLFlBQVksRUFBQyxNQUFNLGdCQUFnQixDQUFDO0FBQzVDLE9BQU8sRUFBQyxpQkFBaUIsRUFBdUIsTUFBTSxnQkFBZ0IsQ0FBQz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