@acorex/components 19.8.0-next.9 → 19.9.0
Sign up to get free protection for your applications and to get access to all the features.
- package/action-sheet/lib/action-sheet.class.d.ts +2 -1
- package/badge/lib/badge.component.d.ts +2 -2
- package/button/lib/button.component.d.ts +6 -1
- package/button-group/lib/button-group-item.component.d.ts +1 -3
- package/button-group/lib/button-group.module.d.ts +1 -2
- package/chips/lib/chips.component.d.ts +7 -11
- package/color-box/lib/color-box.component.d.ts +1 -5
- package/color-palette/lib/color-palette-picker.component.d.ts +14 -19
- package/color-palette/lib/color-palette.module.d.ts +1 -2
- package/common/lib/classes/styles.class.d.ts +4 -6
- package/common/lib/components/button-base-component.class.d.ts +1 -0
- package/conversation/lib/conversation-container/conversation-container.component.d.ts +3 -2
- package/conversation/lib/conversation-input/conversation-input.component.d.ts +2 -1
- package/datetime-picker/lib/datetime-picker.component.d.ts +10 -0
- package/datetime-picker/lib/datetime-picker.module.d.ts +1 -2
- package/decorators/index.d.ts +4 -5
- package/decorators/lib/decorators.module.d.ts +6 -7
- package/dialog/lib/dialog.component.d.ts +0 -2
- package/dropdown-button/lib/dropdown-button.component.d.ts +1 -1
- package/fesm2022/acorex-components-action-sheet.mjs +4 -4
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-alert.mjs +4 -4
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-audio-wave.mjs +5 -5
- package/fesm2022/acorex-components-audio-wave.mjs.map +1 -1
- package/fesm2022/acorex-components-avatar.mjs +4 -4
- package/fesm2022/acorex-components-avatar.mjs.map +1 -1
- package/fesm2022/acorex-components-badge.mjs +6 -6
- package/fesm2022/acorex-components-badge.mjs.map +1 -1
- package/fesm2022/acorex-components-bottom-navigation.mjs +3 -3
- package/fesm2022/acorex-components-bottom-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-breadcrumbs.mjs +3 -3
- package/fesm2022/acorex-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/acorex-components-button-group.mjs +146 -147
- package/fesm2022/acorex-components-button-group.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs +22 -19
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-calendar.mjs +5 -5
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-check-box.mjs +3 -3
- package/fesm2022/acorex-components-check-box.mjs.map +1 -1
- package/fesm2022/acorex-components-chips.mjs +10 -12
- package/fesm2022/acorex-components-chips.mjs.map +1 -1
- package/fesm2022/acorex-components-circular-progress.mjs +7 -7
- package/fesm2022/acorex-components-circular-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-collapse.mjs +4 -4
- package/fesm2022/acorex-components-collapse.mjs.map +1 -1
- package/fesm2022/acorex-components-color-box.mjs +4 -11
- package/fesm2022/acorex-components-color-box.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +326 -342
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-comment.mjs +9 -9
- package/fesm2022/acorex-components-comment.mjs.map +1 -1
- package/fesm2022/acorex-components-common.mjs +7 -22
- package/fesm2022/acorex-components-common.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation.mjs +50 -29
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-cron-job.mjs +3 -3
- package/fesm2022/acorex-components-cron-job.mjs.map +1 -1
- package/fesm2022/acorex-components-data-pager.mjs +7 -7
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +5 -5
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +4 -3
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs +3 -3
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +24 -18
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs +18 -30
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +4 -11
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer.mjs +5 -5
- package/fesm2022/acorex-components-drawer.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown-button.mjs +13 -7
- package/fesm2022/acorex-components-dropdown-button.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown.mjs +2 -2
- package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
- package/fesm2022/acorex-components-file-explorer.mjs +231 -0
- package/fesm2022/acorex-components-file-explorer.mjs.map +1 -0
- package/fesm2022/acorex-components-form.mjs +4 -11
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-grid-layout-builder.mjs +200 -22
- package/fesm2022/acorex-components-grid-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-image-editor.mjs +57 -42
- package/fesm2022/acorex-components-image-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-image.mjs +3 -3
- package/fesm2022/acorex-components-image.mjs.map +1 -1
- package/fesm2022/acorex-components-json-viewer.mjs +3 -3
- package/fesm2022/acorex-components-json-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-label.mjs +3 -3
- package/fesm2022/acorex-components-label.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs +3 -3
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-loading-dialog.mjs +3 -3
- package/fesm2022/acorex-components-loading-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-loading.mjs +5 -5
- package/fesm2022/acorex-components-loading.mjs.map +1 -1
- package/fesm2022/acorex-components-map.mjs +1 -1
- package/fesm2022/acorex-components-media-viewer.mjs +5 -5
- package/fesm2022/acorex-components-media-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +9 -9
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-navbar.mjs +4 -4
- package/fesm2022/acorex-components-navbar.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs +5 -5
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box.mjs +7 -3
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-otp.mjs +3 -3
- package/fesm2022/acorex-components-otp.mjs.map +1 -1
- package/fesm2022/acorex-components-page.mjs +1 -1
- package/fesm2022/acorex-components-paint.mjs +11 -11
- package/fesm2022/acorex-components-paint.mjs.map +1 -1
- package/fesm2022/acorex-components-password-box.mjs +5 -5
- package/fesm2022/acorex-components-password-box.mjs.map +1 -1
- package/fesm2022/acorex-components-pdf-reader.mjs +1 -1
- package/fesm2022/acorex-components-phone-box.mjs +3 -3
- package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
- package/fesm2022/acorex-components-picker.mjs +233 -128
- package/fesm2022/acorex-components-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-popover.mjs +1 -1
- package/fesm2022/acorex-components-popup.mjs +3 -3
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-progress-bar.mjs +23 -23
- package/fesm2022/acorex-components-progress-bar.mjs.map +1 -1
- package/fesm2022/acorex-components-qrcode.mjs +1 -1
- package/fesm2022/acorex-components-radio.mjs +1 -1
- package/fesm2022/acorex-components-rail-navigation.mjs +4 -4
- package/fesm2022/acorex-components-rail-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +4 -4
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-rate-picker.mjs +7 -7
- package/fesm2022/acorex-components-rate-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-result.mjs +3 -3
- package/fesm2022/acorex-components-result.mjs.map +1 -1
- package/fesm2022/acorex-components-routing-progress.mjs +3 -3
- package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler.mjs +12 -12
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-search-box.mjs +11 -20
- package/fesm2022/acorex-components-search-box.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +3 -4
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs +142 -28
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs +18 -9
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-skeleton.mjs +3 -3
- package/fesm2022/acorex-components-skeleton.mjs.map +1 -1
- package/fesm2022/acorex-components-slider.mjs +3 -3
- package/fesm2022/acorex-components-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-step-wizard.mjs +3 -3
- package/fesm2022/acorex-components-step-wizard.mjs.map +1 -1
- package/fesm2022/acorex-components-switch.mjs +4 -9
- package/fesm2022/acorex-components-switch.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs +6 -6
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/fesm2022/acorex-components-tag.mjs +4 -4
- package/fesm2022/acorex-components-tag.mjs.map +1 -1
- package/fesm2022/acorex-components-text-area.mjs +4 -7
- package/fesm2022/acorex-components-text-area.mjs.map +1 -1
- package/fesm2022/acorex-components-text-box.mjs +3 -3
- package/fesm2022/acorex-components-text-box.mjs.map +1 -1
- package/fesm2022/acorex-components-time-line.mjs +9 -9
- package/fesm2022/acorex-components-time-line.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +5 -5
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-toolbar.mjs +12 -3
- package/fesm2022/acorex-components-toolbar.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs +3 -3
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-components-tree-view.mjs +37 -68
- package/fesm2022/acorex-components-tree-view.mjs.map +1 -1
- package/fesm2022/acorex-components-uploader.mjs +8 -8
- package/fesm2022/acorex-components-uploader.mjs.map +1 -1
- package/fesm2022/acorex-components-video-player.mjs +1 -1
- package/fesm2022/acorex-components-wysiwyg.mjs +26 -26
- package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
- package/file-explorer/README.md +3 -0
- package/file-explorer/index.d.ts +6 -0
- package/file-explorer/lib/file-explorer-container/file-explorer-container.component.d.ts +10 -0
- package/file-explorer/lib/file-explorer-item/file-explorer-item.component.d.ts +11 -0
- package/file-explorer/lib/file-explorer-types.d.ts +11 -0
- package/file-explorer/lib/file-explorer-view/file-explorer-view.component.d.ts +27 -0
- package/file-explorer/lib/file-explorer.module.d.ts +16 -0
- package/file-explorer/lib/file-explorer.service.d.ts +6 -0
- package/form/lib/form.component.d.ts +2 -3
- package/grid-layout-builder/index.d.ts +1 -0
- package/grid-layout-builder/lib/grid-layout-builder.module.d.ts +3 -2
- package/grid-layout-builder/lib/grid-layout-container.component.d.ts +14 -10
- package/grid-layout-builder/lib/grid-layout-widget.directive.d.ts +106 -0
- package/grid-layout-builder/lib/types.d.ts +2 -1
- package/image-editor/index.d.ts +1 -0
- package/image-editor/lib/image-editor-container/image-editor-container.component.d.ts +3 -22
- package/image-editor/lib/image-editor-toolbar/image-editor-toolbar.component.d.ts +27 -0
- package/image-editor/lib/image-editor.module.d.ts +17 -16
- package/loading/lib/loading-spinner.component.d.ts +1 -1
- package/menu/lib/menu-item.component.d.ts +1 -2
- package/notification/lib/notification.service.d.ts +1 -1
- package/package.json +5 -1
- package/paint/lib/paint/paint-view/paint-view.component.d.ts +1 -1
- package/picker/index.d.ts +2 -3
- package/picker/lib/picker-column.directive.d.ts +16 -0
- package/picker/lib/picker.component.d.ts +61 -0
- package/picker/lib/picker.module.d.ts +4 -6
- package/progress-bar/lib/progress-bar.component.d.ts +19 -19
- package/range-slider/lib/range-slider.component.d.ts +1 -1
- package/scheduler/lib/scheduler-month-view.component.d.ts +6 -6
- package/search-box/lib/search-box.component.d.ts +1 -5
- package/selection-list/README.md +2 -2
- package/selection-list/lib/selection-list.component.d.ts +70 -18
- package/selection-list/lib/selection-list.module.d.ts +7 -3
- package/side-menu/lib/side-menu-item/side-menu-item.component.d.ts +6 -3
- package/side-menu/lib/side-menu.component.d.ts +2 -1
- package/tabs/lib/tabs.class.d.ts +1 -1
- package/text-area/lib/text-area.component.d.ts +1 -5
- package/time-line/lib/time-line.component.d.ts +1 -1
- package/toast/lib/toast.service.d.ts +1 -1
- package/toolbar/lib/toolbar.component.d.ts +3 -1
- package/tree-view/lib/tree-view.class.d.ts +1 -0
- package/tree-view/lib/tree-view.component.d.ts +1 -7
- package/wysiwyg/lib/wysiwyg/wysiwyg-container/wysiwyg-container.component.d.ts +2 -2
- package/decorators/lib/components/color-indicator/color-indicator.component.d.ts +0 -6
- package/picker/lib/picker-container/picker-container.component.d.ts +0 -7
- package/picker/lib/picker-items/picker-items.component.d.ts +0 -20
- package/picker/lib/picker-title/picker-title.component.d.ts +0 -5
- /package/decorators/lib/components/{clear-button/clear-button.component.d.ts → clear-button.component.d.ts} +0 -0
- /package/decorators/lib/components/{close-button/close-button.component.d.ts → close-button.component.d.ts} +0 -0
- /package/decorators/lib/components/{full-screen/full-screen-button.component.d.ts → full-screen-button.component.d.ts} +0 -0
- /package/decorators/lib/components/{icon/icon.component.d.ts → icon.component.d.ts} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-toast.mjs","sources":["../../../../libs/components/toast/src/lib/toast.config.ts","../../../../libs/components/toast/src/lib/toast.service.ts","../../../../libs/components/toast/src/lib/toast.component.ts","../../../../libs/components/toast/src/lib/toast.component.html","../../../../libs/components/toast/src/lib/toast.module.ts","../../../../libs/components/toast/src/acorex-components-toast.ts"],"sourcesContent":["import { AXLocation } from '@acorex/components/common';\nimport { AX_GLOBAL_CONFIG } from '@acorex/core/config';\nimport { InjectionToken, inject } from '@angular/core';\nimport { set } from 'lodash-es';\n\nexport interface AXToastConfig {\n gap: number;\n timeOut: number;\n timeOutProgress: boolean;\n location: AXLocation;\n limit: number;\n}\n\nexport const AX_TOAST_CONFIG = new InjectionToken<AXToastConfig>('AX_TOAST_CONFIG', {\n providedIn: 'root',\n factory: () => {\n const global = inject(AX_GLOBAL_CONFIG);\n set(global, 'layout.toast', AX_TOAST_CONFIG);\n return AXToastDefaultConfig;\n },\n});\n\nexport const AXToastDefaultConfig: AXToastConfig = {\n gap: 5,\n timeOut: 2500,\n timeOutProgress: true,\n location: 'bottom-center',\n limit: 3,\n};\n\nexport type PartialToastConfig = Partial<AXToastConfig>;\n\nexport function toastConfig(config: PartialToastConfig = {}): AXToastConfig {\n const result = {\n ...AXToastDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { AXLocation, AXStyleColorType } from '@acorex/components/common';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { Dialog } from '@angular/cdk/dialog';\nimport { GlobalPositionStrategy, ScrollStrategy, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { Injectable, inject, signal } from '@angular/core';\nimport { AXToastData, AXToastDisplayConfig, AXToastRef } from './toast.class';\nimport { AXToastComponent } from './toast.component';\nimport { AXToastConfig, AX_TOAST_CONFIG } from './toast.config';\n\ntype AXReservedToasts = {\n config: AXToastDisplayConfig;\n reservedRef: {\n close: () => void;\n };\n};\ntype AXMoreToastsConfig = {\n timeOut?: number;\n timeOutProgress?: boolean;\n color: AXStyleColorType;\n location: AXLocation;\n};\n\n@Injectable()\nexport class AXToastService {\n private dialog: Dialog = inject(Dialog);\n private defaultConfig: AXToastConfig = inject(AX_TOAST_CONFIG);\n private translationService: AXTranslationService = inject(AXTranslationService);\n\n private reserveCounter = signal(0);\n private activeToasts = signal<string[]>([]);\n private reservedToasts = signal<AXReservedToasts[]>([]);\n private toastCounterElement = signal<AXToastComponent | null>(null);\n private moreToastsConfig = signal<AXMoreToastsConfig>({ color: 'primary', location: 'bottom-center' });\n\n scrollStrategy: ScrollStrategy;\n\n constructor(private readonly scrollStrategyOptions: ScrollStrategyOptions) {\n this.scrollStrategy = this.scrollStrategyOptions.noop();\n }\n\n primary(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'primary',\n content: content,\n });\n }\n secondary(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'secondary',\n content: content,\n });\n }\n success(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'success',\n content: content,\n });\n }\n warning(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'warning',\n content: content,\n });\n }\n danger(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'danger',\n content: content,\n });\n }\n\n show(config: AXToastDisplayConfig): AXToastRef {\n config = { ...this.defaultConfig, ...config };\n\n this.moreToastsConfig.set({\n color: config.color,\n location: config.location,\n timeOut: config.timeOut,\n timeOutProgress: config.timeOutProgress,\n });\n\n if (this.defaultConfig.limit > 0 && this.activeToasts().length >= this.defaultConfig.limit) {\n const reservedRef = {\n close: () => {\n console.warn('Reserved notification cannot be closed until it is displayed.');\n },\n };\n this.reservedToasts.update((prev) => [...prev, { config, reservedRef }]);\n this.handleReservedToastCounter();\n return reservedRef;\n }\n\n return this.displayToast(config);\n }\n\n private displayToast(config: AXToastDisplayConfig): AXToastRef {\n const gap = this.defaultConfig.gap;\n const pos = this.getPosition(config.location) + gap + 'px';\n const positionStrategy = this.getPositionStrategy(\n new GlobalPositionStrategy(),\n config.location,\n pos,\n gap,\n );\n const dialogRef = this.dialog.open(AXToastComponent, {\n data: config,\n autoFocus: '__no_element__',\n restoreFocus: true,\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,\n scrollStrategy: this.scrollStrategy,\n });\n\n this.activeToasts.update((prev) => [...prev, dialogRef.id]);\n this.handleReservedToastCounter();\n\n const toastRef = dialogRef.componentInstance as AXToastComponent;\n dialogRef.closed.subscribe(() => {\n this.activeToasts.set(this.activeToasts().filter((id) => id !== dialogRef.id));\n\n this.handleShowReservedToast();\n this.handleReservedToastCounter();\n\n setTimeout(() => {\n this.reposition(config.location, gap);\n });\n });\n\n return {\n close: () => {\n toastRef.close();\n },\n };\n }\n\n hideAll() {\n this.reserveCounter.set(0);\n this.reservedToasts.set([]);\n this.activeToasts.set([]);\n this.dialog.closeAll();\n this.handleReservedToastCounter();\n }\n\n private handleShowReservedToast() {\n if (this.activeToasts().length > this.defaultConfig.limit - 1) return;\n if (!this.reservedToasts().length) return;\n\n const { config, reservedRef } = this.reservedToasts().shift();\n\n const displayedRef = this.displayToast(config);\n this.handleReservedToastCounter();\n reservedRef.close = displayedRef.close;\n }\n\n private handleReservedToastCounter() {\n const reservedCount = this.reservedToasts().length;\n\n if (reservedCount === this.reserveCounter()) return;\n\n this.reserveCounter.set(reservedCount);\n\n if (reservedCount === 0 && this.toastCounterElement() !== null) {\n this.toastCounterElement().close();\n return;\n }\n\n if (reservedCount > 0) {\n if (this.toastCounterElement() !== null) {\n this.toastCounterElement().close();\n }\n const remainingTime = (\n this.dialog.getDialogById(this.activeToasts()[0]).componentRef.instance as AXToastComponent\n ).createdDate();\n\n this.createReservedCounterToast(remainingTime);\n }\n }\n\n private async createReservedCounterToast(remainingTime: number) {\n const timeOut = Math.min(\n this.moreToastsConfig().timeOut - (new Date().getTime() - remainingTime),\n this.moreToastsConfig().timeOut,\n );\n const opt: AXToastData = {\n closeButton: false,\n color: this.moreToastsConfig().color,\n location: this.moreToastsConfig().location,\n title: await this.translationService.translateAsync('more-toast', {\n params: { number: this.reserveCounter() },\n }),\n timeOut,\n timeOutProgress: this.moreToastsConfig().timeOutProgress,\n closeAllButton: true,\n };\n const gap = this.defaultConfig.gap;\n const pos = this.getPosition(opt.location) + gap + 'px';\n const positionStrategy = this.getPositionStrategy(new GlobalPositionStrategy(), opt.location, pos, gap);\n const dialogRef = this.dialog.open(AXToastComponent, {\n data: opt,\n autoFocus: '__no_element__',\n restoreFocus: true,\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,\n scrollStrategy: this.scrollStrategy,\n });\n this.toastCounterElement.set(dialogRef.componentInstance as AXToastComponent);\n }\n\n private reposition(toastLocation: AXLocation, gap: number): void {\n const list = this.dialog.openDialogs\n .map((c) => c.componentInstance as AXToastComponent)\n .filter((c) => c.config?.location == toastLocation);\n\n list.forEach((element, index) => {\n const pos = this.getRepositionPosition(index, gap, list, toastLocation);\n\n this.getPositionStrategy(\n element.dialogRef.config.positionStrategy as GlobalPositionStrategy,\n toastLocation,\n pos,\n gap,\n ).apply();\n });\n }\n\n private getRepositionPosition(index: number, gap: number, list: AXToastComponent[], toastLocation: string) {\n if (index === 0) return gap + 'px';\n const previouseElement = list[index - 1];\n if (toastLocation.split('-')[0] == 'bottom') {\n return window.innerHeight - previouseElement.getHostElement().offsetTop + gap + 'px';\n }\n return (\n previouseElement.getHostElement().offsetTop +\n previouseElement.getHostElement().offsetHeight +\n gap +\n 'px'\n );\n }\n\n private getPosition(location: string) {\n const list = this.dialog.openDialogs\n .map((c) => c.componentInstance as AXToastComponent)\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 }\n return (\n list[list.length - 1].getHostElement().offsetTop + list[list.length - 1].getHostElement().offsetHeight\n );\n }\n\n private getPositionStrategy(\n positionStrategy: GlobalPositionStrategy,\n location: AXLocation,\n pos: string,\n gap: number,\n ) {\n switch (location) {\n case 'bottom-center':\n return positionStrategy.bottom(pos).centerHorizontally();\n break;\n case 'bottom-end':\n return positionStrategy.bottom(pos).right(gap + 'px');\n break;\n case 'bottom-start':\n return positionStrategy.bottom(pos).left(gap + 'px');\n break;\n case 'top-center':\n return positionStrategy.top(pos).centerHorizontally();\n break;\n case 'top-end':\n return positionStrategy.top(pos).right(gap + 'px');\n break;\n case 'top-start':\n return positionStrategy.top(pos).left(gap + 'px');\n break;\n case 'center-start':\n return positionStrategy.centerVertically().left(gap + 'px');\n break;\n case 'center-end':\n return positionStrategy.centerVertically().right(gap + 'px');\n break;\n }\n }\n}\n","import { AXButtonItem } from '@acorex/components/button';\nimport { AXClosbaleComponent, AXComponentCloseEvent, MXBaseComponent } from '@acorex/components/common';\nimport { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog';\nimport {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n inject,\n Inject,\n OnInit,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXToastData } from './toast.class';\nimport { AXToastService } from './toast.service';\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-toast',\n templateUrl: './toast.component.html',\n styleUrls: ['./toast.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: AXClosbaleComponent, useExisting: AXToastComponent }],\n standalone: false,\n})\nexport class AXToastComponent extends MXBaseComponent implements OnInit {\n toastService = inject(AXToastService);\n createdDate = signal(0);\n\n /** @ignore */\n protected _toastWidth = 100;\n\n /** @ignore */\n protected _icon: string;\n\n /**\n * @ignore\n */\n constructor(\n @Inject(DIALOG_DATA)\n public config: AXToastData,\n public dialogRef: DialogRef<AXComponentCloseEvent>,\n ) {\n super();\n }\n\n /** @ignore */\n override ngOnInit() {\n super.ngOnInit();\n if (this.config.timeOut) {\n this.createdDate.set(new Date().getTime());\n setTimeout(() => {\n this.close();\n }, this.config.timeOut);\n }\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 'warning':\n this._icon = 'ax-icon ax-icon-warning';\n break;\n case 'danger':\n this._icon = 'ax-icon ax-icon-error';\n break;\n default:\n this._icon = this.config.icon || 'ax-icon ax-icon-info';\n break;\n }\n } else {\n this._icon = this.config.icon;\n }\n }\n\n /** @ignore */\n _handleButtonClick(button: AXButtonItem) {\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 /** @ignore */\n close() {\n this.dialogRef.close({\n component: this,\n htmlElement: this.getHostElement(),\n });\n }\n\n closeAll() {\n this.toastService.hideAll();\n }\n}\n","<span class=\"ax-toast-icon ax-icon-solid {{ _icon }}\"></span>\n<div class=\"ax-toast-content\">\n <div class=\"ax-toast-title\" [class.ax-mb-2]=\"config.title && config.content\">\n {{ config.title | translate | async }}\n </div>\n <div class=\"ax-toast-content\" [innerHTML]=\"config.content\"></div>\n</div>\n@if (config.closeButton) {\n <ax-close-button></ax-close-button>\n} @else if (config.closeAllButton) {\n <ax-close-button [closeAll]=\"true\"></ax-close-button>\n}\n@if (config.timeOutProgress && config.timeOut) {\n <div class=\"ax-toast-progress\" [style.animation-duration.ms]=\"config.timeOut\"></div>\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 { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXToastComponent } from './toast.component';\nimport { AXToastService } from './toast.service';\n\nconst COMPONENT = [AXToastComponent];\nconst MODULES = [CommonModule, AXButtonModule, AXDecoratorModule, AXLoadingModule, DialogModule, AXTranslationModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [AXToastService],\n})\nexport class AXToastModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"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cAAc,CAAC,YAFd,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAIT,aAAa,EAAA,UAAA,EAAA,CAAA;kBANzB,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,cAAc,CAAC;AAC5B,iBAAA;;;AClBD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-toast.mjs","sources":["../../../../libs/components/toast/src/lib/toast.config.ts","../../../../libs/components/toast/src/lib/toast.service.ts","../../../../libs/components/toast/src/lib/toast.component.ts","../../../../libs/components/toast/src/lib/toast.component.html","../../../../libs/components/toast/src/lib/toast.module.ts","../../../../libs/components/toast/src/acorex-components-toast.ts"],"sourcesContent":["import { AXLocation } from '@acorex/components/common';\nimport { AX_GLOBAL_CONFIG } from '@acorex/core/config';\nimport { InjectionToken, inject } from '@angular/core';\nimport { set } from 'lodash-es';\n\nexport interface AXToastConfig {\n gap: number;\n timeOut: number;\n timeOutProgress: boolean;\n location: AXLocation;\n limit: number;\n}\n\nexport const AX_TOAST_CONFIG = new InjectionToken<AXToastConfig>('AX_TOAST_CONFIG', {\n providedIn: 'root',\n factory: () => {\n const global = inject(AX_GLOBAL_CONFIG);\n set(global, 'layout.toast', AX_TOAST_CONFIG);\n return AXToastDefaultConfig;\n },\n});\n\nexport const AXToastDefaultConfig: AXToastConfig = {\n gap: 5,\n timeOut: 2500,\n timeOutProgress: true,\n location: 'bottom-center',\n limit: 3,\n};\n\nexport type PartialToastConfig = Partial<AXToastConfig>;\n\nexport function toastConfig(config: PartialToastConfig = {}): AXToastConfig {\n const result = {\n ...AXToastDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { AXLocation, AXStyleColorType } from '@acorex/components/common';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { Dialog } from '@angular/cdk/dialog';\nimport { GlobalPositionStrategy, ScrollStrategy, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { Injectable, inject, signal } from '@angular/core';\nimport { AXToastData, AXToastDisplayConfig, AXToastRef } from './toast.class';\nimport { AXToastComponent } from './toast.component';\nimport { AXToastConfig, AX_TOAST_CONFIG } from './toast.config';\n\ntype AXReservedToasts = {\n config: AXToastDisplayConfig;\n reservedRef: {\n close: () => void;\n };\n};\ntype AXMoreToastsConfig = {\n timeOut?: number;\n timeOutProgress?: boolean;\n color: AXStyleColorType;\n location: AXLocation;\n};\n\n@Injectable()\nexport class AXToastService {\n private dialog: Dialog = inject(Dialog);\n private defaultConfig: AXToastConfig = inject(AX_TOAST_CONFIG);\n private translationService: AXTranslationService = inject(AXTranslationService);\n\n private reserveCounter = signal(0);\n private activeToasts = signal<string[]>([]);\n private reservedToasts = signal<AXReservedToasts[]>([]);\n private toastCounterElement = signal<AXToastComponent | null>(null);\n private moreToastsConfig = signal<AXMoreToastsConfig>({ color: 'primary', location: 'bottom-center' });\n\n scrollStrategy: ScrollStrategy;\n\n constructor(private readonly scrollStrategyOptions: ScrollStrategyOptions) {\n this.scrollStrategy = this.scrollStrategyOptions.noop();\n }\n\n primary(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'primary',\n content: content,\n });\n }\n neutral(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'neutral',\n content: content,\n });\n }\n success(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'success',\n content: content,\n });\n }\n warning(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'warning',\n content: content,\n });\n }\n danger(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'danger',\n content: content,\n });\n }\n\n show(config: AXToastDisplayConfig): AXToastRef {\n config = { ...this.defaultConfig, ...config };\n\n this.moreToastsConfig.set({\n color: config.color,\n location: config.location,\n timeOut: config.timeOut,\n timeOutProgress: config.timeOutProgress,\n });\n\n if (this.defaultConfig.limit > 0 && this.activeToasts().length >= this.defaultConfig.limit) {\n const reservedRef = {\n close: () => {\n console.warn('Reserved notification cannot be closed until it is displayed.');\n },\n };\n this.reservedToasts.update((prev) => [...prev, { config, reservedRef }]);\n this.handleReservedToastCounter();\n return reservedRef;\n }\n\n return this.displayToast(config);\n }\n\n private displayToast(config: AXToastDisplayConfig): AXToastRef {\n const gap = this.defaultConfig.gap;\n const pos = this.getPosition(config.location) + gap + 'px';\n const positionStrategy = this.getPositionStrategy(\n new GlobalPositionStrategy(),\n config.location,\n pos,\n gap,\n );\n const dialogRef = this.dialog.open(AXToastComponent, {\n data: config,\n autoFocus: '__no_element__',\n restoreFocus: true,\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,\n scrollStrategy: this.scrollStrategy,\n });\n\n this.activeToasts.update((prev) => [...prev, dialogRef.id]);\n this.handleReservedToastCounter();\n\n const toastRef = dialogRef.componentInstance as AXToastComponent;\n dialogRef.closed.subscribe(() => {\n this.activeToasts.set(this.activeToasts().filter((id) => id !== dialogRef.id));\n\n this.handleShowReservedToast();\n this.handleReservedToastCounter();\n\n setTimeout(() => {\n this.reposition(config.location, gap);\n });\n });\n\n return {\n close: () => {\n toastRef.close();\n },\n };\n }\n\n hideAll() {\n this.reserveCounter.set(0);\n this.reservedToasts.set([]);\n this.activeToasts.set([]);\n this.dialog.closeAll();\n this.handleReservedToastCounter();\n }\n\n private handleShowReservedToast() {\n if (this.activeToasts().length > this.defaultConfig.limit - 1) return;\n if (!this.reservedToasts().length) return;\n\n const { config, reservedRef } = this.reservedToasts().shift();\n\n const displayedRef = this.displayToast(config);\n this.handleReservedToastCounter();\n reservedRef.close = displayedRef.close;\n }\n\n private handleReservedToastCounter() {\n const reservedCount = this.reservedToasts().length;\n\n if (reservedCount === this.reserveCounter()) return;\n\n this.reserveCounter.set(reservedCount);\n\n if (reservedCount === 0 && this.toastCounterElement() !== null) {\n this.toastCounterElement().close();\n return;\n }\n\n if (reservedCount > 0) {\n if (this.toastCounterElement() !== null) {\n this.toastCounterElement().close();\n }\n const remainingTime = (\n this.dialog.getDialogById(this.activeToasts()[0]).componentRef.instance as AXToastComponent\n ).createdDate();\n\n this.createReservedCounterToast(remainingTime);\n }\n }\n\n private async createReservedCounterToast(remainingTime: number) {\n const timeOut = Math.min(\n this.moreToastsConfig().timeOut - (new Date().getTime() - remainingTime),\n this.moreToastsConfig().timeOut,\n );\n const opt: AXToastData = {\n closeButton: false,\n color: this.moreToastsConfig().color,\n location: this.moreToastsConfig().location,\n title: await this.translationService.translateAsync('more-toast', {\n params: { number: this.reserveCounter() },\n }),\n timeOut,\n timeOutProgress: this.moreToastsConfig().timeOutProgress,\n closeAllButton: true,\n };\n const gap = this.defaultConfig.gap;\n const pos = this.getPosition(opt.location) + gap + 'px';\n const positionStrategy = this.getPositionStrategy(new GlobalPositionStrategy(), opt.location, pos, gap);\n const dialogRef = this.dialog.open(AXToastComponent, {\n data: opt,\n autoFocus: '__no_element__',\n restoreFocus: true,\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,\n scrollStrategy: this.scrollStrategy,\n });\n this.toastCounterElement.set(dialogRef.componentInstance as AXToastComponent);\n }\n\n private reposition(toastLocation: AXLocation, gap: number): void {\n const list = this.dialog.openDialogs\n .map((c) => c.componentInstance as AXToastComponent)\n .filter((c) => c.config?.location == toastLocation);\n\n list.forEach((element, index) => {\n const pos = this.getRepositionPosition(index, gap, list, toastLocation);\n\n this.getPositionStrategy(\n element.dialogRef.config.positionStrategy as GlobalPositionStrategy,\n toastLocation,\n pos,\n gap,\n ).apply();\n });\n }\n\n private getRepositionPosition(index: number, gap: number, list: AXToastComponent[], toastLocation: string) {\n if (index === 0) return gap + 'px';\n const previouseElement = list[index - 1];\n if (toastLocation.split('-')[0] == 'bottom') {\n return window.innerHeight - previouseElement.getHostElement().offsetTop + gap + 'px';\n }\n return (\n previouseElement.getHostElement().offsetTop +\n previouseElement.getHostElement().offsetHeight +\n gap +\n 'px'\n );\n }\n\n private getPosition(location: string) {\n const list = this.dialog.openDialogs\n .map((c) => c.componentInstance as AXToastComponent)\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 }\n return (\n list[list.length - 1].getHostElement().offsetTop + list[list.length - 1].getHostElement().offsetHeight\n );\n }\n\n private getPositionStrategy(\n positionStrategy: GlobalPositionStrategy,\n location: AXLocation,\n pos: string,\n gap: number,\n ) {\n switch (location) {\n case 'bottom-center':\n return positionStrategy.bottom(pos).centerHorizontally();\n break;\n case 'bottom-end':\n return positionStrategy.bottom(pos).right(gap + 'px');\n break;\n case 'bottom-start':\n return positionStrategy.bottom(pos).left(gap + 'px');\n break;\n case 'top-center':\n return positionStrategy.top(pos).centerHorizontally();\n break;\n case 'top-end':\n return positionStrategy.top(pos).right(gap + 'px');\n break;\n case 'top-start':\n return positionStrategy.top(pos).left(gap + 'px');\n break;\n case 'center-start':\n return positionStrategy.centerVertically().left(gap + 'px');\n break;\n case 'center-end':\n return positionStrategy.centerVertically().right(gap + 'px');\n break;\n }\n }\n}\n","import { AXButtonItem } from '@acorex/components/button';\nimport { AXClosbaleComponent, AXComponentCloseEvent, MXBaseComponent } from '@acorex/components/common';\nimport { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog';\nimport {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n inject,\n Inject,\n OnInit,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXToastData } from './toast.class';\nimport { AXToastService } from './toast.service';\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-toast',\n templateUrl: './toast.component.html',\n styleUrls: ['./toast.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: AXClosbaleComponent, useExisting: AXToastComponent }],\n standalone: false,\n})\nexport class AXToastComponent extends MXBaseComponent implements OnInit {\n toastService = inject(AXToastService);\n createdDate = signal(0);\n\n /** @ignore */\n protected _toastWidth = 100;\n\n /** @ignore */\n protected _icon: string;\n\n /**\n * @ignore\n */\n constructor(\n @Inject(DIALOG_DATA)\n public config: AXToastData,\n public dialogRef: DialogRef<AXComponentCloseEvent>,\n ) {\n super();\n }\n\n /** @ignore */\n override ngOnInit() {\n super.ngOnInit();\n if (this.config.timeOut) {\n this.createdDate.set(new Date().getTime());\n setTimeout(() => {\n this.close();\n }, this.config.timeOut);\n }\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 'warning':\n this._icon = 'ax-icon ax-icon-warning';\n break;\n case 'danger':\n this._icon = 'ax-icon ax-icon-error';\n break;\n default:\n this._icon = this.config.icon || 'ax-icon ax-icon-info';\n break;\n }\n } else {\n this._icon = this.config.icon;\n }\n }\n\n /** @ignore */\n _handleButtonClick(button: AXButtonItem) {\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 /** @ignore */\n close() {\n this.dialogRef.close({\n component: this,\n htmlElement: this.getHostElement(),\n });\n }\n\n closeAll() {\n this.toastService.hideAll();\n }\n}\n","<span class=\"ax-toast-icon ax-icon-solid {{ _icon }}\"></span>\n<div class=\"ax-toast-content\">\n <div class=\"ax-toast-title\" [class.ax-mb-2]=\"config.title && config.content\">\n {{ config.title | translate | async }}\n </div>\n <div class=\"ax-toast-content\" [innerHTML]=\"config.content\"></div>\n</div>\n@if (config.closeButton) {\n <ax-close-button></ax-close-button>\n} @else if (config.closeAllButton) {\n <ax-close-button [closeAll]=\"true\"></ax-close-button>\n}\n@if (config.timeOutProgress && config.timeOut) {\n <div class=\"ax-toast-progress\" [style.animation-duration.ms]=\"config.timeOut\"></div>\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 { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXToastComponent } from './toast.component';\nimport { AXToastService } from './toast.service';\n\nconst COMPONENT = [AXToastComponent];\nconst MODULES = [CommonModule, AXButtonModule, AXDecoratorModule, AXLoadingModule, DialogModule, AXTranslationModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [AXToastService],\n})\nexport class AXToastModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;MAaa,eAAe,GAAG,IAAI,cAAc,CAAgB,iBAAiB,EAAE;AAClF,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;AACZ,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACvC,QAAA,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,eAAe,CAAC;AAC5C,QAAA,OAAO,oBAAoB;KAC5B;AACF,CAAA;AAEY,MAAA,oBAAoB,GAAkB;AACjD,IAAA,GAAG,EAAE,CAAC;AACN,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,QAAQ,EAAE,eAAe;AACzB,IAAA,KAAK,EAAE,CAAC;;AAKM,SAAA,WAAW,CAAC,MAAA,GAA6B,EAAE,EAAA;AACzD,IAAA,MAAM,MAAM,GAAG;AACb,QAAA,GAA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AE,mBAAmB,CAAC;MAQxG,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAb,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,aAAa,EATP,YAAA,EAAA,CAAA,gBAAgB,CAClB,EAAA,OAAA,EAAA,CAAA,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,aADjG,gBAAgB,CAAA,EAAA,CAAA,CAAA;AAStB,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,aAAa,EAFb,SAAA,EAAA,CAAC,cAAc,CAAC,YAFd,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAIT,aAAa,EAAA,UAAA,EAAA,CAAA;kBANzB,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,cAAc,CAAC;AAC5B,iBAAA;;;AClBD;;AAEG;;;;"}
|
@@ -1,12 +1,15 @@
|
|
1
1
|
import { AXButtonComponent } from '@acorex/components/button';
|
2
2
|
import * as i1 from '@acorex/components/decorators';
|
3
3
|
import { AXDecoratorGenericComponent, AXDecoratorModule } from '@acorex/components/decorators';
|
4
|
+
import { AXTextBoxComponent } from '@acorex/components/text-box';
|
4
5
|
import * as i0 from '@angular/core';
|
5
|
-
import { contentChildren, signal, afterNextRender,
|
6
|
+
import { contentChildren, input, signal, afterNextRender, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
6
7
|
|
7
8
|
class AXToolBarComponent {
|
8
9
|
constructor() {
|
9
10
|
this.buttons = contentChildren(AXButtonComponent, { descendants: true });
|
11
|
+
this.textBox = contentChildren(AXTextBoxComponent, { descendants: true });
|
12
|
+
this.dividerState = input(true);
|
10
13
|
this.decorators = contentChildren(AXDecoratorGenericComponent);
|
11
14
|
this.prefixState = signal(false);
|
12
15
|
this.suffixState = signal(false);
|
@@ -27,6 +30,12 @@ class AXToolBarComponent {
|
|
27
30
|
if (this.buttons().length > 0) {
|
28
31
|
this.buttons().forEach((item) => {
|
29
32
|
item.look = 'blank';
|
33
|
+
item.getHostElement().classList.add('ax-sm');
|
34
|
+
});
|
35
|
+
}
|
36
|
+
if (this.textBox().length > 0) {
|
37
|
+
this.textBox().forEach((item) => {
|
38
|
+
item.getHostElement().classList.add('ax-sm');
|
30
39
|
});
|
31
40
|
}
|
32
41
|
});
|
@@ -36,11 +45,11 @@ class AXToolBarComponent {
|
|
36
45
|
return `ax-sm`;
|
37
46
|
}
|
38
47
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXToolBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
39
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXToolBarComponent, isStandalone: false, selector: "ax-toolbar", host: { properties: { "class": "this.__hostClass" } }, queries: [{ propertyName: "buttons", predicate: AXButtonComponent, descendants: true, isSignal: true }, { propertyName: "decorators", predicate: AXDecoratorGenericComponent, isSignal: true }], ngImport: i0, template: "<ng-content select=\"ax-prefix\"> </ng-content>\n@if (prefixState() && (contentState() || suffixState())) {\n <ax-divider></ax-divider>\n}\n\n<ng-content select=\"ax-content\"></ng-content>\n\n@if (contentState() && suffixState()) {\n <ax-divider></ax-divider>\n}\n\n<ng-content select=\"ax-suffix\"></ng-content>\n", styles: ["ax-toolbar{display:flex;align-items:center;
|
48
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXToolBarComponent, isStandalone: false, selector: "ax-toolbar", inputs: { dividerState: { classPropertyName: "dividerState", publicName: "dividerState", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.__hostClass" } }, queries: [{ propertyName: "buttons", predicate: AXButtonComponent, descendants: true, isSignal: true }, { propertyName: "textBox", predicate: AXTextBoxComponent, descendants: true, isSignal: true }, { propertyName: "decorators", predicate: AXDecoratorGenericComponent, isSignal: true }], ngImport: i0, template: "<ng-content select=\"ax-prefix\"> </ng-content>\n@if (prefixState() && (contentState() || suffixState()) && dividerState()) {\n <ax-divider></ax-divider>\n}\n\n<ng-content select=\"ax-content\"></ng-content>\n\n@if (contentState() && suffixState() && dividerState()) {\n <ax-divider></ax-divider>\n}\n\n<ng-content select=\"ax-suffix\"></ng-content>\n", styles: ["ax-toolbar{display:flex;align-items:center;flex-wrap:wrap;padding:.25rem;width:100%}ax-toolbar ax-divider{display:block;margin-inline:.5rem;width:1px;min-height:25px;background-color:rgba(var(--ax-color-border-default))}ax-toolbar ax-suffix,ax-toolbar ax-prefix,ax-toolbar ax-content{display:flex;justify-content:space-between;align-items:center;min-height:100%;flex-wrap:wrap}\n"], dependencies: [{ kind: "component", type: i1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
40
49
|
}
|
41
50
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXToolBarComponent, decorators: [{
|
42
51
|
type: Component,
|
43
|
-
args: [{ selector: 'ax-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: false, template: "<ng-content select=\"ax-prefix\"> </ng-content>\n@if (prefixState() && (contentState() || suffixState())) {\n <ax-divider></ax-divider>\n}\n\n<ng-content select=\"ax-content\"></ng-content>\n\n@if (contentState() && suffixState()) {\n <ax-divider></ax-divider>\n}\n\n<ng-content select=\"ax-suffix\"></ng-content>\n", styles: ["ax-toolbar{display:flex;align-items:center;
|
52
|
+
args: [{ selector: 'ax-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: false, template: "<ng-content select=\"ax-prefix\"> </ng-content>\n@if (prefixState() && (contentState() || suffixState()) && dividerState()) {\n <ax-divider></ax-divider>\n}\n\n<ng-content select=\"ax-content\"></ng-content>\n\n@if (contentState() && suffixState() && dividerState()) {\n <ax-divider></ax-divider>\n}\n\n<ng-content select=\"ax-suffix\"></ng-content>\n", styles: ["ax-toolbar{display:flex;align-items:center;flex-wrap:wrap;padding:.25rem;width:100%}ax-toolbar ax-divider{display:block;margin-inline:.5rem;width:1px;min-height:25px;background-color:rgba(var(--ax-color-border-default))}ax-toolbar ax-suffix,ax-toolbar ax-prefix,ax-toolbar ax-content{display:flex;justify-content:space-between;align-items:center;min-height:100%;flex-wrap:wrap}\n"] }]
|
44
53
|
}], propDecorators: { __hostClass: [{
|
45
54
|
type: HostBinding,
|
46
55
|
args: ['class']
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-toolbar.mjs","sources":["../../../../libs/components/toolbar/src/lib/toolbar.component.ts","../../../../libs/components/toolbar/src/lib/toolbar.component.html","../../../../libs/components/toolbar/src/lib/toolbar.module.ts","../../../../libs/components/toolbar/src/acorex-components-toolbar.ts"],"sourcesContent":["import { AXButtonComponent } from '@acorex/components/button';\nimport { AXDecoratorGenericComponent } from '@acorex/components/decorators';\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n contentChildren,\n HostBinding,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\n\n@Component({\n selector: 'ax-toolbar',\n templateUrl: './toolbar.component.html',\n styleUrls: ['./toolbar.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: false,\n})\nexport class AXToolBarComponent {\n private buttons = contentChildren(AXButtonComponent, { descendants: true });\n
|
1
|
+
{"version":3,"file":"acorex-components-toolbar.mjs","sources":["../../../../libs/components/toolbar/src/lib/toolbar.component.ts","../../../../libs/components/toolbar/src/lib/toolbar.component.html","../../../../libs/components/toolbar/src/lib/toolbar.module.ts","../../../../libs/components/toolbar/src/acorex-components-toolbar.ts"],"sourcesContent":["import { AXButtonComponent } from '@acorex/components/button';\nimport { AXDecoratorGenericComponent } from '@acorex/components/decorators';\nimport { AXTextBoxComponent } from '@acorex/components/text-box';\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n contentChildren,\n HostBinding,\n input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\n\n@Component({\n selector: 'ax-toolbar',\n templateUrl: './toolbar.component.html',\n styleUrls: ['./toolbar.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: false,\n})\nexport class AXToolBarComponent {\n private buttons = contentChildren(AXButtonComponent, { descendants: true });\n private textBox = contentChildren(AXTextBoxComponent, { descendants: true });\n dividerState = input(true);\n private decorators = contentChildren<AXDecoratorGenericComponent>(AXDecoratorGenericComponent);\n\n protected prefixState = signal(false);\n protected suffixState = signal(false);\n protected contentState = signal(false);\n\n #init = afterNextRender(() => {\n this.decorators().forEach((item) => {\n switch (item.getHostElement().tagName) {\n case 'AX-PREFIX':\n this.prefixState.set(true);\n break;\n case 'AX-SUFFIX':\n this.suffixState.set(true);\n break;\n case 'AX-CONTENT':\n this.contentState.set(true);\n }\n });\n\n if (this.buttons().length > 0) {\n this.buttons().forEach((item) => {\n item.look = 'blank';\n item.getHostElement().classList.add('ax-sm');\n });\n }\n if (this.textBox().length > 0) {\n this.textBox().forEach((item) => {\n item.getHostElement().classList.add('ax-sm');\n });\n }\n });\n\n @HostBinding('class')\n get __hostClass(): string {\n return `ax-sm`;\n }\n}\n","<ng-content select=\"ax-prefix\"> </ng-content>\n@if (prefixState() && (contentState() || suffixState()) && dividerState()) {\n <ax-divider></ax-divider>\n}\n\n<ng-content select=\"ax-content\"></ng-content>\n\n@if (contentState() && suffixState() && dividerState()) {\n <ax-divider></ax-divider>\n}\n\n<ng-content select=\"ax-suffix\"></ng-content>\n","import { AXDecoratorModule } from '@acorex/components/decorators';\nimport { NgModule } from '@angular/core';\nimport { AXToolBarComponent } from './toolbar.component';\n\nconst COMPONENT = [AXToolBarComponent];\n\nconst MODULES = [AXDecoratorModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXToolBarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAsBa,kBAAkB,CAAA;AAR/B,IAAA,WAAA,GAAA;QASU,IAAO,CAAA,OAAA,GAAG,eAAe,CAAC,iBAAiB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;QACnE,IAAO,CAAA,OAAA,GAAG,eAAe,CAAC,kBAAkB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AAC5E,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC;AAClB,QAAA,IAAA,CAAA,UAAU,GAAG,eAAe,CAA8B,2BAA2B,CAAC;AAEpF,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC;AAC3B,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC;AAC3B,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC;AAEtC,QAAA,IAAA,CAA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A,EAAA,IAAA,EAAA,eAAe,EAVT,YAAA,EAAA,CAAA,kBAAkB,CAEpB,EAAA,OAAA,EAAA,CAAA,iBAAiB,aAFf,kBAAkB,CAAA,EAAA,CAAA,CAAA;AAUxB,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,eAAe,YAJb,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAIT,eAAe,EAAA,UAAA,EAAA,CAAA;kBAN3B,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,6 +1,6 @@
|
|
1
1
|
import { MXBaseComponent, convertToPlacement } from '@acorex/components/common';
|
2
2
|
import * as i0 from '@angular/core';
|
3
|
-
import {
|
3
|
+
import { Input, ViewEncapsulation, Component, TemplateRef, Directive, NgModule } from '@angular/core';
|
4
4
|
import { AXPopoverComponent } from '@acorex/components/popover';
|
5
5
|
import { OverlayModule } from '@angular/cdk/overlay';
|
6
6
|
import { CommonModule } from '@angular/common';
|
@@ -11,11 +11,11 @@ import { CommonModule } from '@angular/common';
|
|
11
11
|
*/
|
12
12
|
class AXTooltipComponent extends MXBaseComponent {
|
13
13
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXTooltipComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
14
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: AXTooltipComponent, isStandalone: false, selector: "ax-tooltip", inputs: { text: "text", position: "position" }, usesInheritance: true, ngImport: i0, template: "<div class=\"ax-tooltip-container\">\n <div class=\"ax-tooltip\">\n {{ text }}\n </div>\n <!-- <div class=\"ax-tooltip-tringle ax-tooltip-tringle-{{ position }}\"></div> -->\n</div>", styles: ["ax-tooltip{--ax-
|
14
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: AXTooltipComponent, isStandalone: false, selector: "ax-tooltip", inputs: { text: "text", position: "position" }, usesInheritance: true, ngImport: i0, template: "<div class=\"ax-tooltip-container\">\n <div class=\"ax-tooltip\">\n {{ text }}\n </div>\n <!-- <div class=\"ax-tooltip-tringle ax-tooltip-tringle-{{ position }}\"></div> -->\n</div>", styles: [".ax-dark .ax-tooltip-container{--ax-tooltip-background: 255, 255, 255;--ax-tooltip-color: 97, 97, 97}.ax-tooltip-container{position:relative;--ax-tooltip-background: 97, 97, 97;--ax-tooltip-color: 255, 255, 255}.ax-tooltip-container .ax-tooltip{display:block;padding:.25rem .5rem;background-color:rgba(var(--ax-tooltip-background));color:rgba(var(--ax-tooltip-color));border-radius:.25rem;font-size:.75rem;font-weight:400}\n"], encapsulation: i0.ViewEncapsulation.None }); }
|
15
15
|
}
|
16
16
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXTooltipComponent, decorators: [{
|
17
17
|
type: Component,
|
18
|
-
args: [{ selector: 'ax-tooltip', encapsulation: ViewEncapsulation.None, standalone: false, template: "<div class=\"ax-tooltip-container\">\n <div class=\"ax-tooltip\">\n {{ text }}\n </div>\n <!-- <div class=\"ax-tooltip-tringle ax-tooltip-tringle-{{ position }}\"></div> -->\n</div>", styles: ["ax-tooltip{--ax-
|
18
|
+
args: [{ selector: 'ax-tooltip', encapsulation: ViewEncapsulation.None, standalone: false, template: "<div class=\"ax-tooltip-container\">\n <div class=\"ax-tooltip\">\n {{ text }}\n </div>\n <!-- <div class=\"ax-tooltip-tringle ax-tooltip-tringle-{{ position }}\"></div> -->\n</div>", styles: [".ax-dark .ax-tooltip-container{--ax-tooltip-background: 255, 255, 255;--ax-tooltip-color: 97, 97, 97}.ax-tooltip-container{position:relative;--ax-tooltip-background: 97, 97, 97;--ax-tooltip-color: 255, 255, 255}.ax-tooltip-container .ax-tooltip{display:block;padding:.25rem .5rem;background-color:rgba(var(--ax-tooltip-background));color:rgba(var(--ax-tooltip-color));border-radius:.25rem;font-size:.75rem;font-weight:400}\n"] }]
|
19
19
|
}], propDecorators: { text: [{
|
20
20
|
type: Input
|
21
21
|
}], position: [{
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-tooltip.mjs","sources":["../../../../libs/components/tooltip/src/lib/tooltip.component.ts","../../../../libs/components/tooltip/src/lib/tooltip.component.html","../../../../libs/components/tooltip/src/lib/tooltip.directive.ts","../../../../libs/components/tooltip/src/lib/tooltip.module.ts","../../../../libs/components/tooltip/src/acorex-components-tooltip.ts"],"sourcesContent":["import { AXPlacement, MXBaseComponent } from '@acorex/components/common';\nimport { Component, Input, ViewEncapsulation } from '@angular/core';\n\n/**\n * A component for displaying tooltips with additional information or context when hovering over elements.\n * @category Components\n */\n@Component({\n selector: 'ax-tooltip',\n templateUrl: './tooltip.component.html',\n styleUrls: ['./tooltip.component.scss'],\n encapsulation: ViewEncapsulation.None,\n standalone: false\n})\nexport class AXTooltipComponent extends MXBaseComponent {\n /**\n * The text content displayed in the tooltip.\n * @defaultValue 'string'\n */\n @Input()\n text: string;\n\n /**\n * Specifies the position of the tooltip relative to the target element.\n *\n * @type {AXPlacement}\n */\n @Input()\n position: AXPlacement;\n}\n","<div class=\"ax-tooltip-container\">\n <div class=\"ax-tooltip\">\n {{ text }}\n </div>\n <!-- <div class=\"ax-tooltip-tringle ax-tooltip-tringle-{{ position }}\"></div> -->\n</div>","import { AXPlacementType, convertToPlacement } from '@acorex/components/common';\nimport { AXPopoverComponent } from '@acorex/components/popover';\nimport { Directive, ElementRef, Input, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { AXTooltipComponent } from './tooltip.component';\n\n@Directive({\n selector: '[axTooltip]',\n standalone: false\n})\nexport class AXTooltipDirective implements OnInit {\n @Input('axTooltip')\n public content: string | TemplateRef<unknown>;\n\n private _placement: AXPlacementType = convertToPlacement('top');\n @Input('axTooltipPlacement')\n public get placement(): AXPlacementType {\n return this._placement;\n }\n public set placement(v: AXPlacementType) {\n this._placement = v;\n if (this.popupRef) {\n this.popupRef.placement = v;\n }\n }\n\n private _openAfter = 100;\n @Input('axTooltipOpenAfter')\n public get openAfter(): number {\n return this._openAfter;\n }\n public set openAfter(v: number) {\n this._openAfter = v;\n if (this.popupRef) {\n this.popupRef.openAfter = v;\n }\n }\n\n private _closeAfter = 100;\n @Input('axTooltipCloseAfter')\n public get closeAfter(): number {\n return this._closeAfter;\n }\n public set closeAfter(v: number) {\n this._closeAfter = v;\n if (this.popupRef) {\n this.popupRef.closeAfter = v;\n }\n }\n\n private popupRef: AXPopoverComponent;\n\n constructor(\n private elementRef: ElementRef,\n private vc: ViewContainerRef,\n ) {\n this.popupRef = this.vc.createComponent(AXPopoverComponent).instance;\n this.popupRef.target = this.elementRef.nativeElement;\n }\n\n ngOnInit(): void {\n this.popupRef.target = this.elementRef.nativeElement;\n this.popupRef.openOn = 'hover';\n this.popupRef.closeOn = 'leave';\n this.popupRef.placement = this.placement;\n this.popupRef.openAfter = this.openAfter;\n this.popupRef.closeAfter = this.closeAfter;\n if (typeof this.content === 'string') {\n this.popupRef.content = AXTooltipComponent;\n this.popupRef.context = { text: this.content };\n } else if (this.content instanceof TemplateRef) {\n this.popupRef.content = this.content;\n //this.popupRef.context = { text: this.content };\n }\n }\n}\n","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXTooltipComponent } from './tooltip.component';\nimport { AXTooltipDirective } from './tooltip.directive';\n\nconst COMPONENT = [AXTooltipComponent, AXTooltipDirective];\nconst MODULES = [CommonModule, OverlayModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n})\nexport class AXTooltipModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAGA;;;AAGG;AAQG,MAAO,kBAAmB,SAAQ,eAAe,CAAA;8GAA1C,kBAAkB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,kBAAkB,8ICd/B,6LAKM,EAAA,MAAA,EAAA,CAAA,
|
1
|
+
{"version":3,"file":"acorex-components-tooltip.mjs","sources":["../../../../libs/components/tooltip/src/lib/tooltip.component.ts","../../../../libs/components/tooltip/src/lib/tooltip.component.html","../../../../libs/components/tooltip/src/lib/tooltip.directive.ts","../../../../libs/components/tooltip/src/lib/tooltip.module.ts","../../../../libs/components/tooltip/src/acorex-components-tooltip.ts"],"sourcesContent":["import { AXPlacement, MXBaseComponent } from '@acorex/components/common';\nimport { Component, Input, ViewEncapsulation } from '@angular/core';\n\n/**\n * A component for displaying tooltips with additional information or context when hovering over elements.\n * @category Components\n */\n@Component({\n selector: 'ax-tooltip',\n templateUrl: './tooltip.component.html',\n styleUrls: ['./tooltip.component.scss'],\n encapsulation: ViewEncapsulation.None,\n standalone: false\n})\nexport class AXTooltipComponent extends MXBaseComponent {\n /**\n * The text content displayed in the tooltip.\n * @defaultValue 'string'\n */\n @Input()\n text: string;\n\n /**\n * Specifies the position of the tooltip relative to the target element.\n *\n * @type {AXPlacement}\n */\n @Input()\n position: AXPlacement;\n}\n","<div class=\"ax-tooltip-container\">\n <div class=\"ax-tooltip\">\n {{ text }}\n </div>\n <!-- <div class=\"ax-tooltip-tringle ax-tooltip-tringle-{{ position }}\"></div> -->\n</div>","import { AXPlacementType, convertToPlacement } from '@acorex/components/common';\nimport { AXPopoverComponent } from '@acorex/components/popover';\nimport { Directive, ElementRef, Input, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { AXTooltipComponent } from './tooltip.component';\n\n@Directive({\n selector: '[axTooltip]',\n standalone: false\n})\nexport class AXTooltipDirective implements OnInit {\n @Input('axTooltip')\n public content: string | TemplateRef<unknown>;\n\n private _placement: AXPlacementType = convertToPlacement('top');\n @Input('axTooltipPlacement')\n public get placement(): AXPlacementType {\n return this._placement;\n }\n public set placement(v: AXPlacementType) {\n this._placement = v;\n if (this.popupRef) {\n this.popupRef.placement = v;\n }\n }\n\n private _openAfter = 100;\n @Input('axTooltipOpenAfter')\n public get openAfter(): number {\n return this._openAfter;\n }\n public set openAfter(v: number) {\n this._openAfter = v;\n if (this.popupRef) {\n this.popupRef.openAfter = v;\n }\n }\n\n private _closeAfter = 100;\n @Input('axTooltipCloseAfter')\n public get closeAfter(): number {\n return this._closeAfter;\n }\n public set closeAfter(v: number) {\n this._closeAfter = v;\n if (this.popupRef) {\n this.popupRef.closeAfter = v;\n }\n }\n\n private popupRef: AXPopoverComponent;\n\n constructor(\n private elementRef: ElementRef,\n private vc: ViewContainerRef,\n ) {\n this.popupRef = this.vc.createComponent(AXPopoverComponent).instance;\n this.popupRef.target = this.elementRef.nativeElement;\n }\n\n ngOnInit(): void {\n this.popupRef.target = this.elementRef.nativeElement;\n this.popupRef.openOn = 'hover';\n this.popupRef.closeOn = 'leave';\n this.popupRef.placement = this.placement;\n this.popupRef.openAfter = this.openAfter;\n this.popupRef.closeAfter = this.closeAfter;\n if (typeof this.content === 'string') {\n this.popupRef.content = AXTooltipComponent;\n this.popupRef.context = { text: this.content };\n } else if (this.content instanceof TemplateRef) {\n this.popupRef.content = this.content;\n //this.popupRef.context = { text: this.content };\n }\n }\n}\n","import { OverlayModule } from '@angular/cdk/overlay';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXTooltipComponent } from './tooltip.component';\nimport { AXTooltipDirective } from './tooltip.directive';\n\nconst COMPONENT = [AXTooltipComponent, AXTooltipDirective];\nconst MODULES = [CommonModule, OverlayModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n})\nexport class AXTooltipModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAGA;;;AAGG;AAQG,MAAO,kBAAmB,SAAQ,eAAe,CAAA;8GAA1C,kBAAkB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,kBAAkB,8ICd/B,6LAKM,EAAA,MAAA,EAAA,CAAA,0aAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FDSO,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAP9B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,EAGP,aAAA,EAAA,iBAAiB,CAAC,IAAI,cACzB,KAAK,EAAA,QAAA,EAAA,6LAAA,EAAA,MAAA,EAAA,CAAA,0aAAA,CAAA,EAAA;8BAQnB,IAAI,EAAA,CAAA;sBADH;gBASD,QAAQ,EAAA,CAAA;sBADP;;;MElBU,kBAAkB,CAAA;AAK7B,IAAA,IACW,SAAS,GAAA;QAClB,OAAO,IAAI,CAAC,UAAU;;IAExB,IAAW,SAAS,CAAC,CAAkB,EAAA;AACrC,QAAA,IAAI,CAAC,UAAU,GAAG,CAAC;AACnB,QA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uBAAC,WAAW;gBAKP,SAAS,EAAA,CAAA;sBADnB,KAAK;uBAAC,oBAAoB;gBAahB,SAAS,EAAA,CAAA;sBADnB,KAAK;uBAAC,oBAAoB;gBAahB,UAAU,EAAA,CAAA;sBADpB,KAAK;uBAAC,qBAAqB;;;AChC9B,MAAM,SAAS,GAAG,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;AAC1D,MAAM,OAAO,GAAG,CAAC,YAAY,EAAE,aAAa,CAAC;MAOhC,eAAe,CAAA;8GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAf,eAAe,EAAA,YAAA,EAAA,CART,kBAAkB,EAAE,kBAAkB,CAAA,EAAA,OAAA,EAAA,CACxC,YAAY,EAAE,aAAa,CAAA,EAAA,OAAA,EAAA,CADzB,kBAAkB,EAAE,kBAAkB,CAAA,EAAA,CAAA,CAAA;AAQ5C,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,eAAe,YAHb,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAGT,eAAe,EAAA,UAAA,EAAA,CAAA;kBAL3B,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;AACxB,iBAAA;;;ACbD;;AAEG;;;;"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { NXComponent, AXClickEvent, AXCommonModule } from '@acorex/components/common';
|
2
2
|
import { AXPlatform } from '@acorex/core/platform';
|
3
|
-
import { trigger, state,
|
3
|
+
import { trigger, state, transition, style, animate } from '@angular/animations';
|
4
4
|
import * as i0 from '@angular/core';
|
5
|
-
import { input, output, model, inject, computed,
|
5
|
+
import { input, output, model, inject, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, signal, effect, NgModule } from '@angular/core';
|
6
6
|
import * as i1 from '@acorex/components/tooltip';
|
7
7
|
import { AXTooltipModule } from '@acorex/components/tooltip';
|
8
8
|
import * as i2 from '@acorex/components/loading';
|
@@ -113,9 +113,23 @@ class AXTreeItemClickBaseEvent extends AXClickEvent {
|
|
113
113
|
|
114
114
|
class AXTreeViewComponent extends NXComponent {
|
115
115
|
constructor() {
|
116
|
-
super();
|
116
|
+
super(...arguments);
|
117
117
|
this.itemsSignal = signal([]);
|
118
|
-
this.
|
118
|
+
this.items = input();
|
119
|
+
this.selectable = input(true);
|
120
|
+
this.selectionMode = input('single');
|
121
|
+
this.selectionBehavior = input(null);
|
122
|
+
this.showActiveNode = input(true);
|
123
|
+
this.valueField = input('id');
|
124
|
+
this.textField = input('text');
|
125
|
+
this.visibleField = input('visible');
|
126
|
+
this.disableField = input('disabled');
|
127
|
+
this.hasChildField = input('hasChild');
|
128
|
+
this.iconField = input('icon');
|
129
|
+
this.onSelectionChange = output();
|
130
|
+
this.onItemClick = output();
|
131
|
+
this.onNodeClick = output();
|
132
|
+
this.onNodeExpandClick = output();
|
119
133
|
this.#effect = effect(() => {
|
120
134
|
const itemsInput = this.items();
|
121
135
|
if (typeof itemsInput === 'function') {
|
@@ -134,28 +148,13 @@ class AXTreeViewComponent extends NXComponent {
|
|
134
148
|
this.itemsPromise = null;
|
135
149
|
}
|
136
150
|
});
|
137
|
-
this.items = input();
|
138
|
-
this.selectable = input(true);
|
139
|
-
this.selectionMode = input('single');
|
140
|
-
this.selectionBehavior = input(null);
|
141
|
-
this.showActiveNode = input(true);
|
142
|
-
this.valueField = input('id');
|
143
|
-
this.textField = input('text');
|
144
|
-
this.visibleField = input('visible');
|
145
|
-
this.disableField = input('disabled');
|
146
|
-
this.hasChildField = input('hasChild');
|
147
|
-
this.iconField = input('icon');
|
148
|
-
this.onSelectionChange = output();
|
149
|
-
this.onItemClick = output();
|
150
|
-
this.onNodeClick = output();
|
151
|
-
this.onNodeExpandClick = output();
|
152
151
|
this.expandBehavior = input('both');
|
153
152
|
this.loadingState = signal({});
|
154
153
|
}
|
155
|
-
#effect;
|
156
154
|
get resolvedItems() {
|
157
155
|
return this.itemsSignal();
|
158
156
|
}
|
157
|
+
#effect;
|
159
158
|
handleNodeSelectionClick(event, item) {
|
160
159
|
if (item[this.disableField()] || this.isNodeLoading(item.id)) {
|
161
160
|
return;
|
@@ -164,12 +163,12 @@ class AXTreeViewComponent extends NXComponent {
|
|
164
163
|
this.handleUnSelectNode(this.itemsSignal());
|
165
164
|
}
|
166
165
|
item.selected = event.value;
|
167
|
-
if (event.value
|
166
|
+
if (event.value !== null) {
|
168
167
|
switch (this.selectionBehavior()) {
|
169
168
|
case 'autoExpand':
|
170
169
|
if (event.value) {
|
171
170
|
if (this.itemsPromise && item[this.hasChildField()] && !item?.childrens?.length) {
|
172
|
-
this.fetchData(item
|
171
|
+
this.fetchData(item);
|
173
172
|
this.setNodeLoading(item.id, true);
|
174
173
|
}
|
175
174
|
this.toggleExpand(item);
|
@@ -267,7 +266,7 @@ class AXTreeViewComponent extends NXComponent {
|
|
267
266
|
}
|
268
267
|
}
|
269
268
|
findParent(item, nodes) {
|
270
|
-
for (
|
269
|
+
for (const node of nodes) {
|
271
270
|
if (node.childrens?.includes(item)) {
|
272
271
|
return node;
|
273
272
|
}
|
@@ -314,12 +313,12 @@ class AXTreeViewComponent extends NXComponent {
|
|
314
313
|
* lazy load logic
|
315
314
|
*
|
316
315
|
*/
|
317
|
-
fetchData(
|
318
|
-
this.itemsPromise(
|
316
|
+
fetchData(selectedNode) {
|
317
|
+
this.itemsPromise(selectedNode?.id)
|
319
318
|
.then((data) => {
|
320
319
|
if (Array.isArray(data)) {
|
321
|
-
if (
|
322
|
-
this.findNode(
|
320
|
+
if (selectedNode?.id) {
|
321
|
+
this.findNode(selectedNode.id, data, this.itemsSignal());
|
323
322
|
}
|
324
323
|
else {
|
325
324
|
this.itemsSignal.set(data);
|
@@ -327,7 +326,7 @@ class AXTreeViewComponent extends NXComponent {
|
|
327
326
|
}
|
328
327
|
})
|
329
328
|
.finally(() => {
|
330
|
-
this.setNodeLoading(
|
329
|
+
this.setNodeLoading(selectedNode?.id, false);
|
331
330
|
});
|
332
331
|
}
|
333
332
|
findNode(parentId, _children, source) {
|
@@ -352,10 +351,10 @@ class AXTreeViewComponent extends NXComponent {
|
|
352
351
|
*
|
353
352
|
*/
|
354
353
|
handleNodeExpandClick(node) {
|
355
|
-
const
|
354
|
+
const selectedNode = node.data;
|
356
355
|
if (this.itemsPromise && node.data.isExpanded && !node?.data.childrens?.length) {
|
357
|
-
this.fetchData(
|
358
|
-
this.setNodeLoading(
|
356
|
+
this.fetchData(selectedNode);
|
357
|
+
this.setNodeLoading(selectedNode.id, true);
|
359
358
|
}
|
360
359
|
this.onNodeExpandClick.emit({ component: this, data: node.data, nativeElement: this.nativeElement });
|
361
360
|
}
|
@@ -390,9 +389,9 @@ class AXTreeViewComponent extends NXComponent {
|
|
390
389
|
}
|
391
390
|
handleNodeDbClick(node) {
|
392
391
|
if (this.itemsPromise) {
|
393
|
-
const
|
394
|
-
this.fetchData(
|
395
|
-
this.setNodeLoading(
|
392
|
+
const selectedNode = node.data;
|
393
|
+
this.fetchData(selectedNode);
|
394
|
+
this.setNodeLoading(selectedNode.id, true);
|
396
395
|
}
|
397
396
|
}
|
398
397
|
isNodeLoading(nodeId) {
|
@@ -404,43 +403,13 @@ class AXTreeViewComponent extends NXComponent {
|
|
404
403
|
[nodeId]: isLoading,
|
405
404
|
}));
|
406
405
|
}
|
407
|
-
|
408
|
-
|
409
|
-
this.itemsSignal().forEach((node) => {
|
410
|
-
if (node[this.valueField()] === valueField) {
|
411
|
-
node.active = value;
|
412
|
-
this.cdr.detectChanges();
|
413
|
-
}
|
414
|
-
else {
|
415
|
-
if (node?.childrens?.length) {
|
416
|
-
this.setActiveNodeByValueField(node[this.valueField()], value);
|
417
|
-
}
|
418
|
-
}
|
419
|
-
});
|
420
|
-
}
|
421
|
-
setExpandNodeByValueField(valueField, value) {
|
422
|
-
this.itemsSignal().forEach((node) => {
|
423
|
-
if (node[this.valueField()] === valueField) {
|
424
|
-
node.isExpanded = value;
|
425
|
-
if (this.itemsPromise && value && node[this.hasChildField()] && !node?.childrens?.length) {
|
426
|
-
this.fetchData(node[this.valueField()]);
|
427
|
-
}
|
428
|
-
this.cdr.detectChanges();
|
429
|
-
}
|
430
|
-
else {
|
431
|
-
if (node?.childrens?.length) {
|
432
|
-
this.setExpandNodeByValueField(node[this.valueField()], value);
|
433
|
-
}
|
434
|
-
}
|
435
|
-
});
|
436
|
-
}
|
437
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXTreeViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
438
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXTreeViewComponent, isStandalone: false, selector: "ax-tree-view", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selectionBehavior: { classPropertyName: "selectionBehavior", publicName: "selectionBehavior", isSignal: true, isRequired: false, transformFunction: null }, showActiveNode: { classPropertyName: "showActiveNode", publicName: "showActiveNode", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, visibleField: { classPropertyName: "visibleField", publicName: "visibleField", isSignal: true, isRequired: false, transformFunction: null }, disableField: { classPropertyName: "disableField", publicName: "disableField", isSignal: true, isRequired: false, transformFunction: null }, hasChildField: { classPropertyName: "hasChildField", publicName: "hasChildField", isSignal: true, isRequired: false, transformFunction: null }, iconField: { classPropertyName: "iconField", publicName: "iconField", isSignal: true, isRequired: false, transformFunction: null }, expandBehavior: { classPropertyName: "expandBehavior", publicName: "expandBehavior", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSelectionChange: "onSelectionChange", onItemClick: "onItemClick", onNodeClick: "onNodeClick", onNodeExpandClick: "onNodeExpandClick" }, usesInheritance: true, ngImport: i0, template: "@for (node of resolvedItems; track $index) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"></ng-container>\n}\n\n<ng-template #Recursion let-item>\n @if (item[visibleField()] !== false) {\n <ax-tree-view-item\n [item]=\"item\"\n [(isExpanded)]=\"item.isExpanded\"\n [(isActive)]=\"item.active\"\n [isLoading]=\"isNodeLoading(item.id)\"\n [disableField]=\"disableField()\"\n [hasChildField]=\"hasChildField()\"\n [expandBehavior]=\"expandBehavior()\"\n (onNodeExpand)=\"handleNodeExpandClick($event)\"\n (onNodeClick)=\"handleNodeClick($event)\"\n (onNodeDbClick)=\"handleNodeDbClick($event)\"\n >\n @if (this.selectable()) {\n <ax-check-box\n [disabled]=\"item[disableField()]\"\n [indeterminate]=\"item.indeterminate\"\n [(ngModel)]=\"item.selected\"\n (onValueChanged)=\"handleNodeSelectionClick($event, item)\"\n ></ax-check-box>\n }\n <ax-prefix>\n @if (item[iconField()]) {\n <ax-icon [icon]=\"item[iconField()]\"></ax-icon>\n } @else {\n <i></i>\n }\n </ax-prefix>\n @if (item[textField()]) {\n <ax-text>{{ item[textField()] }}</ax-text>\n }\n\n <ax-suffix></ax-suffix>\n @for (child of item?.childrens; track $index) {\n <ng-container\n [ngTemplateOutlet]=\"Recursion\"\n [ngTemplateOutletContext]=\"{ $implicit: child }\"\n ></ng-container>\n }\n </ax-tree-view-item>\n }\n</ng-template>\n", styles: ["ax-tree-view{--ax-comp-tree-view-arrow-size: .875rem;--ax-comp-tree-view-text-size: .875rem}ax-tree-view{background-color:rgb(var(--ax-comp-tree-view-bg-color))}ax-tree-view ax-tree-view-item .ax-tree-view-container{display:flex;align-items:center;margin-bottom:.125rem;cursor:pointer}ax-tree-view ax-tree-view-item .ax-tree-view-container ax-text{font-size:var(--ax-comp-tree-view-text-size)}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-checkbox-end-side{display:none!important}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-arrow{font-size:var(--ax-comp-tree-view-arrow-size)!important}ax-tree-view ax-tree-view-item .ax-tree-view-container ax-suffix:empty{display:none}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items{display:flex;align-items:center;gap:.5rem}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix{display:flex;align-items:center;gap:.5rem;padding:.5rem;border-radius:.25rem;overflow-x:auto}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix.noselect-tree-view{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix.ax-state-tree-view-active{background-color:var(--ax-sys-color-primary-500);color:var(--ax-sys-color-on-primary)}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix.ax-state-tree-view-active:hover{background-color:var(--ax-sys-color-primary-500);color:var(--ax-sys-color-on-primary)}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix:hover{background-color:rgba(var(--ax-sys-surface-high-bg-color))}ax-tree-view ax-tree-view-item .ax-state-tree-view-rtl{padding-inline-end:1rem}ax-tree-view ax-tree-view-item .ax-state-tree-view-ltr{padding-inline-start:1rem}ax-tree-view ax-tree-view-item .ax-state-disabled{cursor:not-allowed!important;opacity:.5!important}ax-tree-view ax-tree-view-item .arrow-container{position:relative;display:flex;align-items:center}ax-tree-view ax-tree-view-item .vertical-line{width:.125rem;height:100%;background-color:#ccc;position:absolute;bottom:-10px;left:50%;transform:translate(-50%)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i3.AXCheckBoxComponent, selector: "ax-check-box", inputs: ["disabled", "tabIndex", "readonly", "color", "value", "name", "id", "checked", "indeterminate"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: AXTreeViewItemComponent, selector: "ax-tree-view-item", inputs: ["item", "isExpanded", "hasChildField", "isActive", "isLoading", "disableField", "expandIconField", "expandBehavior"], outputs: ["onNodeExpand", "onNodeClick", "isExpandedChange", "isActiveChange", "onNodeDbClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
406
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXTreeViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
407
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXTreeViewComponent, isStandalone: false, selector: "ax-tree-view", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, selectionBehavior: { classPropertyName: "selectionBehavior", publicName: "selectionBehavior", isSignal: true, isRequired: false, transformFunction: null }, showActiveNode: { classPropertyName: "showActiveNode", publicName: "showActiveNode", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, visibleField: { classPropertyName: "visibleField", publicName: "visibleField", isSignal: true, isRequired: false, transformFunction: null }, disableField: { classPropertyName: "disableField", publicName: "disableField", isSignal: true, isRequired: false, transformFunction: null }, hasChildField: { classPropertyName: "hasChildField", publicName: "hasChildField", isSignal: true, isRequired: false, transformFunction: null }, iconField: { classPropertyName: "iconField", publicName: "iconField", isSignal: true, isRequired: false, transformFunction: null }, expandBehavior: { classPropertyName: "expandBehavior", publicName: "expandBehavior", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSelectionChange: "onSelectionChange", onItemClick: "onItemClick", onNodeClick: "onNodeClick", onNodeExpandClick: "onNodeExpandClick" }, usesInheritance: true, ngImport: i0, template: "@for (node of resolvedItems; track $index) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"></ng-container>\n}\n\n<ng-template #Recursion let-item>\n @if (item[visibleField()] !== false) {\n <ax-tree-view-item\n [item]=\"item\"\n [(isExpanded)]=\"item.isExpanded\"\n [(isActive)]=\"item.active\"\n [isLoading]=\"isNodeLoading(item.id)\"\n [disableField]=\"disableField()\"\n [hasChildField]=\"hasChildField()\"\n [expandBehavior]=\"expandBehavior()\"\n (onNodeExpand)=\"handleNodeExpandClick($event)\"\n (onNodeClick)=\"handleNodeClick($event)\"\n (onNodeDbClick)=\"handleNodeDbClick($event)\"\n >\n @if (this.selectable()) {\n <ax-check-box\n [disabled]=\"item[disableField()]\"\n [indeterminate]=\"item.indeterminate\"\n [(ngModel)]=\"item.selected\"\n (onValueChanged)=\"handleNodeSelectionClick($event, item)\"\n ></ax-check-box>\n }\n <ax-prefix>\n @if (item[iconField()]) {\n <ax-icon [icon]=\"item[iconField()]\"></ax-icon>\n } @else {\n <i></i>\n }\n </ax-prefix>\n @if (item[textField()]) {\n <ax-text>{{ item[textField()] }}</ax-text>\n }\n\n <ax-suffix></ax-suffix>\n @for (child of item?.childrens; track $index) {\n <ng-container\n [ngTemplateOutlet]=\"Recursion\"\n [ngTemplateOutletContext]=\"{ $implicit: child }\"\n ></ng-container>\n }\n </ax-tree-view-item>\n }\n</ng-template>\n", styles: [".ax-dark ax-tree-view{--ax-tree-select-node-bk: rgba(var(--ax-color-primary-200));--ax-tree-select-node-text: rgba(var(--ax-color-primary-fore-tint))}ax-tree-view{--ax-tree-select-node-bk: rgba(var(--ax-color-primary-500));--ax-tree-select-node-text: rgba(var(--ax-color-primary-fore))}ax-tree-view ax-text{max-width:5rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.8rem}ax-tree-view ax-tree-view-item .ax-tree-view-container{display:flex;align-items:center;margin-bottom:.125rem;cursor:pointer}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-checkbox-end-side{display:none!important}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-arrow{font-size:.875rem!important}ax-tree-view ax-tree-view-item .ax-tree-view-container ax-suffix:empty{display:none}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items{display:flex;align-items:center}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix{display:flex;align-items:center;gap:.5rem;padding:.5rem;border-radius:.25rem;overflow-x:auto}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix.noselect-tree-view{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix.ax-state-tree-view-active{background-color:var(--ax-tree-select-node-bk);color:var(--ax-tree-select-node-text)}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix.ax-state-tree-view-active:hover{background-color:var(--ax-tree-select-node-bk);color:var(--ax-tree-select-node-text)}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix:hover{background-color:rgba(var(--ax-color-on-surface))}ax-tree-view ax-tree-view-item .ax-state-tree-view-rtl{padding-inline-end:1rem}ax-tree-view ax-tree-view-item .ax-state-tree-view-ltr{padding-inline-start:1rem}ax-tree-view ax-tree-view-item .ax-state-disabled{cursor:not-allowed!important;opacity:.5!important}ax-tree-view ax-tree-view-item .arrow-container{position:relative;display:flex;align-items:center}ax-tree-view ax-tree-view-item .vertical-line{width:.125rem;height:100%;background-color:#ccc;position:absolute;bottom:-10px;left:50%;transform:translate(-50%)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i2$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i3.AXCheckBoxComponent, selector: "ax-check-box", inputs: ["disabled", "tabIndex", "readonly", "color", "value", "name", "id", "checked", "indeterminate"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: AXTreeViewItemComponent, selector: "ax-tree-view-item", inputs: ["item", "isExpanded", "hasChildField", "isActive", "isLoading", "disableField", "expandIconField", "expandBehavior"], outputs: ["onNodeExpand", "onNodeClick", "isExpandedChange", "isActiveChange", "onNodeDbClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
439
408
|
}
|
440
409
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXTreeViewComponent, decorators: [{
|
441
410
|
type: Component,
|
442
|
-
args: [{ selector: 'ax-tree-view', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@for (node of resolvedItems; track $index) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"></ng-container>\n}\n\n<ng-template #Recursion let-item>\n @if (item[visibleField()] !== false) {\n <ax-tree-view-item\n [item]=\"item\"\n [(isExpanded)]=\"item.isExpanded\"\n [(isActive)]=\"item.active\"\n [isLoading]=\"isNodeLoading(item.id)\"\n [disableField]=\"disableField()\"\n [hasChildField]=\"hasChildField()\"\n [expandBehavior]=\"expandBehavior()\"\n (onNodeExpand)=\"handleNodeExpandClick($event)\"\n (onNodeClick)=\"handleNodeClick($event)\"\n (onNodeDbClick)=\"handleNodeDbClick($event)\"\n >\n @if (this.selectable()) {\n <ax-check-box\n [disabled]=\"item[disableField()]\"\n [indeterminate]=\"item.indeterminate\"\n [(ngModel)]=\"item.selected\"\n (onValueChanged)=\"handleNodeSelectionClick($event, item)\"\n ></ax-check-box>\n }\n <ax-prefix>\n @if (item[iconField()]) {\n <ax-icon [icon]=\"item[iconField()]\"></ax-icon>\n } @else {\n <i></i>\n }\n </ax-prefix>\n @if (item[textField()]) {\n <ax-text>{{ item[textField()] }}</ax-text>\n }\n\n <ax-suffix></ax-suffix>\n @for (child of item?.childrens; track $index) {\n <ng-container\n [ngTemplateOutlet]=\"Recursion\"\n [ngTemplateOutletContext]=\"{ $implicit: child }\"\n ></ng-container>\n }\n </ax-tree-view-item>\n }\n</ng-template>\n", styles: ["ax-tree-view{--ax-
|
443
|
-
}]
|
411
|
+
args: [{ selector: 'ax-tree-view', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@for (node of resolvedItems; track $index) {\n <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"></ng-container>\n}\n\n<ng-template #Recursion let-item>\n @if (item[visibleField()] !== false) {\n <ax-tree-view-item\n [item]=\"item\"\n [(isExpanded)]=\"item.isExpanded\"\n [(isActive)]=\"item.active\"\n [isLoading]=\"isNodeLoading(item.id)\"\n [disableField]=\"disableField()\"\n [hasChildField]=\"hasChildField()\"\n [expandBehavior]=\"expandBehavior()\"\n (onNodeExpand)=\"handleNodeExpandClick($event)\"\n (onNodeClick)=\"handleNodeClick($event)\"\n (onNodeDbClick)=\"handleNodeDbClick($event)\"\n >\n @if (this.selectable()) {\n <ax-check-box\n [disabled]=\"item[disableField()]\"\n [indeterminate]=\"item.indeterminate\"\n [(ngModel)]=\"item.selected\"\n (onValueChanged)=\"handleNodeSelectionClick($event, item)\"\n ></ax-check-box>\n }\n <ax-prefix>\n @if (item[iconField()]) {\n <ax-icon [icon]=\"item[iconField()]\"></ax-icon>\n } @else {\n <i></i>\n }\n </ax-prefix>\n @if (item[textField()]) {\n <ax-text>{{ item[textField()] }}</ax-text>\n }\n\n <ax-suffix></ax-suffix>\n @for (child of item?.childrens; track $index) {\n <ng-container\n [ngTemplateOutlet]=\"Recursion\"\n [ngTemplateOutletContext]=\"{ $implicit: child }\"\n ></ng-container>\n }\n </ax-tree-view-item>\n }\n</ng-template>\n", styles: [".ax-dark ax-tree-view{--ax-tree-select-node-bk: rgba(var(--ax-color-primary-200));--ax-tree-select-node-text: rgba(var(--ax-color-primary-fore-tint))}ax-tree-view{--ax-tree-select-node-bk: rgba(var(--ax-color-primary-500));--ax-tree-select-node-text: rgba(var(--ax-color-primary-fore))}ax-tree-view ax-text{max-width:5rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.8rem}ax-tree-view ax-tree-view-item .ax-tree-view-container{display:flex;align-items:center;margin-bottom:.125rem;cursor:pointer}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-checkbox-end-side{display:none!important}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-arrow{font-size:.875rem!important}ax-tree-view ax-tree-view-item .ax-tree-view-container ax-suffix:empty{display:none}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items{display:flex;align-items:center}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix{display:flex;align-items:center;gap:.5rem;padding:.5rem;border-radius:.25rem;overflow-x:auto}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix.noselect-tree-view{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix.ax-state-tree-view-active{background-color:var(--ax-tree-select-node-bk);color:var(--ax-tree-select-node-text)}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix.ax-state-tree-view-active:hover{background-color:var(--ax-tree-select-node-bk);color:var(--ax-tree-select-node-text)}ax-tree-view ax-tree-view-item .ax-tree-view-container .ax-tree-view-items .ax-tree-view-items-prefix:hover{background-color:rgba(var(--ax-color-on-surface))}ax-tree-view ax-tree-view-item .ax-state-tree-view-rtl{padding-inline-end:1rem}ax-tree-view ax-tree-view-item .ax-state-tree-view-ltr{padding-inline-start:1rem}ax-tree-view ax-tree-view-item .ax-state-disabled{cursor:not-allowed!important;opacity:.5!important}ax-tree-view ax-tree-view-item .arrow-container{position:relative;display:flex;align-items:center}ax-tree-view ax-tree-view-item .vertical-line{width:.125rem;height:100%;background-color:#ccc;position:absolute;bottom:-10px;left:50%;transform:translate(-50%)}\n"] }]
|
412
|
+
}] });
|
444
413
|
|
445
414
|
class AXTreeViewModule {
|
446
415
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXTreeViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|