import { Directive, Input, Output, EventEmitter, HostListener, Injector } from '@angular/core'; import { ColorPickerComponent } from './color-picker.component'; import * as i0 from "@angular/core"; import * as i1 from "./color-picker.service"; // Caretaker note: we have still left the `typeof` condition in order to avoid // creating a breaking change for projects that still use the View Engine. // The `ngDevMode` is always available when Ivy is enabled. // This will be evaluated during compilation into `const NG_DEV_MODE = false`, // thus Terser will be able to tree-shake `console.warn` calls. const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode; export class ColorPickerDirective { injector; cfr; appRef; vcRef; elRef; _service; dialog; dialogCreated = false; ignoreChanges = false; cmpRef; viewAttachedToAppRef = false; colorPicker; cpWidth = '230px'; cpHeight = 'auto'; cpToggle = false; cpDisabled = false; cpIgnoredElements = []; cpFallbackColor = ''; cpColorMode = 'color'; cpCmykEnabled = false; cpOutputFormat = 'auto'; cpAlphaChannel = 'enabled'; cpDisableInput = false; cpDialogDisplay = 'popup'; cpSaveClickOutside = true; cpCloseClickOutside = true; cpUseRootViewContainer = false; cpPosition = 'auto'; cpPositionOffset = '0%'; cpPositionRelativeToArrow = false; cpOKButton = false; cpOKButtonText = 'OK'; cpOKButtonClass = 'cp-ok-button-class'; cpCancelButton = false; cpCancelButtonText = 'Cancel'; cpCancelButtonClass = 'cp-cancel-button-class'; cpEyeDropper = false; cpPresetLabel = 'Preset colors'; cpPresetColors; cpPresetColorsClass = 'cp-preset-colors-class'; cpMaxPresetColorsLength = 6; cpPresetEmptyMessage = 'No colors added'; cpPresetEmptyMessageClass = 'preset-empty-message'; cpAddColorButton = false; cpAddColorButtonText = 'Add color'; cpAddColorButtonClass = 'cp-add-color-button-class'; cpRemoveColorButtonClass = 'cp-remove-color-button-class'; cpArrowPosition = 0; cpExtraTemplate; cpInputChange = new EventEmitter(true); cpToggleChange = new EventEmitter(true); cpSliderChange = new EventEmitter(true); cpSliderDragEnd = new EventEmitter(true); cpSliderDragStart = new EventEmitter(true); colorPickerOpen = new EventEmitter(true); colorPickerClose = new EventEmitter(true); colorPickerCancel = new EventEmitter(true); colorPickerSelect = new EventEmitter(true); colorPickerChange = new EventEmitter(false); cpCmykColorChange = new EventEmitter(true); cpPresetColorsChange = new EventEmitter(true); handleClick() { this.inputFocus(); } handleFocus() { this.inputFocus(); } handleInput(event) { this.inputChange(event); } constructor(injector, cfr, appRef, vcRef, elRef, _service) { this.injector = injector; this.cfr = cfr; this.appRef = appRef; this.vcRef = vcRef; this.elRef = elRef; this._service = _service; } ngOnDestroy() { if (this.cmpRef != null) { if (this.viewAttachedToAppRef) { this.appRef.detachView(this.cmpRef.hostView); } this.cmpRef.destroy(); this.cmpRef = null; this.dialog = null; } } ngOnChanges(changes) { if (changes.cpToggle && !this.cpDisabled) { if (changes.cpToggle.currentValue) { this.openDialog(); } else if (!changes.cpToggle.currentValue) { this.closeDialog(); } } if (changes.colorPicker) { if (this.dialog && !this.ignoreChanges) { if (this.cpDialogDisplay === 'inline') { this.dialog.setInitialColor(changes.colorPicker.currentValue); } this.dialog.setColorFromString(changes.colorPicker.currentValue, false); if (this.cpUseRootViewContainer && this.cpDialogDisplay !== 'inline') { this.cmpRef.changeDetectorRef.detectChanges(); } } this.ignoreChanges = false; } if (changes.cpPresetLabel || changes.cpPresetColors) { if (this.dialog) { this.dialog.setPresetConfig(this.cpPresetLabel, this.cpPresetColors); } } } openDialog() { if (!this.dialogCreated) { let vcRef = this.vcRef; this.dialogCreated = true; this.viewAttachedToAppRef = false; if (this.cpUseRootViewContainer && this.cpDialogDisplay !== 'inline') { const classOfRootComponent = this.appRef.componentTypes[0]; const appInstance = this.injector.get(classOfRootComponent, Injector.NULL); if (appInstance !== Injector.NULL) { vcRef = appInstance.vcRef || appInstance.viewContainerRef || this.vcRef; if (NG_DEV_MODE && vcRef === this.vcRef) { console.warn('You are using cpUseRootViewContainer, ' + 'but the root component is not exposing viewContainerRef!' + 'Please expose it by adding \'public vcRef: ViewContainerRef\' to the constructor.'); } } else { this.viewAttachedToAppRef = true; } } const compFactory = this.cfr.resolveComponentFactory(ColorPickerComponent); if (this.viewAttachedToAppRef) { this.cmpRef = compFactory.create(this.injector); this.appRef.attachView(this.cmpRef.hostView); document.body.appendChild(this.cmpRef.hostView.rootNodes[0]); } else { const injector = Injector.create({ providers: [], // We shouldn't use `vcRef.parentInjector` since it's been deprecated long time ago and might be removed // in newer Angular versions: https://github.com/angular/angular/pull/25174. parent: vcRef.injector, }); this.cmpRef = vcRef.createComponent(compFactory, 0, injector, []); } this.cmpRef.instance.setupDialog(this, this.elRef, this.colorPicker, this.cpWidth, this.cpHeight, this.cpDialogDisplay, this.cpFallbackColor, this.cpColorMode, this.cpCmykEnabled, this.cpAlphaChannel, this.cpOutputFormat, this.cpDisableInput, this.cpIgnoredElements, this.cpSaveClickOutside, this.cpCloseClickOutside, this.cpUseRootViewContainer, this.cpPosition, this.cpPositionOffset, this.cpPositionRelativeToArrow, this.cpPresetLabel, this.cpPresetColors, this.cpPresetColorsClass, this.cpMaxPresetColorsLength, this.cpPresetEmptyMessage, this.cpPresetEmptyMessageClass, this.cpOKButton, this.cpOKButtonClass, this.cpOKButtonText, this.cpCancelButton, this.cpCancelButtonClass, this.cpCancelButtonText, this.cpAddColorButton, this.cpAddColorButtonClass, this.cpAddColorButtonText, this.cpRemoveColorButtonClass, this.cpEyeDropper, this.elRef, this.cpExtraTemplate); this.dialog = this.cmpRef.instance; if (this.vcRef !== vcRef) { this.cmpRef.changeDetectorRef.detectChanges(); } } else if (this.dialog) { this.dialog.openDialog(this.colorPicker); } } closeDialog() { if (this.dialog && this.cpDialogDisplay === 'popup') { this.dialog.closeDialog(); } } cmykChanged(value) { this.cpCmykColorChange.emit(value); } stateChanged(state) { this.cpToggleChange.emit(state); if (state) { this.colorPickerOpen.emit(this.colorPicker); } else { this.colorPickerClose.emit(this.colorPicker); } } colorChanged(value, ignore = true) { this.ignoreChanges = ignore; this.colorPickerChange.emit(value); } colorSelected(value) { this.colorPickerSelect.emit(value); } colorCanceled() { this.colorPickerCancel.emit(); } inputFocus() { const element = this.elRef.nativeElement; const ignored = this.cpIgnoredElements.filter((item) => item === element); if (!this.cpDisabled && !ignored.length) { if (typeof document !== 'undefined' && element === document.activeElement) { this.openDialog(); } else if (!this.dialog || !this.dialog.show) { this.openDialog(); } else { this.closeDialog(); } } } inputChange(event) { if (this.dialog) { this.dialog.setColorFromString(event.target.value, true); } else { this.colorPicker = event.target.value; this.colorPickerChange.emit(this.colorPicker); } } inputChanged(event) { this.cpInputChange.emit(event); } sliderChanged(event) { this.cpSliderChange.emit(event); } sliderDragEnd(event) { this.cpSliderDragEnd.emit(event); } sliderDragStart(event) { this.cpSliderDragStart.emit(event); } presetColorsChanged(value) { this.cpPresetColorsChange.emit(value); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: ColorPickerDirective, deps: [{ token: i0.Injector }, { token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i1.ColorPickerService }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.5", type: ColorPickerDirective, selector: "[colorPicker]", inputs: { colorPicker: "colorPicker", cpWidth: "cpWidth", cpHeight: "cpHeight", cpToggle: "cpToggle", cpDisabled: "cpDisabled", cpIgnoredElements: "cpIgnoredElements", cpFallbackColor: "cpFallbackColor", cpColorMode: "cpColorMode", cpCmykEnabled: "cpCmykEnabled", cpOutputFormat: "cpOutputFormat", cpAlphaChannel: "cpAlphaChannel", cpDisableInput: "cpDisableInput", cpDialogDisplay: "cpDialogDisplay", cpSaveClickOutside: "cpSaveClickOutside", cpCloseClickOutside: "cpCloseClickOutside", cpUseRootViewContainer: "cpUseRootViewContainer", cpPosition: "cpPosition", cpPositionOffset: "cpPositionOffset", cpPositionRelativeToArrow: "cpPositionRelativeToArrow", cpOKButton: "cpOKButton", cpOKButtonText: "cpOKButtonText", cpOKButtonClass: "cpOKButtonClass", cpCancelButton: "cpCancelButton", cpCancelButtonText: "cpCancelButtonText", cpCancelButtonClass: "cpCancelButtonClass", cpEyeDropper: "cpEyeDropper", cpPresetLabel: "cpPresetLabel", cpPresetColors: "cpPresetColors", cpPresetColorsClass: "cpPresetColorsClass", cpMaxPresetColorsLength: "cpMaxPresetColorsLength", cpPresetEmptyMessage: "cpPresetEmptyMessage", cpPresetEmptyMessageClass: "cpPresetEmptyMessageClass", cpAddColorButton: "cpAddColorButton", cpAddColorButtonText: "cpAddColorButtonText", cpAddColorButtonClass: "cpAddColorButtonClass", cpRemoveColorButtonClass: "cpRemoveColorButtonClass", cpArrowPosition: "cpArrowPosition", cpExtraTemplate: "cpExtraTemplate" }, outputs: { cpInputChange: "cpInputChange", cpToggleChange: "cpToggleChange", cpSliderChange: "cpSliderChange", cpSliderDragEnd: "cpSliderDragEnd", cpSliderDragStart: "cpSliderDragStart", colorPickerOpen: "colorPickerOpen", colorPickerClose: "colorPickerClose", colorPickerCancel: "colorPickerCancel", colorPickerSelect: "colorPickerSelect", colorPickerChange: "colorPickerChange", cpCmykColorChange: "cpCmykColorChange", cpPresetColorsChange: "cpPresetColorsChange" }, host: { listeners: { "click": "handleClick()", "focus": "handleFocus()", "input": "handleInput($event)" } }, exportAs: ["ngxColorPicker"], usesOnChanges: true, ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: ColorPickerDirective, decorators: [{ type: Directive, args: [{ selector: '[colorPicker]', exportAs: 'ngxColorPicker' }] }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i1.ColorPickerService }]; }, propDecorators: { colorPicker: [{ type: Input }], cpWidth: [{ type: Input }], cpHeight: [{ type: Input }], cpToggle: [{ type: Input }], cpDisabled: [{ type: Input }], cpIgnoredElements: [{ type: Input }], cpFallbackColor: [{ type: Input }], cpColorMode: [{ type: Input }], cpCmykEnabled: [{ type: Input }], cpOutputFormat: [{ type: Input }], cpAlphaChannel: [{ type: Input }], cpDisableInput: [{ type: Input }], cpDialogDisplay: [{ type: Input }], cpSaveClickOutside: [{ type: Input }], cpCloseClickOutside: [{ type: Input }], cpUseRootViewContainer: [{ type: Input }], cpPosition: [{ type: Input }], cpPositionOffset: [{ type: Input }], cpPositionRelativeToArrow: [{ type: Input }], cpOKButton: [{ type: Input }], cpOKButtonText: [{ type: Input }], cpOKButtonClass: [{ type: Input }], cpCancelButton: [{ type: Input }], cpCancelButtonText: [{ type: Input }], cpCancelButtonClass: [{ type: Input }], cpEyeDropper: [{ type: Input }], cpPresetLabel: [{ type: Input }], cpPresetColors: [{ type: Input }], cpPresetColorsClass: [{ type: Input }], cpMaxPresetColorsLength: [{ type: Input }], cpPresetEmptyMessage: [{ type: Input }], cpPresetEmptyMessageClass: [{ type: Input }], cpAddColorButton: [{ type: Input }], cpAddColorButtonText: [{ type: Input }], cpAddColorButtonClass: [{ type: Input }], cpRemoveColorButtonClass: [{ type: Input }], cpArrowPosition: [{ type: Input }], cpExtraTemplate: [{ type: Input }], cpInputChange: [{ type: Output }], cpToggleChange: [{ type: Output }], cpSliderChange: [{ type: Output }], cpSliderDragEnd: [{ type: Output }], cpSliderDragStart: [{ type: Output }], colorPickerOpen: [{ type: Output }], colorPickerClose: [{ type: Output }], colorPickerCancel: [{ type: Output }], colorPickerSelect: [{ type: Output }], colorPickerChange: [{ type: Output }], cpCmykColorChange: [{ type: Output }], cpPresetColorsChange: [{ type: Output }], handleClick: [{ type: HostListener, args: ['click'] }], handleFocus: [{ type: HostListener, args: ['focus'] }], handleInput: [{ type: HostListener, args: ['input', ['$event']] }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sb3ItcGlja2VyLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3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