@libs-ui/components-buttons-select-color 0.2.305 → 0.2.306-3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libs-ui-components-buttons-select-color.mjs","sources":["../../../../../../libs-ui/components/buttons/select-color/src/buttons-select-color.component.ts","../../../../../../libs-ui/components/buttons/select-color/src/buttons-select-color.component.html","../../../../../../libs-ui/components/buttons/select-color/src/libs-ui-components-buttons-select-color.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, model, OnDestroy, output, signal } from '@angular/core';\nimport { IButton, LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';\nimport { IOutputColorChangeMultipleType, IPickerCustomOptions, LibsUiComponentsColorPickerComponent } from '@libs-ui/components-color-picker';\nimport { IPopoverFunctionControlEvent, LibsUiComponentsPopoverComponent, TYPE_POPOVER_DIRECTION } from '@libs-ui/components-popover';\nimport { TranslateModule } from '@ngx-translate/core';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'libs_ui-components-buttons-select_color',\n templateUrl: './buttons-select-color.component.html',\n standalone: true,\n imports: [\n TranslateModule,\n LibsUiComponentsPopoverComponent,\n LibsUiComponentsButtonsButtonComponent,\n LibsUiComponentsColorPickerComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class LibsUiComponentsButtonsSelectColorComponent implements OnDestroy {\n\n // #region PROPERTY\n private color = signal<string>('');\n private popoverFunctionControl = signal<IPopoverFunctionControlEvent | undefined>(undefined);\n\n // #region INPUT\n readonly zIndex = model<number>(1200);\n readonly customOptions = input<IPickerCustomOptions>();\n readonly externalContent = input<boolean>(false);\n readonly direction = input<TYPE_POPOVER_DIRECTION>('bottom');\n readonly button = input<IButton>();\n readonly applyNow = input<boolean>(false);\n\n // #region OUTPUT\n readonly outColorChange = output<string>();\n readonly outColorChangeMultipleType = output<IOutputColorChangeMultipleType>();\n\n /* FUNCTIONS */\n protected handlerColorChange(event: string) {\n if (this.applyNow()) {\n this.outColorChange.emit(event);\n\n return;\n }\n this.color.set(event);\n }\n\n protected handlerFunctionControl(event: IPopoverFunctionControlEvent) {\n this.popoverFunctionControl.set(event);\n }\n\n protected handlerAction(event: Event, action: 'cancel' | 'apply') {\n event.stopPropagation();\n this.popoverFunctionControl()?.removePopoverOverlay();\n if (action === 'apply') {\n this.outColorChange.emit(this.color());\n }\n }\n\n ngOnDestroy(): void {\n this.popoverFunctionControl()?.removePopoverOverlay();\n }\n}\n","<div class=\"flex\"\n LibsUiComponentsPopoverDirective\n [mode]=\"'click-toggle'\"\n [ignoreHiddenPopoverContentWhenMouseLeave]=\"true\"\n [config]=\"{\n template: colorPicker,\n whiteTheme: true,\n ignoreArrow: true,\n widthByParent: false,\n maxWidth: 500,\n maxHeight: 500,\n zIndex: zIndex(),\n classInclude: 'w-[350px]',\n direction: direction(),\n directionDistance: 2,\n position: {\n mode: 'start',\n distance: 0\n }\n}\"\n (outFunctionsControl)=\"handlerFunctionControl($event)\">\n @if (externalContent()) {\n <ng-content select=\"div.libs-ui-buttons-select-color\"></ng-content>\n } @else {\n <libs_ui-components-buttons-button [type]=\"button()?.type || 'button-primary'\"\n [classIconLeft]=\"button()?.classIconLeft || ''\"\n [classIconRight]=\"button()?.classIconRight || ''\"\n [label]=\"button()?.label || ''\"\n [classLabel]=\"button()?.classLabel || ''\"\n [classInclude]=\"button()?.classInclude || ''\"\n [iconOnlyType]=\"button()?.iconOnlyType || false\"\n [popover]=\"button()?.popover || {}\"\n [ignoreStopPropagationEvent]=\"true\" />\n }\n</div>\n\n<ng-template #colorPicker>\n <div class=\"p-[16px] w-auto h-auto\">\n <libs_ui-components-color_picker [customOptions]=\"customOptions()\"\n (outColorChange)=\"handlerColorChange($event)\"\n [noEmitEventColorWhenInitComponent]=\"applyNow()\"\n (outColorChangeMultipleType)=\"outColorChangeMultipleType.emit($event)\" />\n @if (!applyNow()) {\n <div class=\"flex items-center justify-end pt-[16px]\">\n <libs_ui-components-buttons-button [label]=\"'i18n_cancel'\"\n [type]=\"'button-third'\"\n (outClick)=\"handlerAction($event, 'cancel')\" />\n <libs_ui-components-buttons-button [label]=\"'i18n_apply'\"\n [classInclude]=\"'ml-[16px]'\"\n (outClick)=\"handlerAction($event, 'apply')\" />\n </div>\n }\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAmBa,2CAA2C,CAAA;;AAG9C,IAAA,KAAK,GAAG,MAAM,CAAS,EAAE,CAAC;AAC1B,IAAA,sBAAsB,GAAG,MAAM,CAA2C,SAAS,CAAC;;AAGnF,IAAA,MAAM,GAAG,KAAK,CAAS,IAAI,CAAC;IAC5B,aAAa,GAAG,KAAK,EAAwB;AAC7C,IAAA,eAAe,GAAG,KAAK,CAAU,KAAK,CAAC;AACvC,IAAA,SAAS,GAAG,KAAK,CAAyB,QAAQ,CAAC;IACnD,MAAM,GAAG,KAAK,EAAW;AACzB,IAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,CAAC;;IAGhC,cAAc,GAAG,MAAM,EAAU;IACjC,0BAA0B,GAAG,MAAM,EAAkC;;AAGpE,IAAA,kBAAkB,CAAC,KAAa,EAAA;AACxC,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE;AACnB,YAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;YAE/B
|
|
1
|
+
{"version":3,"file":"libs-ui-components-buttons-select-color.mjs","sources":["../../../../../../libs-ui/components/buttons/select-color/src/buttons-select-color.component.ts","../../../../../../libs-ui/components/buttons/select-color/src/buttons-select-color.component.html","../../../../../../libs-ui/components/buttons/select-color/src/libs-ui-components-buttons-select-color.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, model, OnDestroy, output, signal } from '@angular/core';\nimport { IButton, LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';\nimport { IOutputColorChangeMultipleType, IPickerCustomOptions, LibsUiComponentsColorPickerComponent } from '@libs-ui/components-color-picker';\nimport { IPopoverFunctionControlEvent, LibsUiComponentsPopoverComponent, TYPE_POPOVER_DIRECTION } from '@libs-ui/components-popover';\nimport { TranslateModule } from '@ngx-translate/core';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'libs_ui-components-buttons-select_color',\n templateUrl: './buttons-select-color.component.html',\n standalone: true,\n imports: [\n TranslateModule,\n LibsUiComponentsPopoverComponent,\n LibsUiComponentsButtonsButtonComponent,\n LibsUiComponentsColorPickerComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class LibsUiComponentsButtonsSelectColorComponent implements OnDestroy {\n\n // #region PROPERTY\n private color = signal<string>('');\n private popoverFunctionControl = signal<IPopoverFunctionControlEvent | undefined>(undefined);\n\n // #region INPUT\n readonly zIndex = model<number>(1200);\n readonly customOptions = input<IPickerCustomOptions>();\n readonly externalContent = input<boolean>(false);\n readonly direction = input<TYPE_POPOVER_DIRECTION>('bottom');\n readonly button = input<IButton>();\n readonly applyNow = input<boolean>(false);\n\n // #region OUTPUT\n readonly outColorChange = output<string>();\n readonly outColorChangeMultipleType = output<IOutputColorChangeMultipleType>();\n\n /* FUNCTIONS */\n protected handlerColorChange(event: string) {\n if (this.applyNow()) {\n this.outColorChange.emit(event);\n\n return;\n }\n this.color.set(event);\n }\n\n protected handlerFunctionControl(event: IPopoverFunctionControlEvent) {\n this.popoverFunctionControl.set(event);\n }\n\n protected handlerAction(event: Event, action: 'cancel' | 'apply') {\n event.stopPropagation();\n this.popoverFunctionControl()?.removePopoverOverlay();\n if (action === 'apply') {\n this.outColorChange.emit(this.color());\n }\n }\n\n ngOnDestroy(): void {\n this.popoverFunctionControl()?.removePopoverOverlay();\n }\n}\n","<div class=\"flex\"\n LibsUiComponentsPopoverDirective\n [mode]=\"'click-toggle'\"\n [ignoreHiddenPopoverContentWhenMouseLeave]=\"true\"\n [config]=\"{\n template: colorPicker,\n whiteTheme: true,\n ignoreArrow: true,\n widthByParent: false,\n maxWidth: 500,\n maxHeight: 500,\n zIndex: zIndex(),\n classInclude: 'w-[350px]',\n direction: direction(),\n directionDistance: 2,\n position: {\n mode: 'start',\n distance: 0\n }\n}\"\n (outFunctionsControl)=\"handlerFunctionControl($event)\">\n @if (externalContent()) {\n <ng-content select=\"div.libs-ui-buttons-select-color\"></ng-content>\n } @else {\n <libs_ui-components-buttons-button [type]=\"button()?.type || 'button-primary'\"\n [classIconLeft]=\"button()?.classIconLeft || ''\"\n [classIconRight]=\"button()?.classIconRight || ''\"\n [label]=\"button()?.label || ''\"\n [classLabel]=\"button()?.classLabel || ''\"\n [classInclude]=\"button()?.classInclude || ''\"\n [iconOnlyType]=\"button()?.iconOnlyType || false\"\n [popover]=\"button()?.popover || {}\"\n [ignoreStopPropagationEvent]=\"true\" />\n }\n</div>\n\n<ng-template #colorPicker>\n <div class=\"p-[16px] w-auto h-auto\">\n <libs_ui-components-color_picker [customOptions]=\"customOptions()\"\n (outColorChange)=\"handlerColorChange($event)\"\n [noEmitEventColorWhenInitComponent]=\"applyNow()\"\n (outColorChangeMultipleType)=\"outColorChangeMultipleType.emit($event)\" />\n @if (!applyNow()) {\n <div class=\"flex items-center justify-end pt-[16px]\">\n <libs_ui-components-buttons-button [label]=\"'i18n_cancel'\"\n [type]=\"'button-third'\"\n (outClick)=\"handlerAction($event, 'cancel')\" />\n <libs_ui-components-buttons-button [label]=\"'i18n_apply'\"\n [classInclude]=\"'ml-[16px]'\"\n (outClick)=\"handlerAction($event, 'apply')\" />\n </div>\n }\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAmBa,2CAA2C,CAAA;;AAG9C,IAAA,KAAK,GAAG,MAAM,CAAS,EAAE,CAAC;AAC1B,IAAA,sBAAsB,GAAG,MAAM,CAA2C,SAAS,CAAC;;AAGnF,IAAA,MAAM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
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.306-3",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/core": ">=18.0.0",
|
|
6
|
-
"@libs-ui/components-buttons-button": "0.2.
|
|
7
|
-
"@libs-ui/components-color-picker": "0.2.
|
|
8
|
-
"@libs-ui/components-popover": "0.2.
|
|
6
|
+
"@libs-ui/components-buttons-button": "0.2.306-3",
|
|
7
|
+
"@libs-ui/components-color-picker": "0.2.306-3",
|
|
8
|
+
"@libs-ui/components-popover": "0.2.306-3",
|
|
9
9
|
"@ngx-translate/core": "^15.0.0"
|
|
10
10
|
},
|
|
11
11
|
"sideEffects": false,
|