@ng-nest/ui 19.0.10 → 19.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auto-complete/auto-complete.property.d.ts +1 -0
- package/base-form/base-form.component.d.ts +1 -0
- package/cascade/cascade.property.d.ts +1 -0
- package/checkbox/checkbox.property.d.ts +1 -0
- package/color-picker/color-picker.property.d.ts +1 -0
- package/date-picker/date-picker.property.d.ts +2 -0
- package/dialog/dialog-portal.component.d.ts +3 -3
- package/fesm2022/ng-nest-ui-back-top.mjs +0 -1
- package/fesm2022/ng-nest-ui-back-top.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-base-form.mjs +2 -0
- package/fesm2022/ng-nest-ui-base-form.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-cascade.mjs +0 -1
- package/fesm2022/ng-nest-ui-cascade.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-collapse.mjs +0 -1
- package/fesm2022/ng-nest-ui-collapse.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-dialog.mjs +78 -85
- package/fesm2022/ng-nest-ui-dialog.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-form.mjs +4 -3
- package/fesm2022/ng-nest-ui-form.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-select.mjs +70 -27
- package/fesm2022/ng-nest-ui-select.mjs.map +1 -1
- package/find/find.property.d.ts +1 -0
- package/form/form.property.d.ts +1 -0
- package/input/input.property.d.ts +1 -0
- package/input-number/input-number.property.d.ts +1 -0
- package/list/list.property.d.ts +1 -0
- package/package.json +44 -44
- package/radio/radio.property.d.ts +1 -0
- package/rate/rate.property.d.ts +1 -0
- package/select/select.component.d.ts +2 -0
- package/select/select.property.d.ts +3 -2
- package/slider-select/slider-select.property.d.ts +1 -0
- package/switch/switch.property.d.ts +1 -0
- package/textarea/textarea.property.d.ts +1 -0
- package/theme/theme.property.d.ts +1 -0
- package/time-picker/time-picker.property.d.ts +1 -0
- package/transfer/transfer.property.d.ts +1 -0
- package/tree-select/tree-select.property.d.ts +1 -0
- package/upload/upload.property.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-nest-ui-collapse.mjs","sources":["../../../../lib/ng-nest/ui/collapse/collapse.property.ts","../../../../lib/ng-nest/ui/collapse/collapse.component.ts","../../../../lib/ng-nest/ui/collapse/collapse.component.html","../../../../lib/ng-nest/ui/collapse/collapse-panel.component.ts","../../../../lib/ng-nest/ui/collapse/collapse-panel.component.html","../../../../lib/ng-nest/ui/collapse/collapse.module.ts","../../../../lib/ng-nest/ui/collapse/ng-nest-ui-collapse.ts"],"sourcesContent":["import { XProperty, XPropertyFunction, XToBoolean } from '@ng-nest/ui/core';\r\nimport { Component, input } from '@angular/core';\r\nimport type { XTemplate, XBoolean } from '@ng-nest/ui/core';\r\n\r\n/**\r\n * Collapse\r\n * @selector x-collapse\r\n * @decorator component\r\n */\r\nexport const XCollapsePrefix = 'x-collapse';\r\nconst X_COLLAPSE_CONFIG_NAME = 'collapse';\r\n\r\n/**\r\n * Collapse Property\r\n */\r\n@Component({ selector: `${XCollapsePrefix}-property`, template: '' })\r\nexport class XCollapseProperty extends XPropertyFunction(X_COLLAPSE_CONFIG_NAME) {\r\n /**\r\n * @zh_CN 是否以手风琴的方式展示,只展开一个面板\r\n * @en_US Whether to display as an accordion, only expand one panel\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse accordion>\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\"></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly accordion = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 显示的图标\r\n * @en_US The icon displayed on the right\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse [icon]=\"iconTpl\">\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\"></x-collapse-panel>\r\n * </x-collapse>\r\n * <ng-template #iconTpl>\r\n * <x-icon type=\"ado-caret-right\"></x-icon>\r\n * </ng-template>\r\n * ```\r\n *\r\n */\r\n readonly icon = input<XTemplate>();\r\n /**\r\n * @zh_CN 显示/隐藏图标\r\n * @en_US Show / hide icon\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse showIcon=\"false\">\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\"></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly showIcon = input<boolean, XBoolean>(this.config?.showIcon ?? true, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 图标位置\r\n * @en_US Icon position\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse iconPosition=\"left\">\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\"></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly iconPosition = input<XCollapseIconPosition>(this.config?.iconPosition ?? 'right');\r\n /**\r\n * @zh_CN 幽灵面板\r\n * @en_US Ghost panel\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse ghost>\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\"></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly ghost = input<boolean, XBoolean>(this.config?.ghost ?? false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 边框\r\n * @en_US border\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse bordered>\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\"></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly bordered = input<boolean, XBoolean>(this.config?.bordered ?? false, { transform: XToBoolean });\r\n}\r\n\r\n/**\r\n * @zh_CN 图标位置\r\n * @en_US Icon position\r\n */\r\nexport type XCollapseIconPosition = 'left' | 'right';\r\n\r\n/**\r\n * Collapse Panel\r\n * @selector x-collapse-panel\r\n * @decorator component\r\n */\r\nexport const XCollapsePanelPrefix = 'x-collapse-panel';\r\n\r\n/**\r\n * Collapse Panel Property\r\n */\r\n@Component({ selector: `${XCollapsePanelPrefix}-property`, template: '' })\r\nexport class XCollapsePanelProperty extends XProperty {\r\n /**\r\n * @zh_CN 标题,支持模板自定义\r\n * @en_US Title, support template customization\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse>\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel [label]=\"labelTpl\"></x-collapse-panel>\r\n * </x-collapse>\r\n * <ng-template #labelTpl>Title 2</ng-template>\r\n * ```\r\n *\r\n */\r\n readonly label = input<XTemplate>();\r\n /**\r\n * @zh_CN 激活当前面板\r\n * @en_US Activate the current panel\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse>\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\" active></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly active = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US disabled\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse>\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\" disabled></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly disabled = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n}\r\n","import { Component, ViewEncapsulation, ChangeDetectionStrategy, signal } from '@angular/core';\r\nimport { XCollapsePrefix, XCollapseProperty } from './collapse.property';\r\n\r\n@Component({\r\n selector: `${XCollapsePrefix}`,\r\n templateUrl: './collapse.component.html',\r\n styleUrls: ['./collapse.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class XCollapseComponent extends XCollapseProperty {\r\n start = signal(0);\r\n panelChanges = signal<(() => void)[]>([]);\r\n active = signal<number[]>([]);\r\n\r\n change(num: number, add = true) {\r\n const i = this.active().indexOf(num);\r\n if (i === -1) {\r\n if (add) {\r\n this.active.update((x) => [...x, num]);\r\n }\r\n } else {\r\n if (!add) {\r\n this.active.update((x) => {\r\n x.splice(i, 1);\r\n return [...x];\r\n });\r\n }\r\n }\r\n if (this.accordion() && this.active().length === 2) {\r\n const panel = this.panelChanges()[this.active()[0] as number];\r\n panel && panel();\r\n return;\r\n }\r\n }\r\n}\r\n","<div #collapse class=\"x-collapse\" [class.x-collapse-ghost]=\"ghost()\" [class.x-collapse-bordered]=\"bordered()\">\r\n <ng-content></ng-content>\r\n</div>\r\n","import { Component, OnInit, ViewEncapsulation, ChangeDetectionStrategy, inject, signal } from '@angular/core';\r\nimport { XCollapsePanelPrefix, XCollapsePanelProperty } from './collapse.property';\r\nimport { XDropAnimation } from '@ng-nest/ui/core';\r\nimport { XCollapseComponent } from './collapse.component';\r\nimport { XIconComponent } from '@ng-nest/ui/icon';\r\nimport { XOutletDirective } from '@ng-nest/ui/outlet';\r\nimport type { AnimationEvent } from '@angular/animations';\r\n\r\n@Component({\r\n selector: `${XCollapsePanelPrefix}`,\r\n imports: [XIconComponent, XOutletDirective],\r\n templateUrl: './collapse-panel.component.html',\r\n styleUrls: ['./collapse-panel.component.scss'],\r\n animations: [XDropAnimation],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class XCollapsePanelComponent extends XCollapsePanelProperty implements OnInit {\r\n index = signal<number>(0);\r\n collapseComponent = inject(XCollapseComponent, { optional: true, host: true });\r\n show = signal(false);\r\n activeSignal = signal(false);\r\n\r\n done(event: AnimationEvent) {\r\n if (!event.toState) this.show.set(false);\r\n }\r\n\r\n ngOnInit() {\r\n if (!this.collapseComponent) return;\r\n this.activeSignal.set(this.active());\r\n this.index.set(this.collapseComponent.start());\r\n this.collapseComponent.start.update((x) => x + 1);\r\n this.collapseComponent.panelChanges.update((x) => {\r\n x.push(() => {\r\n this.headerClick();\r\n });\r\n return [...x];\r\n });\r\n console.log(this.active(), this.activeSignal());\r\n if (this.activeSignal()) {\r\n this.show.set(true);\r\n this.collapseComponent.change(this.index());\r\n }\r\n }\r\n\r\n headerClick() {\r\n this.activeSignal.update((x) => !x);\r\n if (this.activeSignal()) this.show.set(true);\r\n if (!this.collapseComponent) return;\r\n if (this.activeSignal()) this.collapseComponent.change(this.index());\r\n else this.collapseComponent.change(this.index(), false);\r\n }\r\n}\r\n","<div class=\"x-collapse-panel\" [class.x-activated]=\"activeSignal()\" [class.x-collapse-panel-disabled]=\"disabled()\">\r\n <div\r\n class=\"x-collapse-panel-header x-collapse-panel-icon-{{ collapseComponent?.iconPosition() }}\"\r\n (click)=\"!disabled() && headerClick()\"\r\n >\r\n <div class=\"x-collapse-panel-header-title\">\r\n <ng-container *xOutlet=\"label()\">{{ label() }}</ng-container>\r\n </div>\r\n @if (collapseComponent?.showIcon()) {\r\n <ng-container *xOutlet=\"collapseComponent?.icon()\">\r\n <x-icon type=\"fto-chevron-right\"></x-icon>\r\n </ng-container>\r\n }\r\n </div>\r\n @if (show()) {\r\n <div class=\"x-collapse-panel-body\">\r\n <div\r\n class=\"x-collapse-panel-content\"\r\n [@x-drop-animation]=\"activeSignal()\"\r\n (@x-drop-animation.done)=\"done($event)\"\r\n >\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { XCollapseComponent } from './collapse.component';\r\nimport { XCollapsePanelComponent } from './collapse-panel.component';\r\n\r\n@NgModule({\r\n exports: [XCollapseComponent, XCollapsePanelComponent],\r\n imports: [XCollapseComponent, XCollapsePanelComponent]\r\n})\r\nexport class XCollapseModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './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A,EAAA,CAAA,CAAA;;2FAE1C,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,kBAAkB,EAAE,uBAAuB,CAAC;AACtD,oBAAA,OAAO,EAAE,CAAC,kBAAkB,EAAE,uBAAuB;AACtD,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-nest-ui-collapse.mjs","sources":["../../../../lib/ng-nest/ui/collapse/collapse.property.ts","../../../../lib/ng-nest/ui/collapse/collapse.component.ts","../../../../lib/ng-nest/ui/collapse/collapse.component.html","../../../../lib/ng-nest/ui/collapse/collapse-panel.component.ts","../../../../lib/ng-nest/ui/collapse/collapse-panel.component.html","../../../../lib/ng-nest/ui/collapse/collapse.module.ts","../../../../lib/ng-nest/ui/collapse/ng-nest-ui-collapse.ts"],"sourcesContent":["import { XProperty, XPropertyFunction, XToBoolean } from '@ng-nest/ui/core';\r\nimport { Component, input } from '@angular/core';\r\nimport type { XTemplate, XBoolean } from '@ng-nest/ui/core';\r\n\r\n/**\r\n * Collapse\r\n * @selector x-collapse\r\n * @decorator component\r\n */\r\nexport const XCollapsePrefix = 'x-collapse';\r\nconst X_COLLAPSE_CONFIG_NAME = 'collapse';\r\n\r\n/**\r\n * Collapse Property\r\n */\r\n@Component({ selector: `${XCollapsePrefix}-property`, template: '' })\r\nexport class XCollapseProperty extends XPropertyFunction(X_COLLAPSE_CONFIG_NAME) {\r\n /**\r\n * @zh_CN 是否以手风琴的方式展示,只展开一个面板\r\n * @en_US Whether to display as an accordion, only expand one panel\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse accordion>\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\"></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly accordion = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 显示的图标\r\n * @en_US The icon displayed on the right\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse [icon]=\"iconTpl\">\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\"></x-collapse-panel>\r\n * </x-collapse>\r\n * <ng-template #iconTpl>\r\n * <x-icon type=\"ado-caret-right\"></x-icon>\r\n * </ng-template>\r\n * ```\r\n *\r\n */\r\n readonly icon = input<XTemplate>();\r\n /**\r\n * @zh_CN 显示/隐藏图标\r\n * @en_US Show / hide icon\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse showIcon=\"false\">\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\"></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly showIcon = input<boolean, XBoolean>(this.config?.showIcon ?? true, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 图标位置\r\n * @en_US Icon position\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse iconPosition=\"left\">\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\"></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly iconPosition = input<XCollapseIconPosition>(this.config?.iconPosition ?? 'right');\r\n /**\r\n * @zh_CN 幽灵面板\r\n * @en_US Ghost panel\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse ghost>\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\"></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly ghost = input<boolean, XBoolean>(this.config?.ghost ?? false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 边框\r\n * @en_US border\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse bordered>\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\"></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly bordered = input<boolean, XBoolean>(this.config?.bordered ?? false, { transform: XToBoolean });\r\n}\r\n\r\n/**\r\n * @zh_CN 图标位置\r\n * @en_US Icon position\r\n */\r\nexport type XCollapseIconPosition = 'left' | 'right';\r\n\r\n/**\r\n * Collapse Panel\r\n * @selector x-collapse-panel\r\n * @decorator component\r\n */\r\nexport const XCollapsePanelPrefix = 'x-collapse-panel';\r\n\r\n/**\r\n * Collapse Panel Property\r\n */\r\n@Component({ selector: `${XCollapsePanelPrefix}-property`, template: '' })\r\nexport class XCollapsePanelProperty extends XProperty {\r\n /**\r\n * @zh_CN 标题,支持模板自定义\r\n * @en_US Title, support template customization\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse>\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel [label]=\"labelTpl\"></x-collapse-panel>\r\n * </x-collapse>\r\n * <ng-template #labelTpl>Title 2</ng-template>\r\n * ```\r\n *\r\n */\r\n readonly label = input<XTemplate>();\r\n /**\r\n * @zh_CN 激活当前面板\r\n * @en_US Activate the current panel\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse>\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\" active></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly active = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US disabled\r\n * @example\r\n *\r\n * ```html\r\n * <x-collapse>\r\n * <x-collapse-panel label=\"Title 1\"></x-collapse-panel>\r\n * <x-collapse-panel label=\"Title 2\" disabled></x-collapse-panel>\r\n * </x-collapse>\r\n * ```\r\n *\r\n */\r\n readonly disabled = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n}\r\n","import { Component, ViewEncapsulation, ChangeDetectionStrategy, signal } from '@angular/core';\r\nimport { XCollapsePrefix, XCollapseProperty } from './collapse.property';\r\n\r\n@Component({\r\n selector: `${XCollapsePrefix}`,\r\n templateUrl: './collapse.component.html',\r\n styleUrls: ['./collapse.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class XCollapseComponent extends XCollapseProperty {\r\n start = signal(0);\r\n panelChanges = signal<(() => void)[]>([]);\r\n active = signal<number[]>([]);\r\n\r\n change(num: number, add = true) {\r\n const i = this.active().indexOf(num);\r\n if (i === -1) {\r\n if (add) {\r\n this.active.update((x) => [...x, num]);\r\n }\r\n } else {\r\n if (!add) {\r\n this.active.update((x) => {\r\n x.splice(i, 1);\r\n return [...x];\r\n });\r\n }\r\n }\r\n if (this.accordion() && this.active().length === 2) {\r\n const panel = this.panelChanges()[this.active()[0] as number];\r\n panel && panel();\r\n return;\r\n }\r\n }\r\n}\r\n","<div #collapse class=\"x-collapse\" [class.x-collapse-ghost]=\"ghost()\" [class.x-collapse-bordered]=\"bordered()\">\r\n <ng-content></ng-content>\r\n</div>\r\n","import { Component, OnInit, ViewEncapsulation, ChangeDetectionStrategy, inject, signal } from '@angular/core';\r\nimport { XCollapsePanelPrefix, XCollapsePanelProperty } from './collapse.property';\r\nimport { XDropAnimation } from '@ng-nest/ui/core';\r\nimport { XCollapseComponent } from './collapse.component';\r\nimport { XIconComponent } from '@ng-nest/ui/icon';\r\nimport { XOutletDirective } from '@ng-nest/ui/outlet';\r\nimport type { AnimationEvent } from '@angular/animations';\r\n\r\n@Component({\r\n selector: `${XCollapsePanelPrefix}`,\r\n imports: [XIconComponent, XOutletDirective],\r\n templateUrl: './collapse-panel.component.html',\r\n styleUrls: ['./collapse-panel.component.scss'],\r\n animations: [XDropAnimation],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class XCollapsePanelComponent extends XCollapsePanelProperty implements OnInit {\r\n index = signal<number>(0);\r\n collapseComponent = inject(XCollapseComponent, { optional: true, host: true });\r\n show = signal(false);\r\n activeSignal = signal(false);\r\n\r\n done(event: AnimationEvent) {\r\n if (!event.toState) this.show.set(false);\r\n }\r\n\r\n ngOnInit() {\r\n if (!this.collapseComponent) return;\r\n this.activeSignal.set(this.active());\r\n this.index.set(this.collapseComponent.start());\r\n this.collapseComponent.start.update((x) => x + 1);\r\n this.collapseComponent.panelChanges.update((x) => {\r\n x.push(() => {\r\n this.headerClick();\r\n });\r\n return [...x];\r\n });\r\n if (this.activeSignal()) {\r\n this.show.set(true);\r\n this.collapseComponent.change(this.index());\r\n }\r\n }\r\n\r\n headerClick() {\r\n this.activeSignal.update((x) => !x);\r\n if (this.activeSignal()) this.show.set(true);\r\n if (!this.collapseComponent) return;\r\n if (this.activeSignal()) this.collapseComponent.change(this.index());\r\n else this.collapseComponent.change(this.index(), false);\r\n }\r\n}\r\n","<div class=\"x-collapse-panel\" [class.x-activated]=\"activeSignal()\" [class.x-collapse-panel-disabled]=\"disabled()\">\r\n <div\r\n class=\"x-collapse-panel-header x-collapse-panel-icon-{{ collapseComponent?.iconPosition() }}\"\r\n (click)=\"!disabled() && headerClick()\"\r\n >\r\n <div class=\"x-collapse-panel-header-title\">\r\n <ng-container *xOutlet=\"label()\">{{ label() }}</ng-container>\r\n </div>\r\n @if (collapseComponent?.showIcon()) {\r\n <ng-container *xOutlet=\"collapseComponent?.icon()\">\r\n <x-icon type=\"fto-chevron-right\"></x-icon>\r\n </ng-container>\r\n }\r\n </div>\r\n @if (show()) {\r\n <div class=\"x-collapse-panel-body\">\r\n <div\r\n class=\"x-collapse-panel-content\"\r\n [@x-drop-animation]=\"activeSignal()\"\r\n (@x-drop-animation.done)=\"done($event)\"\r\n >\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { XCollapseComponent } from './collapse.component';\r\nimport { XCollapsePanelComponent } from './collapse-panel.component';\r\n\r\n@NgModule({\r\n exports: [XCollapseComponent, XCollapsePanelComponent],\r\n imports: [XCollapseComponent, XCollapsePanelComponent]\r\n})\r\nexport class XCollapseModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAIA;;;;AAIG;AACI,MAAM,eAAe,GAAG;AAC/B,MAAM,sBAAsB,GAAG,UAAU;AAEzC;;AAEG;MAEU,iBAAkB,SAAQ,iBAAiB,CAAC,sBAAsB,CAAC,CAAA;AADhF,IAAA,WAAA,GAAA;;AAEE;;;;;;;;;;;;AAYG;QACM,IAAS,CAAA,SAAA,GAAG,KAAK,CAAoB,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AAC/E;;;;;;;;;;;;;;;AAeG;QACM,IAAI,CAAA,IAAA,GAAG,KAAK,EAAa;AAClC;;;;;;;;;;;;AAYG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAoB,IAAI,CAAC,MAAM,EAAE,QAAQ,IAAI,IAAI,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AACtG;;;;;;;;;;;;AAYG;QACM,IAAY,CAAA,YAAA,GAAG,KAAK,CAAwB,IAAI,CAAC,MAAM,EAAE,YAAY,IAAI,OAAO,CAAC;AAC1F;;;;;;;;;;;;AAYG;AACM,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAoB,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AACjG;;;;;;;;;;;;AAYG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAoB,IAAI,CAAC,MAAM,EAAE,QAAQ,IAAI,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AACxG;iIAxFY,iBAAiB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA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A,EAAA,IAAA,EAAA,eAAe,YAFI,uBAAuB,CAAA,EAAA,CAAA,CAAA;;2FAE1C,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,kBAAkB,EAAE,uBAAuB,CAAC;AACtD,oBAAA,OAAO,EAAE,CAAC,kBAAkB,EAAE,uBAAuB;AACtD,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, input, model, output, Component, inject, ViewContainerRef, viewChild, signal, computed, DestroyRef, effect, ViewEncapsulation, ChangeDetectionStrategy, HostBinding, Renderer2, ChangeDetectorRef, contentChildren, EventEmitter,
|
|
2
|
+
import { InjectionToken, input, model, output, Component, inject, ViewContainerRef, viewChild, signal, computed, DestroyRef, effect, ViewEncapsulation, ChangeDetectionStrategy, HostBinding, Directive, HostListener, Renderer2, ChangeDetectorRef, contentChildren, EventEmitter, NgModule, RendererFactory2, TemplateRef, Injectable } from '@angular/core';
|
|
3
3
|
import { XPropertyFunction, XToCssPixelValue, XToBoolean, XToNumber, XProperty, XConfigService, XIsFunction, XMoveBoxAnimation, XOpacityAnimation, XFillDefault } from '@ng-nest/ui/core';
|
|
4
4
|
import { XPortalService, XPortalResizablePrefix } from '@ng-nest/ui/portal';
|
|
5
5
|
import { Subject, filter, take } from 'rxjs';
|
|
@@ -14,7 +14,7 @@ import { toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
|
14
14
|
import * as i2 from '@angular/cdk/portal';
|
|
15
15
|
import { BasePortalOutlet, CdkPortalOutlet, PortalModule, TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
|
|
16
16
|
import * as i1 from '@angular/cdk/drag-drop';
|
|
17
|
-
import {
|
|
17
|
+
import { CdkDragHandle, CdkDrag, DragDropModule } from '@angular/cdk/drag-drop';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Dialog
|
|
@@ -472,89 +472,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImpor
|
|
|
472
472
|
args: ['class.x-dialog-container']
|
|
473
473
|
}] } });
|
|
474
474
|
|
|
475
|
-
class XDialogPortalComponent extends BasePortalOutlet {
|
|
476
|
-
constructor() {
|
|
477
|
-
super(...arguments);
|
|
478
|
-
// @HostBinding('class.x-dialog-portal') _has = true;
|
|
479
|
-
this.placement = model.required();
|
|
480
|
-
this.renderer = inject(Renderer2);
|
|
481
|
-
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
482
|
-
this.portalOutlet = viewChild.required(CdkPortalOutlet);
|
|
483
|
-
this.dragRef = viewChild.required(CdkDrag);
|
|
484
|
-
this.handles = contentChildren(CdkDragHandle, { descendants: true });
|
|
485
|
-
this.animationChanged = new EventEmitter();
|
|
486
|
-
this.offsetLeft = 0;
|
|
487
|
-
this.offsetTop = 0;
|
|
488
|
-
this.minWidth = '0rem';
|
|
489
|
-
this.minHeight = '0rem';
|
|
490
|
-
this.initHeight = 0;
|
|
491
|
-
this.initContentHeight = 0;
|
|
492
|
-
this.defaultMaximize = false;
|
|
493
|
-
this.distance = { x: 0, y: 0 };
|
|
494
|
-
this.dialogBox = {};
|
|
495
|
-
}
|
|
496
|
-
get getPlacement() {
|
|
497
|
-
return this.placement();
|
|
498
|
-
}
|
|
499
|
-
done({ toState, totalTime }) {
|
|
500
|
-
this.animationChanged.next({
|
|
501
|
-
action: 'done',
|
|
502
|
-
state: toState,
|
|
503
|
-
totalTime
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
start({ toState, totalTime }) {
|
|
507
|
-
this.animationChanged.next({
|
|
508
|
-
action: 'start',
|
|
509
|
-
state: toState,
|
|
510
|
-
totalTime
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
ngOnInit() {
|
|
514
|
-
this.dialogBox['draggable'] = this.defaultMaximize ? this.dialogBox['draggable'] : this.option.draggable;
|
|
515
|
-
}
|
|
516
|
-
ngAfterViewInit() {
|
|
517
|
-
if (this.dialogRef.dragHandleRefs.length === 0) {
|
|
518
|
-
this.dialogBox['draggable'] = false;
|
|
519
|
-
this.option.draggable = false;
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
attachComponentPortal(portal) {
|
|
524
|
-
if (this.portalOutlet().hasAttached()) {
|
|
525
|
-
throw Error('dialog portal has attached');
|
|
526
|
-
}
|
|
527
|
-
return this.portalOutlet().attachComponentPortal(portal);
|
|
528
|
-
}
|
|
529
|
-
attachTemplatePortal(portal) {
|
|
530
|
-
if (this.portalOutlet().hasAttached()) {
|
|
531
|
-
throw Error('dialog portal has attached');
|
|
532
|
-
}
|
|
533
|
-
return this.portalOutlet().attachTemplatePortal(portal);
|
|
534
|
-
}
|
|
535
|
-
onDragEnded(event) {
|
|
536
|
-
this.distance = {
|
|
537
|
-
x: this.distance.x + event.distance.x,
|
|
538
|
-
y: this.distance.y + event.distance.y
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: XDialogPortalComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
542
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.1", type: XDialogPortalComponent, isStandalone: true, selector: "x-dialog-portal", inputs: { placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { placement: "placementChange" }, host: { listeners: { "@x-move-box-animation.done": "done($event)", "@x-move-box-animation.start": "start($event)" }, properties: { "@x-move-box-animation": "this.getPlacement" } }, queries: [{ propertyName: "handles", predicate: CdkDragHandle, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, isSignal: true }, { propertyName: "dragRef", first: true, predicate: CdkDrag, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"x-dialog-portal\"\r\n #dragRef\r\n cdkDrag\r\n [cdkDragDisabled]=\"!option.draggable && !dialogBox['draggable']\"\r\n [cdkDragRootElement]=\"'.cdk-overlay-pane'\"\r\n [cdkDragFreeDragPosition]=\"dialogBox['distance']\"\r\n (cdkDragEnded)=\"onDragEnded($event)\"\r\n [style.minWidth]=\"dialogBox['minWidth']\"\r\n [style.minHeight]=\"dialogBox['minHeight']\"\r\n [style.maxWidth]=\"dialogBox['maxWidth']\"\r\n [style.maxHeight]=\"dialogBox['maxHeight']\"\r\n>\r\n <ng-template cdkPortalOutlet></ng-template>\r\n</div>\r\n", styles: [".x-dialog-portal{margin:0;padding:0}.x-dialog-portal{width:100%;height:100%;display:block;padding:1rem;box-sizing:border-box;min-height:inherit;max-height:inherit;background-color:var(--x-background-100);box-shadow:var(--x-box-shadow);border-radius:var(--x-border-small-radius)}.x-dialog-portal-title{font-weight:600;color:var(--x-text-300);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:3rem;line-height:3rem;display:block;align-items:center;margin:-1rem -1rem 0;padding:0 1rem}.x-dialog-portal-content{display:block;margin:0 -1rem;padding:0 1rem;max-height:70vh;overflow:auto;color:var(--x-text-300);line-height:1.325rem}.x-dialog-portal-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;box-sizing:content-box;margin:0 -1rem -1rem;padding:0 1rem;height:4rem}.x-dialog-portal-actions[align=center]{justify-content:center}.x-dialog-portal-actions[align=start]{justify-content:flex-start}.x-dialog-portal-actions x-button:not(:first-child){margin-left:1rem}.x-dialog-portal-drag-handle{cursor:move}.x-dialog-portal-fullscreen{margin:0!important}.x-dialog-portal-fullscreen .x-dialog-portal{left:0!important;top:0!important;border-radius:0}.x-dialog-portal-fullscreen .x-dialog-portal-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important}x-dialog-portal{width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i2.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], animations: [XMoveBoxAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
543
|
-
}
|
|
544
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: XDialogPortalComponent, decorators: [{
|
|
545
|
-
type: Component,
|
|
546
|
-
args: [{ selector: 'x-dialog-portal', imports: [DragDropModule, PortalModule], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, animations: [XMoveBoxAnimation], template: "<div\r\n class=\"x-dialog-portal\"\r\n #dragRef\r\n cdkDrag\r\n [cdkDragDisabled]=\"!option.draggable && !dialogBox['draggable']\"\r\n [cdkDragRootElement]=\"'.cdk-overlay-pane'\"\r\n [cdkDragFreeDragPosition]=\"dialogBox['distance']\"\r\n (cdkDragEnded)=\"onDragEnded($event)\"\r\n [style.minWidth]=\"dialogBox['minWidth']\"\r\n [style.minHeight]=\"dialogBox['minHeight']\"\r\n [style.maxWidth]=\"dialogBox['maxWidth']\"\r\n [style.maxHeight]=\"dialogBox['maxHeight']\"\r\n>\r\n <ng-template cdkPortalOutlet></ng-template>\r\n</div>\r\n", styles: [".x-dialog-portal{margin:0;padding:0}.x-dialog-portal{width:100%;height:100%;display:block;padding:1rem;box-sizing:border-box;min-height:inherit;max-height:inherit;background-color:var(--x-background-100);box-shadow:var(--x-box-shadow);border-radius:var(--x-border-small-radius)}.x-dialog-portal-title{font-weight:600;color:var(--x-text-300);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:3rem;line-height:3rem;display:block;align-items:center;margin:-1rem -1rem 0;padding:0 1rem}.x-dialog-portal-content{display:block;margin:0 -1rem;padding:0 1rem;max-height:70vh;overflow:auto;color:var(--x-text-300);line-height:1.325rem}.x-dialog-portal-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;box-sizing:content-box;margin:0 -1rem -1rem;padding:0 1rem;height:4rem}.x-dialog-portal-actions[align=center]{justify-content:center}.x-dialog-portal-actions[align=start]{justify-content:flex-start}.x-dialog-portal-actions x-button:not(:first-child){margin-left:1rem}.x-dialog-portal-drag-handle{cursor:move}.x-dialog-portal-fullscreen{margin:0!important}.x-dialog-portal-fullscreen .x-dialog-portal{left:0!important;top:0!important;border-radius:0}.x-dialog-portal-fullscreen .x-dialog-portal-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important}x-dialog-portal{width:100%;height:100%}\n"] }]
|
|
547
|
-
}], propDecorators: { getPlacement: [{
|
|
548
|
-
type: HostBinding,
|
|
549
|
-
args: ['@x-move-box-animation']
|
|
550
|
-
}], done: [{
|
|
551
|
-
type: HostListener,
|
|
552
|
-
args: ['@x-move-box-animation.done', ['$event']]
|
|
553
|
-
}], start: [{
|
|
554
|
-
type: HostListener,
|
|
555
|
-
args: ['@x-move-box-animation.start', ['$event']]
|
|
556
|
-
}] } });
|
|
557
|
-
|
|
558
475
|
// TODO: add more function
|
|
559
476
|
class XDialogRef {
|
|
560
477
|
constructor(overlayRef, containerInstance, renderer, portalService) {
|
|
@@ -765,6 +682,82 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImpor
|
|
|
765
682
|
args: ['click', ['$event']]
|
|
766
683
|
}] } });
|
|
767
684
|
|
|
685
|
+
class XDialogPortalComponent extends BasePortalOutlet {
|
|
686
|
+
constructor() {
|
|
687
|
+
super(...arguments);
|
|
688
|
+
// @HostBinding('class.x-dialog-portal') _has = true;
|
|
689
|
+
this.placement = model.required();
|
|
690
|
+
this.renderer = inject(Renderer2);
|
|
691
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
692
|
+
this.portalOutlet = viewChild.required(CdkPortalOutlet);
|
|
693
|
+
this.dragRef = viewChild.required(CdkDrag);
|
|
694
|
+
this.handles = contentChildren(XDialogDragHandleDirective, { descendants: true });
|
|
695
|
+
this.animationChanged = new EventEmitter();
|
|
696
|
+
this.offsetLeft = 0;
|
|
697
|
+
this.offsetTop = 0;
|
|
698
|
+
this.minWidth = '0rem';
|
|
699
|
+
this.minHeight = '0rem';
|
|
700
|
+
this.initHeight = 0;
|
|
701
|
+
this.initContentHeight = 0;
|
|
702
|
+
this.defaultMaximize = false;
|
|
703
|
+
this.distance = { x: 0, y: 0 };
|
|
704
|
+
this.dialogBox = {};
|
|
705
|
+
}
|
|
706
|
+
get getPlacement() {
|
|
707
|
+
return this.placement();
|
|
708
|
+
}
|
|
709
|
+
done({ toState, totalTime }) {
|
|
710
|
+
this.animationChanged.next({
|
|
711
|
+
action: 'done',
|
|
712
|
+
state: toState,
|
|
713
|
+
totalTime
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
start({ toState, totalTime }) {
|
|
717
|
+
this.animationChanged.next({
|
|
718
|
+
action: 'start',
|
|
719
|
+
state: toState,
|
|
720
|
+
totalTime
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
ngOnInit() {
|
|
724
|
+
this.dialogBox['draggable'] = this.defaultMaximize ? this.dialogBox['draggable'] : this.option.draggable;
|
|
725
|
+
}
|
|
726
|
+
attachComponentPortal(portal) {
|
|
727
|
+
if (this.portalOutlet().hasAttached()) {
|
|
728
|
+
throw Error('dialog portal has attached');
|
|
729
|
+
}
|
|
730
|
+
return this.portalOutlet().attachComponentPortal(portal);
|
|
731
|
+
}
|
|
732
|
+
attachTemplatePortal(portal) {
|
|
733
|
+
if (this.portalOutlet().hasAttached()) {
|
|
734
|
+
throw Error('dialog portal has attached');
|
|
735
|
+
}
|
|
736
|
+
return this.portalOutlet().attachTemplatePortal(portal);
|
|
737
|
+
}
|
|
738
|
+
onDragEnded(event) {
|
|
739
|
+
this.distance = {
|
|
740
|
+
x: this.distance.x + event.distance.x,
|
|
741
|
+
y: this.distance.y + event.distance.y
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: XDialogPortalComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
745
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.1", type: XDialogPortalComponent, isStandalone: true, selector: "x-dialog-portal", inputs: { placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { placement: "placementChange" }, host: { listeners: { "@x-move-box-animation.done": "done($event)", "@x-move-box-animation.start": "start($event)" }, properties: { "@x-move-box-animation": "this.getPlacement" } }, queries: [{ propertyName: "handles", predicate: XDialogDragHandleDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, isSignal: true }, { propertyName: "dragRef", first: true, predicate: CdkDrag, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"x-dialog-portal\"\r\n #dragRef\r\n cdkDrag\r\n [cdkDragBoundary]=\"'.cdk-overlay-container'\"\r\n [cdkDragDisabled]=\"!option.draggable && !dialogBox['draggable']\"\r\n [cdkDragRootElement]=\"'.cdk-overlay-pane'\"\r\n [cdkDragFreeDragPosition]=\"dialogBox['distance']\"\r\n (cdkDragEnded)=\"onDragEnded($event)\"\r\n [style.minWidth]=\"dialogBox['minWidth']\"\r\n [style.minHeight]=\"dialogBox['minHeight']\"\r\n [style.maxWidth]=\"dialogBox['maxWidth']\"\r\n [style.maxHeight]=\"dialogBox['maxHeight']\"\r\n>\r\n <ng-template cdkPortalOutlet></ng-template>\r\n</div>\r\n", styles: [".x-dialog-portal{margin:0;padding:0}.x-dialog-portal{width:100%;height:100%;display:block;padding:1rem;box-sizing:border-box;min-height:inherit;max-height:inherit;background-color:var(--x-background-100);box-shadow:var(--x-box-shadow);border-radius:var(--x-border-small-radius)}.x-dialog-portal-title{font-weight:600;color:var(--x-text-300);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:3rem;line-height:3rem;display:block;align-items:center;margin:-1rem -1rem 0;padding:0 1rem}.x-dialog-portal-content{display:block;margin:0 -1rem;padding:0 1rem;max-height:70vh;overflow:auto;color:var(--x-text-300);line-height:1.325rem}.x-dialog-portal-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;box-sizing:content-box;margin:0 -1rem -1rem;padding:0 1rem;height:4rem}.x-dialog-portal-actions[align=center]{justify-content:center}.x-dialog-portal-actions[align=start]{justify-content:flex-start}.x-dialog-portal-actions x-button:not(:first-child){margin-left:1rem}.x-dialog-portal-drag-handle{cursor:move}.x-dialog-portal-fullscreen{margin:0!important}.x-dialog-portal-fullscreen .x-dialog-portal{left:0!important;top:0!important;border-radius:0}.x-dialog-portal-fullscreen .x-dialog-portal-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important}x-dialog-portal{width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i2.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], animations: [XMoveBoxAnimation], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
746
|
+
}
|
|
747
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: XDialogPortalComponent, decorators: [{
|
|
748
|
+
type: Component,
|
|
749
|
+
args: [{ selector: 'x-dialog-portal', imports: [DragDropModule, PortalModule], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, animations: [XMoveBoxAnimation], template: "<div\r\n class=\"x-dialog-portal\"\r\n #dragRef\r\n cdkDrag\r\n [cdkDragBoundary]=\"'.cdk-overlay-container'\"\r\n [cdkDragDisabled]=\"!option.draggable && !dialogBox['draggable']\"\r\n [cdkDragRootElement]=\"'.cdk-overlay-pane'\"\r\n [cdkDragFreeDragPosition]=\"dialogBox['distance']\"\r\n (cdkDragEnded)=\"onDragEnded($event)\"\r\n [style.minWidth]=\"dialogBox['minWidth']\"\r\n [style.minHeight]=\"dialogBox['minHeight']\"\r\n [style.maxWidth]=\"dialogBox['maxWidth']\"\r\n [style.maxHeight]=\"dialogBox['maxHeight']\"\r\n>\r\n <ng-template cdkPortalOutlet></ng-template>\r\n</div>\r\n", styles: [".x-dialog-portal{margin:0;padding:0}.x-dialog-portal{width:100%;height:100%;display:block;padding:1rem;box-sizing:border-box;min-height:inherit;max-height:inherit;background-color:var(--x-background-100);box-shadow:var(--x-box-shadow);border-radius:var(--x-border-small-radius)}.x-dialog-portal-title{font-weight:600;color:var(--x-text-300);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:3rem;line-height:3rem;display:block;align-items:center;margin:-1rem -1rem 0;padding:0 1rem}.x-dialog-portal-content{display:block;margin:0 -1rem;padding:0 1rem;max-height:70vh;overflow:auto;color:var(--x-text-300);line-height:1.325rem}.x-dialog-portal-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;box-sizing:content-box;margin:0 -1rem -1rem;padding:0 1rem;height:4rem}.x-dialog-portal-actions[align=center]{justify-content:center}.x-dialog-portal-actions[align=start]{justify-content:flex-start}.x-dialog-portal-actions x-button:not(:first-child){margin-left:1rem}.x-dialog-portal-drag-handle{cursor:move}.x-dialog-portal-fullscreen{margin:0!important}.x-dialog-portal-fullscreen .x-dialog-portal{left:0!important;top:0!important;border-radius:0}.x-dialog-portal-fullscreen .x-dialog-portal-content{max-height:calc(100vh - 7rem)!important;height:calc(100vh - 7rem)!important}x-dialog-portal{width:100%;height:100%}\n"] }]
|
|
750
|
+
}], propDecorators: { getPlacement: [{
|
|
751
|
+
type: HostBinding,
|
|
752
|
+
args: ['@x-move-box-animation']
|
|
753
|
+
}], done: [{
|
|
754
|
+
type: HostListener,
|
|
755
|
+
args: ['@x-move-box-animation.done', ['$event']]
|
|
756
|
+
}], start: [{
|
|
757
|
+
type: HostListener,
|
|
758
|
+
args: ['@x-move-box-animation.start', ['$event']]
|
|
759
|
+
}] } });
|
|
760
|
+
|
|
768
761
|
class XDialogModule {
|
|
769
762
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: XDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
770
763
|
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: XDialogModule, imports: [XDialogComponent,
|