@acorex/components 19.8.0-next.8 → 19.9.0
Sign up to get free protection for your applications and to get access to all the features.
- package/action-sheet/lib/action-sheet.class.d.ts +2 -1
- package/badge/lib/badge.component.d.ts +2 -2
- package/button/lib/button.component.d.ts +6 -1
- package/button-group/lib/button-group-item.component.d.ts +1 -3
- package/button-group/lib/button-group.module.d.ts +1 -2
- package/chips/lib/chips.component.d.ts +7 -11
- package/color-box/lib/color-box.component.d.ts +1 -5
- package/color-palette/lib/color-palette-picker.component.d.ts +14 -19
- package/color-palette/lib/color-palette.module.d.ts +1 -2
- package/common/lib/classes/styles.class.d.ts +4 -6
- package/common/lib/components/button-base-component.class.d.ts +1 -0
- package/conversation/lib/conversation-container/conversation-container.component.d.ts +3 -2
- package/conversation/lib/conversation-input/conversation-input.component.d.ts +2 -1
- package/datetime-picker/lib/datetime-picker.component.d.ts +10 -0
- package/datetime-picker/lib/datetime-picker.module.d.ts +1 -2
- package/decorators/index.d.ts +4 -5
- package/decorators/lib/decorators.module.d.ts +6 -7
- package/dialog/lib/dialog.component.d.ts +0 -2
- package/dropdown-button/lib/dropdown-button.component.d.ts +1 -1
- package/fesm2022/acorex-components-action-sheet.mjs +4 -4
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-alert.mjs +4 -4
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-audio-wave.mjs +5 -5
- package/fesm2022/acorex-components-audio-wave.mjs.map +1 -1
- package/fesm2022/acorex-components-avatar.mjs +4 -4
- package/fesm2022/acorex-components-avatar.mjs.map +1 -1
- package/fesm2022/acorex-components-badge.mjs +6 -6
- package/fesm2022/acorex-components-badge.mjs.map +1 -1
- package/fesm2022/acorex-components-bottom-navigation.mjs +3 -3
- package/fesm2022/acorex-components-bottom-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-breadcrumbs.mjs +3 -3
- package/fesm2022/acorex-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/acorex-components-button-group.mjs +146 -147
- package/fesm2022/acorex-components-button-group.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs +22 -19
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-calendar.mjs +5 -5
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-check-box.mjs +3 -3
- package/fesm2022/acorex-components-check-box.mjs.map +1 -1
- package/fesm2022/acorex-components-chips.mjs +10 -12
- package/fesm2022/acorex-components-chips.mjs.map +1 -1
- package/fesm2022/acorex-components-circular-progress.mjs +7 -7
- package/fesm2022/acorex-components-circular-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-collapse.mjs +4 -4
- package/fesm2022/acorex-components-collapse.mjs.map +1 -1
- package/fesm2022/acorex-components-color-box.mjs +4 -11
- package/fesm2022/acorex-components-color-box.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +326 -342
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-comment.mjs +9 -9
- package/fesm2022/acorex-components-comment.mjs.map +1 -1
- package/fesm2022/acorex-components-common.mjs +7 -22
- package/fesm2022/acorex-components-common.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation.mjs +50 -29
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-cron-job.mjs +3 -3
- package/fesm2022/acorex-components-cron-job.mjs.map +1 -1
- package/fesm2022/acorex-components-data-pager.mjs +7 -7
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +5 -5
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +4 -3
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs +3 -3
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +24 -18
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs +18 -30
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +4 -11
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer.mjs +5 -5
- package/fesm2022/acorex-components-drawer.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown-button.mjs +13 -7
- package/fesm2022/acorex-components-dropdown-button.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown.mjs +2 -2
- package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
- package/fesm2022/acorex-components-file-explorer.mjs +231 -0
- package/fesm2022/acorex-components-file-explorer.mjs.map +1 -0
- package/fesm2022/acorex-components-form.mjs +4 -11
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-grid-layout-builder.mjs +200 -22
- package/fesm2022/acorex-components-grid-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-image-editor.mjs +57 -42
- package/fesm2022/acorex-components-image-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-image.mjs +3 -3
- package/fesm2022/acorex-components-image.mjs.map +1 -1
- package/fesm2022/acorex-components-json-viewer.mjs +3 -3
- package/fesm2022/acorex-components-json-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-label.mjs +3 -3
- package/fesm2022/acorex-components-label.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs +3 -3
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-loading-dialog.mjs +3 -3
- package/fesm2022/acorex-components-loading-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-loading.mjs +5 -5
- package/fesm2022/acorex-components-loading.mjs.map +1 -1
- package/fesm2022/acorex-components-map.mjs +1 -1
- package/fesm2022/acorex-components-media-viewer.mjs +5 -5
- package/fesm2022/acorex-components-media-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +9 -9
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-navbar.mjs +4 -4
- package/fesm2022/acorex-components-navbar.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs +5 -5
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box.mjs +7 -3
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-otp.mjs +3 -3
- package/fesm2022/acorex-components-otp.mjs.map +1 -1
- package/fesm2022/acorex-components-page.mjs +1 -1
- package/fesm2022/acorex-components-paint.mjs +11 -11
- package/fesm2022/acorex-components-paint.mjs.map +1 -1
- package/fesm2022/acorex-components-password-box.mjs +5 -5
- package/fesm2022/acorex-components-password-box.mjs.map +1 -1
- package/fesm2022/acorex-components-pdf-reader.mjs +1 -1
- package/fesm2022/acorex-components-phone-box.mjs +3 -3
- package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
- package/fesm2022/acorex-components-picker.mjs +233 -128
- package/fesm2022/acorex-components-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-popover.mjs +1 -1
- package/fesm2022/acorex-components-popup.mjs +3 -3
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-progress-bar.mjs +23 -23
- package/fesm2022/acorex-components-progress-bar.mjs.map +1 -1
- package/fesm2022/acorex-components-qrcode.mjs +1 -1
- package/fesm2022/acorex-components-radio.mjs +1 -1
- package/fesm2022/acorex-components-rail-navigation.mjs +4 -4
- package/fesm2022/acorex-components-rail-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +4 -4
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-rate-picker.mjs +7 -7
- package/fesm2022/acorex-components-rate-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-result.mjs +3 -3
- package/fesm2022/acorex-components-result.mjs.map +1 -1
- package/fesm2022/acorex-components-routing-progress.mjs +3 -3
- package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler.mjs +12 -12
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-search-box.mjs +11 -20
- package/fesm2022/acorex-components-search-box.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +3 -4
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs +142 -27
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs +18 -9
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-skeleton.mjs +3 -3
- package/fesm2022/acorex-components-skeleton.mjs.map +1 -1
- package/fesm2022/acorex-components-slider.mjs +3 -3
- package/fesm2022/acorex-components-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-step-wizard.mjs +3 -3
- package/fesm2022/acorex-components-step-wizard.mjs.map +1 -1
- package/fesm2022/acorex-components-switch.mjs +4 -9
- package/fesm2022/acorex-components-switch.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs +6 -6
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/fesm2022/acorex-components-tag.mjs +4 -4
- package/fesm2022/acorex-components-tag.mjs.map +1 -1
- package/fesm2022/acorex-components-text-area.mjs +4 -7
- package/fesm2022/acorex-components-text-area.mjs.map +1 -1
- package/fesm2022/acorex-components-text-box.mjs +3 -3
- package/fesm2022/acorex-components-text-box.mjs.map +1 -1
- package/fesm2022/acorex-components-time-line.mjs +9 -9
- package/fesm2022/acorex-components-time-line.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +5 -5
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-toolbar.mjs +12 -3
- package/fesm2022/acorex-components-toolbar.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs +3 -3
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-components-tree-view.mjs +37 -68
- package/fesm2022/acorex-components-tree-view.mjs.map +1 -1
- package/fesm2022/acorex-components-uploader.mjs +8 -8
- package/fesm2022/acorex-components-uploader.mjs.map +1 -1
- package/fesm2022/acorex-components-video-player.mjs +1 -1
- package/fesm2022/acorex-components-wysiwyg.mjs +26 -26
- package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
- package/file-explorer/README.md +3 -0
- package/file-explorer/index.d.ts +6 -0
- package/file-explorer/lib/file-explorer-container/file-explorer-container.component.d.ts +10 -0
- package/file-explorer/lib/file-explorer-item/file-explorer-item.component.d.ts +11 -0
- package/file-explorer/lib/file-explorer-types.d.ts +11 -0
- package/file-explorer/lib/file-explorer-view/file-explorer-view.component.d.ts +27 -0
- package/file-explorer/lib/file-explorer.module.d.ts +16 -0
- package/file-explorer/lib/file-explorer.service.d.ts +6 -0
- package/form/lib/form.component.d.ts +2 -3
- package/grid-layout-builder/index.d.ts +1 -0
- package/grid-layout-builder/lib/grid-layout-builder.module.d.ts +3 -2
- package/grid-layout-builder/lib/grid-layout-container.component.d.ts +14 -10
- package/grid-layout-builder/lib/grid-layout-widget.directive.d.ts +106 -0
- package/grid-layout-builder/lib/types.d.ts +2 -1
- package/image-editor/index.d.ts +1 -0
- package/image-editor/lib/image-editor-container/image-editor-container.component.d.ts +3 -22
- package/image-editor/lib/image-editor-toolbar/image-editor-toolbar.component.d.ts +27 -0
- package/image-editor/lib/image-editor.module.d.ts +17 -16
- package/loading/lib/loading-spinner.component.d.ts +1 -1
- package/menu/lib/menu-item.component.d.ts +1 -2
- package/notification/lib/notification.service.d.ts +1 -1
- package/package.json +5 -1
- package/paint/lib/paint/paint-view/paint-view.component.d.ts +1 -1
- package/picker/index.d.ts +2 -3
- package/picker/lib/picker-column.directive.d.ts +16 -0
- package/picker/lib/picker.component.d.ts +61 -0
- package/picker/lib/picker.module.d.ts +4 -6
- package/progress-bar/lib/progress-bar.component.d.ts +19 -19
- package/range-slider/lib/range-slider.component.d.ts +1 -1
- package/scheduler/lib/scheduler-month-view.component.d.ts +6 -6
- package/search-box/lib/search-box.component.d.ts +1 -5
- package/selection-list/README.md +2 -2
- package/selection-list/lib/selection-list.component.d.ts +70 -17
- package/selection-list/lib/selection-list.module.d.ts +7 -3
- package/side-menu/lib/side-menu-item/side-menu-item.component.d.ts +6 -3
- package/side-menu/lib/side-menu.component.d.ts +2 -1
- package/tabs/lib/tabs.class.d.ts +1 -1
- package/text-area/lib/text-area.component.d.ts +1 -5
- package/time-line/lib/time-line.component.d.ts +1 -1
- package/toast/lib/toast.service.d.ts +1 -1
- package/toolbar/lib/toolbar.component.d.ts +3 -1
- package/tree-view/lib/tree-view.class.d.ts +1 -0
- package/tree-view/lib/tree-view.component.d.ts +1 -7
- package/wysiwyg/lib/wysiwyg/wysiwyg-container/wysiwyg-container.component.d.ts +2 -2
- package/decorators/lib/components/color-indicator/color-indicator.component.d.ts +0 -6
- package/picker/lib/picker-container/picker-container.component.d.ts +0 -7
- package/picker/lib/picker-items/picker-items.component.d.ts +0 -20
- package/picker/lib/picker-title/picker-title.component.d.ts +0 -5
- /package/decorators/lib/components/{clear-button/clear-button.component.d.ts → clear-button.component.d.ts} +0 -0
- /package/decorators/lib/components/{close-button/close-button.component.d.ts → close-button.component.d.ts} +0 -0
- /package/decorators/lib/components/{full-screen/full-screen-button.component.d.ts → full-screen-button.component.d.ts} +0 -0
- /package/decorators/lib/components/{icon/icon.component.d.ts → icon.component.d.ts} +0 -0
@@ -1,161 +1,266 @@
|
|
1
|
+
import { MXValueComponent, MXBaseComponent } from '@acorex/components/common';
|
1
2
|
import * as i0 from '@angular/core';
|
2
|
-
import {
|
3
|
-
import { MXValueComponent } from '@acorex/components/common';
|
3
|
+
import { EventEmitter, forwardRef, Input, Output, Directive, inject, NgZone, PLATFORM_ID, ContentChildren, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
4
4
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
5
|
-
import
|
6
|
-
import {
|
7
|
-
import {
|
5
|
+
import { AXUnsubscriber, AXDrawingUtil } from '@acorex/core/utils';
|
6
|
+
import { isPlatformBrowser, CommonModule } from '@angular/common';
|
7
|
+
import { startWith } from 'rxjs';
|
8
8
|
|
9
|
-
class
|
9
|
+
class AXPickerColumnDirective extends MXValueComponent {
|
10
10
|
constructor() {
|
11
|
-
|
11
|
+
super(...arguments);
|
12
|
+
this.valueField = 'id';
|
13
|
+
this.textField = 'text';
|
14
|
+
this.step = 1;
|
15
|
+
this.itemsChange = new EventEmitter();
|
16
|
+
}
|
17
|
+
get items() {
|
18
|
+
return this._items;
|
19
|
+
}
|
20
|
+
set items(v) {
|
21
|
+
this._items = v;
|
22
|
+
this.itemsChange.emit(v);
|
12
23
|
}
|
13
|
-
|
14
|
-
|
24
|
+
internalSetValue(v) {
|
25
|
+
if (v == null)
|
26
|
+
return v;
|
27
|
+
else if (typeof v == 'object') {
|
28
|
+
return this.items.find((c) => c[this.valueField] == v[this.valueField]);
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
return this.items.find((c) => c[this.valueField] == v);
|
32
|
+
}
|
15
33
|
}
|
16
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
17
|
-
static { this.ɵ
|
34
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPickerColumnDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
35
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.3", type: AXPickerColumnDirective, isStandalone: false, selector: "ax-picker-column", inputs: { disabled: "disabled", readonly: "readonly", readonlyChange: "readonlyChange", disabledChange: "disabledChange", valueField: "valueField", textField: "textField", title: "title", step: "step", items: "items" }, outputs: { onValueChanged: "onValueChanged", itemsChange: "itemsChange" }, providers: [
|
36
|
+
{
|
37
|
+
provide: NG_VALUE_ACCESSOR,
|
38
|
+
useExisting: forwardRef(() => AXPickerColumnDirective),
|
39
|
+
multi: true,
|
40
|
+
},
|
41
|
+
], usesInheritance: true, ngImport: i0 }); }
|
18
42
|
}
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
20
|
-
type:
|
21
|
-
args: [{
|
22
|
-
|
23
|
-
|
24
|
-
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPickerColumnDirective, decorators: [{
|
44
|
+
type: Directive,
|
45
|
+
args: [{
|
46
|
+
selector: 'ax-picker-column',
|
47
|
+
inputs: ['disabled', 'readonly', 'readonlyChange', 'disabledChange'],
|
48
|
+
outputs: ['onValueChanged'],
|
49
|
+
providers: [
|
50
|
+
{
|
51
|
+
provide: NG_VALUE_ACCESSOR,
|
52
|
+
useExisting: forwardRef(() => AXPickerColumnDirective),
|
53
|
+
multi: true,
|
54
|
+
},
|
55
|
+
],
|
56
|
+
standalone: false
|
57
|
+
}]
|
58
|
+
}], propDecorators: { valueField: [{
|
59
|
+
type: Input
|
60
|
+
}], textField: [{
|
61
|
+
type: Input
|
62
|
+
}], title: [{
|
63
|
+
type: Input
|
64
|
+
}], step: [{
|
65
|
+
type: Input
|
66
|
+
}], itemsChange: [{
|
67
|
+
type: Output
|
68
|
+
}], items: [{
|
69
|
+
type: Input
|
25
70
|
}] } });
|
26
71
|
|
27
|
-
|
72
|
+
/**
|
73
|
+
* @category Components
|
74
|
+
* A picker component with OnPush change detection and no encapsulation.
|
75
|
+
*/
|
76
|
+
class AXPickerComponent extends MXBaseComponent {
|
28
77
|
constructor() {
|
29
78
|
super(...arguments);
|
30
|
-
|
31
|
-
this.
|
32
|
-
|
33
|
-
this.
|
34
|
-
|
35
|
-
this.
|
36
|
-
|
37
|
-
this.
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
79
|
+
/** @ignore */
|
80
|
+
this._columns = {};
|
81
|
+
/** @ignore */
|
82
|
+
this._itemHeight = this._calcItemheight();
|
83
|
+
/** @ignore */
|
84
|
+
this._dragging = false;
|
85
|
+
/** @ignore */
|
86
|
+
this._unsubscriber = inject(AXUnsubscriber);
|
87
|
+
/** @ignore */
|
88
|
+
this._zone = inject(NgZone);
|
89
|
+
this.platformID = inject(PLATFORM_ID);
|
90
|
+
}
|
91
|
+
/** @ignore */
|
92
|
+
ngAfterContentInit() {
|
93
|
+
this._columns.changes
|
94
|
+
.pipe(this._unsubscriber.takeUntilDestroy)
|
95
|
+
.pipe(startWith(undefined))
|
96
|
+
.subscribe(() => {
|
97
|
+
this._setHeights();
|
98
|
+
this.cdr.detectChanges();
|
99
|
+
this._bindEvents();
|
47
100
|
});
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
101
|
+
}
|
102
|
+
/** @ignore */
|
103
|
+
ngOnDestroy() {
|
104
|
+
this._removeEvents();
|
105
|
+
}
|
106
|
+
/** @ignore */
|
107
|
+
_setHeights() {
|
108
|
+
this._itemHeight = this._calcItemheight();
|
109
|
+
setTimeout(() => {
|
110
|
+
const val = this.getHostElement().clientHeight - this.getHostElement().querySelector('.ax-header').clientHeight;
|
111
|
+
this.getHostElement().style.setProperty('--ax-content-height', `${val}px`);
|
112
|
+
}, 50);
|
113
|
+
}
|
114
|
+
/** @ignore */
|
115
|
+
_calcItemheight() {
|
116
|
+
if (isPlatformBrowser(this.platformID)) {
|
117
|
+
const rem = window
|
118
|
+
.getComputedStyle(document.documentElement, null)
|
119
|
+
.getPropertyValue('--ax-size-default');
|
120
|
+
return AXDrawingUtil.convertRemToPixels(Number(rem?.replace('rem', '') ?? 0));
|
121
|
+
}
|
122
|
+
return 0;
|
123
|
+
}
|
124
|
+
/** @ignore */
|
125
|
+
_bindEvents() {
|
126
|
+
this._removeEvents();
|
127
|
+
//
|
128
|
+
this._htmlColumns = Array.from(this.getHostElement().querySelectorAll('.ax-picker-col .ax-content'));
|
129
|
+
this._columns.forEach((c) => {
|
130
|
+
c.onValueChanged.pipe(this._unsubscriber.takeUntilDestroy).subscribe(() => {
|
131
|
+
this._detectSelectedItemsByValue();
|
56
132
|
});
|
57
|
-
this.
|
58
|
-
|
59
|
-
this.swiperRef().carousel().disable();
|
60
|
-
}
|
61
|
-
else {
|
62
|
-
this.swiperRef().carousel().enable();
|
63
|
-
}
|
133
|
+
c.onOptionChanged.pipe(this._unsubscriber.takeUntilDestroy).subscribe(() => {
|
134
|
+
this.cdr.markForCheck();
|
64
135
|
});
|
65
136
|
});
|
66
|
-
this
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
137
|
+
this._htmlColumns.forEach((col, index) => {
|
138
|
+
col['column'] = this._columns.get(index);
|
139
|
+
col.addEventListener('wheel', this._handleMouseWeel.bind(this), {
|
140
|
+
passive: false,
|
141
|
+
});
|
142
|
+
//
|
143
|
+
col.addEventListener('touchstart', this._handleTouchStart.bind(this), {
|
144
|
+
passive: false,
|
145
|
+
});
|
146
|
+
//col.addEventListener("mousedown", this._handleTouchStart.bind(this), { passive: false });
|
147
|
+
//
|
148
|
+
col.addEventListener('touchmove', this._handleTouchMove.bind(this), {
|
149
|
+
passive: false,
|
150
|
+
});
|
151
|
+
//col.addEventListener('mousemove', this._handleTouchMove.bind(this), { passive: false })
|
152
|
+
//
|
153
|
+
col.addEventListener('touchend', this._handleTouchEnd.bind(this), {
|
154
|
+
passive: false,
|
155
|
+
});
|
156
|
+
//col.addEventListener('mouseup', this._handleTouchMove.bind(this), { passive: false })
|
78
157
|
});
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
158
|
+
}
|
159
|
+
/** @ignore */
|
160
|
+
_removeEvents() {
|
161
|
+
this._htmlColumns?.forEach((col) => {
|
162
|
+
col.removeEventListener('wheel', this._handleMouseWeel.bind(this));
|
163
|
+
//
|
164
|
+
col.removeEventListener('touchstart', this._handleTouchStart.bind(this));
|
165
|
+
//col.removeEventListener("mousedown", this._handleTouchStart.bind(this));
|
166
|
+
col.removeEventListener('touchmove', this._handleTouchMove.bind(this));
|
167
|
+
//col.removeEventListener('mousemove', this._handleTouchMove.bind(this));
|
168
|
+
//
|
169
|
+
col.removeEventListener('touchend', this._handleTouchEnd.bind(this));
|
170
|
+
//col.removeEventListener('mouseup', this._handleTouchEnd.bind(this));
|
83
171
|
});
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
172
|
+
}
|
173
|
+
/** @ignore */
|
174
|
+
_handleTouchStart(e) {
|
175
|
+
e.preventDefault();
|
176
|
+
e.stopPropagation();
|
177
|
+
this._currentList = e.currentTarget;
|
178
|
+
this._previousY = e instanceof TouchEvent ? e.touches[0].clientY : e.clientY;
|
179
|
+
}
|
180
|
+
/** @ignore */
|
181
|
+
_handleTouchMove(e) {
|
182
|
+
this._dragging = true;
|
183
|
+
e.preventDefault();
|
184
|
+
e.stopPropagation();
|
185
|
+
this._zone.runOutsideAngular(() => {
|
186
|
+
if (this._currentList && this._dragging) {
|
187
|
+
const clientY = e instanceof TouchEvent ? e.touches[0].clientY : e.clientY;
|
188
|
+
const delta = clientY - this._previousY;
|
189
|
+
this._previousY = clientY;
|
190
|
+
if (Math.abs(delta) > 1)
|
191
|
+
this._moveByDelta(this._currentList, -delta);
|
90
192
|
}
|
91
193
|
});
|
92
194
|
}
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
return v;
|
100
|
-
if (typeof v == 'object') {
|
101
|
-
this.selectedItemIndex.set(this.items().findIndex((c) => c[this.valueField()] == v[this.valueField()]));
|
102
|
-
}
|
103
|
-
else {
|
104
|
-
this.selectedItemIndex.set(this.items().findIndex((c) => c[this.valueField()] == v));
|
195
|
+
/** @ignore */
|
196
|
+
_handleTouchEnd(e) {
|
197
|
+
// simulate click
|
198
|
+
const targetelement = e.target;
|
199
|
+
if (!this._dragging && targetelement.tagName == 'LI') {
|
200
|
+
targetelement.click();
|
105
201
|
}
|
202
|
+
this._dragging = false;
|
106
203
|
}
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
}
|
113
|
-
else {
|
114
|
-
this.selectedItemIndex.set(this.items().findIndex((c) => c[this.valueField()] == v));
|
115
|
-
}
|
204
|
+
/** @ignore */
|
205
|
+
_handleMouseWeel(e) {
|
206
|
+
e.preventDefault();
|
207
|
+
e.stopPropagation();
|
208
|
+
this._moveByDelta(e.currentTarget, e.deltaY);
|
116
209
|
}
|
117
210
|
/** @ignore */
|
118
|
-
|
119
|
-
|
211
|
+
_moveByDelta(col, deltaY) {
|
212
|
+
const column = col['column'];
|
213
|
+
if (column.readonly || column.disabled)
|
214
|
+
return;
|
215
|
+
let index = column.items.indexOf(column.value);
|
216
|
+
index = deltaY < 0 ? index - column.step : index + column.step;
|
217
|
+
if (index < 0)
|
218
|
+
index = 0;
|
219
|
+
if (index >= column.items.length)
|
220
|
+
index = column.items.length - 1;
|
221
|
+
column.commitValue(column.items[index], true);
|
120
222
|
}
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
223
|
+
/** @ignore */
|
224
|
+
_handleItemClick(column, item) {
|
225
|
+
if (column.readonly || column.disabled)
|
226
|
+
return;
|
227
|
+
column.commitValue(item, true);
|
228
|
+
}
|
229
|
+
/** @ignore */
|
230
|
+
_detectSelectedItemsByValue() {
|
231
|
+
this._zone.runOutsideAngular(() => {
|
232
|
+
this._htmlColumns.forEach((col) => {
|
233
|
+
const column = col['column'];
|
234
|
+
const index = column.items.indexOf(column.value);
|
235
|
+
col.querySelector('ul').style.transform = `translateY(${-index * this._itemHeight}px)`;
|
236
|
+
this.cdr.markForCheck();
|
237
|
+
});
|
238
|
+
});
|
239
|
+
}
|
240
|
+
/**
|
241
|
+
* Refreshes the component by setting heights and detecting selected items by value.
|
242
|
+
*/
|
243
|
+
refresh() {
|
244
|
+
this._setHeights();
|
245
|
+
this._detectSelectedItemsByValue();
|
246
|
+
}
|
247
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
248
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPickerComponent, isStandalone: false, selector: "ax-picker", providers: [AXUnsubscriber], queries: [{ propertyName: "_columns", predicate: AXPickerColumnDirective }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-header\">\n @for (col of _columns; track $index) {\n <div class=\"ax-picker-col\">\n <div class=\"ax-header\">\n {{ col.title }}\n </div>\n </div>\n }\n</div>\n<div class=\"ax-content\">\n <div class=\"ax-picker-window\"></div>\n @for (col of _columns; track $index) {\n <div\n class=\"ax-picker-col\"\n [class.ax-state-disabled]=\"col.disabled\"\n [class.ax-state-readonly]=\"col.readonly\"\n >\n <div class=\"ax-content\">\n <ul>\n @for (item of col.items; track $index) {\n <li\n (click)=\"_handleItemClick(col, item)\"\n [class.ax-state-active]=\"col.value && col.value[col.valueField] === item[col.valueField]\"\n [class.ax-state-disabled]=\"col.disabled\"\n [class.ax-state-readonly]=\"col.readonly\"\n >\n {{ item[col.textField] }}\n </li>\n }\n </ul>\n </div>\n </div>\n }\n</div>\n", styles: ["ax-picker{display:flex;width:100%;flex-direction:column;direction:ltr!important;--ax-item-height: var(--ax-size-default);--ax-content-height: 302px;--ax-content-pad: calc((var(--ax-content-height) - var(--ax-item-height)) / 2)}ax-picker>.ax-header,ax-picker>.ax-content{display:flex;width:100%}ax-picker>.ax-header .ax-picker-col,ax-picker>.ax-content .ax-picker-col{display:flex;flex:1 1 0%;flex-direction:column;text-align:center}ax-picker>.ax-header{padding:.5rem;font-size:.875rem;line-height:1.25rem;font-weight:500}ax-picker>.ax-content{position:relative;flex:1 1 0%}ax-picker>.ax-content .ax-picker-window{height:calc(var(--ax-item-height));pointer-events:none;position:absolute;inset-inline-start:0px;top:50%;width:100%;transform:translateY(-50%);border-bottom-width:1px;border-top-width:1px;border-color:rgba(var(--ax-color-border-default));background-color:rgba(var(--ax-color-on-surface))}ax-picker>.ax-content .ax-picker-col{display:flex;height:100%;flex:1 1 0%;cursor:pointer;flex-direction:column;justify-content:center;text-align:center}ax-picker>.ax-content .ax-picker-col.ax-state-disabled{cursor:not-allowed;opacity:.5}ax-picker>.ax-content .ax-picker-col.ax-state-readonly{cursor:text;opacity:.75}ax-picker>.ax-content .ax-picker-col:hover:not(.ax-state-disabled,.ax-state-readonly){background-color:rgba(var(--ax-color-on-surface))}ax-picker>.ax-content .ax-picker-col>.ax-content{font-feature-settings:\"tnum\";touch-action:pan-y!important;position:relative;flex:1 1 0%;overflow:hidden;font-weight:400}ax-picker>.ax-content .ax-picker-col>.ax-content:before,ax-picker>.ax-content .ax-picker-col>.ax-content:after{height:var(--ax-content-pad);pointer-events:none;position:absolute;inset-inline-start:0px;z-index:10;width:100%;content:\"\"}ax-picker>.ax-content .ax-picker-col>.ax-content:before{top:0;background:linear-gradient(rgba(var(--ax-color-surface)),rgba(var(--ax-color-surface),.3))}ax-picker>.ax-content .ax-picker-col>.ax-content:after{bottom:0;background:linear-gradient(rgba(var(--ax-color-surface),.3),rgba(var(--ax-color-surface)))}ax-picker>.ax-content .ax-picker-col>.ax-content>ul{transition:transform .1s ease 0s;height:var(--ax-content-height);padding-block:var(--ax-content-pad);will-change:transform}ax-picker>.ax-content .ax-picker-col>.ax-content>ul li{height:calc(var(--ax-item-height));scroll-snap-align:center;display:flex;-webkit-user-select:none;user-select:none;align-items:center;justify-content:center;font-size:1rem;line-height:1.5rem;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}ax-picker>.ax-content .ax-picker-col>.ax-content>ul li:hover:not(.ax-state-disabled,.ax-state-readonly,.ax-state-active){color:rgba(var(--ax-color-primary-500))}ax-picker>.ax-content .ax-picker-col>.ax-content>ul li.ax-state-active{background-color:rgba(var(--ax-color-primary-200));font-size:1.125rem;line-height:1.75rem;font-weight:500;color:rgba(var(--ax-color-primary-fore-tint))}ax-picker>.ax-content .ax-picker-col:not(:last-child){border-inline-end-width:1px;border-color:rgba(var(--ax-color-border-default))}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
129
249
|
}
|
130
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type:
|
250
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPickerComponent, decorators: [{
|
131
251
|
type: Component,
|
132
|
-
args: [{ selector: 'ax-picker
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
multi: true,
|
137
|
-
},
|
138
|
-
], template: "<div #c=\"axCarousel\" axCarousel [carouselOptions]=\"option()\" class=\"ax-carousel\">\n <div class=\"ax-carousel-wrapper\">\n @for (item of items(); track item.id) {\n <div (click)=\"clickHandler(item)\" class=\"ax-carousel-slide\">\n <p class=\"ax-picker-item\">{{ item.text }}</p>\n </div>\n }\n </div>\n\n <div class=\"ax-selected-picker-border\"></div>\n</div>\n", styles: ["ax-picker-items{width:100%;height:100%;display:flex;justify-content:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}ax-picker-items.ax-state-disabled{opacity:.5}ax-picker-items.ax-state-disabled .ax-carousel .ax-carousel-slide{cursor:not-allowed}ax-picker-items .ax-carousel{width:100%;height:100%;position:relative}ax-picker-items .ax-carousel .ax-carousel-wrapper .ax-carousel-slide{cursor:pointer;display:flex;align-items:center;justify-content:center;text-align:center}ax-picker-items .ax-carousel .ax-carousel-wrapper .ax-carousel-slide .ax-picker-item{width:100%;padding-block:.5rem;-webkit-user-select:none;user-select:none}ax-picker-items .ax-carousel .ax-carousel-wrapper .ax-carousel-slide .ax-picker-item:hover{background-color:rgba(var(--ax-sys-color-primary-200));color:rgba(var(--ax-sys-color-on-contrast-primary))}ax-picker-items .ax-carousel .ax-selected-picker-border{border-block:1px solid rgba(var(--ax-sys-color-primary-500));height:2rem;position:absolute;top:50%;transform:translateY(-50%);width:100%}\n"] }]
|
139
|
-
}], propDecorators: { __hostClass: [{
|
140
|
-
type: HostBinding,
|
141
|
-
args: ['class']
|
252
|
+
args: [{ selector: 'ax-picker', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [AXUnsubscriber], standalone: false, template: "<div class=\"ax-header\">\n @for (col of _columns; track $index) {\n <div class=\"ax-picker-col\">\n <div class=\"ax-header\">\n {{ col.title }}\n </div>\n </div>\n }\n</div>\n<div class=\"ax-content\">\n <div class=\"ax-picker-window\"></div>\n @for (col of _columns; track $index) {\n <div\n class=\"ax-picker-col\"\n [class.ax-state-disabled]=\"col.disabled\"\n [class.ax-state-readonly]=\"col.readonly\"\n >\n <div class=\"ax-content\">\n <ul>\n @for (item of col.items; track $index) {\n <li\n (click)=\"_handleItemClick(col, item)\"\n [class.ax-state-active]=\"col.value && col.value[col.valueField] === item[col.valueField]\"\n [class.ax-state-disabled]=\"col.disabled\"\n [class.ax-state-readonly]=\"col.readonly\"\n >\n {{ item[col.textField] }}\n </li>\n }\n </ul>\n </div>\n </div>\n }\n</div>\n", styles: ["ax-picker{display:flex;width:100%;flex-direction:column;direction:ltr!important;--ax-item-height: var(--ax-size-default);--ax-content-height: 302px;--ax-content-pad: calc((var(--ax-content-height) - var(--ax-item-height)) / 2)}ax-picker>.ax-header,ax-picker>.ax-content{display:flex;width:100%}ax-picker>.ax-header .ax-picker-col,ax-picker>.ax-content .ax-picker-col{display:flex;flex:1 1 0%;flex-direction:column;text-align:center}ax-picker>.ax-header{padding:.5rem;font-size:.875rem;line-height:1.25rem;font-weight:500}ax-picker>.ax-content{position:relative;flex:1 1 0%}ax-picker>.ax-content .ax-picker-window{height:calc(var(--ax-item-height));pointer-events:none;position:absolute;inset-inline-start:0px;top:50%;width:100%;transform:translateY(-50%);border-bottom-width:1px;border-top-width:1px;border-color:rgba(var(--ax-color-border-default));background-color:rgba(var(--ax-color-on-surface))}ax-picker>.ax-content .ax-picker-col{display:flex;height:100%;flex:1 1 0%;cursor:pointer;flex-direction:column;justify-content:center;text-align:center}ax-picker>.ax-content .ax-picker-col.ax-state-disabled{cursor:not-allowed;opacity:.5}ax-picker>.ax-content .ax-picker-col.ax-state-readonly{cursor:text;opacity:.75}ax-picker>.ax-content .ax-picker-col:hover:not(.ax-state-disabled,.ax-state-readonly){background-color:rgba(var(--ax-color-on-surface))}ax-picker>.ax-content .ax-picker-col>.ax-content{font-feature-settings:\"tnum\";touch-action:pan-y!important;position:relative;flex:1 1 0%;overflow:hidden;font-weight:400}ax-picker>.ax-content .ax-picker-col>.ax-content:before,ax-picker>.ax-content .ax-picker-col>.ax-content:after{height:var(--ax-content-pad);pointer-events:none;position:absolute;inset-inline-start:0px;z-index:10;width:100%;content:\"\"}ax-picker>.ax-content .ax-picker-col>.ax-content:before{top:0;background:linear-gradient(rgba(var(--ax-color-surface)),rgba(var(--ax-color-surface),.3))}ax-picker>.ax-content .ax-picker-col>.ax-content:after{bottom:0;background:linear-gradient(rgba(var(--ax-color-surface),.3),rgba(var(--ax-color-surface)))}ax-picker>.ax-content .ax-picker-col>.ax-content>ul{transition:transform .1s ease 0s;height:var(--ax-content-height);padding-block:var(--ax-content-pad);will-change:transform}ax-picker>.ax-content .ax-picker-col>.ax-content>ul li{height:calc(var(--ax-item-height));scroll-snap-align:center;display:flex;-webkit-user-select:none;user-select:none;align-items:center;justify-content:center;font-size:1rem;line-height:1.5rem;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}ax-picker>.ax-content .ax-picker-col>.ax-content>ul li:hover:not(.ax-state-disabled,.ax-state-readonly,.ax-state-active){color:rgba(var(--ax-color-primary-500))}ax-picker>.ax-content .ax-picker-col>.ax-content>ul li.ax-state-active{background-color:rgba(var(--ax-color-primary-200));font-size:1.125rem;line-height:1.75rem;font-weight:500;color:rgba(var(--ax-color-primary-fore-tint))}ax-picker>.ax-content .ax-picker-col:not(:last-child){border-inline-end-width:1px;border-color:rgba(var(--ax-color-border-default))}\n"] }]
|
253
|
+
}], propDecorators: { _columns: [{
|
254
|
+
type: ContentChildren,
|
255
|
+
args: [AXPickerColumnDirective, { emitDistinctChangesOnly: true }]
|
142
256
|
}] } });
|
143
257
|
|
144
|
-
|
145
|
-
|
146
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: AXPickerTitleComponent, isStandalone: false, selector: "ax-picker-title", ngImport: i0, template: "<ng-content></ng-content>\n", styles: ["ax-picker-title{display:flex;justify-content:center;align-items:center;padding:.5rem;width:100%;height:fit-content}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
147
|
-
}
|
148
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPickerTitleComponent, decorators: [{
|
149
|
-
type: Component,
|
150
|
-
args: [{ selector: 'ax-picker-title', standalone: false, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n", styles: ["ax-picker-title{display:flex;justify-content:center;align-items:center;padding:.5rem;width:100%;height:fit-content}\n"] }]
|
151
|
-
}] });
|
152
|
-
|
153
|
-
const COMPONENT = [AXPickerContainerComponent, AXPickerItemsComponent, AXPickerTitleComponent];
|
154
|
-
const MODULES = [CommonModule, AXCarouselDirective];
|
258
|
+
const COMPONENT = [AXPickerComponent, AXPickerColumnDirective];
|
259
|
+
const MODULES = [CommonModule];
|
155
260
|
class AXPickerModule {
|
156
261
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
157
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXPickerModule, declarations: [
|
158
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPickerModule, imports: [
|
262
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXPickerModule, declarations: [AXPickerComponent, AXPickerColumnDirective], imports: [CommonModule], exports: [AXPickerComponent, AXPickerColumnDirective] }); }
|
263
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPickerModule, imports: [MODULES] }); }
|
159
264
|
}
|
160
265
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPickerModule, decorators: [{
|
161
266
|
type: NgModule,
|
@@ -171,5 +276,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
171
276
|
* Generated bundle index. Do not edit.
|
172
277
|
*/
|
173
278
|
|
174
|
-
export {
|
279
|
+
export { AXPickerColumnDirective, AXPickerComponent, AXPickerModule };
|
175
280
|
//# sourceMappingURL=acorex-components-picker.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-picker.mjs","sources":["../../../../libs/components/picker/src/lib/picker-container/picker-container.component.ts","../../../../libs/components/picker/src/lib/picker-container/picker-container.component.html","../../../../libs/components/picker/src/lib/picker-items/picker-items.component.ts","../../../../libs/components/picker/src/lib/picker-items/picker-items.component.html","../../../../libs/components/picker/src/lib/picker-title/picker-title.component.ts","../../../../libs/components/picker/src/lib/picker-title/picker-title.component.html","../../../../libs/components/picker/src/lib/picker.module.ts","../../../../libs/components/picker/src/acorex-components-picker.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, HostBinding, input, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'ax-picker-container',\n templateUrl: './picker-container.component.html',\n styleUrls: ['./picker-container.component.scss'],\n standalone: false,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AXPickerContainerComponent {\n customClass = input<string>('', { alias: 'class' });\n\n @HostBinding('class')\n get __hostClass(): string {\n return `${this.customClass()}`;\n }\n}\n","<div class=\"ax-picker-title-container\">\n <ng-content select=\"ax-picker-title\"></ng-content>\n</div>\n<div class=\"ax-picker-items-container\">\n <ng-content select=\"ax-picker-items\"></ng-content>\n</div>\n","import { AXCarouselDirective, AXCarouselOptions } from '@acorex/cdk/carousel';\nimport { MXValueComponent } from '@acorex/components/common';\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n effect,\n forwardRef,\n HostBinding,\n input,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'ax-picker-items',\n templateUrl: './picker-items.component.html',\n styleUrls: ['./picker-items.component.scss'],\n standalone: false,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n inputs: ['disabled', 'readonly', 'readonlyChange', 'disabledChange'],\n outputs: ['onValueChanged'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXPickerItemsComponent),\n multi: true,\n },\n ],\n})\nexport class AXPickerItemsComponent extends MXValueComponent {\n protected swiperRef = viewChild<AXCarouselDirective>('c');\n\n items = input.required<any[]>();\n valueField = input('id');\n textField = input('text');\n selectedItemIndex = signal(null);\n slidesPerGroup = input<number>();\n loop = input<boolean>();\n\n protected option = signal<AXCarouselOptions>({\n direction: 'vertical',\n keyboard: true,\n mousewheel: true,\n autoHeight: true,\n slidesPerView: 'auto',\n centeredSlides: true,\n slidesPerGroup: 1,\n freeMode: { enabled: true, sticky: true },\n loop: false,\n });\n\n #init = afterNextRender(() => {\n this.disabledChange.subscribe((e) => {\n if (e) {\n this.swiperRef().carousel().disable();\n } else {\n this.swiperRef().carousel().enable();\n }\n });\n\n this.readonlyChange.subscribe((e) => {\n if (e) {\n this.swiperRef().carousel().disable();\n } else {\n this.swiperRef().carousel().enable();\n }\n });\n });\n\n #effect = effect(() => {\n if (this.swiperRef().carousel()) {\n this.swiperRef()\n .carousel()\n .on('slideChange', (e) => {\n this.onValueChanged.emit({\n value: this.items()[e.activeIndex],\n component: this,\n isUserInteraction: true,\n });\n });\n }\n });\n\n #effect2 = effect(() => {\n if (this.swiperRef().carousel() && this.selectedItemIndex()) {\n this.swiperRef().carousel().slideTo(this.selectedItemIndex());\n }\n });\n\n #effect3 = effect(() => {\n if (this.slidesPerGroup()) {\n this.option.update((prev) => ({ ...prev, slidesPerGroup: this.slidesPerGroup() }));\n }\n if (this.loop()) {\n this.option.update((prev) => ({ ...prev, loop: true }));\n }\n });\n\n protected clickHandler(v: any) {\n if (v == null) return v;\n if (typeof v == 'object') {\n this.selectedItemIndex.set(this.items().findIndex((c) => c[this.valueField()] == v[this.valueField()]));\n } else {\n this.selectedItemIndex.set(this.items().findIndex((c) => c[this.valueField()] == v));\n }\n }\n\n override internalSetValue(v) {\n if (v == null) return v;\n if (typeof v == 'object') {\n this.selectedItemIndex.set(this.items().findIndex((c) => c[this.valueField()] == v[this.valueField()]));\n } else {\n this.selectedItemIndex.set(this.items().findIndex((c) => c[this.valueField()] == v));\n }\n }\n\n /** @ignore */\n @HostBinding('class')\n private get __hostClass(): string[] {\n return [`${this.disabled && 'ax-state-disabled'}`, `${this.readonly && 'ax-state-readonly'}`];\n }\n}\n","<div #c=\"axCarousel\" axCarousel [carouselOptions]=\"option()\" class=\"ax-carousel\">\n <div class=\"ax-carousel-wrapper\">\n @for (item of items(); track item.id) {\n <div (click)=\"clickHandler(item)\" class=\"ax-carousel-slide\">\n <p class=\"ax-picker-item\">{{ item.text }}</p>\n </div>\n }\n </div>\n\n <div class=\"ax-selected-picker-border\"></div>\n</div>\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'ax-picker-title',\n templateUrl: './picker-title.component.html',\n styleUrls: ['./picker-title.component.scss'],\n standalone: false,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AXPickerTitleComponent {}\n","<ng-content></ng-content>\n","import { AXCarouselDirective } from '@acorex/cdk/carousel';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXPickerContainerComponent } from './picker-container/picker-container.component';\nimport { AXPickerItemsComponent } from './picker-items/picker-items.component';\nimport { AXPickerTitleComponent } from './picker-title/picker-title.component';\n\nconst COMPONENT = [AXPickerContainerComponent, AXPickerItemsComponent, AXPickerTitleComponent];\nconst MODULES = [CommonModule, AXCarouselDirective];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXPickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAUa,0BAA0B,CAAA;AARvC,IAAA,WAAA,GAAA;QASE,IAAW,CAAA,WAAA,GAAG,KAAK,CAAS,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAMpD;AAJC,IAAA,IACI,WAAW,GAAA;AACb,QAAA,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,EAAE;;8GALrB,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA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A,EAAA,cAAc,EATR,YAAA,EAAA,CAAA,0BAA0B,EAAE,sBAAsB,EAAE,sBAAsB,CAAA,EAAA,OAAA,EAAA,CAC5E,YAAY,EAAE,mBAAmB,CAD/B,EAAA,OAAA,EAAA,CAAA,0BAA0B,EAAE,sBAAsB,EAAE,sBAAsB,CAAA,EAAA,CAAA,CAAA;AAShF,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,YARV,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAQhB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAN1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA;;;ACfD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-picker.mjs","sources":["../../../../libs/components/picker/src/lib/picker-column.directive.ts","../../../../libs/components/picker/src/lib/picker.component.ts","../../../../libs/components/picker/src/lib/picker.component.html","../../../../libs/components/picker/src/lib/picker.module.ts","../../../../libs/components/picker/src/acorex-components-picker.ts"],"sourcesContent":["import { MXValueComponent } from '@acorex/components/common';\nimport { Directive, EventEmitter, Input, Output, forwardRef } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Directive({\n selector: 'ax-picker-column',\n inputs: ['disabled', 'readonly', 'readonlyChange', 'disabledChange'],\n outputs: ['onValueChanged'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXPickerColumnDirective),\n multi: true,\n },\n ],\n standalone: false\n})\nexport class AXPickerColumnDirective extends MXValueComponent {\n @Input()\n valueField = 'id';\n\n @Input()\n textField = 'text';\n\n @Input()\n public title: string;\n @Input()\n public step = 1;\n\n @Output()\n itemsChange: EventEmitter<unknown[]> = new EventEmitter<unknown[]>();\n\n private _items: unknown[];\n @Input()\n public get items(): unknown[] {\n return this._items;\n }\n public set items(v: unknown[]) {\n this._items = v;\n this.itemsChange.emit(v);\n }\n\n override internalSetValue(v) {\n if (v == null) return v;\n else if (typeof v == 'object') {\n return this.items.find((c) => c[this.valueField] == v[this.valueField]);\n } else {\n return this.items.find((c) => c[this.valueField] == v);\n }\n }\n}\n","import { MXBaseComponent } from '@acorex/components/common';\nimport { AXDrawingUtil, AXUnsubscriber } from '@acorex/core/utils';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n NgZone,\n OnDestroy,\n PLATFORM_ID,\n QueryList,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { startWith } from 'rxjs';\nimport { AXPickerColumnDirective } from './picker-column.directive';\n\n/**\n * @category Components\n * A picker component with OnPush change detection and no encapsulation.\n */\n@Component({\n selector: 'ax-picker',\n templateUrl: './picker.component.html',\n styleUrls: ['./picker.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [AXUnsubscriber],\n standalone: false\n})\nexport class AXPickerComponent extends MXBaseComponent implements AfterContentInit, OnDestroy {\n /** @ignore */\n @ContentChildren(AXPickerColumnDirective, { emitDistinctChangesOnly: true })\n\n /** @ignore */\n protected _columns: QueryList<AXPickerColumnDirective> = {} as QueryList<AXPickerColumnDirective>;\n\n /** @ignore */\n private _itemHeight = this._calcItemheight();\n\n /** @ignore */\n private _htmlColumns: HTMLDivElement[];\n\n /** @ignore */\n private _dragging = false;\n\n /** @ignore */\n private _previousY: number;\n\n /** @ignore */\n private _currentList: HTMLDivElement;\n\n /** @ignore */\n protected _unsubscriber: AXUnsubscriber = inject(AXUnsubscriber);\n\n /** @ignore */\n protected _zone: NgZone = inject(NgZone);\n protected platformID = inject(PLATFORM_ID);\n\n /** @ignore */\n ngAfterContentInit() {\n this._columns.changes\n .pipe(this._unsubscriber.takeUntilDestroy)\n .pipe(startWith(undefined))\n .subscribe(() => {\n this._setHeights();\n this.cdr.detectChanges();\n this._bindEvents();\n });\n }\n\n /** @ignore */\n ngOnDestroy() {\n this._removeEvents();\n }\n\n /** @ignore */\n private _setHeights() {\n this._itemHeight = this._calcItemheight();\n setTimeout(() => {\n const val =\n this.getHostElement().clientHeight - this.getHostElement().querySelector('.ax-header').clientHeight;\n this.getHostElement().style.setProperty('--ax-content-height', `${val}px`);\n }, 50);\n }\n\n /** @ignore */\n private _calcItemheight(): number {\n if (isPlatformBrowser(this.platformID)) {\n const rem = window\n .getComputedStyle(document.documentElement, null)\n .getPropertyValue('--ax-size-default');\n return AXDrawingUtil.convertRemToPixels(Number(rem?.replace('rem', '') ?? 0));\n }\n return 0;\n }\n\n /** @ignore */\n private _bindEvents(): void {\n this._removeEvents();\n //\n this._htmlColumns = Array.from(\n this.getHostElement().querySelectorAll<HTMLDivElement>('.ax-picker-col .ax-content'),\n );\n this._columns.forEach((c) => {\n c.onValueChanged.pipe(this._unsubscriber.takeUntilDestroy).subscribe(() => {\n this._detectSelectedItemsByValue();\n });\n c.onOptionChanged.pipe(this._unsubscriber.takeUntilDestroy).subscribe(() => {\n this.cdr.markForCheck();\n });\n });\n\n this._htmlColumns.forEach((col, index) => {\n col['column'] = this._columns.get(index);\n col.addEventListener('wheel', this._handleMouseWeel.bind(this), {\n passive: false,\n });\n //\n col.addEventListener('touchstart', this._handleTouchStart.bind(this), {\n passive: false,\n });\n //col.addEventListener(\"mousedown\", this._handleTouchStart.bind(this), { passive: false });\n //\n col.addEventListener('touchmove', this._handleTouchMove.bind(this), {\n passive: false,\n });\n //col.addEventListener('mousemove', this._handleTouchMove.bind(this), { passive: false })\n //\n col.addEventListener('touchend', this._handleTouchEnd.bind(this), {\n passive: false,\n });\n //col.addEventListener('mouseup', this._handleTouchMove.bind(this), { passive: false })\n });\n }\n\n /** @ignore */\n private _removeEvents(): void {\n this._htmlColumns?.forEach((col) => {\n col.removeEventListener('wheel', this._handleMouseWeel.bind(this));\n //\n col.removeEventListener('touchstart', this._handleTouchStart.bind(this));\n //col.removeEventListener(\"mousedown\", this._handleTouchStart.bind(this));\n col.removeEventListener('touchmove', this._handleTouchMove.bind(this));\n //col.removeEventListener('mousemove', this._handleTouchMove.bind(this));\n //\n col.removeEventListener('touchend', this._handleTouchEnd.bind(this));\n //col.removeEventListener('mouseup', this._handleTouchEnd.bind(this));\n });\n }\n\n /** @ignore */\n _handleTouchStart(e: MouseEvent | TouchEvent) {\n e.preventDefault();\n e.stopPropagation();\n this._currentList = e.currentTarget as HTMLDivElement;\n this._previousY = e instanceof TouchEvent ? e.touches[0].clientY : e.clientY;\n }\n\n /** @ignore */\n private _handleTouchMove(e: MouseEvent | TouchEvent): void {\n this._dragging = true;\n e.preventDefault();\n e.stopPropagation();\n this._zone.runOutsideAngular(() => {\n if (this._currentList && this._dragging) {\n const clientY = e instanceof TouchEvent ? e.touches[0].clientY : e.clientY;\n const delta = clientY - this._previousY;\n this._previousY = clientY;\n if (Math.abs(delta) > 1) this._moveByDelta(this._currentList, -delta);\n }\n });\n }\n\n /** @ignore */\n private _handleTouchEnd(e: MouseEvent | TouchEvent): void {\n // simulate click\n const targetelement = e.target as HTMLElement;\n if (!this._dragging && targetelement.tagName == 'LI') {\n targetelement.click();\n }\n this._dragging = false;\n }\n\n /** @ignore */\n private _handleMouseWeel(e: WheelEvent): void {\n e.preventDefault();\n e.stopPropagation();\n this._moveByDelta(e.currentTarget as HTMLDivElement, e.deltaY);\n }\n\n /** @ignore */\n private _moveByDelta(col: HTMLDivElement, deltaY: number) {\n const column = col['column'] as AXPickerColumnDirective;\n if (column.readonly || column.disabled) return;\n let index = column.items.indexOf(column.value);\n index = deltaY < 0 ? index - column.step : index + column.step;\n if (index < 0) index = 0;\n if (index >= column.items.length) index = column.items.length - 1;\n column.commitValue(column.items[index], true);\n }\n\n /** @ignore */\n protected _handleItemClick(column: AXPickerColumnDirective, item: any) {\n if (column.readonly || column.disabled) return;\n column.commitValue(item, true);\n }\n\n /** @ignore */\n private _detectSelectedItemsByValue(): void {\n this._zone.runOutsideAngular(() => {\n this._htmlColumns.forEach((col) => {\n const column = col['column'] as AXPickerColumnDirective;\n const index = column.items.indexOf(column.value);\n col.querySelector('ul').style.transform = `translateY(${-index * this._itemHeight}px)`;\n this.cdr.markForCheck();\n });\n });\n }\n\n /**\n * Refreshes the component by setting heights and detecting selected items by value.\n */\n public refresh() {\n this._setHeights();\n this._detectSelectedItemsByValue();\n }\n}\n","<div class=\"ax-header\">\n @for (col of _columns; track $index) {\n <div class=\"ax-picker-col\">\n <div class=\"ax-header\">\n {{ col.title }}\n </div>\n </div>\n }\n</div>\n<div class=\"ax-content\">\n <div class=\"ax-picker-window\"></div>\n @for (col of _columns; track $index) {\n <div\n class=\"ax-picker-col\"\n [class.ax-state-disabled]=\"col.disabled\"\n [class.ax-state-readonly]=\"col.readonly\"\n >\n <div class=\"ax-content\">\n <ul>\n @for (item of col.items; track $index) {\n <li\n (click)=\"_handleItemClick(col, item)\"\n [class.ax-state-active]=\"col.value && col.value[col.valueField] === item[col.valueField]\"\n [class.ax-state-disabled]=\"col.disabled\"\n [class.ax-state-readonly]=\"col.readonly\"\n >\n {{ item[col.textField] }}\n </li>\n }\n </ul>\n </div>\n </div>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXPickerColumnDirective } from './picker-column.directive';\nimport { AXPickerComponent } from './picker.component';\n\nconst COMPONENT = [AXPickerComponent, AXPickerColumnDirective];\nconst MODULES = [CommonModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXPickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n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,EAAA,CATR,iBAAiB,EAAE,uBAAuB,aAC5C,YAAY,CAAA,EAAA,OAAA,EAAA,CADV,iBAAiB,EAAE,uBAAuB,CAAA,EAAA,CAAA,CAAA;AAShD,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,YAJZ,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAIT,cAAc,EAAA,UAAA,EAAA,CAAA;kBAN1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA;;;ACbD;;AAEG;;;;"}
|
@@ -5,7 +5,7 @@ import { Overlay } from '@angular/cdk/overlay';
|
|
5
5
|
import { TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
|
6
6
|
import { DOCUMENT, isPlatformBrowser, CommonModule } from '@angular/common';
|
7
7
|
import * as i0 from '@angular/core';
|
8
|
-
import { inject, PLATFORM_ID, Renderer2, EventEmitter, ElementRef, TemplateRef,
|
8
|
+
import { inject, PLATFORM_ID, Renderer2, EventEmitter, ElementRef, TemplateRef, Output, Input, ViewChild, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
|
9
9
|
import { fromEvent, delay } from 'rxjs';
|
10
10
|
|
11
11
|
/**
|
@@ -3,7 +3,7 @@ import { AXPlatform } from '@acorex/core/platform';
|
|
3
3
|
import * as i6 from '@angular/cdk/portal';
|
4
4
|
import { TemplatePortal, ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
5
5
|
import * as i0 from '@angular/core';
|
6
|
-
import { TemplateRef,
|
6
|
+
import { TemplateRef, HostListener, Inject, ViewEncapsulation, ChangeDetectionStrategy, Component, inject, Injectable, NgModule } from '@angular/core';
|
7
7
|
import { MXBaseComponent, AXClosbaleComponent, AXComponentClosedPromise, AXCommonModule } from '@acorex/components/common';
|
8
8
|
import * as i1 from '@acorex/components/loading';
|
9
9
|
import * as i3 from '@angular/cdk/dialog';
|
@@ -168,11 +168,11 @@ class AXPopupComponent extends MXBaseComponent {
|
|
168
168
|
}
|
169
169
|
}
|
170
170
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPopupComponent, deps: [{ token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: i1.AXLoadingService }, { token: i2.AXPlatform }, { token: DIALOG_DATA }, { token: i3.DialogRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
171
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPopupComponent, isStandalone: false, selector: "ax-popup", host: { listeners: { "keydown.escape": "onKeydownHandler($event)" } }, providers: [{ provide: AXClosbaleComponent, useExisting: AXPopupComponent }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-popup-wrapper\" aria-modal=\"true\" [cdkTrapFocus]=\"true\">\n <div class=\"ax-popup
|
171
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPopupComponent, isStandalone: false, selector: "ax-popup", host: { listeners: { "keydown.escape": "onKeydownHandler($event)" } }, providers: [{ provide: AXClosbaleComponent, useExisting: AXPopupComponent }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-popup-wrapper \" aria-modal=\"true\" [cdkTrapFocus]=\"true\">\n <div class=\"ax-popup ax-popup-{{ data.size }}\" tabindex=\"0\" cdkDrag [cdkDragDisabled]=\"!data.draggable\">\n <div cdkDragHandle class=\"ax-popup-header-container\">\n @if(data.header){\n <div class=\"ax-popup-header\">\n <span class=\"ax-popup-title\">{{ data.title | translate | async }}</span>\n @if(data.closeButton){\n <ax-close-button tabindex=\"1\"></ax-close-button>\n }\n </div>\n }\n </div>\n <div class=\"ax-popup-main-container ax-loading-container\">\n <div class=\"ax-popup-body-container\">\n <ng-template [cdkPortalOutlet]=\"_selectedPortal\" (attached)=\"_handleAttched($event)\"></ng-template>\n </div>\n <div class=\"ax-popup-footer-container\"></div>\n </div>\n </div>\n</div>", styles: [".ax-popup{max-height:calc(var(--ax-overlay-full-width) * var(--ax-vh));margin-left:auto;margin-right:auto;display:flex;width:auto;flex-direction:column;overflow:hidden;border-radius:var(--ax-rounded-border-default);border-width:1px;border-color:rgba(var(--ax-color-border-default));background-color:rgba(var(--ax-color-surface));padding:0;--ax-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--ax-shadow-colored: 0 10px 15px -3px var(--ax-shadow-color), 0 4px 6px -4px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-shadow);outline:2px solid transparent;outline-offset:2px;color:rgba(var(--ax-color-text-default))}.ax-popup .ax-popup-header{display:flex;align-items:center;justify-content:space-between;border-bottom-width:1px;border-color:rgba(var(--ax-color-border-default));padding:.75rem}.ax-popup .ax-popup-header .ax-popup-title{font-size:1rem;line-height:1;font-weight:500}@media (min-width: 768px){.ax-popup .ax-popup-header .ax-popup-title{font-size:1.125rem;line-height:1.75rem}}.ax-popup ax-footer{box-shadow:0 2px 10px #0000004d;display:flex;align-items:center;justify-content:space-between;border-top-width:1px;border-color:rgba(var(--ax-color-border-default));padding:.75rem}.ax-popup:focus{outline:2px solid transparent;outline-offset:2px}.ax-popup:focus-visible{border-color:rgba(var(--ax-color-primary-500))}.ax-popup .ax-popup-main-container{display:flex;flex:1 1 0%;flex-direction:column;overflow:hidden}.ax-popup .ax-popup-main-container .ax-popup-body-container{flex:1 1 0%;overflow:auto}.ax-popup.ax-popup-full{width:100vw;max-height:calc(100 * var(--ax-vh));height:calc(100 * var(--ax-vh));border-radius:0!important}.ax-popup.ax-fit{width:fit-content!important}.ax-popup.ax-fit .ax-popup-body-container{max-height:100vh}.ax-popup.ax-fit .ax-popup-body-container>ng-component>div{width:fit-content!important}@media (min-width: 320px) and (max-width: 640px){.ax-popup.ax-popup-sm,.ax-popup.ax-popup-md,.ax-popup.ax-popup-lg{width:93vw!important;height:fit-content;max-height:calc(var(--ax-overlay-full-width) * var(--ax-vh))!important}.ax-popup.ax-popup-sm .ax-popup-body-container>ng-component>div,.ax-popup.ax-popup-md .ax-popup-body-container>ng-component>div,.ax-popup.ax-popup-lg .ax-popup-body-container>ng-component>div{width:100%}}@media (min-width: 768px){.ax-popup.ax-popup-sm{width:55vw!important}.ax-popup.ax-popup-md{width:65vw!important}.ax-popup.ax-popup-lg{width:75vw!important}}@media (min-width: 1280px){.ax-popup.ax-popup-sm{width:30vw!important}.ax-popup.ax-popup-md{width:50vw!important}.ax-popup.ax-popup-lg{width:85vw!important}}@media (min-width: 1536px){.ax-popup.ax-popup-sm{width:25vw!important}.ax-popup.ax-popup-md{width:40vw!important}.ax-popup.ax-popup-lg{width:65vw!important}}\n"], dependencies: [{ kind: "directive", type: i4.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: i4.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: i5.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: i6.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "component", type: i7.AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["closeAll", "icon"] }, { kind: "pipe", type: i8.AsyncPipe, name: "async" }, { kind: "pipe", type: i9.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
172
172
|
}
|
173
173
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPopupComponent, decorators: [{
|
174
174
|
type: Component,
|
175
|
-
args: [{ selector: 'ax-popup', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [{ provide: AXClosbaleComponent, useExisting: AXPopupComponent }], standalone: false, template: "<div class=\"ax-popup-wrapper\" aria-modal=\"true\" [cdkTrapFocus]=\"true\">\n <div class=\"ax-popup
|
175
|
+
args: [{ selector: 'ax-popup', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [{ provide: AXClosbaleComponent, useExisting: AXPopupComponent }], standalone: false, template: "<div class=\"ax-popup-wrapper \" aria-modal=\"true\" [cdkTrapFocus]=\"true\">\n <div class=\"ax-popup ax-popup-{{ data.size }}\" tabindex=\"0\" cdkDrag [cdkDragDisabled]=\"!data.draggable\">\n <div cdkDragHandle class=\"ax-popup-header-container\">\n @if(data.header){\n <div class=\"ax-popup-header\">\n <span class=\"ax-popup-title\">{{ data.title | translate | async }}</span>\n @if(data.closeButton){\n <ax-close-button tabindex=\"1\"></ax-close-button>\n }\n </div>\n }\n </div>\n <div class=\"ax-popup-main-container ax-loading-container\">\n <div class=\"ax-popup-body-container\">\n <ng-template [cdkPortalOutlet]=\"_selectedPortal\" (attached)=\"_handleAttched($event)\"></ng-template>\n </div>\n <div class=\"ax-popup-footer-container\"></div>\n </div>\n </div>\n</div>", styles: [".ax-popup{max-height:calc(var(--ax-overlay-full-width) * var(--ax-vh));margin-left:auto;margin-right:auto;display:flex;width:auto;flex-direction:column;overflow:hidden;border-radius:var(--ax-rounded-border-default);border-width:1px;border-color:rgba(var(--ax-color-border-default));background-color:rgba(var(--ax-color-surface));padding:0;--ax-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--ax-shadow-colored: 0 10px 15px -3px var(--ax-shadow-color), 0 4px 6px -4px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-shadow);outline:2px solid transparent;outline-offset:2px;color:rgba(var(--ax-color-text-default))}.ax-popup .ax-popup-header{display:flex;align-items:center;justify-content:space-between;border-bottom-width:1px;border-color:rgba(var(--ax-color-border-default));padding:.75rem}.ax-popup .ax-popup-header .ax-popup-title{font-size:1rem;line-height:1;font-weight:500}@media (min-width: 768px){.ax-popup .ax-popup-header .ax-popup-title{font-size:1.125rem;line-height:1.75rem}}.ax-popup ax-footer{box-shadow:0 2px 10px #0000004d;display:flex;align-items:center;justify-content:space-between;border-top-width:1px;border-color:rgba(var(--ax-color-border-default));padding:.75rem}.ax-popup:focus{outline:2px solid transparent;outline-offset:2px}.ax-popup:focus-visible{border-color:rgba(var(--ax-color-primary-500))}.ax-popup .ax-popup-main-container{display:flex;flex:1 1 0%;flex-direction:column;overflow:hidden}.ax-popup .ax-popup-main-container .ax-popup-body-container{flex:1 1 0%;overflow:auto}.ax-popup.ax-popup-full{width:100vw;max-height:calc(100 * var(--ax-vh));height:calc(100 * var(--ax-vh));border-radius:0!important}.ax-popup.ax-fit{width:fit-content!important}.ax-popup.ax-fit .ax-popup-body-container{max-height:100vh}.ax-popup.ax-fit .ax-popup-body-container>ng-component>div{width:fit-content!important}@media (min-width: 320px) and (max-width: 640px){.ax-popup.ax-popup-sm,.ax-popup.ax-popup-md,.ax-popup.ax-popup-lg{width:93vw!important;height:fit-content;max-height:calc(var(--ax-overlay-full-width) * var(--ax-vh))!important}.ax-popup.ax-popup-sm .ax-popup-body-container>ng-component>div,.ax-popup.ax-popup-md .ax-popup-body-container>ng-component>div,.ax-popup.ax-popup-lg .ax-popup-body-container>ng-component>div{width:100%}}@media (min-width: 768px){.ax-popup.ax-popup-sm{width:55vw!important}.ax-popup.ax-popup-md{width:65vw!important}.ax-popup.ax-popup-lg{width:75vw!important}}@media (min-width: 1280px){.ax-popup.ax-popup-sm{width:30vw!important}.ax-popup.ax-popup-md{width:50vw!important}.ax-popup.ax-popup-lg{width:85vw!important}}@media (min-width: 1536px){.ax-popup.ax-popup-sm{width:25vw!important}.ax-popup.ax-popup-md{width:40vw!important}.ax-popup.ax-popup-lg{width:65vw!important}}\n"] }]
|
176
176
|
}], ctorParameters: () => [{ type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: i1.AXLoadingService }, { type: i2.AXPlatform }, { type: undefined, decorators: [{
|
177
177
|
type: Inject,
|
178
178
|
args: [DIALOG_DATA]
|