@acorex/components 18.12.21 → 18.12.23
Sign up to get free protection for your applications and to get access to all the features.
- package/conversation/lib/conversation-messages/conversation-message-audio/conversation-message-audio.component.d.ts +11 -32
- package/data-table/lib/columns/row-command-column.component.d.ts +3 -3
- package/esm2022/comment/lib/comment-item/comment-item.component.mjs +3 -3
- package/esm2022/conversation/lib/conversation-messages/conversation-message-audio/conversation-message-audio.component.mjs +30 -58
- package/esm2022/conversation/lib/services/conversation.service.mjs +1 -1
- package/esm2022/data-table/lib/columns/row-command-column.component.mjs +20 -10
- package/esm2022/datetime-box/lib/datetime-box.component.mjs +3 -3
- package/esm2022/drawer/lib/drawer/drawer-item/drawer.component.mjs +3 -1
- package/esm2022/image-editor/lib/image-editor-tools/image-editor-color-picker/image-editor-color-picker.component.mjs +6 -16
- package/esm2022/image-editor/lib/image-editor-tools/image-editor-crop/image-editor-crop.component.mjs +4 -3
- package/esm2022/image-editor/lib/image-editor-tools/image-editor-pen-mode-changer/image-editor-pen-mode-changer.component.mjs +4 -3
- package/esm2022/image-editor/lib/image-editor.module.mjs +8 -5
- package/esm2022/json-viewer/acorex-components-json-viewer.mjs +5 -0
- package/esm2022/json-viewer/index.mjs +3 -0
- package/esm2022/json-viewer/lib/json-viewer/json-viewer.component.mjs +35 -0
- package/esm2022/json-viewer/lib/json-viewer.module.mjs +23 -0
- package/esm2022/media-viewer/lib/media-viewer-thumbnail/media-viewer-thumbnail.component.mjs +5 -4
- package/esm2022/menu/lib/menu.module.mjs +2 -2
- package/esm2022/paint/lib/paint/paint-tools/paint-color-picker/paint-color-picker.component.mjs +5 -15
- package/esm2022/paint/lib/paint/paint-tools/paint-pen-mode-changer/paint-pen-mode-changer.component.mjs +4 -3
- package/esm2022/paint/lib/paint.module.mjs +8 -5
- package/esm2022/phone-box/lib/phone-box.component.mjs +26 -22
- package/esm2022/range-slider/lib/range-slider.component.mjs +7 -7
- package/esm2022/step-wizard/lib/step-wizard-item/step-wizard-item.component.mjs +2 -2
- package/esm2022/text-box/lib/text-box.component.mjs +5 -4
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-audio-wave.mjs.map +1 -1
- package/fesm2022/acorex-components-avatar.mjs.map +1 -1
- package/fesm2022/acorex-components-badge.mjs.map +1 -1
- package/fesm2022/acorex-components-bottom-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/acorex-components-button-group.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-check-box.mjs.map +1 -1
- package/fesm2022/acorex-components-chips.mjs.map +1 -1
- package/fesm2022/acorex-components-circular-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-collapse.mjs.map +1 -1
- package/fesm2022/acorex-components-color-box.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-comment.mjs +2 -2
- package/fesm2022/acorex-components-comment.mjs.map +1 -1
- package/fesm2022/acorex-components-common.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation.mjs +29 -57
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +19 -9
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +2 -2
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer.mjs +2 -0
- package/fesm2022/acorex-components-drawer.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown-button.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-image-editor.mjs +19 -23
- package/fesm2022/acorex-components-image-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-image.mjs.map +1 -1
- package/fesm2022/acorex-components-json-viewer.mjs +62 -0
- package/fesm2022/acorex-components-json-viewer.mjs.map +1 -0
- package/fesm2022/acorex-components-label.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-loading-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-loading.mjs.map +1 -1
- package/fesm2022/acorex-components-map.mjs.map +1 -1
- package/fesm2022/acorex-components-media-viewer.mjs +4 -3
- package/fesm2022/acorex-components-media-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-nav.mjs.map +1 -1
- package/fesm2022/acorex-components-navbar.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-otp.mjs.map +1 -1
- package/fesm2022/acorex-components-page.mjs.map +1 -1
- package/fesm2022/acorex-components-paint.mjs +14 -18
- package/fesm2022/acorex-components-paint.mjs.map +1 -1
- package/fesm2022/acorex-components-password-box.mjs.map +1 -1
- package/fesm2022/acorex-components-phone-box.mjs +26 -22
- package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
- package/fesm2022/acorex-components-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-popover.mjs.map +1 -1
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-progress-bar.mjs.map +1 -1
- package/fesm2022/acorex-components-qrcode.mjs.map +1 -1
- package/fesm2022/acorex-components-radio.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +6 -6
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-rate-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-result.mjs.map +1 -1
- package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-scss.mjs.map +1 -1
- package/fesm2022/acorex-components-search-box.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-skeleton.mjs.map +1 -1
- package/fesm2022/acorex-components-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-step-wizard.mjs +2 -2
- package/fesm2022/acorex-components-step-wizard.mjs.map +1 -1
- package/fesm2022/acorex-components-switch.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/fesm2022/acorex-components-tag.mjs.map +1 -1
- package/fesm2022/acorex-components-text-area.mjs.map +1 -1
- package/fesm2022/acorex-components-text-box.mjs +4 -3
- package/fesm2022/acorex-components-text-box.mjs.map +1 -1
- package/fesm2022/acorex-components-time-line.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-components-uploader.mjs.map +1 -1
- package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
- package/image-editor/lib/image-editor-tools/image-editor-color-picker/image-editor-color-picker.component.d.ts +0 -10
- package/image-editor/lib/image-editor.module.d.ts +3 -2
- package/json-viewer/README.md +3 -0
- package/json-viewer/index.d.ts +2 -0
- package/json-viewer/lib/json-viewer/json-viewer.component.d.ts +11 -0
- package/json-viewer/lib/json-viewer.module.d.ts +10 -0
- package/media-viewer/lib/media-viewer-thumbnail/media-viewer-thumbnail.component.d.ts +1 -1
- package/package.json +54 -48
- package/paint/lib/paint/paint-tools/paint-color-picker/paint-color-picker.component.d.ts +0 -10
- package/paint/lib/paint.module.d.ts +3 -2
- package/phone-box/lib/phone-box.component.d.ts +24 -22
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-notification.mjs","sources":["../../../../libs/components/notification/src/lib/notification.component.ts","../../../../libs/components/notification/src/lib/notification.component.html","../../../../libs/components/notification/src/lib/notification.config.ts","../../../../libs/components/notification/src/lib/notification.service.ts","../../../../libs/components/notification/src/lib/notification.module.ts","../../../../libs/components/notification/src/acorex-components-notification.ts"],"sourcesContent":["import { AXClosbaleComponent, AXComponentCloseEvent, MXBaseComponent } from '@acorex/components/common';\nimport { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog';\nimport { ComponentPortal, ComponentType, Portal, TemplatePortal } from '@angular/cdk/portal';\nimport { ChangeDetectionStrategy, Component, HostBinding, Inject, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { AXNotificationButtonItem, AXNotificationData } from './notification.class';\n\n/**\n * The Button is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Component({\n selector: 'ax-notification',\n templateUrl: './notification.component.html',\n styleUrls: ['./notification.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: AXClosbaleComponent, useExisting: AXNotificationComponent }],\n})\nexport class AXNotificationComponent extends MXBaseComponent {\n\n/** @ignore */\n _selectedPortal: Portal<unknown>;\n\n /** @ignore */\n _icon: string;\n\n /**\n * @ignore\n */\n constructor(\n @Inject(DIALOG_DATA)\n public config: AXNotificationData,\n private dialogRef: DialogRef<AXComponentCloseEvent>,\n ) {\n super();\n }\n\n /** @ignore */\n override ngOnInit() {\n super.ngOnInit();\n this._initContent();\n this._initIcon();\n this._handleTimeOut();\n }\n\n /** @ignore */\n private _handleTimeOut() {\n if (this.config.timeOut) {\n setTimeout(() => {\n this.close();\n }, this.config.timeOut);\n }\n }\n\n /** @ignore */\n private _initContent() {\n if (this.config.content instanceof TemplateRef) {\n this._selectedPortal = new TemplatePortal(this.config.content as TemplateRef<unknown>, this.getViewContainer());\n this.cdr.markForCheck();\n } else if (typeof this.config.content === 'function') {\n this._selectedPortal = new ComponentPortal(this.config.content as ComponentType<unknown>);\n this.cdr.markForCheck();\n }\n }\n\n /** @ignore */\n private _initIcon() {\n if (!this.config.icon) {\n switch (this.config.color) {\n case 'success':\n this._icon = 'ax-icon ax-icon-check-circle';\n break;\n case 'danger':\n this._icon = 'ax-icon ax-icon-error';\n break;\n case 'warning':\n this._icon = 'ax-icon ax-icon-warning';\n break;\n case 'info':\n this._icon = 'ax-icon ax-icon-info';\n break;\n default:\n this._icon = this.config.icon || 'ax-icon ax-icon-check-circle';\n break;\n }\n } else {\n this._icon = this.config.icon;\n }\n }\n\n /** @ignore */\n protected _handleButtonClick(button: AXNotificationButtonItem) {\n if (button.onClick) {\n button.onClick({ source: button });\n }\n }\n\n /** @ignore */\n @HostBinding('class')\n private get __hostClass(): string {\n return `ax-${this.config.color}`;\n }\n\n /**\n * Closes the dialog and provides the component and HTML element for reference.\n */\n close() {\n this.dialogRef.close({\n component: this,\n htmlElement: this.getHostElement(),\n });\n }\n}\n","<span class=\"ax-notification-icon ax-icon-solid {{ _icon }}\"></span>\n<div class=\"ax-notification-content\">\n <div class=\"ax-notification-title\">{{ config.title | translate | async }}</div>\n @if(_selectedPortal){\n <ng-template [cdkPortalOutlet]=\"_selectedPortal\"></ng-template>\n } @else{\n <div>{{ config.content }}</div>\n }\n\n @if(config.buttons?.length){\n <div class=\"ax-notification-buttons\">\n @for(button of config.buttons; track $index){\n <ax-button class=\"ax-xs\" [text]=\"button.text | translate | async\" [color]=\"button.color\" [look]=\"button.look\"\n [disabled]=\"button.disabled\" (onClick)=\"_handleButtonClick(button)\">\n @if(button.loading){\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </div>\n }\n\n</div>\n@if(config.closeButton){\n<ax-close-button></ax-close-button>\n}\n@if(config.timeOutProgress && config.timeOut){\n<div class=\"ax-notification-progress\" [style.animation-duration.ms]=\"config.timeOut\"></div>\n}","import { AXLocation } from '@acorex/components/common';\nimport { InjectionToken } from '@angular/core';\n\nexport interface AXNotificationConfig {\n gap: number;\n timeOut: number;\n timeOutProgress: boolean;\n location: AXLocation;\n closeButton: boolean;\n}\n\nexport const AX_NOTIFICATION_CONFIG = new InjectionToken<AXNotificationConfig>('AX_NOTIFICATION_CONFIG', {\n providedIn: 'root',\n factory: () => AXNotificationDefaultConfig,\n});\n\nexport const AXNotificationDefaultConfig: AXNotificationConfig = {\n gap: 5,\n timeOut: 2500,\n timeOutProgress: true,\n closeButton: true,\n location: 'top-end',\n};\n\nexport type PartialNotificationConfig = Partial<AXNotificationConfig>;\n\nexport function notificationConfig(config: PartialNotificationConfig = {}): AXNotificationConfig {\n const result = {\n ...AXNotificationDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { Dialog } from '@angular/cdk/dialog';\nimport { GlobalPositionStrategy } from '@angular/cdk/overlay';\nimport { Injectable, inject } from '@angular/core';\nimport { AXNotificationOptions as AXNotificationDisplayConfig, AXNotificationRef } from './notification.class';\nimport { AXNotificationComponent } from './notification.component';\nimport { AXNotificationConfig, AX_NOTIFICATION_CONFIG } from './notification.config';\n\n@Injectable()\nexport class AXNotificationService {\n private dialog: Dialog = inject(Dialog);\n private defaultConfig: AXNotificationConfig = inject(AX_NOTIFICATION_CONFIG);\n\n show(config: AXNotificationDisplayConfig): AXNotificationRef {\n config = Object.assign(\n {\n closeButton: true,\n location: this.defaultConfig.location,\n },\n config,\n );\n const gap = this.defaultConfig.gap;\n\n let positionStrategy = new GlobalPositionStrategy();\n const pos = this.getPosition(config.location) + gap + 'px';\n switch (config.location) {\n case 'bottom-center':\n positionStrategy = positionStrategy.bottom(pos).centerHorizontally();\n break;\n case 'bottom-end':\n positionStrategy = positionStrategy.bottom(pos).right(gap + 'px');\n break;\n case 'bottom-start':\n positionStrategy = positionStrategy.bottom(pos).left(gap + 'px');\n break;\n case 'top-center':\n positionStrategy = positionStrategy.top(pos).centerHorizontally();\n break;\n case 'top-end':\n positionStrategy = positionStrategy.top(pos).right(gap + 'px');\n break;\n case 'top-start':\n positionStrategy = positionStrategy.top(pos).left(gap + 'px');\n break;\n case 'center-start':\n positionStrategy = positionStrategy.centerVertically().left(gap + 'px');\n break;\n case 'center-end':\n positionStrategy = positionStrategy.centerVertically().right(gap + 'px');\n break;\n default:\n break;\n }\n\n const dialogRef = this.dialog.open(AXNotificationComponent, {\n data: config,\n autoFocus: '__no_element__',\n restoreFocus: false,\n role: 'dialog',\n ariaModal: true,\n closeOnNavigation: true,\n closeOnDestroy: true,\n hasBackdrop: false,\n panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],\n positionStrategy: positionStrategy,\n });\n\n const toastRef = dialogRef.componentInstance as AXNotificationComponent;\n dialogRef.closed.subscribe(() => {\n this.reposition();\n });\n\n return {\n close: () => {\n toastRef.close();\n },\n };\n }\n\n public hideAll() {\n this.dialog.closeAll();\n }\n\n private reposition(): void {\n //TODO: reposition vertically afer close toast\n }\n\n private getPosition(location: string) {\n const list = this.dialog.openDialogs\n .map((c) => c.componentInstance as AXNotificationComponent)\n .filter((c) => c.config.location == location);\n if (list.length == 0) return 0;\n if (location.split('-')[0] == 'bottom') {\n return window.innerHeight - list[list.length - 1].getHostElement().offsetTop;\n } else {\n return list[list.length - 1].getHostElement().offsetTop + list[list.length - 1].getHostElement().offsetHeight;\n }\n }\n}\n","import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { DialogModule } from '@angular/cdk/dialog';\nimport { PortalModule } from '@angular/cdk/portal';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXNotificationComponent } from './notification.component';\nimport { AXNotificationService } from './notification.service';\n\nconst COMPONENT = [AXNotificationComponent];\nconst MODULES = [CommonModule, PortalModule, AXButtonModule, DialogModule, AXLoadingModule, AXDecoratorModule, AXTranslationModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [AXNotificationService],\n})\nexport class AXNotificationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA;;;;AAIG;AASG,MAAO,uBAAwB,SAAQ,eAAe,CAAA;AAQ1D;;AAEG;IACH,WAES,CAAA,MAA0B,EACzB,SAA2C,EAAA;AAEnD,QAAA,KAAK,EAAE,CAAC;QAHD,IAAM,CAAA,MAAA,GAAN,MAAM,CAAoB;QACzB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAkC;KAGpD;;IAGQ,QAAQ,GAAA;QACf,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,cAAc,EAAE,CAAC;KACvB;;IAGO,cAAc,GAAA;AACpB,QAAA,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YACvB,UAAU,CAAC,MAAK;gBACd,IAAI,CAAC,KAAK,EAAE,CAAC;AACf,aAAC,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SACzB;KACF;;IAGO,YAAY,GAAA;QAClB,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,YAAY,WAAW,EAAE;AAC9C,YAAA,IAAI,CAAC,eAAe,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,OAA+B,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAChH,YAAA,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;SACzB;aAAM,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,UAAU,EAAE;AACpD,YAAA,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,OAAiC,CAAC,CAAC;AAC1F,YAAA,IAA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AA,EAAA;;2FAIT,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBANhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;oBACvB,SAAS,EAAE,CAAC,qBAAqB,CAAC;AACnC,iBAAA,CAAA;;;ACnBD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-notification.mjs","sources":["../../../../libs/components/notification/src/lib/notification.component.ts","../../../../libs/components/notification/src/lib/notification.component.html","../../../../libs/components/notification/src/lib/notification.config.ts","../../../../libs/components/notification/src/lib/notification.service.ts","../../../../libs/components/notification/src/lib/notification.module.ts","../../../../libs/components/notification/src/acorex-components-notification.ts"],"sourcesContent":["import { AXClosbaleComponent, AXComponentCloseEvent, MXBaseComponent } from '@acorex/components/common';\nimport { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog';\nimport { ComponentPortal, ComponentType, Portal, TemplatePortal } from '@angular/cdk/portal';\nimport { ChangeDetectionStrategy, Component, HostBinding, Inject, TemplateRef, ViewEncapsulation } from '@angular/core';\nimport { AXNotificationButtonItem, AXNotificationData } from './notification.class';\n\n/**\n * The Button is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Component({\n selector: 'ax-notification',\n templateUrl: './notification.component.html',\n styleUrls: ['./notification.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: AXClosbaleComponent, useExisting: AXNotificationComponent }],\n})\nexport class AXNotificationComponent extends MXBaseComponent {\n\n/** @ignore */\n _selectedPortal: Portal<unknown>;\n\n /** @ignore */\n _icon: string;\n\n /**\n * @ignore\n */\n constructor(\n @Inject(DIALOG_DATA)\n public config: AXNotificationData,\n private dialogRef: DialogRef<AXComponentCloseEvent>,\n ) {\n super();\n }\n\n /** @ignore */\n override ngOnInit() {\n super.ngOnInit();\n this._initContent();\n this._initIcon();\n this._handleTimeOut();\n }\n\n /** @ignore */\n private _handleTimeOut() {\n if (this.config.timeOut) {\n setTimeout(() => {\n this.close();\n }, this.config.timeOut);\n }\n }\n\n /** @ignore */\n private _initContent() {\n if (this.config.content instanceof TemplateRef) {\n this._selectedPortal = new TemplatePortal(this.config.content as TemplateRef<unknown>, this.getViewContainer());\n this.cdr.markForCheck();\n } else if (typeof this.config.content === 'function') {\n this._selectedPortal = new ComponentPortal(this.config.content as ComponentType<unknown>);\n this.cdr.markForCheck();\n }\n }\n\n /** @ignore */\n private _initIcon() {\n if (!this.config.icon) {\n switch (this.config.color) {\n case 'success':\n this._icon = 'ax-icon ax-icon-check-circle';\n break;\n case 'danger':\n this._icon = 'ax-icon ax-icon-error';\n break;\n case 'warning':\n this._icon = 'ax-icon ax-icon-warning';\n break;\n case 'info':\n this._icon = 'ax-icon ax-icon-info';\n break;\n default:\n this._icon = this.config.icon || 'ax-icon ax-icon-check-circle';\n break;\n }\n } else {\n this._icon = this.config.icon;\n }\n }\n\n /** @ignore */\n protected _handleButtonClick(button: AXNotificationButtonItem) {\n if (button.onClick) {\n button.onClick({ source: button });\n }\n }\n\n /** @ignore */\n @HostBinding('class')\n private get __hostClass(): string {\n return `ax-${this.config.color}`;\n }\n\n /**\n * Closes the dialog and provides the component and HTML element for reference.\n */\n close() {\n this.dialogRef.close({\n component: this,\n htmlElement: this.getHostElement(),\n });\n }\n}\n","<span class=\"ax-notification-icon ax-icon-solid {{ _icon }}\"></span>\n<div class=\"ax-notification-content\">\n <div class=\"ax-notification-title\">{{ config.title | translate | async }}</div>\n @if(_selectedPortal){\n <ng-template [cdkPortalOutlet]=\"_selectedPortal\"></ng-template>\n } @else{\n <div>{{ config.content }}</div>\n }\n\n @if(config.buttons?.length){\n <div class=\"ax-notification-buttons\">\n @for(button of config.buttons; track $index){\n <ax-button class=\"ax-xs\" [text]=\"button.text | translate | async\" [color]=\"button.color\" [look]=\"button.look\"\n [disabled]=\"button.disabled\" (onClick)=\"_handleButtonClick(button)\">\n @if(button.loading){\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </div>\n }\n\n</div>\n@if(config.closeButton){\n<ax-close-button></ax-close-button>\n}\n@if(config.timeOutProgress && config.timeOut){\n<div class=\"ax-notification-progress\" [style.animation-duration.ms]=\"config.timeOut\"></div>\n}","import { AXLocation } from '@acorex/components/common';\nimport { InjectionToken } from '@angular/core';\n\nexport interface AXNotificationConfig {\n gap: number;\n timeOut: number;\n timeOutProgress: boolean;\n location: AXLocation;\n closeButton: boolean;\n}\n\nexport const AX_NOTIFICATION_CONFIG = new InjectionToken<AXNotificationConfig>('AX_NOTIFICATION_CONFIG', {\n providedIn: 'root',\n factory: () => AXNotificationDefaultConfig,\n});\n\nexport const AXNotificationDefaultConfig: AXNotificationConfig = {\n gap: 5,\n timeOut: 2500,\n timeOutProgress: true,\n closeButton: true,\n location: 'top-end',\n};\n\nexport type PartialNotificationConfig = Partial<AXNotificationConfig>;\n\nexport function notificationConfig(config: PartialNotificationConfig = {}): AXNotificationConfig {\n const result = {\n ...AXNotificationDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { Dialog } from '@angular/cdk/dialog';\nimport { GlobalPositionStrategy } from '@angular/cdk/overlay';\nimport { Injectable, inject } from '@angular/core';\nimport { AXNotificationOptions as AXNotificationDisplayConfig, AXNotificationRef } from './notification.class';\nimport { AXNotificationComponent } from './notification.component';\nimport { AXNotificationConfig, AX_NOTIFICATION_CONFIG } from './notification.config';\n\n@Injectable()\nexport class AXNotificationService {\n private dialog: Dialog = inject(Dialog);\n private defaultConfig: AXNotificationConfig = inject(AX_NOTIFICATION_CONFIG);\n\n show(config: AXNotificationDisplayConfig): AXNotificationRef {\n config = Object.assign(\n {\n closeButton: true,\n location: this.defaultConfig.location,\n },\n config,\n );\n const gap = this.defaultConfig.gap;\n\n let positionStrategy = new GlobalPositionStrategy();\n const pos = this.getPosition(config.location) + gap + 'px';\n switch (config.location) {\n case 'bottom-center':\n positionStrategy = positionStrategy.bottom(pos).centerHorizontally();\n break;\n case 'bottom-end':\n positionStrategy = positionStrategy.bottom(pos).right(gap + 'px');\n break;\n case 'bottom-start':\n positionStrategy = positionStrategy.bottom(pos).left(gap + 'px');\n break;\n case 'top-center':\n positionStrategy = positionStrategy.top(pos).centerHorizontally();\n break;\n case 'top-end':\n positionStrategy = positionStrategy.top(pos).right(gap + 'px');\n break;\n case 'top-start':\n positionStrategy = positionStrategy.top(pos).left(gap + 'px');\n break;\n case 'center-start':\n positionStrategy = positionStrategy.centerVertically().left(gap + 'px');\n break;\n case 'center-end':\n positionStrategy = positionStrategy.centerVertically().right(gap + 'px');\n break;\n default:\n break;\n }\n\n const dialogRef = this.dialog.open(AXNotificationComponent, {\n data: config,\n autoFocus: '__no_element__',\n restoreFocus: false,\n role: 'dialog',\n ariaModal: true,\n closeOnNavigation: true,\n closeOnDestroy: true,\n hasBackdrop: false,\n panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],\n positionStrategy: positionStrategy,\n });\n\n const toastRef = dialogRef.componentInstance as AXNotificationComponent;\n dialogRef.closed.subscribe(() => {\n this.reposition();\n });\n\n return {\n close: () => {\n toastRef.close();\n },\n };\n }\n\n public hideAll() {\n this.dialog.closeAll();\n }\n\n private reposition(): void {\n //TODO: reposition vertically afer close toast\n }\n\n private getPosition(location: string) {\n const list = this.dialog.openDialogs\n .map((c) => c.componentInstance as AXNotificationComponent)\n .filter((c) => c.config.location == location);\n if (list.length == 0) return 0;\n if (location.split('-')[0] == 'bottom') {\n return window.innerHeight - list[list.length - 1].getHostElement().offsetTop;\n } else {\n return list[list.length - 1].getHostElement().offsetTop + list[list.length - 1].getHostElement().offsetHeight;\n }\n }\n}\n","import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { DialogModule } from '@angular/cdk/dialog';\nimport { PortalModule } from '@angular/cdk/portal';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXNotificationComponent } from './notification.component';\nimport { AXNotificationService } from './notification.service';\n\nconst COMPONENT = [AXNotificationComponent];\nconst MODULES = [CommonModule, PortalModule, AXButtonModule, DialogModule, AXLoadingModule, AXDecoratorModule, AXTranslationModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [AXNotificationService],\n})\nexport class AXNotificationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA;;;;AAIG;AASG,MAAO,uBAAwB,SAAQ,eAAe,CAAA;AAQ1D;;AAEG;IACH,WAES,CAAA,MAA0B,EACzB,SAA2C,EAAA;AAEnD,QAAA,KAAK,EAAE;QAHA,IAAM,CAAA,MAAA,GAAN,MAAM;QACL,IAAS,CAAA,SAAA,GAAT,SAAS;;;IAMV,QAAQ,GAAA;QACf,KAAK,CAAC,QAAQ,EAAE;QAChB,IAAI,CAAC,YAAY,EAAE;QACnB,IAAI,CAAC,SAAS,EAAE;QAChB,IAAI,CAAC,cAAc,EAAE;;;IAIf,cAAc,GAAA;AACpB,QAAA,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YACvB,UAAU,CAAC,MAAK;gBACd,IAAI,CAAC,KAAK,EAAE;AACd,aAAC,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;;;;IAKnB,YAAY,GAAA;QAClB,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,YAAY,WAAW,EAAE;AAC9C,YAAA,IAAI,CAAC,eAAe,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,OAA+B,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC;AAC/G,YAAA,IAAI,CAAC,GAAG,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iBAAA;;;ACnBD;;AAEG;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-number-box.mjs","sources":["../../../../libs/components/number-box/src/lib/number-box.component.ts","../../../../libs/components/number-box/src/lib/number-box.component.html","../../../../libs/components/number-box/src/lib/number-box.module.ts","../../../../libs/components/number-box/src/acorex-components-number-box.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostListener,\n Input,\n ViewChild,\n ViewEncapsulation,\n forwardRef,\n} from '@angular/core';\nimport { IMaskDirective } from 'angular-imask';\nimport { MaskedNumber, createMask } from 'imask';\n\nimport {\n AXClearableComponent,\n AXComponent,\n AXFocusableComponent,\n AXValuableComponent,\n MXInputBaseValueComponent,\n MXLookComponent,\n} from '@acorex/components/common';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { isEmpty, toNumber } from 'lodash-es';\nimport { classes } from 'polytype';\n\n/**\n * The NumberBox is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Component({\n selector: 'ax-number-box',\n templateUrl: './number-box.component.html',\n styleUrls: ['./number-box.component.scss'],\n inputs: ['disabled', 'readonly', 'tabIndex', 'placeholder', 'value', 'state', 'name', 'id', 'look'],\n outputs: [\n 'valueChange',\n 'stateChange',\n 'onValueChanged',\n 'onBlur',\n 'onFocus',\n 'readonlyChange',\n 'disabledChange',\n 'onKeyDown',\n 'onKeyUp',\n 'onKeyPress',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n\n providers: [\n { provide: AXComponent, useExisting: AXNumberBoxComponent },\n { provide: AXFocusableComponent, useExisting: AXNumberBoxComponent },\n { provide: AXClearableComponent, useExisting: AXNumberBoxComponent },\n { provide: AXValuableComponent, useExisting: AXNumberBoxComponent },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXNumberBoxComponent),\n multi: true,\n },\n ],\n})\nexport class AXNumberBoxComponent\n extends classes(MXInputBaseValueComponent<number>, MXLookComponent)\n implements AfterViewInit\n{\n /** @ignore */\n @ViewChild('input') input: ElementRef<HTMLInputElement>;\n\n /** @ignore */\n private _thousandsSeparator: string;\n /**\n * boolean value that specifies the number box change step by scrolling.\n */\n @Input()\n changeOnScroll = false;\n\n /**\n * A character value that specifies the separator character.\n */\n @Input()\n\n /**\n * Gets the thousands separator used in the formatting.\n * @param {string} value\n */\n public get thousandsSeparator(): string {\n return this._thousandsSeparator;\n }\n\n /**\n * Sets the thousands separator for formatting.\n * @param {string} v\n */\n public set thousandsSeparator(v: string) {\n this.setOption({\n name: 'thousandsSeparator',\n value: v ?? '',\n });\n }\n\n /** @ignore */\n private _padDecimalZeros = false;\n /**\n * A character value that specifies the separator character.\n */\n @Input()\n\n /**\n * Gets whether decimal zeros are padded.\n * @param {boolean} value\n */\n public get padDecimalZeros(): boolean {\n return this._padDecimalZeros;\n }\n\n /**\n * Sets whether decimal zeros should be padded.\n * @param {boolean} v\n */\n public set padDecimalZeros(v: boolean) {\n this.setOption({\n name: 'padDecimalZeros',\n value: v,\n });\n }\n\n /**\n * Specifies the value that is used to increment or decrement the **Integer** part of number\n */\n @Input()\n\n /**\n * Defines the increment step value.\n */\n step = 1;\n\n /** @ignore */\n private _decimals = 0;\n /**\n * Specifies the number of decimals that the user can enter\n */\n @Input()\n\n /**\n * Gets the number of decimal places to be used.\n */\n public get decimals(): number {\n return this._decimals;\n }\n\n /**\n * Sets the decimal places; defaults to 0 if not provided.\n */\n public set decimals(v: number) {\n this.setOption({\n name: 'decimals',\n value: v ?? 0,\n });\n }\n\n /**\n * Specifies the value that is used to increment or decrement the **Deciaml** part of number\n */\n @Input()\n\n /**\n * Defines the step size for decimal values.\n * @defaultvalue 'auto'\n */\n decimalStep: number | 'auto' = 'auto';\n\n /**\n * Specifies whether the Up and Down spin buttons will be rendered or not\n */\n @Input()\n\n /**\n * Indicates whether spin buttons are displayed.\n * @defaultvalue true\n */\n showSpinButtons = true;\n\n /** @ignore */\n private _minValue: number = Number.MIN_SAFE_INTEGER;\n /**\n * Specifies the smallest value that is valid\n */\n @Input()\n\n /**\n * Gets the number of decimal places used.\n * @param {number} value\n */\n public get minValue(): number {\n return this._minValue;\n }\n\n /**\n * Sets the number of decimal places to be used.\n * @param {number} v\n * @defaultvalue 0\n */\n public set minValue(v: number) {\n this.setOption({\n name: 'minValue',\n value: v != null ? Number(v) : Number.MIN_SAFE_INTEGER,\n });\n }\n\n /** @ignore */\n private _maxValue: number = Number.MAX_SAFE_INTEGER;\n\n /**\n * Specifies the greatest value that is valid\n */\n @Input()\n\n /**\n * Returns the maximum allowable value.\n */\n public get maxValue(): number {\n return this._maxValue;\n }\n\n /**\n * Sets the maximum allowable value, defaulting to `Number.MAX_SAFE_INTEGER` if null.\n * @param v\n */\n public set maxValue(v: number) {\n this.setOption({\n name: 'maxValue',\n value: v != null ? Number(v) : Number.MAX_SAFE_INTEGER,\n });\n }\n\n /**\n * CSS classes to apply to the component.\n * @param classNames\n */\n @Input('class')\n\n /**\n * CSS classes to apply to the component.\n */\n classNames: string;\n\n /**\n * @ignore\n */\n _maskObj: MaskedNumber;\n\n /** @ignore */\n @ViewChild(IMaskDirective)\n\n /** @ignore */\n private _maskDirective: IMaskDirective<MaskedNumber>;\n\n /** @ignore */\n private _onWheelFlag = false;\n constructor() {\n super();\n this.onFocus.subscribe(() => {\n this._onWheelFlag = true;\n this.input.nativeElement.select();\n });\n this.onBlur.subscribe(() => {\n this._onWheelFlag = false;\n });\n }\n\n /** @ignore */\n ngAfterViewInit(): void {\n this._updateMask();\n }\n\n /**\n * Handles internal option changes and updates the mask accordingly.\n */\n override internalOptionChanged(): void {\n this._updateMask();\n }\n\n /**\n * Resets the input element to its default state and calls the parent class reset method.\n */\n override reset(): void {\n this.input.nativeElement.value = null;\n super.reset(true);\n }\n\n /**\n * Ensures the value is within the min-max range, returning the default if null.\n * @param value\n */\n override internalSetValue(value: any): number {\n // || (value == 0 && !this._maskObj.value)\n if (value == null) {\n return this.defaultValue;\n }\n const v = toNumber(value);\n if (v < this.minValue) return this.minValue;\n if (v > this.maxValue) return this.maxValue;\n return v;\n }\n\n /** @ignore */\n private _updateMask() {\n if (!this._maskObj) {\n this._maskObj = createMask({\n mask: Number,\n min: this.minValue,\n max: this.maxValue,\n thousandsSeparator: this.thousandsSeparator || '',\n scale: this.decimals,\n radix: '.',\n padFractionalZeros: this.decimals > 0 && this.padDecimalZeros,\n });\n\n this._maskObj.format = (v: number, m) => {\n return !isNaN(v)\n ? v.toLocaleString('en-US', {\n useGrouping: false,\n maximumFractionDigits: 20,\n })\n : '';\n };\n } else {\n this._maskObj.updateOptions({\n min: this.minValue,\n max: this.maxValue,\n thousandsSeparator: this.thousandsSeparator || '',\n scale: this.decimals,\n radix: '.',\n padFractionalZeros: this.decimals > 0 && this.padDecimalZeros,\n });\n }\n this._maskDirective?.maskRef?.updateValue();\n this._maskDirective?.maskRef?.updateControl();\n }\n\n /** @ignore */\n _handleModelChange(value: number) {\n if (value == 0 && isEmpty(this.input?.nativeElement?.value)) {\n value = null;\n }\n\n this.commitValue(value, true);\n }\n\n /** @ignore */\n _handleOnKeydownEvent(e: KeyboardEvent) {\n if (this.disabled || this.readonly) return;\n const ignore = () => {\n e.preventDefault();\n e.stopPropagation();\n };\n const input = e.target as HTMLInputElement;\n const valStr = input.value;\n const decimalPointIndex = valStr.indexOf('.');\n const _cursorPos = input.selectionStart!;\n\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n if (decimalPointIndex > 0 && _cursorPos > decimalPointIndex && this.decimals > 0) {\n e.key === 'ArrowDown' ? this.decimalStepDown(true) : this.decimalStepUp(true);\n } else {\n e.key === 'ArrowDown' ? this.stepDown(true) : this.stepUp(true);\n }\n ignore();\n setTimeout(() => {\n input.setSelectionRange(_cursorPos, _cursorPos);\n }, 5);\n }\n super.emitOnKeydownEvent(e);\n }\n\n /** @ignore */\n protected _handleUpDownClick(v: -1 | 1) {\n if (this.disabled || this.readonly) return;\n v == 1 ? this.stepUp(true) : this.stepDown(true);\n }\n\n /**\n * Increases the value by the step amount, ensuring it's at least the minimum value.\n */\n stepUp(u = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(this.value + toNumber(this.step), u);\n }\n\n /**\n * Decreases the value by the step amount, ensuring it's at least the minimum value.\n */\n stepDown(u = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(this.value - toNumber(this.step), u);\n }\n\n /**\n * Increases the value by the decimal step amount, using 'auto' or a custom step value.\n */\n decimalStepUp(u = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(\n this.value + toNumber(this.decimalStep == 'auto' ? 1 / Math.pow(10, this.decimals) : this.decimalStep),\n u,\n );\n }\n\n /**\n * Decreases the value by the decimal step amount, using 'auto' or a custom step value.\n */\n decimalStepDown(u = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(\n this.value - toNumber(this.decimalStep == 'auto' ? 1 / Math.pow(10, this.decimals) : this.decimalStep),\n u,\n );\n }\n\n // @HostBinding('class')\n // get __hostClass(): string {\n // return `ax-editor-container ax-look-${this.look} ${this.disabled ? 'ax-state-disabled' : ''}`;\n // }\n @HostListener('wheel', ['$event'])\n onWheel(event: WheelEvent) {\n if (this.changeOnScroll && this._onWheelFlag) {\n event.preventDefault();\n if (!this.disabled && !this.readonly) {\n if (event.deltaY > 0) {\n this.commitValue(this.value - this.step);\n } else {\n this.commitValue(this.value + this.step);\n }\n }\n }\n }\n}\n","<div class=\"ax-editor-container ax-look-{{look}} {{classNames}}\" [class.ax-state-disabled]=\"disabled\">\n <ng-content select=\"ax-prefix\"> </ng-content>\n <input #input class=\"ax-input\" type=\"text\" [id]=\"id\" [name]=\"name\" [attr.placeholder]=\"placeholder\"\n [attr.autocomplete]=\"'off'\" [imask]=\"_maskObj\" [unmask]=\"'typed'\" [attr.min]=\"minValue\" [attr.max]=\"maxValue\"\n [class.ax-state-disabled]=\"disabled\" [class.ax-state-readonly]=\"readonly\" [disabled]=\"disabled\"\n [readonly]=\"readonly\" [tabindex]=\"tabIndex\" [ngModel]=\"value\" (ngModelChange)=\"_handleModelChange($event)\"\n (keydown)=\"_handleOnKeydownEvent($event)\" (keyup)=\"emitOnKeyupEvent($event)\"\n (keypress)=\"emitOnKeypressEvent($event)\" (focus)=\"emitOnFocusEvent($event)\" (blur)=\"emitOnBlurEvent($event)\" />\n @if(input.value && !disabled && !readonly){\n <ng-content select=\"ax-clear-button\"></ng-content>\n }\n @if(showSpinButtons){\n <div class=\"ax-number-box-control\">\n <button type=\"button\" class=\"ax-general-button ax-button-icon\" [class.ax-state-disabled]=\"disabled\"\n (click)=\"_handleUpDownClick(1)\" tabindex=\"-1\" [disabled]=\"disabled\"><span\n class=\"ax-icon ax-icon-chevron-up ax-arrow-button \"></span></button>\n <button type=\"button\" class=\"ax-general-button ax-button-icon\" [class.ax-state-disabled]=\"disabled\"\n (click)=\"_handleUpDownClick(-1)\" [disabled]=\"disabled\"><span\n class=\"ax-icon ax-icon-chevron-down ax-arrow-button \"></span></button>\n </div>\n\n }\n\n <ng-content select=\"ax-suffix\"> </ng-content>\n</div>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n<div class=\"ax-error-container\"></div>","import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { IMaskModule } from 'angular-imask';\nimport { AXNumberBoxComponent } from './number-box.component';\n\nconst COMPONENT = [AXNumberBoxComponent];\nconst MODULES = [CommonModule, FormsModule, AXButtonModule, AXDecoratorModule, IMaskModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXNumberBoxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */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AA,SAAS,EAAE,EAAE;AACd,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-number-box.mjs","sources":["../../../../libs/components/number-box/src/lib/number-box.component.ts","../../../../libs/components/number-box/src/lib/number-box.component.html","../../../../libs/components/number-box/src/lib/number-box.module.ts","../../../../libs/components/number-box/src/acorex-components-number-box.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostListener,\n Input,\n ViewChild,\n ViewEncapsulation,\n forwardRef,\n} from '@angular/core';\nimport { IMaskDirective } from 'angular-imask';\nimport { MaskedNumber, createMask } from 'imask';\n\nimport {\n AXClearableComponent,\n AXComponent,\n AXFocusableComponent,\n AXValuableComponent,\n MXInputBaseValueComponent,\n MXLookComponent,\n} from '@acorex/components/common';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { isEmpty, toNumber } from 'lodash-es';\nimport { classes } from 'polytype';\n\n/**\n * The NumberBox is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Component({\n selector: 'ax-number-box',\n templateUrl: './number-box.component.html',\n styleUrls: ['./number-box.component.scss'],\n inputs: ['disabled', 'readonly', 'tabIndex', 'placeholder', 'value', 'state', 'name', 'id', 'look'],\n outputs: [\n 'valueChange',\n 'stateChange',\n 'onValueChanged',\n 'onBlur',\n 'onFocus',\n 'readonlyChange',\n 'disabledChange',\n 'onKeyDown',\n 'onKeyUp',\n 'onKeyPress',\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n\n providers: [\n { provide: AXComponent, useExisting: AXNumberBoxComponent },\n { provide: AXFocusableComponent, useExisting: AXNumberBoxComponent },\n { provide: AXClearableComponent, useExisting: AXNumberBoxComponent },\n { provide: AXValuableComponent, useExisting: AXNumberBoxComponent },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXNumberBoxComponent),\n multi: true,\n },\n ],\n})\nexport class AXNumberBoxComponent\n extends classes(MXInputBaseValueComponent<number>, MXLookComponent)\n implements AfterViewInit\n{\n /** @ignore */\n @ViewChild('input') input: ElementRef<HTMLInputElement>;\n\n /** @ignore */\n private _thousandsSeparator: string;\n /**\n * boolean value that specifies the number box change step by scrolling.\n */\n @Input()\n changeOnScroll = false;\n\n /**\n * A character value that specifies the separator character.\n */\n @Input()\n\n /**\n * Gets the thousands separator used in the formatting.\n * @param {string} value\n */\n public get thousandsSeparator(): string {\n return this._thousandsSeparator;\n }\n\n /**\n * Sets the thousands separator for formatting.\n * @param {string} v\n */\n public set thousandsSeparator(v: string) {\n this.setOption({\n name: 'thousandsSeparator',\n value: v ?? '',\n });\n }\n\n /** @ignore */\n private _padDecimalZeros = false;\n /**\n * A character value that specifies the separator character.\n */\n @Input()\n\n /**\n * Gets whether decimal zeros are padded.\n * @param {boolean} value\n */\n public get padDecimalZeros(): boolean {\n return this._padDecimalZeros;\n }\n\n /**\n * Sets whether decimal zeros should be padded.\n * @param {boolean} v\n */\n public set padDecimalZeros(v: boolean) {\n this.setOption({\n name: 'padDecimalZeros',\n value: v,\n });\n }\n\n /**\n * Specifies the value that is used to increment or decrement the **Integer** part of number\n */\n @Input()\n\n /**\n * Defines the increment step value.\n */\n step = 1;\n\n /** @ignore */\n private _decimals = 0;\n /**\n * Specifies the number of decimals that the user can enter\n */\n @Input()\n\n /**\n * Gets the number of decimal places to be used.\n */\n public get decimals(): number {\n return this._decimals;\n }\n\n /**\n * Sets the decimal places; defaults to 0 if not provided.\n */\n public set decimals(v: number) {\n this.setOption({\n name: 'decimals',\n value: v ?? 0,\n });\n }\n\n /**\n * Specifies the value that is used to increment or decrement the **Deciaml** part of number\n */\n @Input()\n\n /**\n * Defines the step size for decimal values.\n * @defaultvalue 'auto'\n */\n decimalStep: number | 'auto' = 'auto';\n\n /**\n * Specifies whether the Up and Down spin buttons will be rendered or not\n */\n @Input()\n\n /**\n * Indicates whether spin buttons are displayed.\n * @defaultvalue true\n */\n showSpinButtons = true;\n\n /** @ignore */\n private _minValue: number = Number.MIN_SAFE_INTEGER;\n /**\n * Specifies the smallest value that is valid\n */\n @Input()\n\n /**\n * Gets the number of decimal places used.\n * @param {number} value\n */\n public get minValue(): number {\n return this._minValue;\n }\n\n /**\n * Sets the number of decimal places to be used.\n * @param {number} v\n * @defaultvalue 0\n */\n public set minValue(v: number) {\n this.setOption({\n name: 'minValue',\n value: v != null ? Number(v) : Number.MIN_SAFE_INTEGER,\n });\n }\n\n /** @ignore */\n private _maxValue: number = Number.MAX_SAFE_INTEGER;\n\n /**\n * Specifies the greatest value that is valid\n */\n @Input()\n\n /**\n * Returns the maximum allowable value.\n */\n public get maxValue(): number {\n return this._maxValue;\n }\n\n /**\n * Sets the maximum allowable value, defaulting to `Number.MAX_SAFE_INTEGER` if null.\n * @param v\n */\n public set maxValue(v: number) {\n this.setOption({\n name: 'maxValue',\n value: v != null ? Number(v) : Number.MAX_SAFE_INTEGER,\n });\n }\n\n /**\n * CSS classes to apply to the component.\n * @param classNames\n */\n @Input('class')\n\n /**\n * CSS classes to apply to the component.\n */\n classNames: string;\n\n /**\n * @ignore\n */\n _maskObj: MaskedNumber;\n\n /** @ignore */\n @ViewChild(IMaskDirective)\n\n /** @ignore */\n private _maskDirective: IMaskDirective<MaskedNumber>;\n\n /** @ignore */\n private _onWheelFlag = false;\n constructor() {\n super();\n this.onFocus.subscribe(() => {\n this._onWheelFlag = true;\n this.input.nativeElement.select();\n });\n this.onBlur.subscribe(() => {\n this._onWheelFlag = false;\n });\n }\n\n /** @ignore */\n ngAfterViewInit(): void {\n this._updateMask();\n }\n\n /**\n * Handles internal option changes and updates the mask accordingly.\n */\n override internalOptionChanged(): void {\n this._updateMask();\n }\n\n /**\n * Resets the input element to its default state and calls the parent class reset method.\n */\n override reset(): void {\n this.input.nativeElement.value = null;\n super.reset(true);\n }\n\n /**\n * Ensures the value is within the min-max range, returning the default if null.\n * @param value\n */\n override internalSetValue(value: any): number {\n // || (value == 0 && !this._maskObj.value)\n if (value == null) {\n return this.defaultValue;\n }\n const v = toNumber(value);\n if (v < this.minValue) return this.minValue;\n if (v > this.maxValue) return this.maxValue;\n return v;\n }\n\n /** @ignore */\n private _updateMask() {\n if (!this._maskObj) {\n this._maskObj = createMask({\n mask: Number,\n min: this.minValue,\n max: this.maxValue,\n thousandsSeparator: this.thousandsSeparator || '',\n scale: this.decimals,\n radix: '.',\n padFractionalZeros: this.decimals > 0 && this.padDecimalZeros,\n });\n\n this._maskObj.format = (v: number, m) => {\n return !isNaN(v)\n ? v.toLocaleString('en-US', {\n useGrouping: false,\n maximumFractionDigits: 20,\n })\n : '';\n };\n } else {\n this._maskObj.updateOptions({\n min: this.minValue,\n max: this.maxValue,\n thousandsSeparator: this.thousandsSeparator || '',\n scale: this.decimals,\n radix: '.',\n padFractionalZeros: this.decimals > 0 && this.padDecimalZeros,\n });\n }\n this._maskDirective?.maskRef?.updateValue();\n this._maskDirective?.maskRef?.updateControl();\n }\n\n /** @ignore */\n _handleModelChange(value: number) {\n if (value == 0 && isEmpty(this.input?.nativeElement?.value)) {\n value = null;\n }\n\n this.commitValue(value, true);\n }\n\n /** @ignore */\n _handleOnKeydownEvent(e: KeyboardEvent) {\n if (this.disabled || this.readonly) return;\n const ignore = () => {\n e.preventDefault();\n e.stopPropagation();\n };\n const input = e.target as HTMLInputElement;\n const valStr = input.value;\n const decimalPointIndex = valStr.indexOf('.');\n const _cursorPos = input.selectionStart!;\n\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n if (decimalPointIndex > 0 && _cursorPos > decimalPointIndex && this.decimals > 0) {\n e.key === 'ArrowDown' ? this.decimalStepDown(true) : this.decimalStepUp(true);\n } else {\n e.key === 'ArrowDown' ? this.stepDown(true) : this.stepUp(true);\n }\n ignore();\n setTimeout(() => {\n input.setSelectionRange(_cursorPos, _cursorPos);\n }, 5);\n }\n super.emitOnKeydownEvent(e);\n }\n\n /** @ignore */\n protected _handleUpDownClick(v: -1 | 1) {\n if (this.disabled || this.readonly) return;\n v == 1 ? this.stepUp(true) : this.stepDown(true);\n }\n\n /**\n * Increases the value by the step amount, ensuring it's at least the minimum value.\n */\n stepUp(u = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(this.value + toNumber(this.step), u);\n }\n\n /**\n * Decreases the value by the step amount, ensuring it's at least the minimum value.\n */\n stepDown(u = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(this.value - toNumber(this.step), u);\n }\n\n /**\n * Increases the value by the decimal step amount, using 'auto' or a custom step value.\n */\n decimalStepUp(u = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(\n this.value + toNumber(this.decimalStep == 'auto' ? 1 / Math.pow(10, this.decimals) : this.decimalStep),\n u,\n );\n }\n\n /**\n * Decreases the value by the decimal step amount, using 'auto' or a custom step value.\n */\n decimalStepDown(u = false) {\n if (!this.value) {\n this.commitValue(Math.max(this.minValue, 0), u);\n }\n this.commitValue(\n this.value - toNumber(this.decimalStep == 'auto' ? 1 / Math.pow(10, this.decimals) : this.decimalStep),\n u,\n );\n }\n\n // @HostBinding('class')\n // get __hostClass(): string {\n // return `ax-editor-container ax-look-${this.look} ${this.disabled ? 'ax-state-disabled' : ''}`;\n // }\n @HostListener('wheel', ['$event'])\n onWheel(event: WheelEvent) {\n if (this.changeOnScroll && this._onWheelFlag) {\n event.preventDefault();\n if (!this.disabled && !this.readonly) {\n if (event.deltaY > 0) {\n this.commitValue(this.value - this.step);\n } else {\n this.commitValue(this.value + this.step);\n }\n }\n }\n }\n}\n","<div class=\"ax-editor-container ax-look-{{look}} {{classNames}}\" [class.ax-state-disabled]=\"disabled\">\n <ng-content select=\"ax-prefix\"> </ng-content>\n <input #input class=\"ax-input\" type=\"text\" [id]=\"id\" [name]=\"name\" [attr.placeholder]=\"placeholder\"\n [attr.autocomplete]=\"'off'\" [imask]=\"_maskObj\" [unmask]=\"'typed'\" [attr.min]=\"minValue\" [attr.max]=\"maxValue\"\n [class.ax-state-disabled]=\"disabled\" [class.ax-state-readonly]=\"readonly\" [disabled]=\"disabled\"\n [readonly]=\"readonly\" [tabindex]=\"tabIndex\" [ngModel]=\"value\" (ngModelChange)=\"_handleModelChange($event)\"\n (keydown)=\"_handleOnKeydownEvent($event)\" (keyup)=\"emitOnKeyupEvent($event)\"\n (keypress)=\"emitOnKeypressEvent($event)\" (focus)=\"emitOnFocusEvent($event)\" (blur)=\"emitOnBlurEvent($event)\" />\n @if(input.value && !disabled && !readonly){\n <ng-content select=\"ax-clear-button\"></ng-content>\n }\n @if(showSpinButtons){\n <div class=\"ax-number-box-control\">\n <button type=\"button\" class=\"ax-general-button ax-button-icon\" [class.ax-state-disabled]=\"disabled\"\n (click)=\"_handleUpDownClick(1)\" tabindex=\"-1\" [disabled]=\"disabled\"><span\n class=\"ax-icon ax-icon-chevron-up ax-arrow-button \"></span></button>\n <button type=\"button\" class=\"ax-general-button ax-button-icon\" [class.ax-state-disabled]=\"disabled\"\n (click)=\"_handleUpDownClick(-1)\" [disabled]=\"disabled\"><span\n class=\"ax-icon ax-icon-chevron-down ax-arrow-button \"></span></button>\n </div>\n\n }\n\n <ng-content select=\"ax-suffix\"> </ng-content>\n</div>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n<div class=\"ax-error-container\"></div>","import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { IMaskModule } from 'angular-imask';\nimport { AXNumberBoxComponent } from './number-box.component';\n\nconst COMPONENT = [AXNumberBoxComponent];\nconst MODULES = [CommonModule, FormsModule, AXButtonModule, AXDecoratorModule, IMaskModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXNumberBoxModule {}\n","/**\n * Generated bundle index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AAA,CAAA,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,aADvE,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAS1B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAJf,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAIT,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAN7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA;;;AChBD;;AAEG;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-otp.mjs","sources":["../../../../libs/components/otp/src/lib/otp.class.ts","../../../../libs/components/otp/src/lib/otp.component.ts","../../../../libs/components/otp/src/lib/otp.component.html","../../../../libs/components/otp/src/lib/otp.module.ts","../../../../libs/components/otp/src/acorex-components-otp.ts"],"sourcesContent":["import { AXEvent } from '@acorex/components/common';\n\nexport class AXOtpCompletedEvent extends AXEvent {\n value: string;\n isCompleted: boolean;\n}\n","import { MXLookComponent, MXValueComponent } from '@acorex/components/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n OnInit,\n ViewEncapsulation,\n effect,\n forwardRef,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { classes } from 'polytype';\nimport { AXOtpCompletedEvent } from './otp.class';\n\n/**\n * @category\n * A component for OTP input fields with state management and custom styling support.\n */\n@Component({\n selector: 'ax-otp',\n templateUrl: './otp.component.html',\n styleUrls: ['./otp.component.scss'],\n inputs: ['state', 'disabled', 'readonly', 'look'],\n outputs: ['stateChange', 'disabledChange'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXOtpComponent),\n multi: true,\n },\n ],\n})\nexport class AXOtpComponent extends classes(MXValueComponent<string>, MXLookComponent) implements OnInit, AfterViewInit {\n\n /**\n * Holds the length of the OTP input field.\n */\n length = model<number>();\n\n /**\n * @event\n * Emits an event when the OTP input is completed.\n */\n onCompleted = output<AXOtpCompletedEvent>();\n\n /**\n * Stores the values entered in the OTP input fields.\n */\n inputValues: number[] = [];\n\n /**\n * Holds the input values as a signal.\n */\n inputs = signal<number[]>([]);\n\n /** @ignore */\n constructor() {\n super();\n effect(\n () => {\n this._render();\n },\n { allowSignalWrites: true },\n );\n }\n\n /** @ignore */\n override ngOnInit(): void {\n super.ngOnInit();\n this._render();\n }\n\n /** @ignore */\n ngAfterViewInit(): void {\n this.calcFontSize();\n this.mapValueToInputs();\n }\n\n /**\n * Converts the value string to input values and updates the inputValues array.\n */\n mapValueToInputs() {\n this._emitOnComplete();\n if (!this.value) return;\n this.value.split('').map((v, i) => {\n this.inputValues[i] = +v;\n });\n }\n\n /**\n * Resets the input values to an empty array.\n */\n override reset() {\n this.inputValues = [];\n }\n\n /** @ignore */\n private _render() {\n this.inputs.set(\n Array(this.length())\n .fill(1)\n .map((x, i) => i),\n );\n }\n\n /** @ignore */\n protected _handleOnInput(event: any, i: number) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n const numberRegex = /^\\d+$/;\n if (!numberRegex.test(event.target.value)) {\n event.target.value = '';\n return;\n }\n if (event.target.value.length > 1) {\n const currentValue = event.target.value;\n event.target.value = '';\n event.target.value = currentValue.slice(-1);\n }\n if (inputs[i + 1]) {\n inputs[i + 1].select();\n }\n this.inputValues[i] = event.target.value;\n // if (this._numbers.filter((c) => c).length === this.length) {\n // this.setState('success');\n // } else {\n // this.setState('error');\n // }\n this._emitOnComplete();\n }\n\n /** @ignore */\n override internalSetValue(value: any): string {\n if (value) {\n this.inputValues = value?.toString().split('') as any;\n }\n return value;\n }\n\n /** @ignore */\n protected calcFontSize() {\n const size = this.getHostElement().querySelector<HTMLInputElement>('.ax-input')?.clientWidth;\n const fontSize = Math.min(size, size) * 0.5;\n this.getHostElement().style.setProperty('--font-size', fontSize + 'px');\n }\n\n /** @ignore */\n protected _handleOnKeyDown(event: KeyboardEvent, i: number) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n switch (event.key) {\n case 'Backspace':\n inputs[i].value = '';\n if (inputs[i - 1]) {\n inputs[i - 1].select();\n event.preventDefault();\n }\n this.inputValues[i] = null;\n break;\n case 'ArrowRight':\n if (inputs[i + 1]) {\n inputs[i + 1].select();\n }\n break;\n\n case 'ArrowLeft':\n if (inputs[i - 1]) {\n inputs[i - 1].select();\n }\n break;\n case 'Home':\n inputs[0].focus();\n break;\n case 'End':\n inputs[this.length() - 1].select();\n break;\n case 'ArrowUp':\n case 'ArrowDown':\n event.preventDefault();\n break;\n }\n }\n\n /** @ignore */\n protected _handleOnPaste(event: ClipboardEvent) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n const data = event.clipboardData.getData('text');\n const isNumber = /\\d+/;\n\n if (isNumber.test(data)) {\n inputs[inputs.length - 1].focus();\n this.inputValues = [];\n for (let i = 0; i < inputs.length; i++) {\n this.inputValues[i] = +data[i];\n }\n }\n\n event.preventDefault();\n }\n\n /** @ignore */\n protected _handleOnClick(i) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n inputs[i].select();\n }\n\n /** @ignore */\n protected _emitOnComplete() {\n // TODO: Check Value delay\n setTimeout(() => {\n this.commitValue(this.inputValues.join(''), true);\n this.onCompleted.emit({\n component: AXOtpComponent,\n value: this.inputValues.join(''),\n isCompleted: this.inputValues.filter((c) => c).length === this.length(),\n });\n });\n }\n}\n","<div\n dir=\"ltr\"\n class=\"ax-otp-input-container ax-editor-container ax-look-{{ look }}\"\n [ngStyle]=\"{ 'grid-template-columns': 'repeat(' + inputs().length + ', minmax(0, 1fr))' }\"\n (paste)=\"_handleOnPaste($event)\"\n>\n @for (input of inputs(); let i = $index; track i) {\n <input\n class=\"ax-input\"\n type=\"number\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-state-success]=\"state === 'success'\"\n [class.ax-state-error]=\"state === 'error'\"\n maxlength=\"1\"\n [ngModel]=\"inputValues[i]\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n (click)=\"_handleOnClick(i)\"\n (input)=\"_handleOnInput($event, i)\"\n (keydown)=\"_handleOnKeyDown($event, i)\"\n [attr.disabled]=\"disabled\"\n />\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AXOtpComponent } from './otp.component';\n\nconst COMPONENT = [AXOtpComponent];\nconst MODULES = [CommonModule, FormsModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXOtpModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAEM,MAAO,mBAAoB,SAAQ,OAAO,CAAA;AAG/C;;ACYD;;;AAGG;AAiBG,MAAO,cAAe,SAAQ,OAAO,EAAC,gBAAwB,GAAE,eAAe,CAAC,CAAA;;AAwBpF,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE,CAAC;AAvBV;;AAEC;QACD,IAAM,CAAA,MAAA,GAAG,KAAK,EAAU,CAAC;AAEzB;;;AAGC;QACD,IAAW,CAAA,WAAA,GAAG,MAAM,EAAuB,CAAC;AAE5C;;AAEC;QACD,IAAW,CAAA,WAAA,GAAa,EAAE,CAAC;AAE3B;;AAEC;AACD,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AA;kBANvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-otp.mjs","sources":["../../../../libs/components/otp/src/lib/otp.class.ts","../../../../libs/components/otp/src/lib/otp.component.ts","../../../../libs/components/otp/src/lib/otp.component.html","../../../../libs/components/otp/src/lib/otp.module.ts","../../../../libs/components/otp/src/acorex-components-otp.ts"],"sourcesContent":["import { AXEvent } from '@acorex/components/common';\n\nexport class AXOtpCompletedEvent extends AXEvent {\n value: string;\n isCompleted: boolean;\n}\n","import { MXLookComponent, MXValueComponent } from '@acorex/components/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n OnInit,\n ViewEncapsulation,\n effect,\n forwardRef,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { classes } from 'polytype';\nimport { AXOtpCompletedEvent } from './otp.class';\n\n/**\n * @category\n * A component for OTP input fields with state management and custom styling support.\n */\n@Component({\n selector: 'ax-otp',\n templateUrl: './otp.component.html',\n styleUrls: ['./otp.component.scss'],\n inputs: ['state', 'disabled', 'readonly', 'look'],\n outputs: ['stateChange', 'disabledChange'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXOtpComponent),\n multi: true,\n },\n ],\n})\nexport class AXOtpComponent extends classes(MXValueComponent<string>, MXLookComponent) implements OnInit, AfterViewInit {\n\n /**\n * Holds the length of the OTP input field.\n */\n length = model<number>();\n\n /**\n * @event\n * Emits an event when the OTP input is completed.\n */\n onCompleted = output<AXOtpCompletedEvent>();\n\n /**\n * Stores the values entered in the OTP input fields.\n */\n inputValues: number[] = [];\n\n /**\n * Holds the input values as a signal.\n */\n inputs = signal<number[]>([]);\n\n /** @ignore */\n constructor() {\n super();\n effect(\n () => {\n this._render();\n },\n { allowSignalWrites: true },\n );\n }\n\n /** @ignore */\n override ngOnInit(): void {\n super.ngOnInit();\n this._render();\n }\n\n /** @ignore */\n ngAfterViewInit(): void {\n this.calcFontSize();\n this.mapValueToInputs();\n }\n\n /**\n * Converts the value string to input values and updates the inputValues array.\n */\n mapValueToInputs() {\n this._emitOnComplete();\n if (!this.value) return;\n this.value.split('').map((v, i) => {\n this.inputValues[i] = +v;\n });\n }\n\n /**\n * Resets the input values to an empty array.\n */\n override reset() {\n this.inputValues = [];\n }\n\n /** @ignore */\n private _render() {\n this.inputs.set(\n Array(this.length())\n .fill(1)\n .map((x, i) => i),\n );\n }\n\n /** @ignore */\n protected _handleOnInput(event: any, i: number) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n const numberRegex = /^\\d+$/;\n if (!numberRegex.test(event.target.value)) {\n event.target.value = '';\n return;\n }\n if (event.target.value.length > 1) {\n const currentValue = event.target.value;\n event.target.value = '';\n event.target.value = currentValue.slice(-1);\n }\n if (inputs[i + 1]) {\n inputs[i + 1].select();\n }\n this.inputValues[i] = event.target.value;\n // if (this._numbers.filter((c) => c).length === this.length) {\n // this.setState('success');\n // } else {\n // this.setState('error');\n // }\n this._emitOnComplete();\n }\n\n /** @ignore */\n override internalSetValue(value: any): string {\n if (value) {\n this.inputValues = value?.toString().split('') as any;\n }\n return value;\n }\n\n /** @ignore */\n protected calcFontSize() {\n const size = this.getHostElement().querySelector<HTMLInputElement>('.ax-input')?.clientWidth;\n const fontSize = Math.min(size, size) * 0.5;\n this.getHostElement().style.setProperty('--font-size', fontSize + 'px');\n }\n\n /** @ignore */\n protected _handleOnKeyDown(event: KeyboardEvent, i: number) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n switch (event.key) {\n case 'Backspace':\n inputs[i].value = '';\n if (inputs[i - 1]) {\n inputs[i - 1].select();\n event.preventDefault();\n }\n this.inputValues[i] = null;\n break;\n case 'ArrowRight':\n if (inputs[i + 1]) {\n inputs[i + 1].select();\n }\n break;\n\n case 'ArrowLeft':\n if (inputs[i - 1]) {\n inputs[i - 1].select();\n }\n break;\n case 'Home':\n inputs[0].focus();\n break;\n case 'End':\n inputs[this.length() - 1].select();\n break;\n case 'ArrowUp':\n case 'ArrowDown':\n event.preventDefault();\n break;\n }\n }\n\n /** @ignore */\n protected _handleOnPaste(event: ClipboardEvent) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n const data = event.clipboardData.getData('text');\n const isNumber = /\\d+/;\n\n if (isNumber.test(data)) {\n inputs[inputs.length - 1].focus();\n this.inputValues = [];\n for (let i = 0; i < inputs.length; i++) {\n this.inputValues[i] = +data[i];\n }\n }\n\n event.preventDefault();\n }\n\n /** @ignore */\n protected _handleOnClick(i) {\n const inputs = this.getHostElement().querySelectorAll<HTMLInputElement>('.ax-input');\n inputs[i].select();\n }\n\n /** @ignore */\n protected _emitOnComplete() {\n // TODO: Check Value delay\n setTimeout(() => {\n this.commitValue(this.inputValues.join(''), true);\n this.onCompleted.emit({\n component: AXOtpComponent,\n value: this.inputValues.join(''),\n isCompleted: this.inputValues.filter((c) => c).length === this.length(),\n });\n });\n }\n}\n","<div\n dir=\"ltr\"\n class=\"ax-otp-input-container ax-editor-container ax-look-{{ look }}\"\n [ngStyle]=\"{ 'grid-template-columns': 'repeat(' + inputs().length + ', minmax(0, 1fr))' }\"\n (paste)=\"_handleOnPaste($event)\"\n>\n @for (input of inputs(); let i = $index; track i) {\n <input\n class=\"ax-input\"\n type=\"number\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-state-success]=\"state === 'success'\"\n [class.ax-state-error]=\"state === 'error'\"\n maxlength=\"1\"\n [ngModel]=\"inputValues[i]\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n (click)=\"_handleOnClick(i)\"\n (input)=\"_handleOnInput($event, i)\"\n (keydown)=\"_handleOnKeyDown($event, i)\"\n [attr.disabled]=\"disabled\"\n />\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AXOtpComponent } from './otp.component';\n\nconst COMPONENT = [AXOtpComponent];\nconst MODULES = [CommonModule, FormsModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXOtpModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAEM,MAAO,mBAAoB,SAAQ,OAAO,CAAA;AAG/C;;ACYD;;;AAGG;AAiBG,MAAO,cAAe,SAAQ,OAAO,EAAC,gBAAwB,GAAE,eAAe,CAAC,CAAA;;AAwBpF,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;AAvBT;;AAEC;QACD,IAAM,CAAA,MAAA,GAAG,KAAK,EAAU;AAExB;;;AAGC;QACD,IAAW,CAAA,WAAA,GAAG,MAAM,EAAuB;AAE3C;;AAEC;QACD,IAAW,CAAA,WAAA,GAAa,EAAE;AAE1B;;AAEC;AACD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAW,EAAE,CAAC;QAK3B,MAAM,CACJ,MAAK;YACH,IAAI,CAAC,OAAO,EAAE;AAChB,SAAC,EACD,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAC5B;;;IAIM,QAAQ,GAAA;QACf,KAAK,CAAC,QAAQ,EAAE;QAChB,IAAI,CAAC,OAAO,EAAE;;;IAIhB,eAAe,GAAA;QACb,IAAI,CAAC,YAAY,EAAE;QACnB,IAAI,CAAC,gBAAgB,EAAE;;AAGzB;;AAEC;IACD,gBAAgB,GAAA;QACd,IAAI,CAAC,eAAe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AAA,IAAA,EAAA,WAAW,iBATL,cAAc,CAAA,EAAA,OAAA,EAAA,CAChB,YAAY,EAAE,WAAW,aADvB,cAAc,CAAA,EAAA,CAAA,CAAA;AASpB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,YAJT,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAIT,WAAW,EAAA,UAAA,EAAA,CAAA;kBANvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA;;;ACbD;;AAEG;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-page.mjs","sources":["../../../../libs/components/page/src/lib/base-page.class.ts","../../../../libs/components/page/src/lib/page.component.ts","../../../../libs/components/page/src/lib/page.module.ts","../../../../libs/components/page/src/acorex-components-page.ts"],"sourcesContent":["import { AXComponentCloseEvent, AXComponentClosing, MXBaseComponent } from '@acorex/components/common';\nimport { AXDecoratorGenericComponent } from '@acorex/components/decorators';\nimport { AXLoadingService } from '@acorex/components/loading';\nimport { EventEmitter, Injectable, Input, OnDestroy, Output, ViewChild, inject } from '@angular/core';\n\n@Injectable()\nexport class AXBasePageComponent extends MXBaseComponent implements OnDestroy {\n private _loadingId: number;\n private _loadingService = inject(AXLoadingService);\n\n public setTitle: (title: string) => void;\n\n @ViewChild('ax-footer', { static: true })\n footer: AXDecoratorGenericComponent;\n\n @Output()\n isLoadingChange = new EventEmitter<boolean>();\n\n private _isLoading = false;\n @Input()\n public get isLoading(): boolean {\n return this._isLoading;\n }\n public set isLoading(v: boolean) {\n this.setOption({\n name: 'isLoading',\n value: v,\n afterCallback: () => {\n if (this._loadingId && !v) {\n this._loadingService.hide(this._loadingId);\n this._loadingId = 0;\n }\n if (v) {\n this._loadingId = this._loadingService.show({\n location: this.getHostElement().closest('.ax-loading-container'),\n });\n }\n this.cdr.markForCheck();\n },\n });\n }\n\n private _isPopup = false;\n public get isPopup(): boolean {\n return this._isPopup;\n }\n\n onClosed: EventEmitter<AXComponentCloseEvent> = new EventEmitter<AXComponentCloseEvent>();\n\n close(data?: unknown) {\n this.onClosed.emit({\n component: this,\n data: data,\n });\n }\n\n onClosing(e: AXComponentClosing): void | Promise<void> {}\n\n ngOnDestroy() {\n this.onClosed.unsubscribe();\n }\n}\n","import { MXBaseComponent } from '@acorex/components/common';\nimport { AXLoadingService } from '@acorex/components/loading';\nimport { EventEmitter, Inject, Injectable, Input, Output } from '@angular/core';\n\n@Injectable()\nexport abstract class AXPageComponent extends MXBaseComponent {\n\n /** @ignore */\n constructor(@Inject(AXLoadingService) private _loadingService) {\n super();\n }\n\n /** @ignore */\n private _loadingId: number;\n\n /**\n * @event\n * Emits an event when the loading state changes.\n */\n @Output()\n isLoadingChange = new EventEmitter<boolean>();\n\n /** @ignore */\n private _isLoading: boolean = false;\n\n/**\n * Controls the loading state and visibility of the loading indicator.\n * @param {boolean} v\n */\n @Input()\n\n /**\n * @param {boolean} v\n * Updates the loading state and manages the loading indicator visibility.\n */\n public get isLoading(): boolean {\n return this._isLoading;\n }\n\n /**\n * Sets the loading state, showing or hiding the loading indicator based on the value.\n * @param {boolean} v\n */\n public set isLoading(v: boolean) {\n this.setOption({\n name: 'isLoading',\n value: v,\n afterCallback: () => {\n if (this._loadingId && !v) {\n this._loadingService.hide(this._loadingId);\n this._loadingId = 0;\n }\n if (v) {\n this._loadingId = this._loadingService.show(this.getHostElement());\n }\n this.cdr.markForCheck();\n },\n });\n }\n}\n","import { NgModule } from '@angular/core';\n\n// TODO: Module is empty!?\n@NgModule({\n imports: [],\n exports: [],\n declarations: [],\n providers: [],\n})\nexport class AXPageModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAMM,MAAO,mBAAoB,SAAQ,eAAe,CAAA;AADxD,IAAA,WAAA,GAAA;;AAGU,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,gBAAgB,CAAC
|
1
|
+
{"version":3,"file":"acorex-components-page.mjs","sources":["../../../../libs/components/page/src/lib/base-page.class.ts","../../../../libs/components/page/src/lib/page.component.ts","../../../../libs/components/page/src/lib/page.module.ts","../../../../libs/components/page/src/acorex-components-page.ts"],"sourcesContent":["import { AXComponentCloseEvent, AXComponentClosing, MXBaseComponent } from '@acorex/components/common';\nimport { AXDecoratorGenericComponent } from '@acorex/components/decorators';\nimport { AXLoadingService } from '@acorex/components/loading';\nimport { EventEmitter, Injectable, Input, OnDestroy, Output, ViewChild, inject } from '@angular/core';\n\n@Injectable()\nexport class AXBasePageComponent extends MXBaseComponent implements OnDestroy {\n private _loadingId: number;\n private _loadingService = inject(AXLoadingService);\n\n public setTitle: (title: string) => void;\n\n @ViewChild('ax-footer', { static: true })\n footer: AXDecoratorGenericComponent;\n\n @Output()\n isLoadingChange = new EventEmitter<boolean>();\n\n private _isLoading = false;\n @Input()\n public get isLoading(): boolean {\n return this._isLoading;\n }\n public set isLoading(v: boolean) {\n this.setOption({\n name: 'isLoading',\n value: v,\n afterCallback: () => {\n if (this._loadingId && !v) {\n this._loadingService.hide(this._loadingId);\n this._loadingId = 0;\n }\n if (v) {\n this._loadingId = this._loadingService.show({\n location: this.getHostElement().closest('.ax-loading-container'),\n });\n }\n this.cdr.markForCheck();\n },\n });\n }\n\n private _isPopup = false;\n public get isPopup(): boolean {\n return this._isPopup;\n }\n\n onClosed: EventEmitter<AXComponentCloseEvent> = new EventEmitter<AXComponentCloseEvent>();\n\n close(data?: unknown) {\n this.onClosed.emit({\n component: this,\n data: data,\n });\n }\n\n onClosing(e: AXComponentClosing): void | Promise<void> {}\n\n ngOnDestroy() {\n this.onClosed.unsubscribe();\n }\n}\n","import { MXBaseComponent } from '@acorex/components/common';\nimport { AXLoadingService } from '@acorex/components/loading';\nimport { EventEmitter, Inject, Injectable, Input, Output } from '@angular/core';\n\n@Injectable()\nexport abstract class AXPageComponent extends MXBaseComponent {\n\n /** @ignore */\n constructor(@Inject(AXLoadingService) private _loadingService) {\n super();\n }\n\n /** @ignore */\n private _loadingId: number;\n\n /**\n * @event\n * Emits an event when the loading state changes.\n */\n @Output()\n isLoadingChange = new EventEmitter<boolean>();\n\n /** @ignore */\n private _isLoading: boolean = false;\n\n/**\n * Controls the loading state and visibility of the loading indicator.\n * @param {boolean} v\n */\n @Input()\n\n /**\n * @param {boolean} v\n * Updates the loading state and manages the loading indicator visibility.\n */\n public get isLoading(): boolean {\n return this._isLoading;\n }\n\n /**\n * Sets the loading state, showing or hiding the loading indicator based on the value.\n * @param {boolean} v\n */\n public set isLoading(v: boolean) {\n this.setOption({\n name: 'isLoading',\n value: v,\n afterCallback: () => {\n if (this._loadingId && !v) {\n this._loadingService.hide(this._loadingId);\n this._loadingId = 0;\n }\n if (v) {\n this._loadingId = this._loadingService.show(this.getHostElement());\n }\n this.cdr.markForCheck();\n },\n });\n }\n}\n","import { NgModule } from '@angular/core';\n\n// TODO: Module is empty!?\n@NgModule({\n imports: [],\n exports: [],\n declarations: [],\n providers: [],\n})\nexport class AXPageModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAMM,MAAO,mBAAoB,SAAQ,eAAe,CAAA;AADxD,IAAA,WAAA,GAAA;;AAGU,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAQlD,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,YAAY,EAAW;QAErC,IAAU,CAAA,UAAA,GAAG,KAAK;QAwBlB,IAAQ,CAAA,QAAA,GAAG,KAAK;AAKxB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A,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAHhB,eAAe,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBADpC;;0BAIc,MAAM;2BAAC,gBAAgB;yCAYpC,eAAe,EAAA,CAAA;sBADd;gBAgBU,SAAS,EAAA,CAAA;sBANnB;;;AC3BH;MAOa,YAAY,CAAA;8GAAZ,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAZ,YAAY,EAAA,CAAA,CAAA;+GAAZ,YAAY,EAAA,CAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBANxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA;;;ACRD;;AAEG;;;;"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import * as
|
1
|
+
import * as i3$1 from '@acorex/components/button';
|
2
2
|
import { AXButtonModule } from '@acorex/components/button';
|
3
|
-
import * as
|
4
|
-
import {
|
3
|
+
import * as i2 from '@acorex/components/color-box';
|
4
|
+
import { AXColorBoxModule } from '@acorex/components/color-box';
|
5
5
|
import * as i5 from '@acorex/components/decorators';
|
6
6
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
7
7
|
import * as i4 from '@acorex/components/popover';
|
@@ -9,6 +9,8 @@ import { AXPopoverModule } from '@acorex/components/popover';
|
|
9
9
|
import * as i2$1 from '@acorex/components/range-slider';
|
10
10
|
import { AXRangeSliderModule } from '@acorex/components/range-slider';
|
11
11
|
import { AXSelectBoxModule } from '@acorex/components/select-box';
|
12
|
+
import * as i3 from '@acorex/components/tooltip';
|
13
|
+
import { AXTooltipModule } from '@acorex/components/tooltip';
|
12
14
|
import * as i0 from '@angular/core';
|
13
15
|
import { signal, Injectable, forwardRef, Component, ViewEncapsulation, inject, HostBinding, input, viewChild, afterNextRender, effect, NgModule } from '@angular/core';
|
14
16
|
import * as i1 from '@angular/forms';
|
@@ -89,14 +91,6 @@ class AXPaintColorPickerComponent {
|
|
89
91
|
this.service = inject(AXPaintService);
|
90
92
|
/** @ignore */
|
91
93
|
this.selectedColor = signal('rgb(12, 12, 12)');
|
92
|
-
/** @ignore */
|
93
|
-
this.popoverOption = {
|
94
|
-
openOn: 'click',
|
95
|
-
closeOn: 'clickOut',
|
96
|
-
placement: 'top',
|
97
|
-
offsetX: 0,
|
98
|
-
offsetY: 0,
|
99
|
-
};
|
100
94
|
}
|
101
95
|
/** @ignore */
|
102
96
|
changeColorHandler(e) {
|
@@ -107,11 +101,11 @@ class AXPaintColorPickerComponent {
|
|
107
101
|
return `.5rem`;
|
108
102
|
}
|
109
103
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPaintColorPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
110
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: AXPaintColorPickerComponent, selector: "ax-paint-color-picker", host: { properties: { "style.marginInline": "this.__hostClass" } }, ngImport: i0, template: "<
|
104
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: AXPaintColorPickerComponent, selector: "ax-paint-color-picker", host: { properties: { "style.marginInline": "this.__hostClass" } }, ngImport: i0, template: "<ax-color-box\n axTooltip=\"Color Picker\"\n axTooltipPlacement=\"top\"\n look=\"outline\"\n [ngModel]=\"selectedColor()\"\n (ngModelChange)=\"changeColorHandler($event)\"\n>\n</ax-color-box>\n", styles: ["ax-paint-color-picker{margin-inline:0!important}ax-paint-color-picker .ax-submit-color{border:1px solid rgb(var(--ax-color-text-default));width:.6rem;height:.6rem;border-radius:1000vmax}ax-paint-color-picker .ax-color-flex-container{display:flex;align-items:center;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.AXColorBoxComponent, selector: "ax-color-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange"] }, { kind: "directive", type: i3.AXTooltipDirective, selector: "[axTooltip]", inputs: ["axTooltip", "axTooltipPlacement", "axTooltipOpenAfter", "axTooltipCloseAfter"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
111
105
|
}
|
112
106
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPaintColorPickerComponent, decorators: [{
|
113
107
|
type: Component,
|
114
|
-
args: [{ selector: 'ax-paint-color-picker', encapsulation: ViewEncapsulation.None, template: "<
|
108
|
+
args: [{ selector: 'ax-paint-color-picker', encapsulation: ViewEncapsulation.None, template: "<ax-color-box\n axTooltip=\"Color Picker\"\n axTooltipPlacement=\"top\"\n look=\"outline\"\n [ngModel]=\"selectedColor()\"\n (ngModelChange)=\"changeColorHandler($event)\"\n>\n</ax-color-box>\n", styles: ["ax-paint-color-picker{margin-inline:0!important}ax-paint-color-picker .ax-submit-color{border:1px solid rgb(var(--ax-color-text-default));width:.6rem;height:.6rem;border-radius:1000vmax}ax-paint-color-picker .ax-color-flex-container{display:flex;align-items:center;cursor:pointer}\n"] }]
|
115
109
|
}], propDecorators: { __hostClass: [{
|
116
110
|
type: HostBinding,
|
117
111
|
args: ['style.marginInline']
|
@@ -154,11 +148,11 @@ class AXPaintPenModeChangerComponent {
|
|
154
148
|
this.service.lineWidth.set(e);
|
155
149
|
}
|
156
150
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPaintPenModeChangerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
157
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXPaintPenModeChangerComponent, selector: "ax-paint-pen-mode-changer", host: { properties: { "style.marginInline": "this.__hostClass" } }, ngImport: i0, template: "<ax-button look=\"blank\" #alignPop>\n @switch (service.penType()) {\n @case ('pen') {\n <ax-icon class=\"ax-icon ax-icon-pen\"></ax-icon>\n }\n @case ('highlight') {\n <ax-icon class=\"ax-icon ax-icon-highlight\"></ax-icon>\n }\n @case ('eraser') {\n <ax-icon class=\"ax-icon ax-icon-eraser\"></ax-icon>\n }\n }\n</ax-button>\n\n<ax-button (click)=\"clear()\" look=\"blank\">\n <ax-icon class=\"ax-icon ax-icon-undo\"></ax-icon>\n</ax-button>\n\n<ax-popover\n [openOn]=\"popoverOption.openOn\"\n [closeOn]=\"popoverOption.closeOn\"\n [target]=\"alignPop\"\n [placement]=\"popoverOption.placement\"\n>\n <div class=\"ax-overlay-pane\">\n <ax-button\n (click)=\"penTypeHandler('pen')\"\n look=\"blank\"\n [selected]=\"this.service.penType() === 'pen' ? true : false\"\n >\n <ax-icon class=\"ax-icon ax-icon-pen\"></ax-icon>\n </ax-button>\n\n <ax-button\n (click)=\"penTypeHandler('highlight')\"\n look=\"blank\"\n [selected]=\"this.service.penType() === 'highlight' ? true : false\"\n >\n <ax-icon class=\"ax-icon ax-icon-highlight\"></ax-icon>\n </ax-button>\n\n <ax-button\n (click)=\"penTypeHandler('eraser')\"\n look=\"blank\"\n [selected]=\"this.service.penType() === 'eraser' ? true : false\"\n >\n <ax-icon class=\"ax-icon ax-icon-eraser\"></ax-icon>\n </ax-button>\n\n <div class=\"ax-paint-width-slider\">\n <ax-range-slider\n [min]=\"2\"\n [max]=\"20\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"valueHandler($event)\"\n ></ax-range-slider>\n </div>\n </div>\n</ax-popover>\n", styles: ["ax-paint-pen-mode-changer{display:flex;align-items:center;margin-inline:0!important}ax-paint-pen-mode-changer ax-range-slider{padding:.5rem .75rem}ax-paint-pen-mode-changer ax-range-slider .ax-range-slider .ax-range-slider-handler{width:1rem!important;height:1rem!important}\n"], dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$1.AXRangeSliderComponent, selector: "ax-range-slider", inputs: ["disabled", "readonly", "orientation", "color", "values", "mode", "min", "max", "step", "snap", "tooltipMode", "snapMode", "hasStep", "hasSnap", "hasLable", "hasTooltip"], outputs: ["valuesChange"] }, { kind: "component", type:
|
151
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXPaintPenModeChangerComponent, selector: "ax-paint-pen-mode-changer", host: { properties: { "style.marginInline": "this.__hostClass" } }, ngImport: i0, template: "<ax-button axTooltip=\"Draw Utilities\" axTooltipPlacement=\"top\" look=\"blank\" #alignPop>\n @switch (service.penType()) {\n @case ('pen') {\n <ax-icon class=\"ax-icon ax-icon-pen\"></ax-icon>\n }\n @case ('highlight') {\n <ax-icon class=\"ax-icon ax-icon-highlight\"></ax-icon>\n }\n @case ('eraser') {\n <ax-icon class=\"ax-icon ax-icon-eraser\"></ax-icon>\n }\n }\n</ax-button>\n\n<ax-button axTooltip=\"Reset Changes\" axTooltipPlacement=\"top\" (click)=\"clear()\" look=\"blank\">\n <ax-icon class=\"ax-icon ax-icon-undo\"></ax-icon>\n</ax-button>\n\n<ax-popover\n [openOn]=\"popoverOption.openOn\"\n [closeOn]=\"popoverOption.closeOn\"\n [target]=\"alignPop\"\n [placement]=\"popoverOption.placement\"\n>\n <div class=\"ax-overlay-pane\">\n <ax-button\n (click)=\"penTypeHandler('pen')\"\n look=\"blank\"\n [selected]=\"this.service.penType() === 'pen' ? true : false\"\n >\n <ax-icon class=\"ax-icon ax-icon-pen\"></ax-icon>\n </ax-button>\n\n <ax-button\n (click)=\"penTypeHandler('highlight')\"\n look=\"blank\"\n [selected]=\"this.service.penType() === 'highlight' ? true : false\"\n >\n <ax-icon class=\"ax-icon ax-icon-highlight\"></ax-icon>\n </ax-button>\n\n <ax-button\n (click)=\"penTypeHandler('eraser')\"\n look=\"blank\"\n [selected]=\"this.service.penType() === 'eraser' ? true : false\"\n >\n <ax-icon class=\"ax-icon ax-icon-eraser\"></ax-icon>\n </ax-button>\n\n <div class=\"ax-paint-width-slider\">\n <ax-range-slider\n [min]=\"2\"\n [max]=\"20\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"valueHandler($event)\"\n ></ax-range-slider>\n </div>\n </div>\n</ax-popover>\n", styles: ["ax-paint-pen-mode-changer{display:flex;align-items:center;margin-inline:0!important}ax-paint-pen-mode-changer ax-range-slider{padding:.5rem .75rem}ax-paint-pen-mode-changer ax-range-slider .ax-range-slider .ax-range-slider-handler{width:1rem!important;height:1rem!important}\n"], dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$1.AXRangeSliderComponent, selector: "ax-range-slider", inputs: ["disabled", "readonly", "orientation", "color", "values", "mode", "min", "max", "step", "snap", "tooltipMode", "snapMode", "hasStep", "hasSnap", "hasLable", "hasTooltip"], outputs: ["valuesChange"] }, { kind: "component", type: i3$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "component", type: i4.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: i5.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "directive", type: i3.AXTooltipDirective, selector: "[axTooltip]", inputs: ["axTooltip", "axTooltipPlacement", "axTooltipOpenAfter", "axTooltipCloseAfter"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
158
152
|
}
|
159
153
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPaintPenModeChangerComponent, decorators: [{
|
160
154
|
type: Component,
|
161
|
-
args: [{ selector: 'ax-paint-pen-mode-changer', encapsulation: ViewEncapsulation.None, template: "<ax-button look=\"blank\" #alignPop>\n @switch (service.penType()) {\n @case ('pen') {\n <ax-icon class=\"ax-icon ax-icon-pen\"></ax-icon>\n }\n @case ('highlight') {\n <ax-icon class=\"ax-icon ax-icon-highlight\"></ax-icon>\n }\n @case ('eraser') {\n <ax-icon class=\"ax-icon ax-icon-eraser\"></ax-icon>\n }\n }\n</ax-button>\n\n<ax-button (click)=\"clear()\" look=\"blank\">\n <ax-icon class=\"ax-icon ax-icon-undo\"></ax-icon>\n</ax-button>\n\n<ax-popover\n [openOn]=\"popoverOption.openOn\"\n [closeOn]=\"popoverOption.closeOn\"\n [target]=\"alignPop\"\n [placement]=\"popoverOption.placement\"\n>\n <div class=\"ax-overlay-pane\">\n <ax-button\n (click)=\"penTypeHandler('pen')\"\n look=\"blank\"\n [selected]=\"this.service.penType() === 'pen' ? true : false\"\n >\n <ax-icon class=\"ax-icon ax-icon-pen\"></ax-icon>\n </ax-button>\n\n <ax-button\n (click)=\"penTypeHandler('highlight')\"\n look=\"blank\"\n [selected]=\"this.service.penType() === 'highlight' ? true : false\"\n >\n <ax-icon class=\"ax-icon ax-icon-highlight\"></ax-icon>\n </ax-button>\n\n <ax-button\n (click)=\"penTypeHandler('eraser')\"\n look=\"blank\"\n [selected]=\"this.service.penType() === 'eraser' ? true : false\"\n >\n <ax-icon class=\"ax-icon ax-icon-eraser\"></ax-icon>\n </ax-button>\n\n <div class=\"ax-paint-width-slider\">\n <ax-range-slider\n [min]=\"2\"\n [max]=\"20\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"valueHandler($event)\"\n ></ax-range-slider>\n </div>\n </div>\n</ax-popover>\n", styles: ["ax-paint-pen-mode-changer{display:flex;align-items:center;margin-inline:0!important}ax-paint-pen-mode-changer ax-range-slider{padding:.5rem .75rem}ax-paint-pen-mode-changer ax-range-slider .ax-range-slider .ax-range-slider-handler{width:1rem!important;height:1rem!important}\n"] }]
|
155
|
+
args: [{ selector: 'ax-paint-pen-mode-changer', encapsulation: ViewEncapsulation.None, template: "<ax-button axTooltip=\"Draw Utilities\" axTooltipPlacement=\"top\" look=\"blank\" #alignPop>\n @switch (service.penType()) {\n @case ('pen') {\n <ax-icon class=\"ax-icon ax-icon-pen\"></ax-icon>\n }\n @case ('highlight') {\n <ax-icon class=\"ax-icon ax-icon-highlight\"></ax-icon>\n }\n @case ('eraser') {\n <ax-icon class=\"ax-icon ax-icon-eraser\"></ax-icon>\n }\n }\n</ax-button>\n\n<ax-button axTooltip=\"Reset Changes\" axTooltipPlacement=\"top\" (click)=\"clear()\" look=\"blank\">\n <ax-icon class=\"ax-icon ax-icon-undo\"></ax-icon>\n</ax-button>\n\n<ax-popover\n [openOn]=\"popoverOption.openOn\"\n [closeOn]=\"popoverOption.closeOn\"\n [target]=\"alignPop\"\n [placement]=\"popoverOption.placement\"\n>\n <div class=\"ax-overlay-pane\">\n <ax-button\n (click)=\"penTypeHandler('pen')\"\n look=\"blank\"\n [selected]=\"this.service.penType() === 'pen' ? true : false\"\n >\n <ax-icon class=\"ax-icon ax-icon-pen\"></ax-icon>\n </ax-button>\n\n <ax-button\n (click)=\"penTypeHandler('highlight')\"\n look=\"blank\"\n [selected]=\"this.service.penType() === 'highlight' ? true : false\"\n >\n <ax-icon class=\"ax-icon ax-icon-highlight\"></ax-icon>\n </ax-button>\n\n <ax-button\n (click)=\"penTypeHandler('eraser')\"\n look=\"blank\"\n [selected]=\"this.service.penType() === 'eraser' ? true : false\"\n >\n <ax-icon class=\"ax-icon ax-icon-eraser\"></ax-icon>\n </ax-button>\n\n <div class=\"ax-paint-width-slider\">\n <ax-range-slider\n [min]=\"2\"\n [max]=\"20\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"valueHandler($event)\"\n ></ax-range-slider>\n </div>\n </div>\n</ax-popover>\n", styles: ["ax-paint-pen-mode-changer{display:flex;align-items:center;margin-inline:0!important}ax-paint-pen-mode-changer ax-range-slider{padding:.5rem .75rem}ax-paint-pen-mode-changer ax-range-slider .ax-range-slider .ax-range-slider-handler{width:1rem!important;height:1rem!important}\n"] }]
|
162
156
|
}], propDecorators: { __hostClass: [{
|
163
157
|
type: HostBinding,
|
164
158
|
args: ['style.marginInline']
|
@@ -329,9 +323,10 @@ const MODULES = [
|
|
329
323
|
AXRangeSliderModule,
|
330
324
|
AXSelectBoxModule,
|
331
325
|
AXButtonModule,
|
332
|
-
|
326
|
+
AXColorBoxModule,
|
333
327
|
AXPopoverModule,
|
334
328
|
AXDecoratorModule,
|
329
|
+
AXTooltipModule,
|
335
330
|
];
|
336
331
|
class AXPaintModule {
|
337
332
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPaintModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
@@ -343,9 +338,10 @@ class AXPaintModule {
|
|
343
338
|
AXRangeSliderModule,
|
344
339
|
AXSelectBoxModule,
|
345
340
|
AXButtonModule,
|
346
|
-
|
341
|
+
AXColorBoxModule,
|
347
342
|
AXPopoverModule,
|
348
|
-
AXDecoratorModule
|
343
|
+
AXDecoratorModule,
|
344
|
+
AXTooltipModule], exports: [AXPaintContainerComponent,
|
349
345
|
AXPaintToolbarComponent,
|
350
346
|
AXPaintViewComponent,
|
351
347
|
AXPaintColorPickerComponent,
|