@acorex/components 21.0.2-next.7 → 21.0.2-next.9
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.
|
@@ -71,7 +71,7 @@ class AXDialogComponent extends MXBaseComponent {
|
|
|
71
71
|
provide: AXComponent,
|
|
72
72
|
useExisting: AXDialogComponent,
|
|
73
73
|
},
|
|
74
|
-
], usesInheritance: true, ngImport: i0, template: "<div\n class=\"ax-dialog ax-orientation-{{ data().orientation }}\"\n tabindex=\"-1\"\n cdkDrag\n cdkDragHandle\n [cdkDragDisabled]=\"!data().draggable\"\n>\n <div class=\"ax-dialog-content-wrapper\">\n @if (data().icon !== 'none') {\n <div class=\"ax-dialog-icon-side\">\n <i class=\"ax-dialog-icon {{ data().icon }}\"></i>\n </div>\n }\n <div class=\"ax-dialog-content-side\">\n <div class=\"ax-dialog-title\">{{ data().title | translate | async }}</div>\n <div class=\"ax-dialog-content\">{{ data().content | translate | async }}</div>\n </div>\n <div class=\"ax-dialog-dismiss-icon\">\n @if (data().closeButton) {\n <i class=\"ax-icon ax-icon-close\"></i>\n }\n </div>\n </div>\n\n <ax-footer>\n @for (button of data().buttons; let i = $index; track i) {\n <ax-button\n [text]=\"button.text | translate | async\"\n [tabindex]=\"i\"\n [axHotkey]=\"button.hotkey\"\n [axAutoFocus]=\"_hasAutoFocus(button)\"\n (onClick)=\"_handleButtonClick(button)\"\n [look]=\"button.look || 'solid'\"\n [disabled]=\"button.disabled\"\n [color]=\"button.color || 'default'\"\n >\n @if (button.loading) {\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </ax-footer>\n</div>\n", styles: ["@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial}}}@layer components{.ax-dialog{border-radius:var(--radius-xl,.75rem);border-style:var(--tw-border-style);background-color:var(--color-lightest);width:93vw;color:var(--color-on-lightest);border-width:1px;border-color:var(--color-border-lightest);flex-direction:column;display:flex;position:relative;overflow:hidden}.ax-dialog:where(.ax-dark,.ax-dark *){background-color:var(--color-darkest);color:var(--color-on-darkest);border-color:var(--color-border-darkest)}@media(min-width:48rem){.ax-dialog{width:75vw}}@media(min-width:64rem){.ax-dialog{width:50vw}}@media(min-width:80rem){.ax-dialog{width:35vw}}@media(min-width:96rem){.ax-dialog{width:w5vw}}.ax-dialog.ax-orientation-horizontal .ax-dialog-content-wrapper{flex-direction:row!important}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper{flex-direction:column;align-items:center}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-icon-side{margin-bottom:calc(var(--spacing,.25rem) * 4)}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-content-side{margin:calc(var(--spacing,.25rem) * 0);text-align:center}.ax-dialog.ax-orientation-vertical ax-footer ax-button{flex:1}.ax-dialog .ax-dialog-content-wrapper{gap:calc(var(--spacing,.25rem) * 2);padding:calc(var(--spacing,.25rem) * 6);display:flex}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-icon-side .ax-dialog-icon{min-height:calc(var(--spacing,.25rem) * 12)!important;width:calc(var(--spacing,.25rem) * 12)!important;cursor:move!important;background-color:var(--ax-comp-bg,var(--color-surface))!important;font-size:var(--text-2xl,1.5rem)!important;line-height:var(--tw-leading,var(--text-2xl--line-height,calc(2 / 1.5)))!important;color:var(--ax-comp-text,var(--color-on-surface))!important;border-radius:3.40282e38px!important;justify-content:center!important;align-items:center!important;display:flex!important}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side{flex:1;margin-inline-start:calc(var(--spacing,.25rem) * 4)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-title{margin-bottom:calc(var(--spacing,.25rem) * 2);font-size:var(--text-lg,1.125rem);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75 / 1.125)));--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-content{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.ax-dialog ax-footer{padding-inline:calc(var(--spacing,.25rem) * 6);padding-block:calc(var(--spacing,.25rem) * 3);align-items:flex-end}}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}\n/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: 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: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "directive", type: AXHotkeyDirective, selector: "[axHotkey]", inputs: ["axHotkey"] }, { kind: "directive", type: AXAutoFocusDirective, selector: "[axAutoFocus]", inputs: ["axAutoFocus", "axAutoFocusTime"] }, { kind: "component", type: AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
74
|
+
], usesInheritance: true, ngImport: i0, template: "<div\n class=\"ax-dialog ax-orientation-{{ data().orientation }}\"\n tabindex=\"-1\"\n cdkDrag\n cdkDragHandle\n [cdkDragDisabled]=\"!data().draggable\"\n>\n <div class=\"ax-dialog-content-wrapper\">\n @if (data().icon !== 'none') {\n <div class=\"ax-dialog-icon-side\">\n <i class=\"ax-dialog-icon {{ data().icon }}\"></i>\n </div>\n }\n <div class=\"ax-dialog-content-side\">\n <div class=\"ax-dialog-title\">{{ data().title | translate | async }}</div>\n <div class=\"ax-dialog-content\">{{ data().content | translate | async }}</div>\n </div>\n <div class=\"ax-dialog-dismiss-icon\">\n @if (data().closeButton) {\n <i class=\"ax-icon ax-icon-close\"></i>\n }\n </div>\n </div>\n\n <ax-footer>\n <ax-suffix>\n @for (button of data().buttons; let i = $index; track i) {\n <ax-button\n [text]=\"button.text | translate | async\"\n [tabindex]=\"i\"\n [axHotkey]=\"button.hotkey\"\n [axAutoFocus]=\"_hasAutoFocus(button)\"\n (onClick)=\"_handleButtonClick(button)\"\n [look]=\"button.look || 'solid'\"\n [disabled]=\"button.disabled\"\n [color]=\"button.color || 'default'\"\n >\n @if (button.loading) {\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </ax-suffix>\n </ax-footer>\n</div>\n", styles: ["@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial}}}@layer components{.ax-dialog{border-radius:var(--radius-xl,.75rem);border-style:var(--tw-border-style);background-color:var(--color-lightest);width:93vw;color:var(--color-on-lightest);border-width:1px;border-color:var(--color-border-lightest);flex-direction:column;display:flex;position:relative;overflow:hidden}.ax-dialog:where(.ax-dark,.ax-dark *){background-color:var(--color-darkest);color:var(--color-on-darkest);border-color:var(--color-border-darkest)}@media(min-width:48rem){.ax-dialog{width:75vw}}@media(min-width:64rem){.ax-dialog{width:50vw}}@media(min-width:80rem){.ax-dialog{width:35vw}}@media(min-width:96rem){.ax-dialog{width:w5vw}}.ax-dialog.ax-orientation-horizontal .ax-dialog-content-wrapper{flex-direction:row!important}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper{flex-direction:column;align-items:center}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-icon-side{margin-bottom:calc(var(--spacing,.25rem) * 4)}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-content-side{margin:calc(var(--spacing,.25rem) * 0);text-align:center}.ax-dialog.ax-orientation-vertical ax-footer ax-button{flex:1}.ax-dialog .ax-dialog-content-wrapper{gap:calc(var(--spacing,.25rem) * 2);padding:calc(var(--spacing,.25rem) * 6);display:flex}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-icon-side .ax-dialog-icon{min-height:calc(var(--spacing,.25rem) * 12)!important;width:calc(var(--spacing,.25rem) * 12)!important;cursor:move!important;background-color:var(--ax-comp-bg,var(--color-surface))!important;font-size:var(--text-2xl,1.5rem)!important;line-height:var(--tw-leading,var(--text-2xl--line-height,calc(2 / 1.5)))!important;color:var(--ax-comp-text,var(--color-on-surface))!important;border-radius:3.40282e38px!important;justify-content:center!important;align-items:center!important;display:flex!important}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side{flex:1;margin-inline-start:calc(var(--spacing,.25rem) * 4)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-title{margin-bottom:calc(var(--spacing,.25rem) * 2);font-size:var(--text-lg,1.125rem);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75 / 1.125)));--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-content{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.ax-dialog ax-footer{padding-inline:calc(var(--spacing,.25rem) * 6);padding-block:calc(var(--spacing,.25rem) * 3);align-items:flex-end}}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}\n/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "directive", type: 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: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "component", type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "directive", type: AXHotkeyDirective, selector: "[axHotkey]", inputs: ["axHotkey"] }, { kind: "directive", type: AXAutoFocusDirective, selector: "[axAutoFocus]", inputs: ["axAutoFocus", "axAutoFocusTime"] }, { kind: "component", type: AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
75
75
|
}
|
|
76
76
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXDialogComponent, decorators: [{
|
|
77
77
|
type: Component,
|
|
@@ -97,7 +97,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
97
97
|
AXLoadingComponent,
|
|
98
98
|
AsyncPipe,
|
|
99
99
|
AXTranslatorPipe,
|
|
100
|
-
], template: "<div\n class=\"ax-dialog ax-orientation-{{ data().orientation }}\"\n tabindex=\"-1\"\n cdkDrag\n cdkDragHandle\n [cdkDragDisabled]=\"!data().draggable\"\n>\n <div class=\"ax-dialog-content-wrapper\">\n @if (data().icon !== 'none') {\n <div class=\"ax-dialog-icon-side\">\n <i class=\"ax-dialog-icon {{ data().icon }}\"></i>\n </div>\n }\n <div class=\"ax-dialog-content-side\">\n <div class=\"ax-dialog-title\">{{ data().title | translate | async }}</div>\n <div class=\"ax-dialog-content\">{{ data().content | translate | async }}</div>\n </div>\n <div class=\"ax-dialog-dismiss-icon\">\n @if (data().closeButton) {\n <i class=\"ax-icon ax-icon-close\"></i>\n }\n </div>\n </div>\n\n <ax-footer>\n @for (button of data().buttons; let i = $index; track i) {\n <ax-button\n [text]=\"button.text | translate | async\"\n [tabindex]=\"i\"\n [axHotkey]=\"button.hotkey\"\n [axAutoFocus]=\"_hasAutoFocus(button)\"\n (onClick)=\"_handleButtonClick(button)\"\n [look]=\"button.look || 'solid'\"\n [disabled]=\"button.disabled\"\n [color]=\"button.color || 'default'\"\n >\n @if (button.loading) {\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </ax-footer>\n</div>\n", styles: ["@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial}}}@layer components{.ax-dialog{border-radius:var(--radius-xl,.75rem);border-style:var(--tw-border-style);background-color:var(--color-lightest);width:93vw;color:var(--color-on-lightest);border-width:1px;border-color:var(--color-border-lightest);flex-direction:column;display:flex;position:relative;overflow:hidden}.ax-dialog:where(.ax-dark,.ax-dark *){background-color:var(--color-darkest);color:var(--color-on-darkest);border-color:var(--color-border-darkest)}@media(min-width:48rem){.ax-dialog{width:75vw}}@media(min-width:64rem){.ax-dialog{width:50vw}}@media(min-width:80rem){.ax-dialog{width:35vw}}@media(min-width:96rem){.ax-dialog{width:w5vw}}.ax-dialog.ax-orientation-horizontal .ax-dialog-content-wrapper{flex-direction:row!important}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper{flex-direction:column;align-items:center}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-icon-side{margin-bottom:calc(var(--spacing,.25rem) * 4)}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-content-side{margin:calc(var(--spacing,.25rem) * 0);text-align:center}.ax-dialog.ax-orientation-vertical ax-footer ax-button{flex:1}.ax-dialog .ax-dialog-content-wrapper{gap:calc(var(--spacing,.25rem) * 2);padding:calc(var(--spacing,.25rem) * 6);display:flex}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-icon-side .ax-dialog-icon{min-height:calc(var(--spacing,.25rem) * 12)!important;width:calc(var(--spacing,.25rem) * 12)!important;cursor:move!important;background-color:var(--ax-comp-bg,var(--color-surface))!important;font-size:var(--text-2xl,1.5rem)!important;line-height:var(--tw-leading,var(--text-2xl--line-height,calc(2 / 1.5)))!important;color:var(--ax-comp-text,var(--color-on-surface))!important;border-radius:3.40282e38px!important;justify-content:center!important;align-items:center!important;display:flex!important}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side{flex:1;margin-inline-start:calc(var(--spacing,.25rem) * 4)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-title{margin-bottom:calc(var(--spacing,.25rem) * 2);font-size:var(--text-lg,1.125rem);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75 / 1.125)));--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-content{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.ax-dialog ax-footer{padding-inline:calc(var(--spacing,.25rem) * 6);padding-block:calc(var(--spacing,.25rem) * 3);align-items:flex-end}}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}\n/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */\n"] }]
|
|
100
|
+
], template: "<div\n class=\"ax-dialog ax-orientation-{{ data().orientation }}\"\n tabindex=\"-1\"\n cdkDrag\n cdkDragHandle\n [cdkDragDisabled]=\"!data().draggable\"\n>\n <div class=\"ax-dialog-content-wrapper\">\n @if (data().icon !== 'none') {\n <div class=\"ax-dialog-icon-side\">\n <i class=\"ax-dialog-icon {{ data().icon }}\"></i>\n </div>\n }\n <div class=\"ax-dialog-content-side\">\n <div class=\"ax-dialog-title\">{{ data().title | translate | async }}</div>\n <div class=\"ax-dialog-content\">{{ data().content | translate | async }}</div>\n </div>\n <div class=\"ax-dialog-dismiss-icon\">\n @if (data().closeButton) {\n <i class=\"ax-icon ax-icon-close\"></i>\n }\n </div>\n </div>\n\n <ax-footer>\n <ax-suffix>\n @for (button of data().buttons; let i = $index; track i) {\n <ax-button\n [text]=\"button.text | translate | async\"\n [tabindex]=\"i\"\n [axHotkey]=\"button.hotkey\"\n [axAutoFocus]=\"_hasAutoFocus(button)\"\n (onClick)=\"_handleButtonClick(button)\"\n [look]=\"button.look || 'solid'\"\n [disabled]=\"button.disabled\"\n [color]=\"button.color || 'default'\"\n >\n @if (button.loading) {\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </ax-suffix>\n </ax-footer>\n</div>\n", styles: ["@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial}}}@layer components{.ax-dialog{border-radius:var(--radius-xl,.75rem);border-style:var(--tw-border-style);background-color:var(--color-lightest);width:93vw;color:var(--color-on-lightest);border-width:1px;border-color:var(--color-border-lightest);flex-direction:column;display:flex;position:relative;overflow:hidden}.ax-dialog:where(.ax-dark,.ax-dark *){background-color:var(--color-darkest);color:var(--color-on-darkest);border-color:var(--color-border-darkest)}@media(min-width:48rem){.ax-dialog{width:75vw}}@media(min-width:64rem){.ax-dialog{width:50vw}}@media(min-width:80rem){.ax-dialog{width:35vw}}@media(min-width:96rem){.ax-dialog{width:w5vw}}.ax-dialog.ax-orientation-horizontal .ax-dialog-content-wrapper{flex-direction:row!important}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper{flex-direction:column;align-items:center}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-icon-side{margin-bottom:calc(var(--spacing,.25rem) * 4)}.ax-dialog.ax-orientation-vertical .ax-dialog-content-wrapper .ax-dialog-content-side{margin:calc(var(--spacing,.25rem) * 0);text-align:center}.ax-dialog.ax-orientation-vertical ax-footer ax-button{flex:1}.ax-dialog .ax-dialog-content-wrapper{gap:calc(var(--spacing,.25rem) * 2);padding:calc(var(--spacing,.25rem) * 6);display:flex}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-icon-side .ax-dialog-icon{min-height:calc(var(--spacing,.25rem) * 12)!important;width:calc(var(--spacing,.25rem) * 12)!important;cursor:move!important;background-color:var(--ax-comp-bg,var(--color-surface))!important;font-size:var(--text-2xl,1.5rem)!important;line-height:var(--tw-leading,var(--text-2xl--line-height,calc(2 / 1.5)))!important;color:var(--ax-comp-text,var(--color-on-surface))!important;border-radius:3.40282e38px!important;justify-content:center!important;align-items:center!important;display:flex!important}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side{flex:1;margin-inline-start:calc(var(--spacing,.25rem) * 4)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-title{margin-bottom:calc(var(--spacing,.25rem) * 2);font-size:var(--text-lg,1.125rem);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75 / 1.125)));--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.ax-dialog .ax-dialog-content-wrapper .ax-dialog-content-side .ax-dialog-content{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.ax-dialog ax-footer{padding-inline:calc(var(--spacing,.25rem) * 6);padding-block:calc(var(--spacing,.25rem) * 3);align-items:flex-end}}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}\n/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */\n"] }]
|
|
101
101
|
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], onClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "onClose", required: false }] }] } });
|
|
102
102
|
|
|
103
103
|
const AX_DIALOG_CONFIG = new InjectionToken('AX_DIALOG_CONFIG', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-dialog.mjs","sources":["../../../../packages/components/dialog/src/lib/dialog.component.ts","../../../../packages/components/dialog/src/lib/dialog.component.html","../../../../packages/components/dialog/src/lib/dialog.config.ts","../../../../packages/components/dialog/src/lib/dialog.service.ts","../../../../packages/components/dialog/src/lib/dialog.module.ts","../../../../packages/components/dialog/src/acorex-components-dialog.ts"],"sourcesContent":["import {\n AXAutoFocusDirective,\n AXClosableComponent,\n AXComponent,\n AXHotkeyDirective,\n MXBaseComponent,\n} from '@acorex/cdk/common';\nimport { AXButtonComponent } from '@acorex/components/button';\nimport { AXDecoratorGenericComponent } from '@acorex/components/decorators';\nimport { AXLoadingComponent } from '@acorex/components/loading';\nimport { AXTranslatorPipe } from '@acorex/core/translation';\nimport { CdkDrag, CdkDragHandle } from '@angular/cdk/drag-drop';\nimport { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation, input } from '@angular/core';\nimport { AXDialogButtonItem, AXDialogData } from './dialog.class';\n\n/**\n * A dialog component that provides a modal interface for user interactions.\n * @category Components\n */\n@Component({\n selector: 'ax-dialog',\n templateUrl: './dialog.component.html',\n styleUrls: ['./dialog.component.compiled.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '[attr.tabIndex]': '\"-1\"',\n '[class]': '\"ax-\" + data().type',\n },\n providers: [\n {\n provide: AXClosableComponent,\n useExisting: AXDialogComponent,\n },\n {\n provide: AXComponent,\n useExisting: AXDialogComponent,\n },\n ],\n imports: [\n CdkDrag,\n CdkDragHandle,\n AXDecoratorGenericComponent,\n AXButtonComponent,\n AXHotkeyDirective,\n AXAutoFocusDirective,\n AXLoadingComponent,\n AsyncPipe,\n AXTranslatorPipe,\n ],\n})\nexport class AXDialogComponent extends MXBaseComponent {\n /** Dialog configuration data */\n data = input.required<AXDialogData>();\n\n /** @internal Callback function to close the dialog */\n onClose = input<() => void>();\n\n /**\n * @ignore\n */\n protected _icon: string;\n\n /**\n * @ignore\n */\n protected _handleButtonClick(button: AXDialogButtonItem) {\n if (button.onClick) {\n button.onClick({ source: button });\n }\n }\n\n /**\n * @ignore\n */\n protected _hasAutoFocus(button: AXDialogButtonItem): boolean {\n const buttons = this.data().buttons;\n const autoFocusItem = buttons.find((item) => item.autofocus === true);\n if (autoFocusItem && autoFocusItem.text === button.text) {\n return true;\n }\n if (!autoFocusItem) {\n if (buttons.length > 0) {\n buttons[0].autofocus = true;\n return buttons[0].text === button.text;\n }\n }\n return false;\n }\n\n /**\n * Closes the dialog.\n *\n * @returns void - No return value. The dialog is closed and removed from the DOM.\n */\n close() {\n const closeCallback = this.onClose();\n if (closeCallback) {\n closeCallback();\n }\n }\n}\n","<div\n class=\"ax-dialog ax-orientation-{{ data().orientation }}\"\n tabindex=\"-1\"\n cdkDrag\n cdkDragHandle\n [cdkDragDisabled]=\"!data().draggable\"\n>\n <div class=\"ax-dialog-content-wrapper\">\n @if (data().icon !== 'none') {\n <div class=\"ax-dialog-icon-side\">\n <i class=\"ax-dialog-icon {{ data().icon }}\"></i>\n </div>\n }\n <div class=\"ax-dialog-content-side\">\n <div class=\"ax-dialog-title\">{{ data().title | translate | async }}</div>\n <div class=\"ax-dialog-content\">{{ data().content | translate | async }}</div>\n </div>\n <div class=\"ax-dialog-dismiss-icon\">\n @if (data().closeButton) {\n <i class=\"ax-icon ax-icon-close\"></i>\n }\n </div>\n </div>\n\n <ax-footer>\n @for (button of data().buttons; let i = $index; track i) {\n <ax-button\n [text]=\"button.text | translate | async\"\n [tabindex]=\"i\"\n [axHotkey]=\"button.hotkey\"\n [axAutoFocus]=\"_hasAutoFocus(button)\"\n (onClick)=\"_handleButtonClick(button)\"\n [look]=\"button.look || 'solid'\"\n [disabled]=\"button.disabled\"\n [color]=\"button.color || 'default'\"\n >\n @if (button.loading) {\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </ax-footer>\n</div>\n","import { AX_GLOBAL_CONFIG } from '@acorex/core/config';\nimport { InjectionToken, inject } from '@angular/core';\nimport { set } from 'lodash-es';\n\nexport interface AXDialogConfigToken {\n confirm: { defaultAction: 'confirm' | 'cancel' };\n}\n\nexport const AX_DIALOG_CONFIG = new InjectionToken<AXDialogConfigToken>('AX_DIALOG_CONFIG', {\n providedIn: 'root',\n factory: () => {\n const global = inject(AX_GLOBAL_CONFIG);\n set(global, 'layout.dialog', AX_DIALOG_CONFIG);\n return AXDialogDefaultConfig;\n },\n});\n\nexport const AXDialogDefaultConfig: AXDialogConfigToken = {\n confirm: { defaultAction: 'cancel' },\n};\n\nexport type PartialDialogConfig = Partial<AXDialogConfigToken>;\n\nexport function dialogConfig(config: PartialDialogConfig = {}): AXDialogConfigToken {\n const result = {\n ...AXDialogDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { AXStyleColorType } from '@acorex/cdk/common';\nimport { AXOverlayService } from '@acorex/cdk/overlay';\nimport { AXHtmlUtil } from '@acorex/core/utils';\nimport { Injectable, inject } from '@angular/core';\nimport { AXDialogConfig, AXDialogData, AXDialogInternalRef, AXDialogRef } from './dialog.class';\nimport { AXDialogComponent } from './dialog.component';\nimport { AXDialogConfigToken, AX_DIALOG_CONFIG } from './dialog.config';\n\n/**\n * The Button is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Injectable()\nexport class AXDialogService {\n private overlayService = inject(AXOverlayService);\n private defaultConfig: AXDialogConfigToken = inject(AX_DIALOG_CONFIG);\n\n private detectIcon(type: AXStyleColorType): string {\n let icon: string;\n switch (type) {\n case 'success':\n icon = 'ax-icon ax-icon-check';\n break;\n case 'danger':\n icon = 'ax-icon ax-icon-error';\n break;\n case 'warning':\n icon = 'ax-icon ax-icon-warning';\n break;\n default:\n icon = 'ax-icon ax-icon-info';\n break;\n }\n return icon;\n }\n\n /**\n * Show an alert box with 'Okay' button.\n *\n * @param title - The title of the alert dialog.\n * @param content - The content message of the alert dialog.\n * @param type - The type/color of the alert (primary, success, warning, danger).\n * @param orientation - The orientation of the dialog (horizontal or vertical).\n * @param draggable - Whether the dialog can be dragged.\n * @returns Promise<void> - Promise that resolves when the dialog is closed.\n */\n alert(\n title: string,\n content: string,\n type: AXStyleColorType = 'primary',\n orientation: 'horizontal' | 'vertical' = 'horizontal',\n draggable?: boolean,\n ): Promise<void> {\n return new Promise((resolve) => {\n const popup = this.open({\n title,\n type: type,\n content,\n icon: this.detectIcon(type),\n orientation,\n draggable,\n buttons: [\n {\n name: 'confirm',\n text: AXHtmlUtil.isRtl() ? 'باشه' : 'Okay',\n color: type,\n autofocus: true,\n onClick: () => {\n popup.close();\n if (resolve) {\n resolve();\n }\n },\n },\n ],\n });\n });\n }\n\n /**\n * Show a confirm box with 'Okay' & 'Cancel' buttons.\n *\n * @param title - The title of the confirm dialog.\n * @param content - The content message of the confirm dialog.\n * @param type - The type/color of the confirm dialog (primary, success, warning, danger).\n * @param orientation - The orientation of the dialog (horizontal or vertical).\n * @param draggable - Whether the dialog can be dragged.\n * @param defaultAction - The default action to focus (confirm or cancel).\n * @returns Promise<{ result: boolean }> - Promise that resolves with the user's choice.\n */\n confirm(\n title: string,\n content: string,\n type: AXStyleColorType = 'primary',\n orientation: 'horizontal' | 'vertical' = 'horizontal',\n draggable?: boolean,\n defaultAction?: 'confirm' | 'cancel',\n ): Promise<{ result: boolean }> {\n return new Promise<{ result: boolean }>((resolve) => {\n const tokenConfig = this.defaultConfig.confirm.defaultAction;\n\n const action = defaultAction || (type === 'danger' ? 'cancel' : tokenConfig);\n\n const popup = this.open({\n title,\n content,\n type,\n icon: this.detectIcon(type),\n orientation,\n draggable,\n buttons: [\n {\n name: 'confirm',\n text: AXHtmlUtil.isRtl() ? 'باشه' : 'Okay',\n color: type,\n autofocus: action === 'confirm',\n onClick: () => {\n popup.close();\n if (resolve) {\n resolve({ result: true });\n }\n },\n },\n {\n name: 'cancel',\n text: AXHtmlUtil.isRtl() ? 'انصراف' : 'Cancel',\n color: 'default',\n autofocus: action === 'cancel',\n onClick: () => {\n popup.close();\n if (resolve) {\n resolve({ result: false });\n }\n },\n hotkey: {\n Escape: () => {\n popup.close();\n if (resolve) {\n resolve({ result: false });\n }\n },\n },\n },\n ],\n });\n });\n }\n\n /**\n * Show a custom dialog box.\n *\n * @param options - Configuration options for the custom dialog.\n * @returns Promise<{ name: string }> - Promise that resolves with the button name that was clicked.\n */\n show(options: AXDialogConfig): Promise<{ name: string }> {\n return new Promise((resolve) => {\n options.orientation = options.orientation || 'horizontal';\n options.icon = options.icon ?? this.detectIcon(options.type);\n\n const popup = this.open(options);\n\n options.buttons?.forEach((b) => {\n const orginalClick = b.onClick;\n b.onClick = () => {\n const e = { source: b, handled: false };\n if (orginalClick) {\n orginalClick(e);\n if (e.handled) {\n resolve({ name: b.name ?? b.text });\n } else {\n popup.close();\n resolve({ name: b.name ?? b.text });\n }\n } else if (resolve) {\n popup.close();\n resolve({ name: b.name ?? b.text });\n } else {\n popup.close();\n }\n };\n });\n });\n }\n\n /**\n * Show a custom dialog box.\n *\n * @param options - Configuration options for the custom dialog.\n * @returns Promise<{ name: string }> - Promise that resolves with the button name that was clicked.\n */\n open(config: AXDialogConfig): AXDialogRef {\n config.orientation = config.orientation || 'horizontal';\n config.icon = config.icon ?? this.detectIcon(config.type);\n\n const dialogData: AXDialogData = {\n title: config.title,\n content: config.content,\n type: config.type,\n buttons: config.buttons,\n closeButton: config.closeButton ?? false,\n orientation: config.orientation,\n icon: config.icon,\n draggable: config.draggable,\n };\n\n let internalRef: AXDialogInternalRef;\n\n const closeDialog = () => {\n if (internalRef) {\n internalRef.overlayRef.dispose();\n }\n };\n\n this.overlayService\n .create<AXDialogComponent>(AXDialogComponent, {\n inputs: {\n data: dialogData,\n onClose: closeDialog,\n },\n backdrop: {\n enabled: true,\n background: true,\n closeOnClick: false, // disableClose: true equivalent\n },\n panelClass: ['ax-dialog-panel', 'ax-animate-bounceIn', 'ax-animate-faster'],\n })\n .then((overlayRef) => {\n internalRef = {\n overlayRef,\n close: closeDialog,\n };\n\n // Apply direction if specified\n if (config.direction || AXHtmlUtil.isRtl()) {\n const dir = config.direction ? config.direction : AXHtmlUtil.isRtl() ? 'rtl' : 'ltr';\n if (overlayRef.overlayElement) {\n overlayRef.overlayElement.setAttribute('dir', dir);\n }\n }\n });\n\n return {\n close: () => {\n closeDialog();\n },\n };\n }\n}\n","import { AXCommonModule, AXHotkeysService } from '@acorex/cdk/common';\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXDialogComponent } from './dialog.component';\nimport { AXDialogService } from './dialog.service';\n\nconst COMPONENT = [AXDialogComponent];\nconst MODULES = [\n CommonModule,\n AXCommonModule,\n DragDropModule,\n A11yModule,\n AXButtonModule,\n AXDecoratorModule,\n AXLoadingModule,\n AXTranslationModule,\n];\n\n@NgModule({\n imports: [...MODULES, ...COMPONENT],\n exports: [...COMPONENT],\n providers: [AXDialogService, AXHotkeysService],\n})\nexport class AXDialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgBA;;;AAGG;AAiCG,MAAO,iBAAkB,SAAQ,eAAe,CAAA;AAhCtD,IAAA,WAAA,GAAA;;;AAkCE,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,+CAAgB;;QAGrC,IAAA,CAAA,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAc;AA6C9B,IAAA;AAtCC;;AAEG;AACO,IAAA,kBAAkB,CAAC,MAA0B,EAAA;AACrD,QAAA,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QACpC;IACF;AAEA;;AAEG;AACO,IAAA,aAAa,CAAC,MAA0B,EAAA;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO;AACnC,QAAA,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC;QACrE,IAAI,aAAa,IAAI,aAAa,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,EA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AAmB;CACpB;MAOY,cAAc,CAAA;8GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAd,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,cAAc,YAfzB,YAAY;YACZ,cAAc;YACd,cAAc;YACd,UAAU;YACV,cAAc;YACd,iBAAiB;YACjB,eAAe;YACf,mBAAmB,EATF,iBAAiB,CAAA,EAAA,OAAA,EAAA,CAAjB,iBAAiB,CAAA,EAAA,CAAA,CAAA;+GAiBvB,cAAc,EAAA,SAAA,EAFd,CAAC,eAAe,EAAE,gBAAgB,CAAC,EAAA,OAAA,EAAA,CAFjC,OAAO,EAAK,SAAS,CAAA,EAAA,CAAA,CAAA;;2FAIvB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,SAAS,CAAC;AACnC,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,CAAC,eAAe,EAAE,gBAAgB,CAAC;AAC/C,iBAAA;;;AC5BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-components-dialog.mjs","sources":["../../../../packages/components/dialog/src/lib/dialog.component.ts","../../../../packages/components/dialog/src/lib/dialog.component.html","../../../../packages/components/dialog/src/lib/dialog.config.ts","../../../../packages/components/dialog/src/lib/dialog.service.ts","../../../../packages/components/dialog/src/lib/dialog.module.ts","../../../../packages/components/dialog/src/acorex-components-dialog.ts"],"sourcesContent":["import {\n AXAutoFocusDirective,\n AXClosableComponent,\n AXComponent,\n AXHotkeyDirective,\n MXBaseComponent,\n} from '@acorex/cdk/common';\nimport { AXButtonComponent } from '@acorex/components/button';\nimport { AXDecoratorGenericComponent } from '@acorex/components/decorators';\nimport { AXLoadingComponent } from '@acorex/components/loading';\nimport { AXTranslatorPipe } from '@acorex/core/translation';\nimport { CdkDrag, CdkDragHandle } from '@angular/cdk/drag-drop';\nimport { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation, input } from '@angular/core';\nimport { AXDialogButtonItem, AXDialogData } from './dialog.class';\n\n/**\n * A dialog component that provides a modal interface for user interactions.\n * @category Components\n */\n@Component({\n selector: 'ax-dialog',\n templateUrl: './dialog.component.html',\n styleUrls: ['./dialog.component.compiled.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '[attr.tabIndex]': '\"-1\"',\n '[class]': '\"ax-\" + data().type',\n },\n providers: [\n {\n provide: AXClosableComponent,\n useExisting: AXDialogComponent,\n },\n {\n provide: AXComponent,\n useExisting: AXDialogComponent,\n },\n ],\n imports: [\n CdkDrag,\n CdkDragHandle,\n AXDecoratorGenericComponent,\n AXButtonComponent,\n AXHotkeyDirective,\n AXAutoFocusDirective,\n AXLoadingComponent,\n AsyncPipe,\n AXTranslatorPipe,\n ],\n})\nexport class AXDialogComponent extends MXBaseComponent {\n /** Dialog configuration data */\n data = input.required<AXDialogData>();\n\n /** @internal Callback function to close the dialog */\n onClose = input<() => void>();\n\n /**\n * @ignore\n */\n protected _icon: string;\n\n /**\n * @ignore\n */\n protected _handleButtonClick(button: AXDialogButtonItem) {\n if (button.onClick) {\n button.onClick({ source: button });\n }\n }\n\n /**\n * @ignore\n */\n protected _hasAutoFocus(button: AXDialogButtonItem): boolean {\n const buttons = this.data().buttons;\n const autoFocusItem = buttons.find((item) => item.autofocus === true);\n if (autoFocusItem && autoFocusItem.text === button.text) {\n return true;\n }\n if (!autoFocusItem) {\n if (buttons.length > 0) {\n buttons[0].autofocus = true;\n return buttons[0].text === button.text;\n }\n }\n return false;\n }\n\n /**\n * Closes the dialog.\n *\n * @returns void - No return value. The dialog is closed and removed from the DOM.\n */\n close() {\n const closeCallback = this.onClose();\n if (closeCallback) {\n closeCallback();\n }\n }\n}\n","<div\n class=\"ax-dialog ax-orientation-{{ data().orientation }}\"\n tabindex=\"-1\"\n cdkDrag\n cdkDragHandle\n [cdkDragDisabled]=\"!data().draggable\"\n>\n <div class=\"ax-dialog-content-wrapper\">\n @if (data().icon !== 'none') {\n <div class=\"ax-dialog-icon-side\">\n <i class=\"ax-dialog-icon {{ data().icon }}\"></i>\n </div>\n }\n <div class=\"ax-dialog-content-side\">\n <div class=\"ax-dialog-title\">{{ data().title | translate | async }}</div>\n <div class=\"ax-dialog-content\">{{ data().content | translate | async }}</div>\n </div>\n <div class=\"ax-dialog-dismiss-icon\">\n @if (data().closeButton) {\n <i class=\"ax-icon ax-icon-close\"></i>\n }\n </div>\n </div>\n\n <ax-footer>\n <ax-suffix>\n @for (button of data().buttons; let i = $index; track i) {\n <ax-button\n [text]=\"button.text | translate | async\"\n [tabindex]=\"i\"\n [axHotkey]=\"button.hotkey\"\n [axAutoFocus]=\"_hasAutoFocus(button)\"\n (onClick)=\"_handleButtonClick(button)\"\n [look]=\"button.look || 'solid'\"\n [disabled]=\"button.disabled\"\n [color]=\"button.color || 'default'\"\n >\n @if (button.loading) {\n <ax-loading></ax-loading>\n }\n </ax-button>\n }\n </ax-suffix>\n </ax-footer>\n</div>\n","import { AX_GLOBAL_CONFIG } from '@acorex/core/config';\nimport { InjectionToken, inject } from '@angular/core';\nimport { set } from 'lodash-es';\n\nexport interface AXDialogConfigToken {\n confirm: { defaultAction: 'confirm' | 'cancel' };\n}\n\nexport const AX_DIALOG_CONFIG = new InjectionToken<AXDialogConfigToken>('AX_DIALOG_CONFIG', {\n providedIn: 'root',\n factory: () => {\n const global = inject(AX_GLOBAL_CONFIG);\n set(global, 'layout.dialog', AX_DIALOG_CONFIG);\n return AXDialogDefaultConfig;\n },\n});\n\nexport const AXDialogDefaultConfig: AXDialogConfigToken = {\n confirm: { defaultAction: 'cancel' },\n};\n\nexport type PartialDialogConfig = Partial<AXDialogConfigToken>;\n\nexport function dialogConfig(config: PartialDialogConfig = {}): AXDialogConfigToken {\n const result = {\n ...AXDialogDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { AXStyleColorType } from '@acorex/cdk/common';\nimport { AXOverlayService } from '@acorex/cdk/overlay';\nimport { AXHtmlUtil } from '@acorex/core/utils';\nimport { Injectable, inject } from '@angular/core';\nimport { AXDialogConfig, AXDialogData, AXDialogInternalRef, AXDialogRef } from './dialog.class';\nimport { AXDialogComponent } from './dialog.component';\nimport { AXDialogConfigToken, AX_DIALOG_CONFIG } from './dialog.config';\n\n/**\n * The Button is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Injectable()\nexport class AXDialogService {\n private overlayService = inject(AXOverlayService);\n private defaultConfig: AXDialogConfigToken = inject(AX_DIALOG_CONFIG);\n\n private detectIcon(type: AXStyleColorType): string {\n let icon: string;\n switch (type) {\n case 'success':\n icon = 'ax-icon ax-icon-check';\n break;\n case 'danger':\n icon = 'ax-icon ax-icon-error';\n break;\n case 'warning':\n icon = 'ax-icon ax-icon-warning';\n break;\n default:\n icon = 'ax-icon ax-icon-info';\n break;\n }\n return icon;\n }\n\n /**\n * Show an alert box with 'Okay' button.\n *\n * @param title - The title of the alert dialog.\n * @param content - The content message of the alert dialog.\n * @param type - The type/color of the alert (primary, success, warning, danger).\n * @param orientation - The orientation of the dialog (horizontal or vertical).\n * @param draggable - Whether the dialog can be dragged.\n * @returns Promise<void> - Promise that resolves when the dialog is closed.\n */\n alert(\n title: string,\n content: string,\n type: AXStyleColorType = 'primary',\n orientation: 'horizontal' | 'vertical' = 'horizontal',\n draggable?: boolean,\n ): Promise<void> {\n return new Promise((resolve) => {\n const popup = this.open({\n title,\n type: type,\n content,\n icon: this.detectIcon(type),\n orientation,\n draggable,\n buttons: [\n {\n name: 'confirm',\n text: AXHtmlUtil.isRtl() ? 'باشه' : 'Okay',\n color: type,\n autofocus: true,\n onClick: () => {\n popup.close();\n if (resolve) {\n resolve();\n }\n },\n },\n ],\n });\n });\n }\n\n /**\n * Show a confirm box with 'Okay' & 'Cancel' buttons.\n *\n * @param title - The title of the confirm dialog.\n * @param content - The content message of the confirm dialog.\n * @param type - The type/color of the confirm dialog (primary, success, warning, danger).\n * @param orientation - The orientation of the dialog (horizontal or vertical).\n * @param draggable - Whether the dialog can be dragged.\n * @param defaultAction - The default action to focus (confirm or cancel).\n * @returns Promise<{ result: boolean }> - Promise that resolves with the user's choice.\n */\n confirm(\n title: string,\n content: string,\n type: AXStyleColorType = 'primary',\n orientation: 'horizontal' | 'vertical' = 'horizontal',\n draggable?: boolean,\n defaultAction?: 'confirm' | 'cancel',\n ): Promise<{ result: boolean }> {\n return new Promise<{ result: boolean }>((resolve) => {\n const tokenConfig = this.defaultConfig.confirm.defaultAction;\n\n const action = defaultAction || (type === 'danger' ? 'cancel' : tokenConfig);\n\n const popup = this.open({\n title,\n content,\n type,\n icon: this.detectIcon(type),\n orientation,\n draggable,\n buttons: [\n {\n name: 'confirm',\n text: AXHtmlUtil.isRtl() ? 'باشه' : 'Okay',\n color: type,\n autofocus: action === 'confirm',\n onClick: () => {\n popup.close();\n if (resolve) {\n resolve({ result: true });\n }\n },\n },\n {\n name: 'cancel',\n text: AXHtmlUtil.isRtl() ? 'انصراف' : 'Cancel',\n color: 'default',\n autofocus: action === 'cancel',\n onClick: () => {\n popup.close();\n if (resolve) {\n resolve({ result: false });\n }\n },\n hotkey: {\n Escape: () => {\n popup.close();\n if (resolve) {\n resolve({ result: false });\n }\n },\n },\n },\n ],\n });\n });\n }\n\n /**\n * Show a custom dialog box.\n *\n * @param options - Configuration options for the custom dialog.\n * @returns Promise<{ name: string }> - Promise that resolves with the button name that was clicked.\n */\n show(options: AXDialogConfig): Promise<{ name: string }> {\n return new Promise((resolve) => {\n options.orientation = options.orientation || 'horizontal';\n options.icon = options.icon ?? this.detectIcon(options.type);\n\n const popup = this.open(options);\n\n options.buttons?.forEach((b) => {\n const orginalClick = b.onClick;\n b.onClick = () => {\n const e = { source: b, handled: false };\n if (orginalClick) {\n orginalClick(e);\n if (e.handled) {\n resolve({ name: b.name ?? b.text });\n } else {\n popup.close();\n resolve({ name: b.name ?? b.text });\n }\n } else if (resolve) {\n popup.close();\n resolve({ name: b.name ?? b.text });\n } else {\n popup.close();\n }\n };\n });\n });\n }\n\n /**\n * Show a custom dialog box.\n *\n * @param options - Configuration options for the custom dialog.\n * @returns Promise<{ name: string }> - Promise that resolves with the button name that was clicked.\n */\n open(config: AXDialogConfig): AXDialogRef {\n config.orientation = config.orientation || 'horizontal';\n config.icon = config.icon ?? this.detectIcon(config.type);\n\n const dialogData: AXDialogData = {\n title: config.title,\n content: config.content,\n type: config.type,\n buttons: config.buttons,\n closeButton: config.closeButton ?? false,\n orientation: config.orientation,\n icon: config.icon,\n draggable: config.draggable,\n };\n\n let internalRef: AXDialogInternalRef;\n\n const closeDialog = () => {\n if (internalRef) {\n internalRef.overlayRef.dispose();\n }\n };\n\n this.overlayService\n .create<AXDialogComponent>(AXDialogComponent, {\n inputs: {\n data: dialogData,\n onClose: closeDialog,\n },\n backdrop: {\n enabled: true,\n background: true,\n closeOnClick: false, // disableClose: true equivalent\n },\n panelClass: ['ax-dialog-panel', 'ax-animate-bounceIn', 'ax-animate-faster'],\n })\n .then((overlayRef) => {\n internalRef = {\n overlayRef,\n close: closeDialog,\n };\n\n // Apply direction if specified\n if (config.direction || AXHtmlUtil.isRtl()) {\n const dir = config.direction ? config.direction : AXHtmlUtil.isRtl() ? 'rtl' : 'ltr';\n if (overlayRef.overlayElement) {\n overlayRef.overlayElement.setAttribute('dir', dir);\n }\n }\n });\n\n return {\n close: () => {\n closeDialog();\n },\n };\n }\n}\n","import { AXCommonModule, AXHotkeysService } from '@acorex/cdk/common';\nimport { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXDialogComponent } from './dialog.component';\nimport { AXDialogService } from './dialog.service';\n\nconst COMPONENT = [AXDialogComponent];\nconst MODULES = [\n CommonModule,\n AXCommonModule,\n DragDropModule,\n A11yModule,\n AXButtonModule,\n AXDecoratorModule,\n AXLoadingModule,\n AXTranslationModule,\n];\n\n@NgModule({\n imports: [...MODULES, ...COMPONENT],\n exports: [...COMPONENT],\n providers: [AXDialogService, AXHotkeysService],\n})\nexport class AXDialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgBA;;;AAGG;AAiCG,MAAO,iBAAkB,SAAQ,eAAe,CAAA;AAhCtD,IAAA,WAAA,GAAA;;;AAkCE,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,+CAAgB;;QAGrC,IAAA,CAAA,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAc;AA6C9B,IAAA;AAtCC;;AAEG;AACO,IAAA,kBAAkB,CAAC,MAA0B,EAAA;AACrD,QAAA,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QACpC;IACF;AAEA;;AAEG;AACO,IAAA,aAAa,CAAC,MAA0B,EAAA;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO;AACnC,QAAA,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC;Q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IACd,cAAc;IACd,UAAU;IACV,cAAc;IACd,iBAAiB;IACjB,eAAe;IACf,mBAAmB;CACpB;MAOY,cAAc,CAAA;8GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAd,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,cAAc,YAfzB,YAAY;YACZ,cAAc;YACd,cAAc;YACd,UAAU;YACV,cAAc;YACd,iBAAiB;YACjB,eAAe;YACf,mBAAmB,EATF,iBAAiB,CAAA,EAAA,OAAA,EAAA,CAAjB,iBAAiB,CAAA,EAAA,CAAA,CAAA;+GAiBvB,cAAc,EAAA,SAAA,EAFd,CAAC,eAAe,EAAE,gBAAgB,CAAC,EAAA,OAAA,EAAA,CAFjC,OAAO,EAAK,SAAS,CAAA,EAAA,CAAA,CAAA;;2FAIvB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,GAAG,SAAS,CAAC;AACnC,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,CAAC,eAAe,EAAE,gBAAgB,CAAC;AAC/C,iBAAA;;;AC5BD;;AAEG;;;;"}
|
|
@@ -59,7 +59,7 @@ class AXSwitchComponent extends classes((MXValueComponent), MXColorComponent) {
|
|
|
59
59
|
multi: true,
|
|
60
60
|
},
|
|
61
61
|
{ provide: AXComponent, useExisting: AXSwitchComponent },
|
|
62
|
-
], usesInheritance: true, ngImport: i0, template: "<button\n type=\"button\"\n role=\"switch\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-state-readonly]=\"readonly\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n [class.ax-switch-checked]=\"value\"\n (click)=\"_handleOnClickEvent($event)\"\n>\n <div class=\"ax-switch-handle\">\n @if (isLoading) {\n <span class=\"ax-loader\"></span>\n }\n @if (!isLoading) {\n <ng-content select=\"ax-switch-handler-content\"></ng-content>\n }\n @if (!isLoading && value) {\n <ng-content select=\"ax-switch-handler-on-content\"></ng-content>\n }\n @if (!isLoading && !value) {\n <ng-content select=\"ax-switch-handler-off-content\"></ng-content>\n }\n </div>\n @if (!value) {\n <
|
|
62
|
+
], usesInheritance: true, ngImport: i0, template: "<button\n type=\"button\"\n role=\"switch\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-state-readonly]=\"readonly\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n [class.ax-switch-checked]=\"value\"\n (click)=\"_handleOnClickEvent($event)\"\n>\n <div class=\"ax-switch-handle\">\n @if (isLoading) {\n <span class=\"ax-loader\"></span>\n }\n @if (!isLoading) {\n <ng-content select=\"ax-switch-handler-content\"></ng-content>\n }\n @if (!isLoading && value) {\n <ng-content select=\"ax-switch-handler-on-content\"></ng-content>\n }\n @if (!isLoading && !value) {\n <ng-content select=\"ax-switch-handler-off-content\"></ng-content>\n }\n </div>\n @if (!value) {\n <ng-content select=\"ax-switch-off-content\"></ng-content>\n }\n @if (value) {\n <ng-content select=\"ax-switch-on-content\"></ng-content>\n }\n</button>\n", styles: ["@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-leading:initial;--tw-outline-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid}}}@layer components{ax-switch{--tw-leading:initial;line-height:initial;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}ax-switch button{height:calc(var(--spacing,.25rem) * 5);min-width:calc(var(--spacing,.25rem) * 10);cursor:pointer;background-color:#0000004d;border-radius:3.40282e38px;display:inline-block;position:relative}@supports (color:color-mix(in lab,red,red)){ax-switch button{background-color:color-mix(in oklab,var(--color-black,#000) 30%,transparent)}}ax-switch button{vertical-align:middle;--tw-leading:calc(var(--spacing,.25rem) * 5);line-height:calc(var(--spacing,.25rem) * 5);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}ax-switch button:where(.ax-dark,.ax-dark *){background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){ax-switch button:where(.ax-dark,.ax-dark *){background-color:color-mix(in oklab,var(--color-white,#fff) 30%,transparent)}}ax-switch button:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--ax-comp-bg,var(--color-surface))}ax-switch button:active .ax-switch-handle{width:calc(var(--spacing,.25rem) * 6)}ax-switch button.ax-switch-checked{background-color:var(--ax-comp-bg,var(--color-surface))}ax-switch button.ax-switch-checked .ax-switch-handle{background-color:var(--ax-comp-text,var(--color-dark));inset-inline-start:initial;inset-inline-end:calc(var(--spacing,.25rem) * .5)}ax-switch button .ax-switch-handle{inset-inline-start:calc(var(--spacing,.25rem) * .5);top:calc(var(--spacing,.25rem) * .5);width:calc(var(--spacing,.25rem) * 4);height:calc(var(--spacing,.25rem) * 4);background-color:var(--color-white,#fff);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s));border-radius:3.40282e38px;justify-content:center;align-items:center;font-size:80%;display:flex;position:absolute}ax-switch button .ax-switch-handle:active{width:calc(var(--spacing,.25rem) * 6)}ax-switch button .ax-switch-handle .ax-loader{box-sizing:border-box;min-height:calc(var(--spacing,.25rem) * 3);min-width:calc(var(--spacing,.25rem) * 3);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);border-style:var(--tw-border-style);border-width:2px;border-color:var(--ax-comp-bg,var(--color-surface));border-bottom-color:#0000;border-radius:3.40282e38px;animation:.5s linear infinite rotation;display:inline-block;position:absolute;top:50%}ax-switch button .ax-switch-handle:before{content:\"\";transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s));background-color:var(--ax-sys-color-surface);border-radius:3.40282e38px;position:absolute}ax-switch button .ax-switch-inner{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s));margin-inline-start:calc(var(--spacing,.25rem) * 6);margin-inline-end:calc(var(--spacing,.25rem) * 1.5);display:block}ax-switch button .ax-switch-inner ax-switch-on-content,ax-switch button .ax-switch-inner ax-switch-off-content{padding-inline:calc(var(--spacing,.25rem) * 1);font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)));--tw-leading:calc(var(--spacing,.25rem) * 5);line-height:calc(var(--spacing,.25rem) * 5);display:flex}ax-switch .ax-state-disabled{cursor:not-allowed;opacity:.5}ax-switch .ax-state-readonly{opacity:.75}}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}\n/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
63
63
|
}
|
|
64
64
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXSwitchComponent, decorators: [{
|
|
65
65
|
type: Component,
|
|
@@ -70,7 +70,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
70
70
|
multi: true,
|
|
71
71
|
},
|
|
72
72
|
{ provide: AXComponent, useExisting: AXSwitchComponent },
|
|
73
|
-
], template: "<button\n type=\"button\"\n role=\"switch\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-state-readonly]=\"readonly\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n [class.ax-switch-checked]=\"value\"\n (click)=\"_handleOnClickEvent($event)\"\n>\n <div class=\"ax-switch-handle\">\n @if (isLoading) {\n <span class=\"ax-loader\"></span>\n }\n @if (!isLoading) {\n <ng-content select=\"ax-switch-handler-content\"></ng-content>\n }\n @if (!isLoading && value) {\n <ng-content select=\"ax-switch-handler-on-content\"></ng-content>\n }\n @if (!isLoading && !value) {\n <ng-content select=\"ax-switch-handler-off-content\"></ng-content>\n }\n </div>\n @if (!value) {\n <
|
|
73
|
+
], template: "<button\n type=\"button\"\n role=\"switch\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-state-readonly]=\"readonly\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n [class.ax-switch-checked]=\"value\"\n (click)=\"_handleOnClickEvent($event)\"\n>\n <div class=\"ax-switch-handle\">\n @if (isLoading) {\n <span class=\"ax-loader\"></span>\n }\n @if (!isLoading) {\n <ng-content select=\"ax-switch-handler-content\"></ng-content>\n }\n @if (!isLoading && value) {\n <ng-content select=\"ax-switch-handler-on-content\"></ng-content>\n }\n @if (!isLoading && !value) {\n <ng-content select=\"ax-switch-handler-off-content\"></ng-content>\n }\n </div>\n @if (!value) {\n <ng-content select=\"ax-switch-off-content\"></ng-content>\n }\n @if (value) {\n <ng-content select=\"ax-switch-on-content\"></ng-content>\n }\n</button>\n", styles: ["@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-leading:initial;--tw-outline-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-border-style:solid}}}@layer components{ax-switch{--tw-leading:initial;line-height:initial;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}ax-switch button{height:calc(var(--spacing,.25rem) * 5);min-width:calc(var(--spacing,.25rem) * 10);cursor:pointer;background-color:#0000004d;border-radius:3.40282e38px;display:inline-block;position:relative}@supports (color:color-mix(in lab,red,red)){ax-switch button{background-color:color-mix(in oklab,var(--color-black,#000) 30%,transparent)}}ax-switch button{vertical-align:middle;--tw-leading:calc(var(--spacing,.25rem) * 5);line-height:calc(var(--spacing,.25rem) * 5);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}ax-switch button:where(.ax-dark,.ax-dark *){background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){ax-switch button:where(.ax-dark,.ax-dark *){background-color:color-mix(in oklab,var(--color-white,#fff) 30%,transparent)}}ax-switch button:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--ax-comp-bg,var(--color-surface))}ax-switch button:active .ax-switch-handle{width:calc(var(--spacing,.25rem) * 6)}ax-switch button.ax-switch-checked{background-color:var(--ax-comp-bg,var(--color-surface))}ax-switch button.ax-switch-checked .ax-switch-handle{background-color:var(--ax-comp-text,var(--color-dark));inset-inline-start:initial;inset-inline-end:calc(var(--spacing,.25rem) * .5)}ax-switch button .ax-switch-handle{inset-inline-start:calc(var(--spacing,.25rem) * .5);top:calc(var(--spacing,.25rem) * .5);width:calc(var(--spacing,.25rem) * 4);height:calc(var(--spacing,.25rem) * 4);background-color:var(--color-white,#fff);--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s));border-radius:3.40282e38px;justify-content:center;align-items:center;font-size:80%;display:flex;position:absolute}ax-switch button .ax-switch-handle:active{width:calc(var(--spacing,.25rem) * 6)}ax-switch button .ax-switch-handle .ax-loader{box-sizing:border-box;min-height:calc(var(--spacing,.25rem) * 3);min-width:calc(var(--spacing,.25rem) * 3);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);border-style:var(--tw-border-style);border-width:2px;border-color:var(--ax-comp-bg,var(--color-surface));border-bottom-color:#0000;border-radius:3.40282e38px;animation:.5s linear infinite rotation;display:inline-block;position:absolute;top:50%}ax-switch button .ax-switch-handle:before{content:\"\";transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s));background-color:var(--ax-sys-color-surface);border-radius:3.40282e38px;position:absolute}ax-switch button .ax-switch-inner{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s));margin-inline-start:calc(var(--spacing,.25rem) * 6);margin-inline-end:calc(var(--spacing,.25rem) * 1.5);display:block}ax-switch button .ax-switch-inner ax-switch-on-content,ax-switch button .ax-switch-inner ax-switch-off-content{padding-inline:calc(var(--spacing,.25rem) * 1);font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)));--tw-leading:calc(var(--spacing,.25rem) * 5);line-height:calc(var(--spacing,.25rem) * 5);display:flex}ax-switch .ax-state-disabled{cursor:not-allowed;opacity:.5}ax-switch .ax-state-readonly{opacity:.75}}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@property --tw-leading{syntax:\"*\";inherits:false}@property --tw-outline-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}\n/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */\n"] }]
|
|
74
74
|
}], propDecorators: { isLoading: [{
|
|
75
75
|
type: Input
|
|
76
76
|
}], __hostClass: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-components-switch.mjs","sources":["../../../../packages/components/switch/src/lib/switch-content.component.ts","../../../../packages/components/switch/src/lib/switch.component.ts","../../../../packages/components/switch/src/lib/switch.component.html","../../../../packages/components/switch/src/lib/switch.module.ts","../../../../packages/components/switch/src/acorex-components-switch.ts"],"sourcesContent":["import { AXComponent, MXBaseComponent } from '@acorex/cdk/common';\nimport { Component } from '@angular/core';\n\n/**\n * @category\n * Displays content for different switch states using `<ng-content>`.\n */\n@Component({\n selector:\n 'ax-switch-handler-content,ax-switch-handler-on-content,ax-switch-handler-off-content,ax-switch-off-content,ax-switch-on-content',\n template: `<ng-content></ng-content>`,\n providers: [{ provide: AXComponent, useExisting: AXSwitchContentComponent }],\n})\nexport class AXSwitchContentComponent extends MXBaseComponent {}\n","import { AXComponent, MXColorComponent, MXValueComponent } from '@acorex/cdk/common';\nimport { ChangeDetectionStrategy, Component, HostBinding, Input, ViewEncapsulation, forwardRef } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { classes } from 'polytype';\n\n/**\n * @category\n * A switch component that allows toggling between on and off states.\n */\n@Component({\n selector: 'ax-switch',\n templateUrl: './switch.component.html',\n styleUrls: ['./switch.component.compiled.css'],\n inputs: ['disabled', 'readonly', 'color', 'tabIndex', 'value', 'name'],\n outputs: ['onBlur', 'onFocus', 'valueChange', 'onValueChanged', 'readonlyChange', 'disabledChange'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXSwitchComponent),\n multi: true,\n },\n { provide: AXComponent, useExisting: AXSwitchComponent },\n ],\n})\nexport class AXSwitchComponent extends classes(MXValueComponent<boolean>, MXColorComponent) {\n /**\n * Indicates whether the component is in a loading state.\n */\n @Input()\n isLoading: boolean;\n\n /**\n * @ignore\n */\n protected _handleOnClickEvent(e: MouseEvent) {\n this.onTouchedCallback();\n if (this.readonly || this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n } else {\n this.commitValue(!this.value, true);\n }\n }\n\n /**\n * @ignore\n */\n @HostBinding('class')\n private get __hostClass(): string {\n if (this.color === 'ax-default') {\n return 'ax-primary';\n } else {\n return `${this.color ? this.color : 'ax-primary'}`;\n }\n }\n}\n","<button\n type=\"button\"\n role=\"switch\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-state-readonly]=\"readonly\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n [class.ax-switch-checked]=\"value\"\n (click)=\"_handleOnClickEvent($event)\"\n>\n <div class=\"ax-switch-handle\">\n @if (isLoading) {\n <span class=\"ax-loader\"></span>\n }\n @if (!isLoading) {\n <ng-content select=\"ax-switch-handler-content\"></ng-content>\n }\n @if (!isLoading && value) {\n <ng-content select=\"ax-switch-handler-on-content\"></ng-content>\n }\n @if (!isLoading && !value) {\n <ng-content select=\"ax-switch-handler-off-content\"></ng-content>\n }\n </div>\n @if (!value) {\n <
|
|
1
|
+
{"version":3,"file":"acorex-components-switch.mjs","sources":["../../../../packages/components/switch/src/lib/switch-content.component.ts","../../../../packages/components/switch/src/lib/switch.component.ts","../../../../packages/components/switch/src/lib/switch.component.html","../../../../packages/components/switch/src/lib/switch.module.ts","../../../../packages/components/switch/src/acorex-components-switch.ts"],"sourcesContent":["import { AXComponent, MXBaseComponent } from '@acorex/cdk/common';\nimport { Component } from '@angular/core';\n\n/**\n * @category\n * Displays content for different switch states using `<ng-content>`.\n */\n@Component({\n selector:\n 'ax-switch-handler-content,ax-switch-handler-on-content,ax-switch-handler-off-content,ax-switch-off-content,ax-switch-on-content',\n template: `<ng-content></ng-content>`,\n providers: [{ provide: AXComponent, useExisting: AXSwitchContentComponent }],\n})\nexport class AXSwitchContentComponent extends MXBaseComponent {}\n","import { AXComponent, MXColorComponent, MXValueComponent } from '@acorex/cdk/common';\nimport { ChangeDetectionStrategy, Component, HostBinding, Input, ViewEncapsulation, forwardRef } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { classes } from 'polytype';\n\n/**\n * @category\n * A switch component that allows toggling between on and off states.\n */\n@Component({\n selector: 'ax-switch',\n templateUrl: './switch.component.html',\n styleUrls: ['./switch.component.compiled.css'],\n inputs: ['disabled', 'readonly', 'color', 'tabIndex', 'value', 'name'],\n outputs: ['onBlur', 'onFocus', 'valueChange', 'onValueChanged', 'readonlyChange', 'disabledChange'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXSwitchComponent),\n multi: true,\n },\n { provide: AXComponent, useExisting: AXSwitchComponent },\n ],\n})\nexport class AXSwitchComponent extends classes(MXValueComponent<boolean>, MXColorComponent) {\n /**\n * Indicates whether the component is in a loading state.\n */\n @Input()\n isLoading: boolean;\n\n /**\n * @ignore\n */\n protected _handleOnClickEvent(e: MouseEvent) {\n this.onTouchedCallback();\n if (this.readonly || this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n } else {\n this.commitValue(!this.value, true);\n }\n }\n\n /**\n * @ignore\n */\n @HostBinding('class')\n private get __hostClass(): string {\n if (this.color === 'ax-default') {\n return 'ax-primary';\n } else {\n return `${this.color ? this.color : 'ax-primary'}`;\n }\n }\n}\n","<button\n type=\"button\"\n role=\"switch\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-state-readonly]=\"readonly\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n [class.ax-switch-checked]=\"value\"\n (click)=\"_handleOnClickEvent($event)\"\n>\n <div class=\"ax-switch-handle\">\n @if (isLoading) {\n <span class=\"ax-loader\"></span>\n }\n @if (!isLoading) {\n <ng-content select=\"ax-switch-handler-content\"></ng-content>\n }\n @if (!isLoading && value) {\n <ng-content select=\"ax-switch-handler-on-content\"></ng-content>\n }\n @if (!isLoading && !value) {\n <ng-content select=\"ax-switch-handler-off-content\"></ng-content>\n }\n </div>\n @if (!value) {\n <ng-content select=\"ax-switch-off-content\"></ng-content>\n }\n @if (value) {\n <ng-content select=\"ax-switch-on-content\"></ng-content>\n }\n</button>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AXSwitchContentComponent } from './switch-content.component';\nimport { AXSwitchComponent } from './switch.component';\n\n@NgModule({\n imports: [CommonModule, FormsModule, AXSwitchComponent, AXSwitchContentComponent],\n exports: [AXSwitchComponent, AXSwitchContentComponent],\n providers: [],\n})\nexport class AXSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAGA;;;AAGG;AAOG,MAAO,wBAAyB,SAAQ,eAAe,CAAA;8GAAhD,wBAAwB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iIAAA,EAAA,SAAA,EAFxB,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC,iDADlE,CAAA,yBAAA,CAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;;2FAG1B,wBAAwB,EA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,SAAA,EACpC;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,uBAAuB,CAAC;AAChD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACD,wBAAA,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,mBAAmB,EAAE;AACzD,qBAAA,EAAA,QAAA,EAAA,65BAAA,EAAA,MAAA,EAAA,CAAA,6iNAAA,CAAA,EAAA;;sBAMA;;sBAmBA,WAAW;uBAAC,OAAO;;;MEtCT,cAAc,CAAA;8GAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAd,cAAc,EAAA,OAAA,EAAA,CAJf,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,wBAAwB,CAAA,EAAA,OAAA,EAAA,CACtE,iBAAiB,EAAE,wBAAwB,CAAA,EAAA,CAAA,CAAA;+GAG1C,cAAc,EAAA,OAAA,EAAA,CAJf,YAAY,EAAE,WAAW,CAAA,EAAA,CAAA,CAAA;;2FAIxB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,wBAAwB,CAAC;AACjF,oBAAA,OAAO,EAAE,CAAC,iBAAiB,EAAE,wBAAwB,CAAC;AACtD,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA;;;ACVD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex/components",
|
|
3
|
-
"version": "21.0.2-next.
|
|
3
|
+
"version": "21.0.2-next.9",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@acorex/core": "21.0.2-next.
|
|
6
|
-
"@acorex/cdk": "21.0.2-next.
|
|
5
|
+
"@acorex/core": "21.0.2-next.9",
|
|
6
|
+
"@acorex/cdk": "21.0.2-next.9",
|
|
7
7
|
"polytype": ">=0.17.0",
|
|
8
8
|
"angular-imask": ">=7.6.1",
|
|
9
9
|
"gridstack": ">=12.0.0",
|