@acorex/components 7.0.8 → 7.0.11
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/action-sheet/public-api.d.ts +1 -1
- package/action-sheet/src/action-sheet.component.d.ts +19 -13
- package/action-sheet/src/action-sheet.interface.d.ts +20 -0
- package/action-sheet/src/action-sheet.module.d.ts +8 -4
- package/action-sheet/src/action-sheet.service.d.ts +13 -0
- package/alert/src/alert.component.d.ts +2 -2
- package/badge/src/badge.component.d.ts +2 -2
- package/breadcrumbs/src/breadcrumbs-item.component.d.ts +6 -6
- package/button/src/button-group.component.d.ts +6 -6
- package/button/src/button-item.component.d.ts +6 -6
- package/color-picker/src/color-picker.component.d.ts +16 -16
- package/common/public-api.d.ts +12 -12
- package/common/src/{components.class.d.ts → classes/components.class.d.ts} +21 -1
- package/common/src/{drawing.class.d.ts → classes/drawing.class.d.ts} +0 -0
- package/common/src/{events.class.d.ts → classes/events.class.d.ts} +0 -0
- package/common/src/{styles.class.d.ts → classes/styles.class.d.ts} +0 -0
- package/common/src/common.module.d.ts +5 -5
- package/common/src/{auto-focus.directive.d.ts → directives/auto-focus.directive.d.ts} +1 -1
- package/common/src/{debounce-time.directive.d.ts → directives/debounce-time.directive.d.ts} +0 -0
- package/common/src/{hotkey.directive.d.ts → directives/hotkey.directive.d.ts} +2 -2
- package/common/src/{infinite-scroll.directive.d.ts → directives/infinite-scroll.directive.d.ts} +0 -0
- package/common/src/{responsive.directive.d.ts → directives/responsive.directive.d.ts} +0 -0
- package/common/src/{custom-cdk-overlay.service.d.ts → services/custom-cdk-overlay.service.d.ts} +0 -0
- package/common/src/{hotkey.service.d.ts → services/hotkey.service.d.ts} +0 -0
- package/common/src/{overlay.service.d.ts → services/overlay.service.d.ts} +4 -3
- package/context-menu/src/context-menu.component.d.ts +1 -1
- package/date-picker/src/datepicker.component.d.ts +14 -14
- package/dialog/src/dialog.class.d.ts +2 -1
- package/esm2020/action-sheet/public-api.mjs +2 -2
- package/esm2020/action-sheet/src/action-sheet.component.mjs +49 -74
- package/esm2020/action-sheet/src/action-sheet.interface.mjs +3 -0
- package/esm2020/action-sheet/src/action-sheet.module.mjs +12 -7
- package/esm2020/action-sheet/src/action-sheet.service.mjs +85 -0
- package/esm2020/button/src/button.component.mjs +2 -2
- package/esm2020/collapse/src/collapse.component.mjs +3 -3
- package/esm2020/common/public-api.mjs +13 -13
- package/esm2020/common/src/classes/components.class.mjs +71 -0
- package/esm2020/common/src/classes/drawing.class.mjs +2 -0
- package/esm2020/common/src/classes/events.class.mjs +58 -0
- package/esm2020/common/src/classes/styles.class.mjs +22 -0
- package/esm2020/common/src/common.module.mjs +6 -6
- package/esm2020/common/src/directives/auto-focus.directive.mjs +55 -0
- package/esm2020/common/src/directives/debounce-time.directive.mjs +47 -0
- package/esm2020/common/src/directives/hotkey.directive.mjs +79 -0
- package/esm2020/common/src/directives/infinite-scroll.directive.mjs +63 -0
- package/esm2020/common/src/directives/responsive.directive.mjs +34 -0
- package/esm2020/common/src/services/custom-cdk-overlay.service.mjs +48 -0
- package/esm2020/common/src/services/hotkey.service.mjs +38 -0
- package/esm2020/common/src/services/overlay.service.mjs +96 -0
- package/esm2020/context-menu/src/context-menu.component.mjs +4 -4
- package/esm2020/data-pager/src/data-pager-numeric-selector.component.mjs +3 -3
- package/esm2020/decorators/src/close-button.component.mjs +4 -4
- package/esm2020/dialog/src/dialog.class.mjs +1 -1
- package/esm2020/dialog/src/dialog.component.mjs +3 -3
- package/esm2020/dialog/src/dialog.service.mjs +2 -1
- package/esm2020/menu/src/menu.component.mjs +16 -16
- package/esm2020/mixin/src/base-menu-mixin.class.mjs +3 -3
- package/esm2020/notification/acorex-components-notification.mjs +5 -0
- package/esm2020/notification/public-api.mjs +5 -0
- package/esm2020/notification/src/notification.class.mjs +2 -0
- package/esm2020/notification/src/notification.component.mjs +63 -0
- package/esm2020/notification/src/notification.module.mjs +21 -0
- package/esm2020/notification/src/notification.service.mjs +136 -0
- package/esm2020/number-box/src/number-box.component.mjs +3 -3
- package/esm2020/page/src/base-page.class.mjs +1 -27
- package/esm2020/popup/src/popup.component.mjs +4 -5
- package/esm2020/popup/src/popup.service.mjs +3 -3
- package/esm2020/range-slider/src/range-slider.component.mjs +2 -2
- package/esm2020/select-box/src/selectbox.component.mjs +3 -3
- package/esm2020/tabs/src/tab-content.directive.mjs +1 -1
- package/esm2020/tabs/src/tab-item.component.mjs +1 -1
- package/esm2020/tabs/src/tabs.component.mjs +1 -1
- package/esm2020/toast/src/toast.class.mjs +1 -1
- package/esm2020/toast/src/toast.component.mjs +29 -21
- package/esm2020/toast/src/toast.module.mjs +3 -6
- package/fesm2015/acorex-components-action-sheet.mjs +140 -124
- package/fesm2015/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2015/acorex-components-alert.mjs +0 -1
- package/fesm2015/acorex-components-avatar.mjs +0 -1
- package/fesm2015/acorex-components-badge.mjs +0 -1
- package/fesm2015/acorex-components-breadcrumbs.mjs +0 -1
- package/fesm2015/acorex-components-button.mjs +2 -3
- package/fesm2015/acorex-components-button.mjs.map +1 -1
- package/fesm2015/acorex-components-calendar.mjs +0 -1
- package/fesm2015/acorex-components-checkbox.mjs +0 -1
- package/fesm2015/acorex-components-chips.mjs +0 -1
- package/fesm2015/acorex-components-collapse.mjs +2 -3
- package/fesm2015/acorex-components-collapse.mjs.map +1 -1
- package/fesm2015/acorex-components-color-palette.mjs +0 -1
- package/fesm2015/acorex-components-color-picker.mjs +0 -1
- package/fesm2015/acorex-components-common.mjs +149 -120
- package/fesm2015/acorex-components-common.mjs.map +1 -1
- package/fesm2015/acorex-components-context-menu.mjs +3 -4
- package/fesm2015/acorex-components-context-menu.mjs.map +1 -1
- package/fesm2015/acorex-components-data-pager.mjs +2 -3
- package/fesm2015/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2015/acorex-components-data-table.mjs +0 -1
- package/fesm2015/acorex-components-date-picker.mjs +0 -1
- package/fesm2015/acorex-components-decorators.mjs +3 -4
- package/fesm2015/acorex-components-decorators.mjs.map +1 -1
- package/fesm2015/acorex-components-dialog.mjs +3 -3
- package/fesm2015/acorex-components-dialog.mjs.map +1 -1
- package/fesm2015/acorex-components-drawer.mjs +0 -1
- package/fesm2015/acorex-components-dropdown.mjs +0 -1
- package/fesm2015/acorex-components-form.mjs +0 -1
- package/fesm2015/acorex-components-image.mjs +0 -1
- package/fesm2015/acorex-components-label.mjs +0 -1
- package/fesm2015/acorex-components-loading.mjs +0 -1
- package/fesm2015/acorex-components-menu.mjs +15 -16
- package/fesm2015/acorex-components-menu.mjs.map +1 -1
- package/fesm2015/acorex-components-mixin.mjs +2 -3
- package/fesm2015/acorex-components-mixin.mjs.map +1 -1
- package/fesm2015/acorex-components-notification.mjs +221 -0
- package/fesm2015/acorex-components-notification.mjs.map +1 -0
- package/fesm2015/acorex-components-number-box.mjs +2 -3
- package/fesm2015/acorex-components-number-box.mjs.map +1 -1
- package/fesm2015/acorex-components-page.mjs +1 -28
- package/fesm2015/acorex-components-page.mjs.map +1 -1
- package/fesm2015/acorex-components-password-box.mjs +0 -1
- package/fesm2015/acorex-components-popover.mjs +0 -1
- package/fesm2015/acorex-components-popup.mjs +4 -6
- package/fesm2015/acorex-components-popup.mjs.map +1 -1
- package/fesm2015/acorex-components-progress-bar.mjs +0 -1
- package/fesm2015/acorex-components-radio.mjs +0 -1
- package/fesm2015/acorex-components-range-slider.mjs +2 -3
- package/fesm2015/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2015/acorex-components-rating.mjs +0 -1
- package/fesm2015/acorex-components-result.mjs +0 -1
- package/fesm2015/acorex-components-search-box.mjs +0 -1
- package/fesm2015/acorex-components-select-box.mjs +2 -3
- package/fesm2015/acorex-components-select-box.mjs.map +1 -1
- package/fesm2015/acorex-components-selection-list.mjs +0 -1
- package/fesm2015/acorex-components-switch.mjs +0 -1
- package/fesm2015/acorex-components-tabs.mjs.map +1 -1
- package/fesm2015/acorex-components-tag.mjs +0 -1
- package/fesm2015/acorex-components-textarea.mjs +0 -1
- package/fesm2015/acorex-components-textbox.mjs +0 -1
- package/fesm2015/acorex-components-time-box.mjs +0 -1
- package/fesm2015/acorex-components-toast.mjs +30 -26
- package/fesm2015/acorex-components-toast.mjs.map +1 -1
- package/fesm2015/acorex-components-tooltip.mjs +0 -1
- package/fesm2015/acorex-components-tree-view.mjs +0 -1
- package/fesm2015/acorex-components-uploader.mjs +0 -1
- package/fesm2015/acorex-components.mjs +0 -1
- package/fesm2020/acorex-components-action-sheet.mjs +139 -124
- package/fesm2020/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2020/acorex-components-alert.mjs +0 -1
- package/fesm2020/acorex-components-avatar.mjs +0 -1
- package/fesm2020/acorex-components-badge.mjs +0 -1
- package/fesm2020/acorex-components-breadcrumbs.mjs +0 -1
- package/fesm2020/acorex-components-button.mjs +2 -3
- package/fesm2020/acorex-components-button.mjs.map +1 -1
- package/fesm2020/acorex-components-calendar.mjs +0 -1
- package/fesm2020/acorex-components-checkbox.mjs +0 -1
- package/fesm2020/acorex-components-chips.mjs +0 -1
- package/fesm2020/acorex-components-collapse.mjs +2 -3
- package/fesm2020/acorex-components-collapse.mjs.map +1 -1
- package/fesm2020/acorex-components-color-palette.mjs +0 -1
- package/fesm2020/acorex-components-color-picker.mjs +0 -1
- package/fesm2020/acorex-components-common.mjs +149 -120
- package/fesm2020/acorex-components-common.mjs.map +1 -1
- package/fesm2020/acorex-components-context-menu.mjs +3 -4
- package/fesm2020/acorex-components-context-menu.mjs.map +1 -1
- package/fesm2020/acorex-components-data-pager.mjs +2 -3
- package/fesm2020/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2020/acorex-components-data-table.mjs +0 -1
- package/fesm2020/acorex-components-date-picker.mjs +0 -1
- package/fesm2020/acorex-components-decorators.mjs +3 -4
- package/fesm2020/acorex-components-decorators.mjs.map +1 -1
- package/fesm2020/acorex-components-dialog.mjs +3 -3
- package/fesm2020/acorex-components-dialog.mjs.map +1 -1
- package/fesm2020/acorex-components-drawer.mjs +0 -1
- package/fesm2020/acorex-components-dropdown.mjs +0 -1
- package/fesm2020/acorex-components-form.mjs +0 -1
- package/fesm2020/acorex-components-image.mjs +0 -1
- package/fesm2020/acorex-components-label.mjs +0 -1
- package/fesm2020/acorex-components-loading.mjs +0 -1
- package/fesm2020/acorex-components-menu.mjs +15 -16
- package/fesm2020/acorex-components-menu.mjs.map +1 -1
- package/fesm2020/acorex-components-mixin.mjs +2 -3
- package/fesm2020/acorex-components-mixin.mjs.map +1 -1
- package/fesm2020/acorex-components-notification.mjs +221 -0
- package/fesm2020/acorex-components-notification.mjs.map +1 -0
- package/fesm2020/acorex-components-number-box.mjs +2 -3
- package/fesm2020/acorex-components-number-box.mjs.map +1 -1
- package/fesm2020/acorex-components-page.mjs +1 -28
- package/fesm2020/acorex-components-page.mjs.map +1 -1
- package/fesm2020/acorex-components-password-box.mjs +0 -1
- package/fesm2020/acorex-components-popover.mjs +0 -1
- package/fesm2020/acorex-components-popup.mjs +4 -6
- package/fesm2020/acorex-components-popup.mjs.map +1 -1
- package/fesm2020/acorex-components-progress-bar.mjs +0 -1
- package/fesm2020/acorex-components-radio.mjs +0 -1
- package/fesm2020/acorex-components-range-slider.mjs +2 -3
- package/fesm2020/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2020/acorex-components-rating.mjs +0 -1
- package/fesm2020/acorex-components-result.mjs +0 -1
- package/fesm2020/acorex-components-search-box.mjs +0 -1
- package/fesm2020/acorex-components-select-box.mjs +2 -3
- package/fesm2020/acorex-components-select-box.mjs.map +1 -1
- package/fesm2020/acorex-components-selection-list.mjs +0 -1
- package/fesm2020/acorex-components-switch.mjs +0 -1
- package/fesm2020/acorex-components-tabs.mjs.map +1 -1
- package/fesm2020/acorex-components-tag.mjs +0 -1
- package/fesm2020/acorex-components-textarea.mjs +0 -1
- package/fesm2020/acorex-components-textbox.mjs +0 -1
- package/fesm2020/acorex-components-time-box.mjs +0 -1
- package/fesm2020/acorex-components-toast.mjs +30 -26
- package/fesm2020/acorex-components-toast.mjs.map +1 -1
- package/fesm2020/acorex-components-tooltip.mjs +0 -1
- package/fesm2020/acorex-components-tree-view.mjs +0 -1
- package/fesm2020/acorex-components-uploader.mjs +0 -1
- package/fesm2020/acorex-components.mjs +0 -1
- package/menu/src/menu.component.d.ts +1 -1
- package/mixin/src/base-components.class.d.ts +2 -2
- package/mixin/src/base-menu-mixin.class.d.ts +6 -6
- package/mixin/src/button-mixin.class.d.ts +2 -2
- package/mixin/src/clickable-mixin.class.d.ts +2 -2
- package/mixin/src/color-look-mixing.class.d.ts +2 -2
- package/mixin/src/datalist-component.class.d.ts +10 -10
- package/mixin/src/dropdown-mixin.class.d.ts +2 -2
- package/mixin/src/interactive-mixin.class.d.ts +4 -4
- package/mixin/src/loading-mixin.class.d.ts +2 -2
- package/mixin/src/mixin.class.d.ts +62 -62
- package/mixin/src/page-component.class.d.ts +2 -2
- package/mixin/src/selection-component.class.d.ts +2 -2
- package/mixin/src/sizable-mixin.class.d.ts +2 -2
- package/mixin/src/textbox-mixin.class.d.ts +2 -2
- package/mixin/src/value-mixin.class.d.ts +8 -8
- package/notification/index.d.ts +5 -0
- package/notification/public-api.d.ts +4 -0
- package/notification/src/notification.class.d.ts +16 -0
- package/notification/src/notification.component.d.ts +25 -0
- package/notification/src/notification.module.d.ts +8 -0
- package/notification/src/notification.service.d.ts +21 -0
- package/package.json +9 -1
- package/page/src/base-page.class.d.ts +3 -23
- package/popup/src/popup.component.d.ts +2 -2
- package/popup/src/popup.service.d.ts +3 -4
- package/tabs/src/tab-content.directive.d.ts +2 -2
- package/tabs/src/tab-item.component.d.ts +4 -4
- package/toast/src/toast.class.d.ts +1 -0
- package/toast/src/toast.component.d.ts +1 -0
- package/toast/src/toast.module.d.ts +1 -4
- package/action-sheet/src/action-sheet-item.component.d.ts +0 -16
- package/esm2020/action-sheet/src/action-sheet-item.component.mjs +0 -47
- package/esm2020/common/src/auto-focus.directive.mjs +0 -55
- package/esm2020/common/src/components.class.mjs +0 -45
- package/esm2020/common/src/custom-cdk-overlay.service.mjs +0 -48
- package/esm2020/common/src/debounce-time.directive.mjs +0 -47
- package/esm2020/common/src/drawing.class.mjs +0 -2
- package/esm2020/common/src/events.class.mjs +0 -58
- package/esm2020/common/src/hotkey.directive.mjs +0 -79
- package/esm2020/common/src/hotkey.service.mjs +0 -38
- package/esm2020/common/src/infinite-scroll.directive.mjs +0 -63
- package/esm2020/common/src/overlay.service.mjs +0 -91
- package/esm2020/common/src/responsive.directive.mjs +0 -34
- package/esm2020/common/src/styles.class.mjs +0 -22
@@ -0,0 +1,221 @@
|
|
1
|
+
import { AXClosbaleComponent } from '@acorex/components/common';
|
2
|
+
import * as i0 from '@angular/core';
|
3
|
+
import { Component, ChangeDetectionStrategy, ViewEncapsulation, HostBinding, NgModule, Injectable } from '@angular/core';
|
4
|
+
import { AXBaseComponentMixin } from '@acorex/components/mixin';
|
5
|
+
import * as i1 from '@angular/common';
|
6
|
+
import { CommonModule } from '@angular/common';
|
7
|
+
import { AXConfig } from '@acorex/core/config';
|
8
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
9
|
+
import * as i1$1 from '@angular/cdk/overlay';
|
10
|
+
|
11
|
+
/**
|
12
|
+
* The Button is a component which detects user interaction and triggers a corresponding event
|
13
|
+
*
|
14
|
+
* @category Components
|
15
|
+
*/
|
16
|
+
class AXNotificationComponent extends AXBaseComponentMixin {
|
17
|
+
/**
|
18
|
+
* @ignore
|
19
|
+
*/
|
20
|
+
constructor(elementRef, cdr) {
|
21
|
+
super(elementRef, cdr);
|
22
|
+
this._notificationWidth = 100;
|
23
|
+
}
|
24
|
+
onInit() {
|
25
|
+
if (this.options.timeOut) {
|
26
|
+
setTimeout(() => {
|
27
|
+
this.close();
|
28
|
+
}, this.options.timeOut);
|
29
|
+
}
|
30
|
+
if (!this.options.icon) {
|
31
|
+
switch (this.options.color) {
|
32
|
+
case 'success':
|
33
|
+
this._icon = 'ax-icon ax-icon-check-circle-fill';
|
34
|
+
break;
|
35
|
+
case 'warning':
|
36
|
+
this._icon = 'ax-icon ax-icon-warning-fill';
|
37
|
+
break;
|
38
|
+
case 'danger':
|
39
|
+
this._icon = 'ax-icon ax-icon-error-fill';
|
40
|
+
break;
|
41
|
+
default:
|
42
|
+
this._icon = this.options.icon || 'ax-icon ax-icon-check-circle-fill';
|
43
|
+
break;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
this._icon = this.options.icon;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
_handleButtonClick(button) {
|
51
|
+
if (button.onClick) {
|
52
|
+
button.onClick(this);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
get __hostClass() {
|
56
|
+
return `ax-${this.options.color}`;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
AXNotificationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXNotificationComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
60
|
+
AXNotificationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AXNotificationComponent, selector: "ax-notification", host: { properties: { "class": "this.__hostClass" } }, providers: [{ provide: AXClosbaleComponent, useExisting: AXNotificationComponent }], usesInheritance: true, ngImport: i0, template: "<!-- <ax-alert [color]=\"options.color\" [timeOut]=\"options.timeOut\">\r\n <ax-icon *ngIf=\"_icon\" [icon]=\"_icon\"></ax-icon>\r\n <ax-title [text]=\"options.title\"></ax-title>\r\n <ax-close-button *ngIf=\"options.closeable\"></ax-close-button>\r\n <ax-content *ngIf=\"options.content\">\r\n <div [innerHTML]=\"options.content\"></div>\r\n </ax-content>\r\n <ax-footer *ngIf=\"options?.buttons?.length\">\r\n <ax-button *ngFor=\"let button of options.buttons\" [text]=\"button.text\" class=\"ax-sm\"\r\n (onClick)=\"_handleButtonClick(button)\" [color]=\"options.color\" [look]=\"'default'\"></ax-button>\r\n </ax-footer>\r\n</ax-alert> -->\r\n<span [class]=\"'ax-toast-icon '+ _icon \"></span>\r\n<div class=\"ax-toast-content\">\r\n <div class=\"ax-toast-title\">{{options.title}}</div>\r\n <div [innerHTML]=\"options.content\"></div>\r\n <div class=\"ax-toast-buttons\" *ngIf=\"options?.buttons?.length\">\r\n <button *ngFor=\"let button of options.buttons\" (click)=\"_handleButtonClick(button)\">\r\n {{button.text}}\r\n </button>\r\n </div>\r\n</div>\r\n<span class=\"ax-icon ax-icon-close\" (click)=\"close()\"></span>\r\n<div class=\"ax-toast-progress\" [style.animation-duration.ms]=\"options.timeOut\" *ngIf=\"options.timeOut\"></div>", styles: ["ax-toast{width:max(20vw,380px);display:flex;padding:.75rem 1rem;border-radius:var(--ax-rounded-border-default);font-size:.875rem;border:1px solid;background-color:rgb(var(--ax-color-surface));border-color:rgba(var(--ax-color-border-default));position:relative;overflow:hidden}ax-toast.ax-primary{background-color:rgb(var(--ax-color-primary-50));color:rgb(var(--ax-color-primary-700));border-color:rgb(var(--ax-color-primary-500))}ax-toast.ax-primary .ax-toast-title{color:rgb(var(--ax-color-primary-800))}ax-toast.ax-primary .ax-toast-progress{background-color:rgb(var(--ax-color-primary-500))}ax-toast.ax-secondary{background-color:rgb(var(--ax-color-secondary-50));color:rgb(var(--ax-color-secondary-700));border-color:rgb(var(--ax-color-secondary-500))}ax-toast.ax-secondary .ax-toast-title{color:rgb(var(--ax-color-secondary-800))}ax-toast.ax-secondary .ax-toast-progress{background-color:rgb(var(--ax-color-secondary-500))}ax-toast.ax-success{background-color:rgb(var(--ax-color-success-50));color:rgb(var(--ax-color-success-700));border-color:rgb(var(--ax-color-success-500))}ax-toast.ax-success .ax-toast-title{color:rgb(var(--ax-color-success-800))}ax-toast.ax-success .ax-toast-progress{background-color:rgb(var(--ax-color-success-500))}ax-toast.ax-warning{background-color:rgb(var(--ax-color-warning-50));color:rgb(var(--ax-color-warning-700));border-color:rgb(var(--ax-color-warning-500))}ax-toast.ax-warning .ax-toast-title{color:rgb(var(--ax-color-warning-800))}ax-toast.ax-warning .ax-toast-progress{background-color:rgb(var(--ax-color-warning-500))}ax-toast.ax-danger{background-color:rgb(var(--ax-color-danger-50));color:rgb(var(--ax-color-danger-700));border-color:rgb(var(--ax-color-danger-500))}ax-toast.ax-danger .ax-toast-title{color:rgb(var(--ax-color-danger-800))}ax-toast.ax-danger .ax-toast-progress{background-color:rgb(var(--ax-color-danger-500))}@media (max-width: 599px){ax-toast{width:98vw}}ax-toast .ax-toast-icon,ax-toast .ax-icon-close{font-size:1.25rem}ax-toast .ax-toast-icon{padding-inline-end:.75rem}ax-toast .ax-toast-content{display:flex;flex-direction:column;flex:1;gap:.5rem}ax-toast .ax-toast-content .ax-toast-title{font-weight:500;margin-bottom:.5rem}ax-toast .ax-toast-content .ax-toast-buttons{margin-top:.25rem}ax-toast .ax-toast-content .ax-toast-buttons button{font-weight:700}ax-toast .ax-toast-content .ax-toast-buttons button:hover{opacity:.6}ax-toast .ax-icon-close{cursor:pointer;height:-moz-fit-content;height:fit-content}ax-toast .ax-icon-close:hover{opacity:.6}ax-toast .ax-toast-progress{position:absolute;right:0;left:0;bottom:0;height:.25rem;width:100%;animation-duration:4s;animation-timing-function:linear;animation-name:progressBar;background-color:rgba(var(--ax-color-border-default))}@keyframes progressBar{0%{width:100%}to{width:0%}}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXNotificationComponent, decorators: [{
|
62
|
+
type: Component,
|
63
|
+
args: [{ selector: 'ax-notification', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [{ provide: AXClosbaleComponent, useExisting: AXNotificationComponent }], template: "<!-- <ax-alert [color]=\"options.color\" [timeOut]=\"options.timeOut\">\r\n <ax-icon *ngIf=\"_icon\" [icon]=\"_icon\"></ax-icon>\r\n <ax-title [text]=\"options.title\"></ax-title>\r\n <ax-close-button *ngIf=\"options.closeable\"></ax-close-button>\r\n <ax-content *ngIf=\"options.content\">\r\n <div [innerHTML]=\"options.content\"></div>\r\n </ax-content>\r\n <ax-footer *ngIf=\"options?.buttons?.length\">\r\n <ax-button *ngFor=\"let button of options.buttons\" [text]=\"button.text\" class=\"ax-sm\"\r\n (onClick)=\"_handleButtonClick(button)\" [color]=\"options.color\" [look]=\"'default'\"></ax-button>\r\n </ax-footer>\r\n</ax-alert> -->\r\n<span [class]=\"'ax-toast-icon '+ _icon \"></span>\r\n<div class=\"ax-toast-content\">\r\n <div class=\"ax-toast-title\">{{options.title}}</div>\r\n <div [innerHTML]=\"options.content\"></div>\r\n <div class=\"ax-toast-buttons\" *ngIf=\"options?.buttons?.length\">\r\n <button *ngFor=\"let button of options.buttons\" (click)=\"_handleButtonClick(button)\">\r\n {{button.text}}\r\n </button>\r\n </div>\r\n</div>\r\n<span class=\"ax-icon ax-icon-close\" (click)=\"close()\"></span>\r\n<div class=\"ax-toast-progress\" [style.animation-duration.ms]=\"options.timeOut\" *ngIf=\"options.timeOut\"></div>", styles: ["ax-toast{width:max(20vw,380px);display:flex;padding:.75rem 1rem;border-radius:var(--ax-rounded-border-default);font-size:.875rem;border:1px solid;background-color:rgb(var(--ax-color-surface));border-color:rgba(var(--ax-color-border-default));position:relative;overflow:hidden}ax-toast.ax-primary{background-color:rgb(var(--ax-color-primary-50));color:rgb(var(--ax-color-primary-700));border-color:rgb(var(--ax-color-primary-500))}ax-toast.ax-primary .ax-toast-title{color:rgb(var(--ax-color-primary-800))}ax-toast.ax-primary .ax-toast-progress{background-color:rgb(var(--ax-color-primary-500))}ax-toast.ax-secondary{background-color:rgb(var(--ax-color-secondary-50));color:rgb(var(--ax-color-secondary-700));border-color:rgb(var(--ax-color-secondary-500))}ax-toast.ax-secondary .ax-toast-title{color:rgb(var(--ax-color-secondary-800))}ax-toast.ax-secondary .ax-toast-progress{background-color:rgb(var(--ax-color-secondary-500))}ax-toast.ax-success{background-color:rgb(var(--ax-color-success-50));color:rgb(var(--ax-color-success-700));border-color:rgb(var(--ax-color-success-500))}ax-toast.ax-success .ax-toast-title{color:rgb(var(--ax-color-success-800))}ax-toast.ax-success .ax-toast-progress{background-color:rgb(var(--ax-color-success-500))}ax-toast.ax-warning{background-color:rgb(var(--ax-color-warning-50));color:rgb(var(--ax-color-warning-700));border-color:rgb(var(--ax-color-warning-500))}ax-toast.ax-warning .ax-toast-title{color:rgb(var(--ax-color-warning-800))}ax-toast.ax-warning .ax-toast-progress{background-color:rgb(var(--ax-color-warning-500))}ax-toast.ax-danger{background-color:rgb(var(--ax-color-danger-50));color:rgb(var(--ax-color-danger-700));border-color:rgb(var(--ax-color-danger-500))}ax-toast.ax-danger .ax-toast-title{color:rgb(var(--ax-color-danger-800))}ax-toast.ax-danger .ax-toast-progress{background-color:rgb(var(--ax-color-danger-500))}@media (max-width: 599px){ax-toast{width:98vw}}ax-toast .ax-toast-icon,ax-toast .ax-icon-close{font-size:1.25rem}ax-toast .ax-toast-icon{padding-inline-end:.75rem}ax-toast .ax-toast-content{display:flex;flex-direction:column;flex:1;gap:.5rem}ax-toast .ax-toast-content .ax-toast-title{font-weight:500;margin-bottom:.5rem}ax-toast .ax-toast-content .ax-toast-buttons{margin-top:.25rem}ax-toast .ax-toast-content .ax-toast-buttons button{font-weight:700}ax-toast .ax-toast-content .ax-toast-buttons button:hover{opacity:.6}ax-toast .ax-icon-close{cursor:pointer;height:-moz-fit-content;height:fit-content}ax-toast .ax-icon-close:hover{opacity:.6}ax-toast .ax-toast-progress{position:absolute;right:0;left:0;bottom:0;height:.25rem;width:100%;animation-duration:4s;animation-timing-function:linear;animation-name:progressBar;background-color:rgba(var(--ax-color-border-default))}@keyframes progressBar{0%{width:100%}to{width:0%}}\n"] }]
|
64
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { __hostClass: [{
|
65
|
+
type: HostBinding,
|
66
|
+
args: ['class']
|
67
|
+
}] } });
|
68
|
+
|
69
|
+
const COMPONENT = [AXNotificationComponent];
|
70
|
+
const MODULES = [CommonModule];
|
71
|
+
class AXNotificationModule {
|
72
|
+
}
|
73
|
+
AXNotificationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXNotificationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
74
|
+
AXNotificationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: AXNotificationModule, declarations: [AXNotificationComponent], imports: [CommonModule], exports: [AXNotificationComponent] });
|
75
|
+
AXNotificationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXNotificationModule, imports: [MODULES] });
|
76
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXNotificationModule, decorators: [{
|
77
|
+
type: NgModule,
|
78
|
+
args: [{
|
79
|
+
declarations: [...COMPONENT],
|
80
|
+
imports: [...MODULES],
|
81
|
+
exports: [...COMPONENT],
|
82
|
+
providers: [],
|
83
|
+
}]
|
84
|
+
}] });
|
85
|
+
|
86
|
+
class AXNotificationService {
|
87
|
+
constructor(overlayService, parentInjector) {
|
88
|
+
this.overlayService = overlayService;
|
89
|
+
this.parentInjector = parentInjector;
|
90
|
+
this._defaults = {
|
91
|
+
gap: 5,
|
92
|
+
timeOut: 2500,
|
93
|
+
location: 'bottom-center',
|
94
|
+
};
|
95
|
+
this._activeList = [];
|
96
|
+
}
|
97
|
+
primary(content) {
|
98
|
+
this.show({
|
99
|
+
timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,
|
100
|
+
color: 'primary',
|
101
|
+
content: content
|
102
|
+
});
|
103
|
+
}
|
104
|
+
secondary(content) {
|
105
|
+
this.show({
|
106
|
+
timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,
|
107
|
+
color: 'secondary',
|
108
|
+
content: content
|
109
|
+
});
|
110
|
+
}
|
111
|
+
success(content) {
|
112
|
+
this.show({
|
113
|
+
timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,
|
114
|
+
color: 'success',
|
115
|
+
content: content
|
116
|
+
});
|
117
|
+
}
|
118
|
+
warning(content) {
|
119
|
+
this.show({
|
120
|
+
timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,
|
121
|
+
color: 'warning',
|
122
|
+
content: content
|
123
|
+
});
|
124
|
+
}
|
125
|
+
danger(content) {
|
126
|
+
this.show({
|
127
|
+
timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,
|
128
|
+
color: 'danger',
|
129
|
+
content: content
|
130
|
+
});
|
131
|
+
}
|
132
|
+
show(options) {
|
133
|
+
const opt = Object.assign({
|
134
|
+
closeable: true,
|
135
|
+
location: AXConfig.get('toast.location') || this._defaults.location
|
136
|
+
}, options);
|
137
|
+
const gap = AXConfig.get('toast.gap') || this._defaults.gap;
|
138
|
+
let positionStrategy = this.overlayService.position().global();
|
139
|
+
const pos = this.getPosition(opt.location) + gap + 'px';
|
140
|
+
switch (opt.location) {
|
141
|
+
case 'bottom-center':
|
142
|
+
positionStrategy = positionStrategy.bottom(pos).centerHorizontally();
|
143
|
+
break;
|
144
|
+
case 'bottom-end':
|
145
|
+
positionStrategy = positionStrategy.bottom(pos).right(gap + 'px');
|
146
|
+
break;
|
147
|
+
case 'bottom-start':
|
148
|
+
positionStrategy = positionStrategy.bottom(pos).left(gap + 'px');
|
149
|
+
break;
|
150
|
+
case 'top-center':
|
151
|
+
positionStrategy = positionStrategy.top(pos).centerHorizontally();
|
152
|
+
break;
|
153
|
+
case 'top-end':
|
154
|
+
positionStrategy = positionStrategy.top(pos).right(gap + 'px');
|
155
|
+
break;
|
156
|
+
case 'top-start':
|
157
|
+
positionStrategy = positionStrategy.top(pos).left(gap + 'px');
|
158
|
+
break;
|
159
|
+
case 'center-start':
|
160
|
+
positionStrategy = positionStrategy.centerVertically().left(gap + 'px');
|
161
|
+
break;
|
162
|
+
case 'center-end':
|
163
|
+
positionStrategy = positionStrategy.centerVertically().right(gap + 'px');
|
164
|
+
break;
|
165
|
+
default:
|
166
|
+
break;
|
167
|
+
}
|
168
|
+
const overlayRef = this.overlayService.create({
|
169
|
+
positionStrategy,
|
170
|
+
panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],
|
171
|
+
});
|
172
|
+
const toastPortal = new ComponentPortal(AXNotificationComponent, null, this.parentInjector);
|
173
|
+
const host = overlayRef.attach(toastPortal);
|
174
|
+
host.instance.visibleIndex = this._activeList.length;
|
175
|
+
this._activeList.push(host.instance);
|
176
|
+
if (host.instance) {
|
177
|
+
Object.assign(host.instance, {
|
178
|
+
options: opt,
|
179
|
+
close: () => {
|
180
|
+
this._activeList = this._activeList.filter(c => c != host.instance);
|
181
|
+
overlayRef.dispose();
|
182
|
+
}
|
183
|
+
});
|
184
|
+
setTimeout(() => {
|
185
|
+
host.changeDetectorRef.detectChanges();
|
186
|
+
}, 0);
|
187
|
+
}
|
188
|
+
return {
|
189
|
+
close: () => {
|
190
|
+
host.instance.close();
|
191
|
+
}
|
192
|
+
};
|
193
|
+
}
|
194
|
+
hideAll() {
|
195
|
+
this._activeList.forEach(c => c.close());
|
196
|
+
}
|
197
|
+
getPosition(location) {
|
198
|
+
const list = this._activeList.filter(c => c.options.location == location);
|
199
|
+
if (list.length == 0)
|
200
|
+
return 0;
|
201
|
+
if (location.split('-')[0] == 'bottom') {
|
202
|
+
return window.innerHeight - list[list.length - 1]._getHostElement().offsetTop;
|
203
|
+
}
|
204
|
+
else {
|
205
|
+
return list[list.length - 1]._getHostElement().offsetTop + list[list.length - 1]._getHostElement().offsetHeight;
|
206
|
+
}
|
207
|
+
}
|
208
|
+
}
|
209
|
+
AXNotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXNotificationService, deps: [{ token: i1$1.Overlay }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
210
|
+
AXNotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXNotificationService, providedIn: 'root' });
|
211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXNotificationService, decorators: [{
|
212
|
+
type: Injectable,
|
213
|
+
args: [{ providedIn: 'root' }]
|
214
|
+
}], ctorParameters: function () { return [{ type: i1$1.Overlay }, { type: i0.Injector }]; } });
|
215
|
+
|
216
|
+
/**
|
217
|
+
* Generated bundle index. Do not edit.
|
218
|
+
*/
|
219
|
+
|
220
|
+
export { AXNotificationComponent, AXNotificationModule, AXNotificationService };
|
221
|
+
//# sourceMappingURL=acorex-components-notification.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"acorex-components-notification.mjs","sources":["../../../../projects/acorex/components/notification/src/notification.component.ts","../../../../projects/acorex/components/notification/src/notification.component.html","../../../../projects/acorex/components/notification/src/notification.module.ts","../../../../projects/acorex/components/notification/src/notification.service.ts","../../../../projects/acorex/components/notification/acorex-components-notification.ts"],"sourcesContent":["import { AXClosbaleComponent } from '@acorex/components/common';\r\nimport { AXButtonItem } from '@acorex/components/button';\r\nimport {\r\n Component,\r\n ViewEncapsulation,\r\n ChangeDetectionStrategy,\r\n ElementRef,\r\n ChangeDetectorRef,\r\n HostBinding,\r\n} from '@angular/core';\r\nimport { AXBaseComponentMixin } from '@acorex/components/mixin';\r\nimport { AXNotificationOptions } from './notification.class';\r\n\r\n/**\r\n * The Button is a component which detects user interaction and triggers a corresponding event\r\n *\r\n * @category Components\r\n */\r\n@Component({\r\n selector: 'ax-notification',\r\n templateUrl: './notification.component.html',\r\n styleUrls: ['./notification.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n providers: [{ provide: AXClosbaleComponent, useExisting: AXNotificationComponent }],\r\n})\r\nexport class AXNotificationComponent extends AXBaseComponentMixin {\r\n\r\n options: AXNotificationOptions;\r\n\r\n _notificationWidth: number = 100;\r\n\r\n _icon: string;\r\n\r\n close: () => void;\r\n /**\r\n * @ignore\r\n */\r\n constructor(elementRef: ElementRef, cdr: ChangeDetectorRef) {\r\n super(elementRef, cdr);\r\n }\r\n\r\n onInit() {\r\n if (this.options.timeOut) {\r\n setTimeout(() => {\r\n this.close();\r\n }, this.options.timeOut);\r\n }\r\n if (!this.options.icon) {\r\n switch (this.options.color) {\r\n case 'success':\r\n this._icon = 'ax-icon ax-icon-check-circle-fill';\r\n break;\r\n case 'warning':\r\n this._icon = 'ax-icon ax-icon-warning-fill';\r\n break;\r\n case 'danger':\r\n this._icon = 'ax-icon ax-icon-error-fill';\r\n break;\r\n default:\r\n this._icon = this.options.icon || 'ax-icon ax-icon-check-circle-fill';\r\n break;\r\n }\r\n } else {\r\n this._icon = this.options.icon;\r\n }\r\n }\r\n\r\n _handleButtonClick(button: AXButtonItem) {\r\n if (button.onClick) {\r\n button.onClick(this);\r\n }\r\n }\r\n\r\n @HostBinding('class')\r\n private get __hostClass(): string {\r\n return `ax-${this.options.color}`\r\n }\r\n\r\n\r\n}\r\n","<!-- <ax-alert [color]=\"options.color\" [timeOut]=\"options.timeOut\">\r\n <ax-icon *ngIf=\"_icon\" [icon]=\"_icon\"></ax-icon>\r\n <ax-title [text]=\"options.title\"></ax-title>\r\n <ax-close-button *ngIf=\"options.closeable\"></ax-close-button>\r\n <ax-content *ngIf=\"options.content\">\r\n <div [innerHTML]=\"options.content\"></div>\r\n </ax-content>\r\n <ax-footer *ngIf=\"options?.buttons?.length\">\r\n <ax-button *ngFor=\"let button of options.buttons\" [text]=\"button.text\" class=\"ax-sm\"\r\n (onClick)=\"_handleButtonClick(button)\" [color]=\"options.color\" [look]=\"'default'\"></ax-button>\r\n </ax-footer>\r\n</ax-alert> -->\r\n<span [class]=\"'ax-toast-icon '+ _icon \"></span>\r\n<div class=\"ax-toast-content\">\r\n <div class=\"ax-toast-title\">{{options.title}}</div>\r\n <div [innerHTML]=\"options.content\"></div>\r\n <div class=\"ax-toast-buttons\" *ngIf=\"options?.buttons?.length\">\r\n <button *ngFor=\"let button of options.buttons\" (click)=\"_handleButtonClick(button)\">\r\n {{button.text}}\r\n </button>\r\n </div>\r\n</div>\r\n<span class=\"ax-icon ax-icon-close\" (click)=\"close()\"></span>\r\n<div class=\"ax-toast-progress\" [style.animation-duration.ms]=\"options.timeOut\" *ngIf=\"options.timeOut\"></div>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { AXNotificationComponent } from './notification.component';\r\n\r\nconst COMPONENT = [AXNotificationComponent];\r\nconst MODULES = [CommonModule];\r\n\r\n@NgModule({\r\n declarations: [...COMPONENT],\r\n imports: [...MODULES],\r\n exports: [...COMPONENT],\r\n providers: [],\r\n})\r\nexport class AXNotificationModule {\r\n \r\n}\r\n","import { AXConfig } from '@acorex/core/config';\r\nimport { Overlay } from '@angular/cdk/overlay';\r\nimport { ComponentPortal } from '@angular/cdk/portal';\r\nimport { Injectable, Injector } from '@angular/core';\r\nimport { AXNotificationOptions, AXNotificationRef } from './notification.class';\r\nimport { AXNotificationComponent } from './notification.component';\r\n\r\n\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class AXNotificationService {\r\n\r\n\r\n private readonly _defaults = {\r\n gap: 5,\r\n timeOut: 2500,\r\n location: 'bottom-center',\r\n }\r\n\r\n constructor(private overlayService: Overlay, private parentInjector: Injector) {\r\n\r\n }\r\n\r\n private _activeList: AXNotificationComponent[] = [];\r\n\r\n primary(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'primary',\r\n content: content\r\n });\r\n }\r\n secondary(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'secondary',\r\n content: content\r\n });\r\n }\r\n success(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'success',\r\n content: content\r\n });\r\n }\r\n\r\n warning(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'warning',\r\n content: content\r\n });\r\n }\r\n danger(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'danger',\r\n content: content\r\n });\r\n }\r\n show(options: AXNotificationOptions): AXNotificationRef {\r\n const opt = Object.assign(\r\n {\r\n closeable: true,\r\n location: AXConfig.get('toast.location') || this._defaults.location\r\n },\r\n options\r\n );\r\n const gap = AXConfig.get('toast.gap') || this._defaults.gap;\r\n\r\n let positionStrategy = this.overlayService.position().global();\r\n const pos = this.getPosition(opt.location) + gap + 'px';\r\n switch (opt.location) {\r\n case 'bottom-center':\r\n positionStrategy = positionStrategy.bottom(pos).centerHorizontally()\r\n break;\r\n case 'bottom-end':\r\n positionStrategy = positionStrategy.bottom(pos).right(gap + 'px');\r\n break;\r\n case 'bottom-start':\r\n positionStrategy = positionStrategy.bottom(pos).left(gap + 'px');\r\n break;\r\n case 'top-center':\r\n positionStrategy = positionStrategy.top(pos).centerHorizontally()\r\n break;\r\n case 'top-end':\r\n positionStrategy = positionStrategy.top(pos).right(gap + 'px');\r\n break;\r\n case 'top-start':\r\n positionStrategy = positionStrategy.top(pos).left(gap + 'px');\r\n break;\r\n case 'center-start':\r\n positionStrategy = positionStrategy.centerVertically().left(gap + 'px');\r\n break;\r\n case 'center-end':\r\n positionStrategy = positionStrategy.centerVertically().right(gap + 'px');\r\n break;\r\n default:\r\n break;\r\n }\r\n const overlayRef = this.overlayService.create(\r\n {\r\n positionStrategy,\r\n panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],\r\n });\r\n const toastPortal = new ComponentPortal(AXNotificationComponent, null, this.parentInjector);\r\n\r\n const host = overlayRef.attach(toastPortal);\r\n (host.instance as any).visibleIndex = this._activeList.length;\r\n this._activeList.push(host.instance);\r\n if (host.instance) {\r\n Object.assign(host.instance, {\r\n options: opt,\r\n close: () => {\r\n this._activeList = this._activeList.filter(c => c != host.instance);\r\n overlayRef.dispose()\r\n }\r\n });\r\n setTimeout(() => {\r\n host.changeDetectorRef.detectChanges();\r\n }, 0);\r\n }\r\n\r\n return {\r\n close: () => {\r\n host.instance.close();\r\n }\r\n }\r\n }\r\n\r\n\r\n\r\n public hideAll() {\r\n this._activeList.forEach(c => c.close());\r\n }\r\n\r\n private getPosition(location: string) {\r\n const list = this._activeList.filter(c => c.options.location == location);\r\n if (list.length == 0) return 0;\r\n if (location.split('-')[0] == 'bottom') {\r\n return window.innerHeight - list[list.length - 1]._getHostElement().offsetTop;\r\n }\r\n else {\r\n return list[list.length - 1]._getHostElement().offsetTop + list[list.length - 1]._getHostElement().offsetHeight;\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;AAaA;;;;AAIG;AASG,MAAO,uBAAwB,SAAQ,oBAAoB,CAAA;AAS/D;;AAEG;IACH,WAAY,CAAA,UAAsB,EAAE,GAAsB,EAAA;AACxD,QAAA,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AATzB,QAAA,IAAkB,CAAA,kBAAA,GAAW,GAAG,CAAC;KAUhC;IAED,MAAM,GAAA;AACJ,QAAA,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACxB,UAAU,CAAC,MAAK;gBACd,IAAI,CAAC,KAAK,EAAE,CAAC;AACf,aAAC,E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CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,QAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArB,qBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cADR,MAAM,EAAA,CAAA,CAAA;2FACnB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACTlC;;AAEG;;;;"}
|
@@ -213,7 +213,7 @@ class AXNumberBoxComponent extends AXBaseTextBoxMixin {
|
|
213
213
|
}
|
214
214
|
}
|
215
215
|
AXNumberBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXNumberBoxComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
216
|
-
AXNumberBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AXNumberBoxComponent, selector: "ax-number-box", inputs: { disabled: "disabled", readonly: "readonly", tabIndex: "tabIndex", size: "size", value: "value", placeholder: "placeholder", maxLength: "maxLength", allowNull: "allowNull", type: "type", autoComplete: "autoComplete", name: "name", checked: "checked", thousandsSeparator: "thousandsSeparator", padDecimalZeros: "padDecimalZeros", step: "step", decimals: "decimals", decimalStep: "decimalStep", showSpinButtons: "showSpinButtons", minValue: "minValue", maxValue: "maxValue" }, outputs: { valueChange: "valueChange", onValueChanged: "onValueChanged", onBlur: "onBlur", onFocus: "onFocus" }, host: { classAttribute: "ax-editor-container" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }, { propertyName: "_maskDirective", first: true, predicate: IMaskDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<input #input class=\"ax-input\" type=\"text\" [attr.placeholder]=\"placeholder\" [attr.autocomplete]=\"autoComplete\"\r\n [imask]=\"_maskObj\" [unmask]=\"'typed'\" [attr.min]=\"minValue\" [attr.max]=\"maxValue\"\r\n [class.ax-state-disabled]=\"disabled\" [class.ax-state-readonly]=\"readonly\" [disabled]=\"disabled\"\r\n [readonly]=\"readonly\" [tabindex]=\"tabIndex\" [(ngModel)]=\"value\" (keydown)=\"_handleOnKeydownEvent($event)\"\r\n (keyup)=\"_emitOnKeyupEvent($event)\" (keypress)=\"_emitOnKeypressEvent($event)\" (focus)=\"_emitOnFocusEvent($event)\"\r\n (blur)=\"_emitOnBlurEvent($event)\">\r\n\r\n<div class=\"ax-number-box-control\" *ngIf=\"showSpinButtons\">\r\n <button class=\"ax-general-button ax-button-icon\" (click)=\"_handleUpDownClick(1)\">\r\n <span class=\"ax-icon ax-icon-arrow-up\"></span>\r\n </button>\r\n <button class=\"ax-general-button ax-button-icon\" (click)=\"_handleUpDownClick(-1)\">\r\n <span class=\"ax-icon ax-icon-arrow-down\"></span>\r\n </button>\r\n</div>\r\n\r\n<!-- <div class=\"ax-number-box-arrows\" *ngIf=\"showSpinButtons && !(disabled || readonly)\">\r\n <ax-button color=\"light\" look=\"blank\" (onClick)=\"_handleUpDownClick($event,1)\" [tabIndex]=\"-1\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-icon-arrow-fill ax-
|
216
|
+
AXNumberBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AXNumberBoxComponent, selector: "ax-number-box", inputs: { disabled: "disabled", readonly: "readonly", tabIndex: "tabIndex", size: "size", value: "value", placeholder: "placeholder", maxLength: "maxLength", allowNull: "allowNull", type: "type", autoComplete: "autoComplete", name: "name", checked: "checked", thousandsSeparator: "thousandsSeparator", padDecimalZeros: "padDecimalZeros", step: "step", decimals: "decimals", decimalStep: "decimalStep", showSpinButtons: "showSpinButtons", minValue: "minValue", maxValue: "maxValue" }, outputs: { valueChange: "valueChange", onValueChanged: "onValueChanged", onBlur: "onBlur", onFocus: "onFocus" }, host: { classAttribute: "ax-editor-container" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }, { propertyName: "_maskDirective", first: true, predicate: IMaskDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<input #input class=\"ax-input\" type=\"text\" [attr.placeholder]=\"placeholder\" [attr.autocomplete]=\"autoComplete\"\r\n [imask]=\"_maskObj\" [unmask]=\"'typed'\" [attr.min]=\"minValue\" [attr.max]=\"maxValue\"\r\n [class.ax-state-disabled]=\"disabled\" [class.ax-state-readonly]=\"readonly\" [disabled]=\"disabled\"\r\n [readonly]=\"readonly\" [tabindex]=\"tabIndex\" [(ngModel)]=\"value\" (keydown)=\"_handleOnKeydownEvent($event)\"\r\n (keyup)=\"_emitOnKeyupEvent($event)\" (keypress)=\"_emitOnKeypressEvent($event)\" (focus)=\"_emitOnFocusEvent($event)\"\r\n (blur)=\"_emitOnBlurEvent($event)\">\r\n\r\n<div class=\"ax-number-box-control\" *ngIf=\"showSpinButtons\">\r\n <button class=\"ax-general-button ax-button-icon\" (click)=\"_handleUpDownClick(1)\">\r\n <span class=\"ax-icon ax-icon-arrow-up\"></span>\r\n </button>\r\n <button class=\"ax-general-button ax-button-icon\" (click)=\"_handleUpDownClick(-1)\">\r\n <span class=\"ax-icon ax-icon-arrow-down\"></span>\r\n </button>\r\n</div>\r\n\r\n<!-- <div class=\"ax-number-box-arrows\" *ngIf=\"showSpinButtons && !(disabled || readonly)\">\r\n <ax-button color=\"light\" look=\"blank\" (onClick)=\"_handleUpDownClick($event,1)\" [tabIndex]=\"-1\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-icon-arrow-fill ax-rotation-90\">\r\n </ax-icon>\r\n </ax-prefix>\r\n </ax-button>\r\n <ax-button color=\"light\" look=\"blank\" (onClick)=\"_handleUpDownClick($event,-1)\" [tabIndex]=\"-1\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-icon-arrow-fill -ax-rotation-90\">\r\n </ax-icon>\r\n </ax-prefix>\r\n </ax-button>\r\n</div> -->\r\n<ng-content select=\"ax-suffix\">\r\n</ng-content>\r\n<ng-content select=\"ax-validation-rule\">\r\n</ng-content>", styles: [".ax-number-box-control{display:flex;height:100%;align-items:center;justify-content:center;margin-inline-end:.25rem;flex-direction:column}.ax-number-box-control .ax-general-button{display:flex;width:1.25rem;height:1rem;border-radius:.2rem}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.IMaskDirective, selector: "[imask]", inputs: ["imask", "unmask", "imaskElement"], outputs: ["accept", "complete"], exportAs: ["imask"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
217
217
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXNumberBoxComponent, decorators: [{
|
218
218
|
type: Component,
|
219
219
|
args: [{ selector: 'ax-number-box', inputs: [
|
@@ -237,7 +237,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
237
237
|
'onValueChanged',
|
238
238
|
'onBlur',
|
239
239
|
'onFocus'
|
240
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { class: 'ax-editor-container' }, template: "<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<input #input class=\"ax-input\" type=\"text\" [attr.placeholder]=\"placeholder\" [attr.autocomplete]=\"autoComplete\"\r\n [imask]=\"_maskObj\" [unmask]=\"'typed'\" [attr.min]=\"minValue\" [attr.max]=\"maxValue\"\r\n [class.ax-state-disabled]=\"disabled\" [class.ax-state-readonly]=\"readonly\" [disabled]=\"disabled\"\r\n [readonly]=\"readonly\" [tabindex]=\"tabIndex\" [(ngModel)]=\"value\" (keydown)=\"_handleOnKeydownEvent($event)\"\r\n (keyup)=\"_emitOnKeyupEvent($event)\" (keypress)=\"_emitOnKeypressEvent($event)\" (focus)=\"_emitOnFocusEvent($event)\"\r\n (blur)=\"_emitOnBlurEvent($event)\">\r\n\r\n<div class=\"ax-number-box-control\" *ngIf=\"showSpinButtons\">\r\n <button class=\"ax-general-button ax-button-icon\" (click)=\"_handleUpDownClick(1)\">\r\n <span class=\"ax-icon ax-icon-arrow-up\"></span>\r\n </button>\r\n <button class=\"ax-general-button ax-button-icon\" (click)=\"_handleUpDownClick(-1)\">\r\n <span class=\"ax-icon ax-icon-arrow-down\"></span>\r\n </button>\r\n</div>\r\n\r\n<!-- <div class=\"ax-number-box-arrows\" *ngIf=\"showSpinButtons && !(disabled || readonly)\">\r\n <ax-button color=\"light\" look=\"blank\" (onClick)=\"_handleUpDownClick($event,1)\" [tabIndex]=\"-1\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-icon-arrow-fill ax-
|
240
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { class: 'ax-editor-container' }, template: "<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<input #input class=\"ax-input\" type=\"text\" [attr.placeholder]=\"placeholder\" [attr.autocomplete]=\"autoComplete\"\r\n [imask]=\"_maskObj\" [unmask]=\"'typed'\" [attr.min]=\"minValue\" [attr.max]=\"maxValue\"\r\n [class.ax-state-disabled]=\"disabled\" [class.ax-state-readonly]=\"readonly\" [disabled]=\"disabled\"\r\n [readonly]=\"readonly\" [tabindex]=\"tabIndex\" [(ngModel)]=\"value\" (keydown)=\"_handleOnKeydownEvent($event)\"\r\n (keyup)=\"_emitOnKeyupEvent($event)\" (keypress)=\"_emitOnKeypressEvent($event)\" (focus)=\"_emitOnFocusEvent($event)\"\r\n (blur)=\"_emitOnBlurEvent($event)\">\r\n\r\n<div class=\"ax-number-box-control\" *ngIf=\"showSpinButtons\">\r\n <button class=\"ax-general-button ax-button-icon\" (click)=\"_handleUpDownClick(1)\">\r\n <span class=\"ax-icon ax-icon-arrow-up\"></span>\r\n </button>\r\n <button class=\"ax-general-button ax-button-icon\" (click)=\"_handleUpDownClick(-1)\">\r\n <span class=\"ax-icon ax-icon-arrow-down\"></span>\r\n </button>\r\n</div>\r\n\r\n<!-- <div class=\"ax-number-box-arrows\" *ngIf=\"showSpinButtons && !(disabled || readonly)\">\r\n <ax-button color=\"light\" look=\"blank\" (onClick)=\"_handleUpDownClick($event,1)\" [tabIndex]=\"-1\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-icon-arrow-fill ax-rotation-90\">\r\n </ax-icon>\r\n </ax-prefix>\r\n </ax-button>\r\n <ax-button color=\"light\" look=\"blank\" (onClick)=\"_handleUpDownClick($event,-1)\" [tabIndex]=\"-1\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-icon-arrow-fill -ax-rotation-90\">\r\n </ax-icon>\r\n </ax-prefix>\r\n </ax-button>\r\n</div> -->\r\n<ng-content select=\"ax-suffix\">\r\n</ng-content>\r\n<ng-content select=\"ax-validation-rule\">\r\n</ng-content>", styles: [".ax-number-box-control{display:flex;height:100%;align-items:center;justify-content:center;margin-inline-end:.25rem;flex-direction:column}.ax-number-box-control .ax-general-button{display:flex;width:1.25rem;height:1rem;border-radius:.2rem}\n"] }]
|
241
241
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { input: [{
|
242
242
|
type: ViewChild,
|
243
243
|
args: ['input']
|
@@ -295,4 +295,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
295
295
|
|
296
296
|
export { AXNumberBoxComponent, AXNumberBoxModule };
|
297
297
|
//# sourceMappingURL=acorex-components-number-box.mjs.map
|
298
|
-
//# sourceMappingURL=acorex-components-number-box.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-number-box.mjs","sources":["../../../../projects/acorex/components/number-box/src/number-box.component.ts","../../../../projects/acorex/components/number-box/src/number-box.component.html","../../../../projects/acorex/components/number-box/src/number-box.module.ts","../../../../projects/acorex/components/number-box/acorex-components-number-box.ts"],"sourcesContent":["import IMask from 'imask';\r\nimport { IMaskDirective } from 'angular-imask';\r\nimport {\r\n Component,\r\n ViewEncapsulation,\r\n ChangeDetectionStrategy,\r\n ElementRef,\r\n ChangeDetectorRef,\r\n Input,\r\n ViewChild,\r\n} from '@angular/core';\r\n\r\n\r\nimport { toNumber } from 'lodash-es';\r\nimport {\r\n AXBaseTextBoxMixin,\r\n AXComponentOptionChanged,\r\n} from '@acorex/components/mixin';\r\n\r\n/**\r\n * The NumberBox is a component which detects user interaction and triggers a corresponding event\r\n *\r\n * @category Components\r\n */\r\n@Component({\r\n selector: 'ax-number-box',\r\n templateUrl: './number-box.component.html',\r\n styleUrls: ['./number-box.component.scss'],\r\n inputs: [\r\n 'disabled',\r\n 'readonly',\r\n 'tabIndex',\r\n 'size',\r\n 'value',\r\n 'placeholder',\r\n 'maxLength',\r\n 'allowNull',\r\n 'type',\r\n 'autoComplete',\r\n 'readonly',\r\n 'allowNull',\r\n 'value',\r\n 'name',\r\n 'checked',\r\n ],\r\n outputs: [\r\n 'valueChange',\r\n 'onValueChanged',\r\n 'onBlur',\r\n 'onFocus'\r\n ],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n host: { class: 'ax-editor-container' },\r\n})\r\nexport class AXNumberBoxComponent extends AXBaseTextBoxMixin {\r\n @ViewChild('input') input: ElementRef<HTMLInputElement>;\r\n\r\n private _thousandsSeparator: string;\r\n /**\r\n * A character value that specifies the separator character.\r\n */\r\n @Input()\r\n public get thousandsSeparator(): string {\r\n return this._thousandsSeparator;\r\n }\r\n public set thousandsSeparator(v: string) {\r\n this._setOption({\r\n name: 'thousandsSeparator',\r\n value: v ?? '',\r\n });\r\n }\r\n\r\n private _padDecimalZeros: boolean = false;\r\n /**\r\n * A character value that specifies the separator character.\r\n */\r\n @Input()\r\n public get padDecimalZeros(): boolean {\r\n return this._padDecimalZeros;\r\n }\r\n public set padDecimalZeros(v: boolean) {\r\n this._setOption({\r\n name: 'padDecimalZeros',\r\n value: v,\r\n });\r\n }\r\n\r\n /**\r\n * Specifies the value that is used to increment or decrement the **Integer** part of number\r\n */\r\n @Input()\r\n step: number = 1;\r\n\r\n private _decimals: number = 0;\r\n /**\r\n * Specifies the number of decimals that the user can enter\r\n */\r\n @Input()\r\n public get decimals(): number {\r\n return this._decimals;\r\n }\r\n public set decimals(v: number) {\r\n this._setOption({\r\n name: 'decimals',\r\n value: v ?? 0,\r\n });\r\n }\r\n\r\n /**\r\n * Specifies the value that is used to increment or decrement the **Deciaml** part of number\r\n */\r\n @Input()\r\n decimalStep: number | 'auto' = 'auto';\r\n\r\n /**\r\n * Specifies whether the Up and Down spin buttons will be rendered or not\r\n */\r\n @Input()\r\n showSpinButtons: boolean = true;\r\n\r\n private _minValue: number = Number.MIN_SAFE_INTEGER;\r\n /**\r\n * Specifies the smallest value that is valid\r\n */\r\n @Input()\r\n public get minValue(): number {\r\n return this._minValue;\r\n }\r\n public set minValue(v: number) {\r\n this._setOption({\r\n name: 'minValue',\r\n value: v != null ? Number(v) : Number.MIN_SAFE_INTEGER,\r\n });\r\n }\r\n\r\n private _maxValue: number = Number.MAX_SAFE_INTEGER;\r\n /**\r\n * Specifies the greatest value that is valid\r\n */\r\n @Input()\r\n public get maxValue(): number {\r\n return this._maxValue;\r\n }\r\n public set maxValue(v: number) {\r\n this._setOption({\r\n name: 'maxValue',\r\n value: v != null ? Number(v) : Number.MAX_SAFE_INTEGER,\r\n });\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n _maskObj: IMask.MaskedNumber;\r\n\r\n @ViewChild(IMaskDirective)\r\n private _maskDirective: IMaskDirective<IMask.MaskedNumber>;\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(elementRef: ElementRef, private cdr: ChangeDetectorRef) {\r\n super(elementRef, cdr);\r\n }\r\n\r\n onViewInit(): void {\r\n super.onViewInit();\r\n this._updateMask();\r\n }\r\n\r\n _onOptionChanged(option: AXComponentOptionChanged): void {\r\n super._onOptionChanged(option);\r\n this._updateMask();\r\n }\r\n\r\n focus(): void {\r\n this.input.nativeElement.focus()\r\n }\r\n\r\n private _updateMask() {\r\n if (!this._maskObj) {\r\n this._maskObj = IMask.createMask({\r\n mask: Number,\r\n min: this.minValue,\r\n max: this.maxValue,\r\n thousandsSeparator: this.thousandsSeparator || '',\r\n scale: this.decimals,\r\n radix: '.',\r\n padFractionalZeros: this.decimals > 0 && this.padDecimalZeros,\r\n });\r\n } else {\r\n this._maskObj.updateOptions({\r\n min: this.minValue,\r\n max: this.maxValue,\r\n thousandsSeparator: this.thousandsSeparator || '',\r\n scale: this.decimals,\r\n radix: '.',\r\n padFractionalZeros: this.decimals > 0 && this.padDecimalZeros,\r\n });\r\n }\r\n this._maskDirective?.maskRef?.updateValue();\r\n this._maskDirective?.maskRef?.updateControl();\r\n }\r\n\r\n _handleOnKeydownEvent(e: KeyboardEvent) {\r\n if (this.disabled || this.readonly) return;\r\n const ignore = () => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n };\r\n this._setUserInteraction();\r\n const input = e.target as HTMLInputElement;\r\n const valStr = input.value;\r\n const decimalPointIndex = valStr.indexOf('.');\r\n const _cursorPos = input.selectionStart!;\r\n\r\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\r\n if (\r\n decimalPointIndex > 0 &&\r\n _cursorPos > decimalPointIndex &&\r\n this.decimals > 0\r\n ) {\r\n e.key === 'ArrowDown' ? this.decimalStepDown() : this.decimalStepUp();\r\n } else {\r\n e.key === 'ArrowDown' ? this.stepDown() : this.stepUp();\r\n }\r\n ignore();\r\n setTimeout(() => {\r\n input.setSelectionRange(_cursorPos, _cursorPos);\r\n }, 5);\r\n }\r\n super._emitOnKeydownEvent(e);\r\n }\r\n\r\n _handleUpDownClick(v: -1 | 1) {\r\n if (this.disabled || this.readonly) return;\r\n this._setUserInteraction();\r\n v == 1 ? this.stepUp() : this.stepDown();\r\n }\r\n\r\n _setValue(value: any) {\r\n if ((value == null || (value == 0 && !this._maskObj.value)) && this.allowNull) {\r\n return null;\r\n }\r\n const v = toNumber(value);\r\n if (v < this.minValue) return this.minValue;\r\n if (v > this.maxValue) return this.maxValue;\r\n return v;\r\n }\r\n\r\n stepUp() {\r\n if (!this.value) {\r\n this.value = Math.max(this.minValue, 0);\r\n }\r\n this.value += toNumber(this.step);\r\n }\r\n\r\n stepDown() {\r\n if (!this.value) {\r\n this.value = Math.max(this.minValue, 0);\r\n }\r\n this.value -= toNumber(this.step);\r\n }\r\n\r\n decimalStepUp() {\r\n if (!this.value) {\r\n this.value = Math.max(this.minValue, 0);\r\n }\r\n this.value += toNumber(\r\n this.decimalStep == 'auto'\r\n ? 1 / Math.pow(10, this.decimals)\r\n : this.decimalStep\r\n );\r\n }\r\n\r\n decimalStepDown() {\r\n if (!this.value) {\r\n this.value = Math.max(this.minValue, 0);\r\n }\r\n this.value -= toNumber(\r\n this.decimalStep == 'auto'\r\n ? 1 / Math.pow(10, this.decimals)\r\n : this.decimalStep\r\n );\r\n }\r\n}\r\n","<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<input #input class=\"ax-input\" type=\"text\" [attr.placeholder]=\"placeholder\" [attr.autocomplete]=\"autoComplete\"\r\n [imask]=\"_maskObj\" [unmask]=\"'typed'\" [attr.min]=\"minValue\" [attr.max]=\"maxValue\"\r\n [class.ax-state-disabled]=\"disabled\" [class.ax-state-readonly]=\"readonly\" [disabled]=\"disabled\"\r\n [readonly]=\"readonly\" [tabindex]=\"tabIndex\" [(ngModel)]=\"value\" (keydown)=\"_handleOnKeydownEvent($event)\"\r\n (keyup)=\"_emitOnKeyupEvent($event)\" (keypress)=\"_emitOnKeypressEvent($event)\" (focus)=\"_emitOnFocusEvent($event)\"\r\n (blur)=\"_emitOnBlurEvent($event)\">\r\n\r\n<div class=\"ax-number-box-control\" *ngIf=\"showSpinButtons\">\r\n <button class=\"ax-general-button ax-button-icon\" (click)=\"_handleUpDownClick(1)\">\r\n <span class=\"ax-icon ax-icon-arrow-up\"></span>\r\n </button>\r\n <button class=\"ax-general-button ax-button-icon\" (click)=\"_handleUpDownClick(-1)\">\r\n <span class=\"ax-icon ax-icon-arrow-down\"></span>\r\n </button>\r\n</div>\r\n\r\n<!-- <div class=\"ax-number-box-arrows\" *ngIf=\"showSpinButtons && !(disabled || readonly)\">\r\n <ax-button color=\"light\" look=\"blank\" (onClick)=\"_handleUpDownClick($event,1)\" [tabIndex]=\"-1\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-icon-arrow-fill ax-rotate-90\">\r\n </ax-icon>\r\n </ax-prefix>\r\n </ax-button>\r\n <ax-button color=\"light\" look=\"blank\" (onClick)=\"_handleUpDownClick($event,-1)\" [tabIndex]=\"-1\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-icon-arrow-fill -ax-rotate-90\">\r\n </ax-icon>\r\n </ax-prefix>\r\n </ax-button>\r\n</div> -->\r\n<ng-content select=\"ax-suffix\">\r\n</ng-content>\r\n<ng-content select=\"ax-validation-rule\">\r\n</ng-content>","import { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { CommonModule } from '@angular/common';\r\nimport {IMaskModule} from 'angular-imask';\r\nimport { AXButtonModule } from '@acorex/components/button';\r\nimport { AXDecoratorModule } from '@acorex/components/decorators';\r\nimport { AXNumberBoxComponent } from './number-box.component';\r\n\r\nconst COMPONENT = [AXNumberBoxComponent];\r\nconst MODULES = [\r\n CommonModule,\r\n FormsModule,\r\n AXButtonModule,\r\n AXDecoratorModule,\r\n IMaskModule\r\n];\r\n\r\n@NgModule({\r\n declarations: [...COMPONENT],\r\n imports: [...MODULES],\r\n exports: [...COMPONENT],\r\n providers: [],\r\n})\r\nexport class AXNumberBoxModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAmBA;;;;AAIG;AAgCG,MAAO,oBAAqB,SAAQ,kBAAkB,CAAA;AAwG1D;;AAEG;IACH,WAAY,CAAA,UAAsB,EAAU,GAAsB,EAAA;AAChE,QAAA,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AADmB,QAAA,IAAG,CAAA,GAAA,GAAH,GAAG,CAAmB;AAzF1D,QAAA,IAAgB,CAAA,gBAAA,GAAY,KAAK,CAAC;AAe1C;;AAEG;AAEH,QAAA,IAAI,CAAA,IAAA,GAAW,CAAC,CAAC;AAET,QAAA,IAAS,CAAA,SAAA,GAAW,CAAC,CAAC;AAe9B;;AAEG;AAEH,QAAA,IAAW,CAAA,WAAA,GAAoB,MAAM,CAAC;AAEtC;;AAEG;AAEH,QAAA,IAAe,CAAA,eAAA,GAAY,IAAI,CAAC;AAExB,QAAA,IAAA,CAAA,SAAS,GAAW,MAAM,CAAC,gBAAgB,CAAC;AAe5C,QAAA,IAAA,CAAA,SAAS,GAAW,MAAM,CAAC,gBAAgB,CAAC;KA4BnD;AAzGD;;AAEG;AACH,IAAA,IACW,kBAAkB,GAAA;QAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC;KACjC;IACD,IAAW,kBAAkB,CAAC,CAAS,EAAA;QACrC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AAA;AAe1B,iBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAJb,OAAO,CAAA,EAAA,CAAA,CAAA;2FAIX,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAN7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;iBAChB,CAAA;;;ACtBD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-number-box.mjs","sources":["../../../../projects/acorex/components/number-box/src/number-box.component.ts","../../../../projects/acorex/components/number-box/src/number-box.component.html","../../../../projects/acorex/components/number-box/src/number-box.module.ts","../../../../projects/acorex/components/number-box/acorex-components-number-box.ts"],"sourcesContent":["import IMask from 'imask';\r\nimport { IMaskDirective } from 'angular-imask';\r\nimport {\r\n Component,\r\n ViewEncapsulation,\r\n ChangeDetectionStrategy,\r\n ElementRef,\r\n ChangeDetectorRef,\r\n Input,\r\n ViewChild,\r\n} from '@angular/core';\r\n\r\n\r\nimport { toNumber } from 'lodash-es';\r\nimport {\r\n AXBaseTextBoxMixin,\r\n AXComponentOptionChanged,\r\n} from '@acorex/components/mixin';\r\n\r\n/**\r\n * The NumberBox is a component which detects user interaction and triggers a corresponding event\r\n *\r\n * @category Components\r\n */\r\n@Component({\r\n selector: 'ax-number-box',\r\n templateUrl: './number-box.component.html',\r\n styleUrls: ['./number-box.component.scss'],\r\n inputs: [\r\n 'disabled',\r\n 'readonly',\r\n 'tabIndex',\r\n 'size',\r\n 'value',\r\n 'placeholder',\r\n 'maxLength',\r\n 'allowNull',\r\n 'type',\r\n 'autoComplete',\r\n 'readonly',\r\n 'allowNull',\r\n 'value',\r\n 'name',\r\n 'checked',\r\n ],\r\n outputs: [\r\n 'valueChange',\r\n 'onValueChanged',\r\n 'onBlur',\r\n 'onFocus'\r\n ],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n host: { class: 'ax-editor-container' },\r\n})\r\nexport class AXNumberBoxComponent extends AXBaseTextBoxMixin {\r\n @ViewChild('input') input: ElementRef<HTMLInputElement>;\r\n\r\n private _thousandsSeparator: string;\r\n /**\r\n * A character value that specifies the separator character.\r\n */\r\n @Input()\r\n public get thousandsSeparator(): string {\r\n return this._thousandsSeparator;\r\n }\r\n public set thousandsSeparator(v: string) {\r\n this._setOption({\r\n name: 'thousandsSeparator',\r\n value: v ?? '',\r\n });\r\n }\r\n\r\n private _padDecimalZeros: boolean = false;\r\n /**\r\n * A character value that specifies the separator character.\r\n */\r\n @Input()\r\n public get padDecimalZeros(): boolean {\r\n return this._padDecimalZeros;\r\n }\r\n public set padDecimalZeros(v: boolean) {\r\n this._setOption({\r\n name: 'padDecimalZeros',\r\n value: v,\r\n });\r\n }\r\n\r\n /**\r\n * Specifies the value that is used to increment or decrement the **Integer** part of number\r\n */\r\n @Input()\r\n step: number = 1;\r\n\r\n private _decimals: number = 0;\r\n /**\r\n * Specifies the number of decimals that the user can enter\r\n */\r\n @Input()\r\n public get decimals(): number {\r\n return this._decimals;\r\n }\r\n public set decimals(v: number) {\r\n this._setOption({\r\n name: 'decimals',\r\n value: v ?? 0,\r\n });\r\n }\r\n\r\n /**\r\n * Specifies the value that is used to increment or decrement the **Deciaml** part of number\r\n */\r\n @Input()\r\n decimalStep: number | 'auto' = 'auto';\r\n\r\n /**\r\n * Specifies whether the Up and Down spin buttons will be rendered or not\r\n */\r\n @Input()\r\n showSpinButtons: boolean = true;\r\n\r\n private _minValue: number = Number.MIN_SAFE_INTEGER;\r\n /**\r\n * Specifies the smallest value that is valid\r\n */\r\n @Input()\r\n public get minValue(): number {\r\n return this._minValue;\r\n }\r\n public set minValue(v: number) {\r\n this._setOption({\r\n name: 'minValue',\r\n value: v != null ? Number(v) : Number.MIN_SAFE_INTEGER,\r\n });\r\n }\r\n\r\n private _maxValue: number = Number.MAX_SAFE_INTEGER;\r\n /**\r\n * Specifies the greatest value that is valid\r\n */\r\n @Input()\r\n public get maxValue(): number {\r\n return this._maxValue;\r\n }\r\n public set maxValue(v: number) {\r\n this._setOption({\r\n name: 'maxValue',\r\n value: v != null ? Number(v) : Number.MAX_SAFE_INTEGER,\r\n });\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n _maskObj: IMask.MaskedNumber;\r\n\r\n @ViewChild(IMaskDirective)\r\n private _maskDirective: IMaskDirective<IMask.MaskedNumber>;\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(elementRef: ElementRef, private cdr: ChangeDetectorRef) {\r\n super(elementRef, cdr);\r\n }\r\n\r\n onViewInit(): void {\r\n super.onViewInit();\r\n this._updateMask();\r\n }\r\n\r\n _onOptionChanged(option: AXComponentOptionChanged): void {\r\n super._onOptionChanged(option);\r\n this._updateMask();\r\n }\r\n\r\n focus(): void {\r\n this.input.nativeElement.focus()\r\n }\r\n\r\n private _updateMask() {\r\n if (!this._maskObj) {\r\n this._maskObj = IMask.createMask({\r\n mask: Number,\r\n min: this.minValue,\r\n max: this.maxValue,\r\n thousandsSeparator: this.thousandsSeparator || '',\r\n scale: this.decimals,\r\n radix: '.',\r\n padFractionalZeros: this.decimals > 0 && this.padDecimalZeros,\r\n });\r\n } else {\r\n this._maskObj.updateOptions({\r\n min: this.minValue,\r\n max: this.maxValue,\r\n thousandsSeparator: this.thousandsSeparator || '',\r\n scale: this.decimals,\r\n radix: '.',\r\n padFractionalZeros: this.decimals > 0 && this.padDecimalZeros,\r\n });\r\n }\r\n this._maskDirective?.maskRef?.updateValue();\r\n this._maskDirective?.maskRef?.updateControl();\r\n }\r\n\r\n _handleOnKeydownEvent(e: KeyboardEvent) {\r\n if (this.disabled || this.readonly) return;\r\n const ignore = () => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n };\r\n this._setUserInteraction();\r\n const input = e.target as HTMLInputElement;\r\n const valStr = input.value;\r\n const decimalPointIndex = valStr.indexOf('.');\r\n const _cursorPos = input.selectionStart!;\r\n\r\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\r\n if (\r\n decimalPointIndex > 0 &&\r\n _cursorPos > decimalPointIndex &&\r\n this.decimals > 0\r\n ) {\r\n e.key === 'ArrowDown' ? this.decimalStepDown() : this.decimalStepUp();\r\n } else {\r\n e.key === 'ArrowDown' ? this.stepDown() : this.stepUp();\r\n }\r\n ignore();\r\n setTimeout(() => {\r\n input.setSelectionRange(_cursorPos, _cursorPos);\r\n }, 5);\r\n }\r\n super._emitOnKeydownEvent(e);\r\n }\r\n\r\n _handleUpDownClick(v: -1 | 1) {\r\n if (this.disabled || this.readonly) return;\r\n this._setUserInteraction();\r\n v == 1 ? this.stepUp() : this.stepDown();\r\n }\r\n\r\n _setValue(value: any) {\r\n if ((value == null || (value == 0 && !this._maskObj.value)) && this.allowNull) {\r\n return null;\r\n }\r\n const v = toNumber(value);\r\n if (v < this.minValue) return this.minValue;\r\n if (v > this.maxValue) return this.maxValue;\r\n return v;\r\n }\r\n\r\n stepUp() {\r\n if (!this.value) {\r\n this.value = Math.max(this.minValue, 0);\r\n }\r\n this.value += toNumber(this.step);\r\n }\r\n\r\n stepDown() {\r\n if (!this.value) {\r\n this.value = Math.max(this.minValue, 0);\r\n }\r\n this.value -= toNumber(this.step);\r\n }\r\n\r\n decimalStepUp() {\r\n if (!this.value) {\r\n this.value = Math.max(this.minValue, 0);\r\n }\r\n this.value += toNumber(\r\n this.decimalStep == 'auto'\r\n ? 1 / Math.pow(10, this.decimals)\r\n : this.decimalStep\r\n );\r\n }\r\n\r\n decimalStepDown() {\r\n if (!this.value) {\r\n this.value = Math.max(this.minValue, 0);\r\n }\r\n this.value -= toNumber(\r\n this.decimalStep == 'auto'\r\n ? 1 / Math.pow(10, this.decimals)\r\n : this.decimalStep\r\n );\r\n }\r\n}\r\n","<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<input #input class=\"ax-input\" type=\"text\" [attr.placeholder]=\"placeholder\" [attr.autocomplete]=\"autoComplete\"\r\n [imask]=\"_maskObj\" [unmask]=\"'typed'\" [attr.min]=\"minValue\" [attr.max]=\"maxValue\"\r\n [class.ax-state-disabled]=\"disabled\" [class.ax-state-readonly]=\"readonly\" [disabled]=\"disabled\"\r\n [readonly]=\"readonly\" [tabindex]=\"tabIndex\" [(ngModel)]=\"value\" (keydown)=\"_handleOnKeydownEvent($event)\"\r\n (keyup)=\"_emitOnKeyupEvent($event)\" (keypress)=\"_emitOnKeypressEvent($event)\" (focus)=\"_emitOnFocusEvent($event)\"\r\n (blur)=\"_emitOnBlurEvent($event)\">\r\n\r\n<div class=\"ax-number-box-control\" *ngIf=\"showSpinButtons\">\r\n <button class=\"ax-general-button ax-button-icon\" (click)=\"_handleUpDownClick(1)\">\r\n <span class=\"ax-icon ax-icon-arrow-up\"></span>\r\n </button>\r\n <button class=\"ax-general-button ax-button-icon\" (click)=\"_handleUpDownClick(-1)\">\r\n <span class=\"ax-icon ax-icon-arrow-down\"></span>\r\n </button>\r\n</div>\r\n\r\n<!-- <div class=\"ax-number-box-arrows\" *ngIf=\"showSpinButtons && !(disabled || readonly)\">\r\n <ax-button color=\"light\" look=\"blank\" (onClick)=\"_handleUpDownClick($event,1)\" [tabIndex]=\"-1\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-icon-arrow-fill ax-rotation-90\">\r\n </ax-icon>\r\n </ax-prefix>\r\n </ax-button>\r\n <ax-button color=\"light\" look=\"blank\" (onClick)=\"_handleUpDownClick($event,-1)\" [tabIndex]=\"-1\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-icon-arrow-fill -ax-rotation-90\">\r\n </ax-icon>\r\n </ax-prefix>\r\n </ax-button>\r\n</div> -->\r\n<ng-content select=\"ax-suffix\">\r\n</ng-content>\r\n<ng-content select=\"ax-validation-rule\">\r\n</ng-content>","import { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { CommonModule } from '@angular/common';\r\nimport {IMaskModule} from 'angular-imask';\r\nimport { AXButtonModule } from '@acorex/components/button';\r\nimport { AXDecoratorModule } from '@acorex/components/decorators';\r\nimport { AXNumberBoxComponent } from './number-box.component';\r\n\r\nconst COMPONENT = [AXNumberBoxComponent];\r\nconst MODULES = [\r\n CommonModule,\r\n FormsModule,\r\n AXButtonModule,\r\n AXDecoratorModule,\r\n IMaskModule\r\n];\r\n\r\n@NgModule({\r\n declarations: [...COMPONENT],\r\n imports: [...MODULES],\r\n exports: [...COMPONENT],\r\n providers: [],\r\n})\r\nexport class AXNumberBoxModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAmBA;;;;AAIG;AAgCG,MAAO,oBAAqB,SAAQ,kBAAkB,CAAA;AAwG1D;;AAEG;IACH,WAAY,CAAA,UAAsB,EAAU,GAAsB,EAAA;AAChE,QAAA,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AADmB,QAAA,IAAG,CAAA,GAAA,GAAH,GAAG,CAAmB;AAzF1D,QAAA,IAAgB,CAAA,gBAAA,GAAY,KAAK,CAAC;AAe1C;;AAEG;AAEH,QAAA,IAAI,CAAA,IAAA,GAAW,CAAC,CAAC;AAET,QAAA,IAAS,CAAA,SAAA,GAAW,CAAC,CAAC;AAe9B;;AAEG;AAEH,QAAA,IAAW,CAAA,WAAA,GAAoB,MAAM,CAAC;AAEtC;;AAEG;AAEH,QAAA,IAAe,CAAA,eAAA,GAAY,IAAI,CAAC;AAExB,QAAA,IAAA,CAAA,SAAS,GAAW,MAAM,CAAC,gBAAgB,CAAC;AAe5C,QAAA,IAAA,CAAA,SAAS,GAAW,MAAM,CAAC,gBAAgB,CAAC;K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,EAAA,CAfX,oBAAoB,CAAA,EAAA,OAAA,EAAA,CAEnC,YAAY;QACZ,WAAW;QACX,cAAc;QACd,iBAAiB;QACjB,WAAW,aANI,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAe1B,iBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAJb,OAAO,CAAA,EAAA,CAAA,CAAA;2FAIX,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAN7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;iBAChB,CAAA;;;ACtBD;;AAEG;;;;"}
|
@@ -2,7 +2,6 @@ import * as i0 from '@angular/core';
|
|
2
2
|
import { EventEmitter, Injectable, Inject, Output, Input, ViewChild, NgModule } from '@angular/core';
|
3
3
|
import { AXLoadingService } from '@acorex/components/loading';
|
4
4
|
import { AXBaseComponentMixin } from '@acorex/components/mixin';
|
5
|
-
import { AXEvent } from '@acorex/components/common';
|
6
5
|
import { AXDecoratorFooterComponent } from '@acorex/components/decorators';
|
7
6
|
|
8
7
|
class AXPageComponent extends AXBaseComponentMixin {
|
@@ -47,31 +46,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
47
46
|
type: Input
|
48
47
|
}] } });
|
49
48
|
|
50
|
-
const TAB_META_KEY = '__meta__';
|
51
|
-
class AXPageCloseEvent extends AXEvent {
|
52
|
-
}
|
53
|
-
class AXPageClosing {
|
54
|
-
constructor() {
|
55
|
-
this.cancel = false;
|
56
|
-
}
|
57
|
-
}
|
58
|
-
class AXPageResult {
|
59
|
-
}
|
60
|
-
/**
|
61
|
-
* Defines a CSS class—or multiple classes separated by spaces— which are applied to a span element inside the Button. Allows the usage of custom icons after the primary text.
|
62
|
-
*/
|
63
|
-
class AXPageClosedPromise extends Promise {
|
64
|
-
constructor(executor) {
|
65
|
-
//TODO: check ts error
|
66
|
-
//@ts-ignore
|
67
|
-
super(executor);
|
68
|
-
}
|
69
|
-
close() {
|
70
|
-
if (this.closeMethod) {
|
71
|
-
this.closeMethod();
|
72
|
-
}
|
73
|
-
}
|
74
|
-
}
|
75
49
|
class AXBasePageComponent extends AXBaseComponentMixin {
|
76
50
|
/**
|
77
51
|
* @ignore
|
@@ -148,6 +122,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
148
122
|
* Generated bundle index. Do not edit.
|
149
123
|
*/
|
150
124
|
|
151
|
-
export { AXBasePageComponent,
|
152
|
-
//# sourceMappingURL=acorex-components-page.mjs.map
|
125
|
+
export { AXBasePageComponent, AXPageComponent, AXPageModule };
|
153
126
|
//# sourceMappingURL=acorex-components-page.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-page.mjs","sources":["../../../../projects/acorex/components/page/src/page.component.ts","../../../../projects/acorex/components/page/src/base-page.class.ts","../../../../projects/acorex/components/page/src/page.module.ts","../../../../projects/acorex/components/page/acorex-components-page.ts"],"sourcesContent":["import { ChangeDetectorRef, ElementRef, EventEmitter, Inject, Injectable, Input, Output } from \"@angular/core\";\r\nimport { AXLoadingService } from \"@acorex/components/loading\";\r\nimport { AXBaseComponentMixin } from \"@acorex/components/mixin\";\r\n\r\n@Injectable()\r\nexport abstract class AXPageComponent extends AXBaseComponentMixin {\r\n\r\n constructor(\r\n elementRef: ElementRef,\r\n cdr: ChangeDetectorRef,\r\n @Inject(AXLoadingService) private _loadingService\r\n ) {\r\n super(elementRef, cdr);\r\n }\r\n\r\n private _loadingId: number;\r\n\r\n @Output()\r\n isLoadingChange = new EventEmitter<boolean>();\r\n\r\n private _isLoading: boolean = false;\r\n @Input()\r\n public get isLoading(): boolean {\r\n return this._isLoading;\r\n }\r\n public set isLoading(v: boolean) {\r\n this._setOption({\r\n name: 'isLoading',\r\n value: v,\r\n afterCallback: () => {\r\n if (this._loadingId && !v) {\r\n this._loadingService.hide(this._loadingId);\r\n this._loadingId = 0;\r\n }\r\n if (v) {\r\n this._loadingId = this._loadingService.show(this._getHostElement());\r\n }\r\n this._cdr.markForCheck();\r\n }\r\n });\r\n }\r\n}","import {\r\n ChangeDetectorRef,\r\n ElementRef,\r\n EventEmitter,\r\n Injectable,\r\n Input,\r\n Output,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport {
|
1
|
+
{"version":3,"file":"acorex-components-page.mjs","sources":["../../../../projects/acorex/components/page/src/page.component.ts","../../../../projects/acorex/components/page/src/base-page.class.ts","../../../../projects/acorex/components/page/src/page.module.ts","../../../../projects/acorex/components/page/acorex-components-page.ts"],"sourcesContent":["import { ChangeDetectorRef, ElementRef, EventEmitter, Inject, Injectable, Input, Output } from \"@angular/core\";\r\nimport { AXLoadingService } from \"@acorex/components/loading\";\r\nimport { AXBaseComponentMixin } from \"@acorex/components/mixin\";\r\n\r\n@Injectable()\r\nexport abstract class AXPageComponent extends AXBaseComponentMixin {\r\n\r\n constructor(\r\n elementRef: ElementRef,\r\n cdr: ChangeDetectorRef,\r\n @Inject(AXLoadingService) private _loadingService\r\n ) {\r\n super(elementRef, cdr);\r\n }\r\n\r\n private _loadingId: number;\r\n\r\n @Output()\r\n isLoadingChange = new EventEmitter<boolean>();\r\n\r\n private _isLoading: boolean = false;\r\n @Input()\r\n public get isLoading(): boolean {\r\n return this._isLoading;\r\n }\r\n public set isLoading(v: boolean) {\r\n this._setOption({\r\n name: 'isLoading',\r\n value: v,\r\n afterCallback: () => {\r\n if (this._loadingId && !v) {\r\n this._loadingService.hide(this._loadingId);\r\n this._loadingId = 0;\r\n }\r\n if (v) {\r\n this._loadingId = this._loadingService.show(this._getHostElement());\r\n }\r\n this._cdr.markForCheck();\r\n }\r\n });\r\n }\r\n}","import {\r\n ChangeDetectorRef,\r\n ElementRef,\r\n EventEmitter,\r\n Injectable,\r\n Input,\r\n Output,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { AXPageComponent } from './page.component';\r\nimport { AXDecoratorFooterComponent } from '@acorex/components/decorators';\r\nimport { AXBaseComponentMixin } from '@acorex/components/mixin';\r\nimport { AXComponentCloseEvent, AXComponentClosing } from '@acorex/components/common';\r\n\r\n\r\n\r\n@Injectable()\r\nexport class AXBasePageComponent extends AXBaseComponentMixin {\r\n /**\r\n * @ignore\r\n */\r\n constructor(elementRef: ElementRef, cdr: ChangeDetectorRef) {\r\n super(elementRef, cdr);\r\n }\r\n\r\n @ViewChild(AXPageComponent, { static: true })\r\n private pageContainer: AXPageComponent;\r\n\r\n @ViewChild(AXDecoratorFooterComponent, { static: true })\r\n footer: AXDecoratorFooterComponent;\r\n\r\n @Output()\r\n isLoadingChange = new EventEmitter<boolean>();\r\n\r\n private _isLoading: boolean = false;\r\n @Input()\r\n public get isLoading(): boolean {\r\n return this._isLoading;\r\n }\r\n public set isLoading(v: boolean) {\r\n this._setOption({\r\n name: 'isLoading',\r\n value: v,\r\n afterCallback: () => {\r\n if (this.pageContainer) {\r\n this.pageContainer.isLoading = this.isLoading;\r\n }\r\n this._cdr.markForCheck();\r\n },\r\n });\r\n }\r\n\r\n private _isPopup: boolean = false;\r\n public get isPopup(): boolean {\r\n return this._isPopup;\r\n }\r\n\r\n onClosed: EventEmitter<AXComponentCloseEvent> =\r\n new EventEmitter<AXComponentCloseEvent>();\r\n\r\n close(data?: any) {\r\n this.onClosed.emit({\r\n component: this,\r\n data: data,\r\n });\r\n }\r\n\r\n onClosing(e: AXComponentClosing): void | Promise<void> {}\r\n\r\n ngOnDestroy() {\r\n this.onClosed.unsubscribe();\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\n\r\n\r\n// TODO: Module is empty!?\r\n@NgModule({\r\n imports: [],\r\n exports: [],\r\n declarations: [],\r\n providers: [],\r\n})\r\nexport class AXPageModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAKM,MAAgB,eAAgB,SAAQ,oBAAoB,CAAA;AAE9D,IAAA,WAAA,CACI,UAAsB,EACtB,GAAsB,EACY,eAAe,EAAA;AAEjD,QAAA,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AAFW,QAAA,IAAe,CAAA,eAAA,GAAf,eAAe,CAAA;AAQrD,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,YAAY,EAAW,CAAC;AAEtC,QAAA,IAAU,CAAA,UAAA,GAAY,KAAK,CAAC;KAPnC;AAQD,IAAA,IACW,SAAS,GAAA;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC;KAC1B;IACD,IAAW,SAAS,CAAC,CAAU,EAAA;QAC3B,IAAI,CAAC,UAAU,CAAC;AACZ,YAAA,IAAI,EAAE,WAAW;AACjB,YAAA,KAAK,EAAE,CAAC;YACR,aAAa,EAAE,MAAK;AAChB,gBAAA,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC,EAAE;oBACvB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAC3C,oBAAA,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;AACvB,iBAAA;AACD,gBAAA,IAAI,CAAC,EAAE;AACH,oBAAA,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;AACvE,iBAAA;AACD,gBAAA,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;aAC5B;AACJ,SAAA,CAAC,CAAC;KACN;;AAnCiB,eAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAA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