@acorex/components 7.5.1 → 7.8.0
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/badge/lib/badge.component.d.ts +3 -3
- package/button/lib/button-item.component.d.ts +3 -1
- package/calendar/lib/calendar.component.d.ts +6 -4
- package/chips/lib/chips.component.d.ts +1 -1
- package/collapse/lib/collapse.component.d.ts +15 -2
- package/collapse/lib/collapse.module.d.ts +2 -1
- package/common/index.d.ts +1 -0
- package/common/lib/classes/datalist.class.d.ts +0 -31
- package/common/lib/classes/datasource.class.d.ts +55 -0
- package/common/lib/classes/styles.class.d.ts +1 -1
- package/common/lib/components/interactive-component.class.d.ts +1 -7
- package/common/lib/components/selection-base.component.class.d.ts +4 -6
- package/common/lib/directives/ripple.directive.d.ts +2 -1
- package/datetime-box/lib/datetime-box.component.d.ts +2 -1
- package/datetime-input/lib/datetime-input.component.d.ts +2 -1
- package/esm2022/action-sheet/lib/action-sheet.component.mjs +2 -2
- package/esm2022/alert/lib/alert.component.mjs +4 -5
- package/esm2022/avatar/lib/avatar.component.mjs +4 -4
- package/esm2022/badge/lib/badge.component.mjs +6 -6
- package/esm2022/button/lib/button-item.component.mjs +12 -3
- package/esm2022/button/lib/button.component.mjs +2 -2
- package/esm2022/button-group/lib/button-group.component.mjs +2 -2
- package/esm2022/calendar/lib/calendar.class.mjs +1 -58
- package/esm2022/calendar/lib/calendar.component.mjs +27 -16
- package/esm2022/chips/lib/chips.component.mjs +4 -4
- package/esm2022/collapse/lib/collapse-group.component.mjs +8 -4
- package/esm2022/collapse/lib/collapse.component.mjs +63 -15
- package/esm2022/collapse/lib/collapse.module.mjs +5 -4
- package/esm2022/color-box/lib/color-box.module.mjs +1 -1
- package/esm2022/common/index.mjs +2 -1
- package/esm2022/common/lib/classes/datalist.class.mjs +2 -41
- package/esm2022/common/lib/classes/datasource.class.mjs +106 -0
- package/esm2022/common/lib/classes/styles.class.mjs +1 -1
- package/esm2022/common/lib/components/interactive-component.class.mjs +13 -13
- package/esm2022/common/lib/components/selection-base.component.class.mjs +55 -27
- package/esm2022/common/lib/directives/ripple.directive.mjs +14 -8
- package/esm2022/datetime-box/lib/datetime-box.component.mjs +6 -3
- package/esm2022/datetime-input/lib/datetime-input.component.mjs +11 -4
- package/esm2022/datetime-picker/lib/datetime-picker.component.mjs +3 -3
- package/esm2022/list/lib/list.component.mjs +34 -60
- package/esm2022/menu/index.mjs +1 -2
- package/esm2022/menu/lib/class/root-menu.class.mjs +1 -1
- package/esm2022/menu/lib/menu-item/menu-item.component.mjs +60 -18
- package/esm2022/menu/lib/menu.component.mjs +37 -342
- package/esm2022/menu/lib/menu.module.mjs +3 -4
- package/esm2022/notification/lib/notification.component.mjs +2 -2
- package/esm2022/otp/lib/otp.component.mjs +4 -3
- package/esm2022/otp/lib/otp.module.mjs +4 -3
- package/esm2022/picker/lib/picker.component.mjs +2 -2
- package/esm2022/progress-bar/lib/progress-bar.component.mjs +2 -2
- package/esm2022/range-slider/lib/range-slider.component.mjs +2 -2
- package/esm2022/routing-progress/lib/routing-progress.component.mjs +3 -3
- package/esm2022/search-box/lib/search-box.component.mjs +5 -4
- package/esm2022/select-box/index.mjs +2 -2
- package/esm2022/select-box/lib/select-box.component.mjs +168 -308
- package/esm2022/select-box/lib/select-box.module.mjs +5 -6
- package/esm2022/selection-list/lib/selection-list.component.mjs +11 -1
- package/esm2022/side-menu/acorex-components-side-menu.mjs +5 -0
- package/esm2022/side-menu/index.mjs +4 -0
- package/esm2022/side-menu/lib/side-menu-item/side-menu-item.compoent.mjs +116 -0
- package/esm2022/side-menu/lib/side-menu.component.mjs +15 -0
- package/esm2022/side-menu/lib/side-menu.module.mjs +23 -0
- package/esm2022/skeleton/acorex-components-skeleton.mjs +5 -0
- package/esm2022/skeleton/index.mjs +3 -0
- package/esm2022/skeleton/lib/skeleton.component.mjs +24 -0
- package/esm2022/skeleton/lib/skeleton.module.mjs +18 -0
- package/esm2022/tabs/lib/tab-item.component.mjs +9 -2
- package/esm2022/tag/lib/tag.component.mjs +6 -12
- package/esm2022/toast/lib/toast.component.mjs +3 -3
- package/fesm2022/acorex-components-action-sheet.mjs +2 -2
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-alert.mjs +3 -4
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-avatar.mjs +3 -3
- package/fesm2022/acorex-components-avatar.mjs.map +1 -1
- package/fesm2022/acorex-components-badge.mjs +5 -5
- package/fesm2022/acorex-components-badge.mjs.map +1 -1
- package/fesm2022/acorex-components-button-group.mjs +2 -2
- package/fesm2022/acorex-components-button-group.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs +13 -4
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-calendar.mjs +27 -73
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-chips.mjs +3 -3
- package/fesm2022/acorex-components-chips.mjs.map +1 -1
- package/fesm2022/acorex-components-collapse.mjs +74 -21
- package/fesm2022/acorex-components-collapse.mjs.map +1 -1
- package/fesm2022/acorex-components-color-box.mjs.map +1 -1
- package/fesm2022/acorex-components-common.mjs +161 -62
- package/fesm2022/acorex-components-common.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +5 -2
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs +10 -3
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +2 -2
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs +33 -59
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +78 -381
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs +2 -2
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-otp.mjs +6 -4
- package/fesm2022/acorex-components-otp.mjs.map +1 -1
- package/fesm2022/acorex-components-picker.mjs +2 -2
- package/fesm2022/acorex-components-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-progress-bar.mjs +2 -2
- package/fesm2022/acorex-components-progress-bar.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +2 -2
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-routing-progress.mjs +2 -2
- package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-search-box.mjs +4 -4
- package/fesm2022/acorex-components-search-box.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +96 -417
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs +10 -0
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs +153 -0
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -0
- package/fesm2022/acorex-components-skeleton.mjs +46 -0
- package/fesm2022/acorex-components-skeleton.mjs.map +1 -0
- package/fesm2022/acorex-components-tabs.mjs +8 -1
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/fesm2022/acorex-components-tag.mjs +5 -11
- package/fesm2022/acorex-components-tag.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +2 -2
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/list/lib/list.component.d.ts +11 -23
- package/menu/index.d.ts +0 -1
- package/menu/lib/class/root-menu.class.d.ts +2 -0
- package/menu/lib/menu-item/menu-item.component.d.ts +19 -6
- package/menu/lib/menu.component.d.ts +10 -40
- package/menu/lib/menu.module.d.ts +7 -8
- package/mixin/lib/base-components.class.d.ts +2 -2
- package/mixin/lib/base-menu-mixin.class.d.ts +5 -5
- package/mixin/lib/button-mixin.class.d.ts +2 -2
- package/mixin/lib/clickable-mixin.class.d.ts +2 -2
- package/mixin/lib/color-look-mixing.class.d.ts +2 -2
- package/mixin/lib/datalist-component.class.d.ts +10 -10
- package/mixin/lib/dropdown-mixin.class.d.ts +2 -2
- package/mixin/lib/interactive-mixin.class.d.ts +4 -4
- package/mixin/lib/mixin.class.d.ts +61 -61
- package/mixin/lib/page-component.class.d.ts +2 -2
- package/mixin/lib/selection-component.class.d.ts +2 -2
- package/mixin/lib/sizable-mixin.class.d.ts +2 -2
- package/mixin/lib/textbox-mixin.class.d.ts +2 -2
- package/mixin/lib/value-mixin.class.d.ts +8 -8
- package/otp/lib/otp.module.d.ts +2 -1
- package/package.json +13 -7
- package/search-box/lib/search-box.component.d.ts +2 -1
- package/select-box/index.d.ts +1 -1
- package/select-box/lib/select-box.component.d.ts +37 -59
- package/select-box/lib/select-box.module.d.ts +14 -15
- package/selection-list/lib/selection-list.component.d.ts +3 -0
- package/side-menu/README.md +3 -0
- package/side-menu/index.d.ts +3 -0
- package/side-menu/lib/side-menu-item/side-menu-item.compoent.d.ts +37 -0
- package/side-menu/lib/side-menu.component.d.ts +8 -0
- package/side-menu/lib/side-menu.module.d.ts +10 -0
- package/skeleton/README.md +3 -0
- package/skeleton/index.d.ts +2 -0
- package/skeleton/lib/skeleton.component.d.ts +8 -0
- package/skeleton/lib/skeleton.module.d.ts +8 -0
- package/tabs/lib/tab-item.component.d.ts +2 -1
- package/tag/lib/tag.component.d.ts +3 -4
- package/context-menu/README.md +0 -3
- package/context-menu/index.d.ts +0 -2
- package/context-menu/lib/context-menu.component.d.ts +0 -34
- package/context-menu/lib/context-menu.module.d.ts +0 -13
- package/esm2022/context-menu/acorex-components-context-menu.mjs +0 -5
- package/esm2022/context-menu/index.mjs +0 -3
- package/esm2022/context-menu/lib/context-menu.component.mjs +0 -262
- package/esm2022/context-menu/lib/context-menu.module.mjs +0 -26
- package/esm2022/menu/lib/menu2.component.mjs +0 -45
- package/esm2022/select-box/lib/select-box2.component.mjs +0 -191
- package/fesm2022/acorex-components-context-menu.mjs +0 -290
- package/fesm2022/acorex-components-context-menu.mjs.map +0 -1
- package/menu/lib/menu2.component.d.ts +0 -12
- package/select-box/lib/select-box2.component.d.ts +0 -44
@@ -1,429 +1,86 @@
|
|
1
|
-
import {
|
2
|
-
import * as
|
3
|
-
import {
|
4
|
-
import * as
|
5
|
-
import {
|
6
|
-
import * as i0 from '@angular/core';
|
7
|
-
import { Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, ContentChild, Input, HostListener, HostBinding, inject, forwardRef, NgModule } from '@angular/core';
|
8
|
-
import { findLast, first, last, findLastIndex, nth } from 'lodash-es';
|
9
|
-
import { AXBaseSelectionDropdownMixin } from '@acorex/components/mixin';
|
10
|
-
import * as i4 from '@acorex/components/popover';
|
11
|
-
import { AXPopoverComponent, AXPopoverModule } from '@acorex/components/popover';
|
1
|
+
import { MXSelectionValueComponent, MXLookComponent, convertArrayToDataSource, AXComponent, AXFocusableComponent, AXValuableComponent, AXClearableComponent, AXClosbaleComponent, AXSearchableComponent, AXCommonModule } from '@acorex/components/common';
|
2
|
+
import * as i5 from '@acorex/components/dropdown';
|
3
|
+
import { MXDropdownBoxBaseComponent, AXDropdownBoxComponent, AXDropdownModule } from '@acorex/components/dropdown';
|
4
|
+
import * as i6 from '@acorex/components/list';
|
5
|
+
import { AXListComponent, AXListModule } from '@acorex/components/list';
|
12
6
|
import { AXSearchBoxComponent } from '@acorex/components/search-box';
|
13
|
-
import * as
|
7
|
+
import * as i0 from '@angular/core';
|
8
|
+
import { forwardRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ViewChild, ContentChild, HostListener, NgModule } from '@angular/core';
|
9
|
+
import * as i2 from '@angular/forms';
|
10
|
+
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
11
|
+
import { last, findLastIndex, nth } from 'lodash-es';
|
12
|
+
import { classes } from 'polytype';
|
13
|
+
import * as i1 from '@angular/common';
|
14
14
|
import { CommonModule } from '@angular/common';
|
15
15
|
import * as i3 from '@acorex/components/decorators';
|
16
16
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
17
|
-
import * as
|
17
|
+
import * as i4 from '@acorex/components/loading';
|
18
18
|
import { AXLoadingModule } from '@acorex/components/loading';
|
19
|
-
import * as i6 from '@angular/cdk/a11y';
|
20
|
-
import { A11yModule } from '@angular/cdk/a11y';
|
21
19
|
import { AXBadgeModule } from '@acorex/components/badge';
|
22
20
|
import { AXCheckBoxModule } from '@acorex/components/check-box';
|
23
|
-
import
|
24
|
-
import {
|
25
|
-
import
|
26
|
-
import { MXDropdownBoxBaseComponent, AXDropdownBoxComponent, AXDropdownModule } from '@acorex/components/dropdown';
|
27
|
-
import * as i6$1 from '@acorex/components/list';
|
28
|
-
import { AXListComponent, AXListModule } from '@acorex/components/list';
|
21
|
+
import { AXPopoverModule } from '@acorex/components/popover';
|
22
|
+
import { AXTranslationModule } from '@acorex/core/translation';
|
23
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
29
24
|
import { AXTextBoxModule } from '@acorex/components/text-box';
|
30
|
-
import { classes } from 'polytype';
|
31
25
|
|
32
26
|
/**
|
33
27
|
* The Button is a component which detects user interaction and triggers a corresponding event
|
34
28
|
*
|
35
29
|
* @category Components
|
36
30
|
*/
|
37
|
-
class AXSelectBoxComponent extends
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
this._elementRef = _elementRef;
|
47
|
-
this._cdr = _cdr;
|
48
|
-
this._zone = _zone;
|
49
|
-
this._platform = _platform;
|
50
|
-
/**
|
51
|
-
* Defines the clearButton.
|
52
|
-
*/
|
53
|
-
this.clearButton = false;
|
54
|
-
/**
|
55
|
-
* Defines the checkbox.
|
56
|
-
*/
|
57
|
-
this.checkbox = false;
|
58
|
-
this._isActionSheet = false;
|
59
|
-
this._forceFocus = false;
|
60
|
-
this._loadingOptions = {
|
61
|
-
text: AXTranslator.get('layout.loading.text'),
|
62
|
-
};
|
63
|
-
this._isActionSheet = this._platform.is('SM');
|
64
|
-
this._platform.resize.subscribe(() => {
|
65
|
-
this._isActionSheet = this._platform.is('SM');
|
66
|
-
this.popover.close();
|
67
|
-
this._detectPopupSize();
|
31
|
+
class AXSelectBoxComponent extends classes(MXDropdownBoxBaseComponent, MXSelectionValueComponent, MXLookComponent) {
|
32
|
+
constructor() {
|
33
|
+
super(...arguments);
|
34
|
+
this.isLoading = false;
|
35
|
+
this.renderList = false;
|
36
|
+
this.dropdownSizes = { width: 'auto', height: 'auto' };
|
37
|
+
this._listDataSource = convertArrayToDataSource([], {
|
38
|
+
key: this.valueField,
|
39
|
+
pageSize: 10,
|
68
40
|
});
|
41
|
+
this.autoHeight = false;
|
69
42
|
}
|
70
|
-
|
71
|
-
|
72
|
-
// e.nativeEvent.stopPropagation();
|
73
|
-
this.toggle();
|
74
|
-
}
|
75
|
-
_handleInputClickEvent(e) {
|
76
|
-
e.stopPropagation();
|
77
|
-
this.toggle();
|
78
|
-
}
|
79
|
-
onInit() {
|
80
|
-
super.onInit();
|
81
|
-
this._target = this._elementRef.nativeElement;
|
82
|
-
this._updatePopupTitle();
|
83
|
-
}
|
84
|
-
onViewInit() {
|
85
|
-
super.onViewInit();
|
86
|
-
this._detectPopupSize();
|
87
|
-
}
|
88
|
-
refresh() {
|
89
|
-
this.value = null;
|
90
|
-
super.refresh();
|
91
|
-
}
|
92
|
-
_updatePopupTitle() {
|
93
|
-
const count = this.selectedItems?.length || 0;
|
94
|
-
//this._popoverTitle = count > 1 ? `(${count}) items selected` : (this.placeholder || AXTranslator.get('selectbox.popover.title'));
|
95
|
-
this._popoverTitle = this.placeholder || AXTranslator.get('selectbox.popover.title');
|
96
|
-
}
|
97
|
-
_detectPopupSize() {
|
98
|
-
this._popoverWidth = this._isActionSheet ? 0 : this._target.offsetWidth;
|
99
|
-
}
|
100
|
-
_handleOnItemClick(e, item) {
|
101
|
-
if (this.isItemDisabled(item)) {
|
102
|
-
return;
|
103
|
-
}
|
104
|
-
if (!this.multiple)
|
105
|
-
this.close();
|
106
|
-
this.toggleSelect(item);
|
107
|
-
this._cdr.detectChanges();
|
108
|
-
}
|
109
|
-
_handleListScroll(e) {
|
110
|
-
const list = e.target;
|
111
|
-
if (list.scrollTop < list.scrollHeight - list.clientHeight) {
|
112
|
-
return;
|
113
|
-
}
|
114
|
-
this._fetchData();
|
115
|
-
}
|
116
|
-
_checkForLoadData() {
|
117
|
-
const list = this.listContainer.nativeElement;
|
118
|
-
if (this.loadedCount < this.totalCount && list.scrollHeight < list.parentElement.clientHeight * 1.5) {
|
119
|
-
this._fetchData();
|
120
|
-
}
|
121
|
-
}
|
122
|
-
_onDataLoaded() {
|
123
|
-
if (this.popover.isOpen) {
|
124
|
-
setTimeout(() => {
|
125
|
-
this._checkForLoadData();
|
126
|
-
this.popover.updatePosition();
|
127
|
-
if (this._forceFocus) {
|
128
|
-
this._focusSelectedItem();
|
129
|
-
this._forceFocus = false;
|
130
|
-
}
|
131
|
-
this._focusSearchBox();
|
132
|
-
}, 100);
|
133
|
-
}
|
134
|
-
}
|
135
|
-
_onValueChanged(oldValue, newValue) {
|
136
|
-
super._onValueChanged(oldValue, newValue);
|
137
|
-
}
|
138
|
-
_handleOnRemoveItemClick(e, item) {
|
139
|
-
this.unselectItems(item);
|
140
|
-
e.stopPropagation();
|
141
|
-
}
|
142
|
-
_handleBadgeRemove(e, item) {
|
143
|
-
this.unselectItems(item);
|
144
|
-
e.stopPropagation();
|
145
|
-
this.close();
|
146
|
-
}
|
147
|
-
_handleKeydown(e) {
|
148
|
-
const isLetter = new RegExp(/[a-zA-Z0-9\-]/).test(String.fromCharCode(e.keyCode));
|
149
|
-
if (e.code === 'Backspace' &&
|
150
|
-
e.type === 'keydown' &&
|
151
|
-
((this.allowNull === true && this.selectedItems.length > 0) ||
|
152
|
-
(this.allowNull !== true && this.selectedItems.length > 1))) {
|
153
|
-
this.isUserInput = true;
|
154
|
-
this.unselectItems(this.selectedItems.pop());
|
155
|
-
e.preventDefault();
|
156
|
-
return;
|
157
|
-
}
|
158
|
-
else if ((e.code === 'ArrowDown' || e.code === 'ArrowUp' || e.code === 'Space') &&
|
159
|
-
!this.popover.isOpen &&
|
160
|
-
e.type === 'keydown') {
|
161
|
-
if (this.multiple) {
|
162
|
-
this.open();
|
163
|
-
}
|
164
|
-
else {
|
165
|
-
this.isUserInput = true;
|
166
|
-
if (e.ctrlKey || e.code === 'Space') {
|
167
|
-
this.open();
|
168
|
-
}
|
169
|
-
else {
|
170
|
-
this._selectedItemByNav(e.key === 'ArrowDown' ? 1 : -1);
|
171
|
-
}
|
172
|
-
}
|
173
|
-
e.preventDefault();
|
174
|
-
return;
|
175
|
-
}
|
176
|
-
else if (isLetter) {
|
177
|
-
this.text = e.key;
|
178
|
-
this.open();
|
179
|
-
e.preventDefault();
|
180
|
-
return;
|
181
|
-
}
|
182
|
-
}
|
183
|
-
_handlePopoverKeydown(e) {
|
184
|
-
if (e.target.tagName == 'INPUT' && ['Space', 'Backspace'].includes(e.code))
|
185
|
-
return;
|
186
|
-
if ((e.key === 'ArrowDown' || e.key === 'ArrowUp') && this.displayItems.length > 0) {
|
187
|
-
this.isUserInput = true;
|
188
|
-
this._focusItemByNav(e.key === 'ArrowDown' ? 1 : -1);
|
189
|
-
e.preventDefault();
|
190
|
-
}
|
191
|
-
else if (e.code === 'Backspace' &&
|
192
|
-
((this.allowNull === true && this.selectedItems.length > 0) ||
|
193
|
-
(this.allowNull !== true && this.selectedItems.length > 1))) {
|
194
|
-
this.isUserInput = true;
|
195
|
-
this.unselectItems(this.selectedItems.pop());
|
196
|
-
e.preventDefault();
|
197
|
-
}
|
198
|
-
else if (e.code === 'Space' || e.code === 'Enter') {
|
199
|
-
e.preventDefault();
|
200
|
-
const focusedItemId = this.listContainer.nativeElement.querySelector('.ax-state-focus')?.dataset?.id;
|
201
|
-
const focusedItem = findLast(this.flatItems, [this.valueField, focusedItemId]);
|
202
|
-
if (focusedItem) {
|
203
|
-
if (this.isItemDisabled(focusedItem)) {
|
204
|
-
return;
|
205
|
-
}
|
206
|
-
if (this.multiple) {
|
207
|
-
this.isUserInput = true;
|
208
|
-
this.toggleSelect(focusedItem);
|
209
|
-
}
|
210
|
-
else {
|
211
|
-
this.isUserInput = true;
|
212
|
-
this.selectItems(focusedItem);
|
213
|
-
this.close();
|
214
|
-
}
|
215
|
-
}
|
216
|
-
}
|
217
|
-
else if (e.code === 'Tab') {
|
218
|
-
this.close();
|
219
|
-
e.preventDefault();
|
220
|
-
e.stopPropagation();
|
221
|
-
}
|
222
|
-
else if (e.key === 'Escape') {
|
223
|
-
this.close();
|
224
|
-
e.preventDefault();
|
225
|
-
e.stopPropagation();
|
226
|
-
}
|
227
|
-
}
|
228
|
-
async _handlePopupOnOpened(e) {
|
229
|
-
this._detectPopupSize();
|
230
|
-
this.popover.focus();
|
231
|
-
if (this.displayItems.length == 0) {
|
232
|
-
this._forceFocus = true;
|
233
|
-
this._fetchData();
|
234
|
-
}
|
235
|
-
else {
|
236
|
-
this._focusSelectedItem();
|
237
|
-
}
|
238
|
-
this._focusSearchBox();
|
239
|
-
}
|
240
|
-
_handlePopupOnClosed(e) {
|
241
|
-
this.focus();
|
242
|
-
}
|
243
|
-
_focusSearchBox() {
|
244
|
-
if (this._searchBox && (!this._isActionSheet || this._searchBox.value)) {
|
245
|
-
this._searchBox.focus();
|
246
|
-
}
|
43
|
+
get dataSource() {
|
44
|
+
return this._dataSource;
|
247
45
|
}
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
let next = (sign == 1 ? itemDiv.nextElementSibling : itemDiv.previousElementSibling);
|
253
|
-
if (next) {
|
254
|
-
this._focusItemElement(next);
|
46
|
+
set dataSource(v) {
|
47
|
+
this._dataSource = v;
|
48
|
+
if (Array.isArray(v)) {
|
49
|
+
this._listDataSource = convertArrayToDataSource(v, { key: this.valueField, pageSize: 10 });
|
255
50
|
}
|
256
51
|
else {
|
257
|
-
|
258
|
-
if (parent) {
|
259
|
-
const lis = (sign == 1 ? parent.nextElementSibling : parent.previousElementSibling)?.querySelectorAll('li');
|
260
|
-
const a = sign == 1 ? first(lis) : last(lis);
|
261
|
-
if (a) {
|
262
|
-
this._focusItemElement(a);
|
263
|
-
}
|
264
|
-
}
|
52
|
+
this._listDataSource = this.dataSource;
|
265
53
|
}
|
266
54
|
}
|
267
|
-
|
268
|
-
|
269
|
-
const list = this.listContainer.nativeElement;
|
270
|
-
const fn = (s) => list.querySelector(s);
|
271
|
-
const itemDiv = fn(`.ax-list-item.ax-state-selected`) || fn(`.ax-list-item`);
|
272
|
-
if (itemDiv) {
|
273
|
-
this._focusItemElement(itemDiv);
|
274
|
-
}
|
275
|
-
});
|
276
|
-
}
|
277
|
-
_focusItemElement(el) {
|
278
|
-
this._zone.runOutsideAngular(() => {
|
279
|
-
const list = this.listContainer.nativeElement;
|
280
|
-
list.querySelectorAll('.ax-list-item').forEach((c) => {
|
281
|
-
if (c == el) {
|
282
|
-
c.classList.add('ax-state-focus');
|
283
|
-
el.scrollIntoView({ behavior: 'auto' });
|
284
|
-
}
|
285
|
-
else {
|
286
|
-
c.classList.remove('ax-state-focus');
|
287
|
-
}
|
288
|
-
});
|
289
|
-
if (!this._isActionSheet && this._searchBox)
|
290
|
-
this._searchBox.focus();
|
291
|
-
else
|
292
|
-
el.focus();
|
293
|
-
});
|
294
|
-
}
|
295
|
-
_selectedItemByNav(sign) {
|
296
|
-
const _last = last(this.selectedItems);
|
297
|
-
let i = 0;
|
298
|
-
if (_last) {
|
299
|
-
i = findLastIndex(this.flatItems, [this.valueField, _last[this.valueField]]);
|
300
|
-
}
|
301
|
-
i += sign;
|
302
|
-
let next = nth(this.flatItems, i);
|
303
|
-
while (next?.children && next?.children.length) {
|
304
|
-
i += sign;
|
305
|
-
next = nth(this.flatItems, i);
|
306
|
-
}
|
307
|
-
if (next) {
|
308
|
-
this.selectItems(next);
|
309
|
-
}
|
310
|
-
else if (next == null && sign == 1) {
|
311
|
-
this._fetchData();
|
312
|
-
}
|
313
|
-
}
|
314
|
-
search(exp) {
|
315
|
-
this.empty();
|
316
|
-
this._forceFocus = true;
|
317
|
-
this._fetchData();
|
318
|
-
}
|
319
|
-
_fetchData() {
|
320
|
-
super._fetchData({ searchQuery: this._searchBox?.value });
|
321
|
-
}
|
322
|
-
get __hostClass() {
|
323
|
-
return `ax-editor-container ax-drop-down ax-look-solid`;
|
324
|
-
}
|
325
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXSelectBoxComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i1.AXPlatform }], target: i0.ɵɵFactoryTarget.Component }); }
|
326
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.9", type: AXSelectBoxComponent, selector: "ax-select-box", inputs: { isOpen: "isOpen", fitParent: "fitParent", dropdownWidth: "dropdownWidth", position: "position", disabled: "disabled", tabIndex: "tabIndex", allowNull: "allowNull", value: "value", name: "name", checked: "checked", placeholder: "placeholder", maxLength: "maxLength", type: "type", autoComplete: "autoComplete", readonly: "readonly", pageSize: "pageSize", items: "items", valueField: "valueField", textField: "textField", disabledField: "disabledField", disabledCallback: "disabledCallback", multiple: "multiple", selectionMode: "selectionMode", clearButton: "clearButton", checkbox: "checkbox" }, outputs: { onOpened: "onOpened", onClosed: "onClosed", onBlur: "onBlur", onFocus: "onFocus", valueChange: "valueChange", onValueChanged: "onValueChanged" }, host: { listeners: { "keydown": "_handleKeydown($event)" }, properties: { "class": "this.__hostClass" } }, providers: [
|
327
|
-
{ provide: AXClosbaleComponent, useExisting: AXSelectBoxComponent },
|
328
|
-
{ provide: AXSearchableComponent, useExisting: AXSelectBoxComponent },
|
329
|
-
{ provide: AXValuableComponent, useExisting: AXSelectBoxComponent },
|
330
|
-
], queries: [{ propertyName: "_searchBox", first: true, predicate: AXSearchBoxComponent, descendants: true, static: true }, { propertyName: "_contentEmptyTemplate", first: true, predicate: ["emptyTemplate"], descendants: true }], viewQueries: [{ propertyName: "popover", first: true, predicate: AXPopoverComponent, descendants: true, static: true }, { propertyName: "listContainer", first: true, predicate: ["listContainer"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-prefix\"> </ng-content>\n<div class=\"ax-dropdown-content\" [class.ax-state-disabled]=\"disabled\" (click)=\"_handleInputClickEvent($event)\">\n <div class=\"ax-select-box-selection\" [tabindex]=\"tabIndex\" (focus)=\"_emitOnFocusEvent($event)\"\n (blur)=\"_emitOnBlurEvent($event)\">\n <ng-container *ngIf=\"selectedItems && selectedItems.length; else showPlaceholder\">\n <ng-container *ngIf=\"!multiple; then singleSelectedTemplate; else multipleSelectedTemplate\"></ng-container>\n <ng-template #singleSelectedTemplate>\n <ng-container *ngFor=\"let item of selectedItems\">\n <span> {{ _getItemDisplayTextTemplte(item) }}</span>\n </ng-container>\n </ng-template>\n <ng-template #multipleSelectedTemplate>\n <div class=\"ax-select-box-multi-selection\">\n <ng-container *ngFor=\"let item of selectedItems\">\n <div class=\"ax-select-multi-item\">\n {{ _getItemDisplayTextTemplte(item) }}\n <span class=\"ax-icon ax-icon-close\" (click)=\"_handleBadgeRemove($event, item)\"> </span>\n </div>\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n <ng-template #showPlaceholder>\n <div class=\"ax-placeholder\" role=\"textbox\" area-readonly=\"true\">\n {{ placeholder }}\n </div>\n </ng-template>\n </div>\n</div>\n<button type=\"button\" class=\"ax-general-button ax-button-icon\" (click)=\"clear()\" [tabIndex]=\"-1\"\n *ngIf=\"value && clearButton && !(disabled || readonly)\">\n <span class=\"ax-icon ax-icon-close\"></span>\n</button>\n<button type=\"button\" [disabled]=\"disabled\" [tabIndex]=\"-1\" class=\"ax-general-button ax-button-icon\"\n (click)=\"_handleArrowClickEvent($event)\">\n <ng-container *ngIf=\"isLoading && !this.popover.isOpen; else iconTemplate\">\n <ax-loading type=\"spinner\"></ax-loading>\n </ng-container>\n <ng-template #iconTemplate>\n <span class=\"ax-icon ax-icon-chevron-left ax-arrow-button\" [ngClass]=\"{\n '-rotation-90': !isOpen,\n 'rotation-90': isOpen\n }\"></span>\n </ng-template>\n</button>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n<ng-content select=\"ax-suffix\"> </ng-content>\n<ax-popover [target]=\"_target\" [placement]=\"position\" [openOn]=\"'manual'\" [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\" (onOpened)=\"_handlePopupOnOpened($event)\" (onClosed)=\"_handlePopupOnClosed($event)\">\n <div class=\"ax-overlay-pane\" (keydown)=\"_handlePopoverKeydown($event)\" tabindex=\"0\" aria-modal=\"true\" cdkTrapFocus\n [class.ax-overlay-actionsheet]=\"_isActionSheet\" [class.ax-full]=\"_searchBox || isLazy\"\n [style.min-width.px]=\"_popoverWidth\">\n <div class=\"ax-list\">\n <ax-header *ngIf=\"_isActionSheet\">\n <ax-title>{{ _popoverTitle }}</ax-title>\n <ax-close-button class=\"ax-icon\"\n [icon]=\"multiple ? 'ax-icon-done !ax-text-primary-500' : 'ax-icon-close'\"></ax-close-button>\n </ax-header>\n <div class=\"ax-search-box-container\" [class.ax-state-hidden]=\"!_searchBox\" [cdkTrapFocus]=\"_searchBox != null\">\n <ng-content select=\"ax-search-box\"></ng-content>\n </div>\n <div class=\"ax-content ax-list-items-container ax-default\" (scroll)=\"_handleListScroll($event)\" #listContainer>\n <ng-container *ngIf=\"displayItems.length; else tmpEmpty\">\n <ul>\n <ng-container *ngTemplateOutlet=\"tmpTree; context: { list: displayItems }\"> </ng-container>\n <ng-template #tmpTree let-list=\"list\">\n <ng-container *ngFor=\"let item of list; let i = index; trackBy: _trackByFunction\">\n <ng-container *ngIf=\"itemTemplate; else defualtTemplate\">\n <li class=\"ax-list-item\" (click)=\"_handleOnItemClick($event, item)\"\n [attr.data-id]=\"item[this.valueField]\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item, direction: direction }\">\n </ng-container>\n </li>\n </ng-container>\n <ng-template #defualtTemplate>\n <ng-container *ngIf=\"item.children?.length > 0; else tmpItem\">\n <li class=\"ax-list-item-group\" [attr.data-id]=\"item[this.valueField]\">\n <span> {{ _getItemDisplayTextTemplte(item) }}</span>\n <ul *ngIf=\"item.children?.length > 0\">\n <ng-container *ngTemplateOutlet=\"tmpTree; context: { list: item.children }\">\n </ng-container>\n </ul>\n </li>\n </ng-container>\n <ng-template #tmpItem>\n <ng-container *ngIf=\"!multiple; else multipleTemplate\">\n <li class=\"ax-list-item\" [class.ax-state-selected]=\"isItemSelected(item)\"\n [class.ax-state-disabled]=\"isItemDisabled(item)\" [attr.tabindex]=\"i\"\n (click)=\"_handleOnItemClick($event, item)\" [attr.data-id]=\"item[this.valueField]\">\n <span> {{ _getItemDisplayTextTemplte(item) }}</span>\n <span class=\"ax-icon ax-icon-done ax-selected-icon\" *ngIf=\"isItemSelected(item)\"></span>\n </li>\n </ng-container>\n <ng-template #multipleTemplate>\n <li class=\"ax-list-item\" [class.ax-state-selected]=\"isItemSelected(item)\"\n [class.ax-state-disabled]=\"isItemDisabled(item)\" [class.ax-state-checkbox]=\"checkbox\"\n [attr.tabindex]=\"i\" (click)=\"_handleOnItemClick($event, item)\"\n [attr.data-id]=\"item[this.valueField]\">\n <span>\n <input class=\"ax-checkbox\" type=\"checkbox\" [class.ax-state-disabled]=\"isItemDisabled(item)\"\n *ngIf=\"checkbox\" [checked]=\"isItemSelected(item)\" [disabled]=\"isItemDisabled(item)\" />\n <span class=\"ax-checkbox-label\">{{ _getItemDisplayTextTemplte(item) }}</span>\n </span>\n <span class=\"ax-icon ax-icon-done ax-selected-icon\"\n *ngIf=\"isItemSelected(item) && !checkbox\"></span>\n </li>\n </ng-template>\n </ng-template>\n </ng-template>\n </ng-container>\n </ng-template>\n </ul>\n </ng-container>\n <ng-container *ngIf=\"isLoading\">\n <ng-container *ngIf=\"loadingTemplate; else elseLoadingTemplate\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate\"> </ng-container>\n </ng-container>\n <ng-template #elseLoadingTemplate>\n <div class=\"ax-flex ax-items-center ax-justify-center ax-p-4\">\n <ax-loading [context]=\"_loadingOptions\"></ax-loading>\n </div>\n </ng-template>\n </ng-container>\n <ng-template #tmpEmpty>\n <ng-container *ngIf=\"!isLoading\">\n <ng-container *ngIf=\"emptyTemplate; else elseEmptyTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyTemplate\"> </ng-container>\n </ng-container>\n <ng-template #elseEmptyTemplate>\n <div class=\"ax-flex ax-items-center ax-justify-center ax-p-4\" [innerHTML]=\"\n 'common.no-result-for'\n | trans\n : {\n exp: this._searchBox ? this._searchBox.value : ''\n }\n \"></div>\n </ng-template>\n </ng-container>\n </ng-template>\n </div>\n <!-- <div class=\"ax-list-items-container ax-vertical ax-default\" [class.ax-full]=\"_isMobile\"\n >\n \n </div> -->\n <!-- <div class=\"ax-footer\">footer</div> -->\n </div>\n </div>\n</ax-popover>", styles: ["ax-select-box .ax-select-multi-item{display:flex;align-items:center;padding:.25rem .5rem;background-color:rgba(var(--ax-color-on-surface));color:rgba(var(--ax-color-text-default));border-radius:var(--ax-rounded-border-default);margin-inline-end:.5rem}ax-select-box .ax-select-multi-item .ax-icon-close{cursor:pointer;margin-inline-start:.5rem}ax-select-box .ax-select-box-selection{display:flex;justify-content:center;align-items:center;outline-color:transparent;outline:transparent;-webkit-user-select:none;user-select:none}ax-select-box .ax-select-box-selection>span{padding-inline-start:1rem;padding-inline-end:.75rem;white-space:nowrap}ax-select-box .ax-select-box-selection .ax-selectbox-input{opacity:0;width:0}ax-select-box .ax-select-box-multi-selection{display:flex;justify-content:center;flex-wrap:wrap;gap:.25rem;padding:.25rem}ax-select-box .ax-placeholder{padding-inline-start:1rem;padding-inline-end:.75rem}ax-select-box .ax-general-button .ax-arrow-button{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}ax-select-box .ax-general-button .ax-arrow-button.-rotation-90{transform:rotate(-90deg)}ax-select-box .ax-general-button .ax-arrow-button.rotation-90{transform:rotate(90deg)}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title , ax-sub-title" }, { kind: "component", type: i4.AXPopoverComponent, selector: "ax-popover", inputs: ["offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "component", type: i5.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "directive", type: i6.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "pipe", type: i7.AXTranslatorPipe, name: "trans" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
331
|
-
}
|
332
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXSelectBoxComponent, decorators: [{
|
333
|
-
type: Component,
|
334
|
-
args: [{ selector: 'ax-select-box', inputs: [
|
335
|
-
'isOpen',
|
336
|
-
'fitParent',
|
337
|
-
'dropdownWidth',
|
338
|
-
'position',
|
339
|
-
'disabled',
|
340
|
-
'tabIndex',
|
341
|
-
'allowNull',
|
342
|
-
'value',
|
343
|
-
'name',
|
344
|
-
'checked',
|
345
|
-
'placeholder',
|
346
|
-
'maxLength',
|
347
|
-
'type',
|
348
|
-
'autoComplete',
|
349
|
-
'readonly',
|
350
|
-
'pageSize',
|
351
|
-
'items',
|
352
|
-
'valueField',
|
353
|
-
'textField',
|
354
|
-
'disabledField',
|
355
|
-
'disabledCallback',
|
356
|
-
'multiple',
|
357
|
-
'selectionMode',
|
358
|
-
], outputs: ['onOpened', 'onClosed', 'onBlur', 'onFocus', 'valueChange', 'onValueChanged'], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
359
|
-
{ provide: AXClosbaleComponent, useExisting: AXSelectBoxComponent },
|
360
|
-
{ provide: AXSearchableComponent, useExisting: AXSelectBoxComponent },
|
361
|
-
{ provide: AXValuableComponent, useExisting: AXSelectBoxComponent },
|
362
|
-
], template: "<ng-content select=\"ax-prefix\"> </ng-content>\n<div class=\"ax-dropdown-content\" [class.ax-state-disabled]=\"disabled\" (click)=\"_handleInputClickEvent($event)\">\n <div class=\"ax-select-box-selection\" [tabindex]=\"tabIndex\" (focus)=\"_emitOnFocusEvent($event)\"\n (blur)=\"_emitOnBlurEvent($event)\">\n <ng-container *ngIf=\"selectedItems && selectedItems.length; else showPlaceholder\">\n <ng-container *ngIf=\"!multiple; then singleSelectedTemplate; else multipleSelectedTemplate\"></ng-container>\n <ng-template #singleSelectedTemplate>\n <ng-container *ngFor=\"let item of selectedItems\">\n <span> {{ _getItemDisplayTextTemplte(item) }}</span>\n </ng-container>\n </ng-template>\n <ng-template #multipleSelectedTemplate>\n <div class=\"ax-select-box-multi-selection\">\n <ng-container *ngFor=\"let item of selectedItems\">\n <div class=\"ax-select-multi-item\">\n {{ _getItemDisplayTextTemplte(item) }}\n <span class=\"ax-icon ax-icon-close\" (click)=\"_handleBadgeRemove($event, item)\"> </span>\n </div>\n </ng-container>\n </div>\n </ng-template>\n </ng-container>\n <ng-template #showPlaceholder>\n <div class=\"ax-placeholder\" role=\"textbox\" area-readonly=\"true\">\n {{ placeholder }}\n </div>\n </ng-template>\n </div>\n</div>\n<button type=\"button\" class=\"ax-general-button ax-button-icon\" (click)=\"clear()\" [tabIndex]=\"-1\"\n *ngIf=\"value && clearButton && !(disabled || readonly)\">\n <span class=\"ax-icon ax-icon-close\"></span>\n</button>\n<button type=\"button\" [disabled]=\"disabled\" [tabIndex]=\"-1\" class=\"ax-general-button ax-button-icon\"\n (click)=\"_handleArrowClickEvent($event)\">\n <ng-container *ngIf=\"isLoading && !this.popover.isOpen; else iconTemplate\">\n <ax-loading type=\"spinner\"></ax-loading>\n </ng-container>\n <ng-template #iconTemplate>\n <span class=\"ax-icon ax-icon-chevron-left ax-arrow-button\" [ngClass]=\"{\n '-rotation-90': !isOpen,\n 'rotation-90': isOpen\n }\"></span>\n </ng-template>\n</button>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n<ng-content select=\"ax-suffix\"> </ng-content>\n<ax-popover [target]=\"_target\" [placement]=\"position\" [openOn]=\"'manual'\" [closeOn]=\"'clickOut'\"\n [adaptivityEnabled]=\"true\" (onOpened)=\"_handlePopupOnOpened($event)\" (onClosed)=\"_handlePopupOnClosed($event)\">\n <div class=\"ax-overlay-pane\" (keydown)=\"_handlePopoverKeydown($event)\" tabindex=\"0\" aria-modal=\"true\" cdkTrapFocus\n [class.ax-overlay-actionsheet]=\"_isActionSheet\" [class.ax-full]=\"_searchBox || isLazy\"\n [style.min-width.px]=\"_popoverWidth\">\n <div class=\"ax-list\">\n <ax-header *ngIf=\"_isActionSheet\">\n <ax-title>{{ _popoverTitle }}</ax-title>\n <ax-close-button class=\"ax-icon\"\n [icon]=\"multiple ? 'ax-icon-done !ax-text-primary-500' : 'ax-icon-close'\"></ax-close-button>\n </ax-header>\n <div class=\"ax-search-box-container\" [class.ax-state-hidden]=\"!_searchBox\" [cdkTrapFocus]=\"_searchBox != null\">\n <ng-content select=\"ax-search-box\"></ng-content>\n </div>\n <div class=\"ax-content ax-list-items-container ax-default\" (scroll)=\"_handleListScroll($event)\" #listContainer>\n <ng-container *ngIf=\"displayItems.length; else tmpEmpty\">\n <ul>\n <ng-container *ngTemplateOutlet=\"tmpTree; context: { list: displayItems }\"> </ng-container>\n <ng-template #tmpTree let-list=\"list\">\n <ng-container *ngFor=\"let item of list; let i = index; trackBy: _trackByFunction\">\n <ng-container *ngIf=\"itemTemplate; else defualtTemplate\">\n <li class=\"ax-list-item\" (click)=\"_handleOnItemClick($event, item)\"\n [attr.data-id]=\"item[this.valueField]\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item, direction: direction }\">\n </ng-container>\n </li>\n </ng-container>\n <ng-template #defualtTemplate>\n <ng-container *ngIf=\"item.children?.length > 0; else tmpItem\">\n <li class=\"ax-list-item-group\" [attr.data-id]=\"item[this.valueField]\">\n <span> {{ _getItemDisplayTextTemplte(item) }}</span>\n <ul *ngIf=\"item.children?.length > 0\">\n <ng-container *ngTemplateOutlet=\"tmpTree; context: { list: item.children }\">\n </ng-container>\n </ul>\n </li>\n </ng-container>\n <ng-template #tmpItem>\n <ng-container *ngIf=\"!multiple; else multipleTemplate\">\n <li class=\"ax-list-item\" [class.ax-state-selected]=\"isItemSelected(item)\"\n [class.ax-state-disabled]=\"isItemDisabled(item)\" [attr.tabindex]=\"i\"\n (click)=\"_handleOnItemClick($event, item)\" [attr.data-id]=\"item[this.valueField]\">\n <span> {{ _getItemDisplayTextTemplte(item) }}</span>\n <span class=\"ax-icon ax-icon-done ax-selected-icon\" *ngIf=\"isItemSelected(item)\"></span>\n </li>\n </ng-container>\n <ng-template #multipleTemplate>\n <li class=\"ax-list-item\" [class.ax-state-selected]=\"isItemSelected(item)\"\n [class.ax-state-disabled]=\"isItemDisabled(item)\" [class.ax-state-checkbox]=\"checkbox\"\n [attr.tabindex]=\"i\" (click)=\"_handleOnItemClick($event, item)\"\n [attr.data-id]=\"item[this.valueField]\">\n <span>\n <input class=\"ax-checkbox\" type=\"checkbox\" [class.ax-state-disabled]=\"isItemDisabled(item)\"\n *ngIf=\"checkbox\" [checked]=\"isItemSelected(item)\" [disabled]=\"isItemDisabled(item)\" />\n <span class=\"ax-checkbox-label\">{{ _getItemDisplayTextTemplte(item) }}</span>\n </span>\n <span class=\"ax-icon ax-icon-done ax-selected-icon\"\n *ngIf=\"isItemSelected(item) && !checkbox\"></span>\n </li>\n </ng-template>\n </ng-template>\n </ng-template>\n </ng-container>\n </ng-template>\n </ul>\n </ng-container>\n <ng-container *ngIf=\"isLoading\">\n <ng-container *ngIf=\"loadingTemplate; else elseLoadingTemplate\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate\"> </ng-container>\n </ng-container>\n <ng-template #elseLoadingTemplate>\n <div class=\"ax-flex ax-items-center ax-justify-center ax-p-4\">\n <ax-loading [context]=\"_loadingOptions\"></ax-loading>\n </div>\n </ng-template>\n </ng-container>\n <ng-template #tmpEmpty>\n <ng-container *ngIf=\"!isLoading\">\n <ng-container *ngIf=\"emptyTemplate; else elseEmptyTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyTemplate\"> </ng-container>\n </ng-container>\n <ng-template #elseEmptyTemplate>\n <div class=\"ax-flex ax-items-center ax-justify-center ax-p-4\" [innerHTML]=\"\n 'common.no-result-for'\n | trans\n : {\n exp: this._searchBox ? this._searchBox.value : ''\n }\n \"></div>\n </ng-template>\n </ng-container>\n </ng-template>\n </div>\n <!-- <div class=\"ax-list-items-container ax-vertical ax-default\" [class.ax-full]=\"_isMobile\"\n >\n \n </div> -->\n <!-- <div class=\"ax-footer\">footer</div> -->\n </div>\n </div>\n</ax-popover>", styles: ["ax-select-box .ax-select-multi-item{display:flex;align-items:center;padding:.25rem .5rem;background-color:rgba(var(--ax-color-on-surface));color:rgba(var(--ax-color-text-default));border-radius:var(--ax-rounded-border-default);margin-inline-end:.5rem}ax-select-box .ax-select-multi-item .ax-icon-close{cursor:pointer;margin-inline-start:.5rem}ax-select-box .ax-select-box-selection{display:flex;justify-content:center;align-items:center;outline-color:transparent;outline:transparent;-webkit-user-select:none;user-select:none}ax-select-box .ax-select-box-selection>span{padding-inline-start:1rem;padding-inline-end:.75rem;white-space:nowrap}ax-select-box .ax-select-box-selection .ax-selectbox-input{opacity:0;width:0}ax-select-box .ax-select-box-multi-selection{display:flex;justify-content:center;flex-wrap:wrap;gap:.25rem;padding:.25rem}ax-select-box .ax-placeholder{padding-inline-start:1rem;padding-inline-end:.75rem}ax-select-box .ax-general-button .ax-arrow-button{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}ax-select-box .ax-general-button .ax-arrow-button.-rotation-90{transform:rotate(-90deg)}ax-select-box .ax-general-button .ax-arrow-button.rotation-90{transform:rotate(90deg)}\n"] }]
|
363
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1.AXPlatform }]; }, propDecorators: { popover: [{
|
364
|
-
type: ViewChild,
|
365
|
-
args: [AXPopoverComponent, { static: true }]
|
366
|
-
}], _searchBox: [{
|
367
|
-
type: ContentChild,
|
368
|
-
args: [AXSearchBoxComponent, { static: true }]
|
369
|
-
}], clearButton: [{
|
370
|
-
type: Input
|
371
|
-
}], checkbox: [{
|
372
|
-
type: Input
|
373
|
-
}], listContainer: [{
|
374
|
-
type: ViewChild,
|
375
|
-
args: ['listContainer', { static: true }]
|
376
|
-
}], _contentEmptyTemplate: [{
|
377
|
-
type: ContentChild,
|
378
|
-
args: ['emptyTemplate']
|
379
|
-
}], _handleKeydown: [{
|
380
|
-
type: HostListener,
|
381
|
-
args: ['keydown', ['$event']]
|
382
|
-
}], __hostClass: [{
|
383
|
-
type: HostBinding,
|
384
|
-
args: ['class']
|
385
|
-
}] } });
|
386
|
-
|
387
|
-
/**
|
388
|
-
* The Button is a component which detects user interaction and triggers a corresponding event
|
389
|
-
*
|
390
|
-
* @category Components
|
391
|
-
*/
|
392
|
-
class AXSelectBox2Component extends classes(MXDropdownBoxBaseComponent, MXSelectionValueComponent, MXLookComponent) {
|
393
|
-
constructor() {
|
394
|
-
super(...arguments);
|
395
|
-
this.isLoading = false;
|
396
|
-
this.renderList = false;
|
397
|
-
//_dataSource:AXDate
|
398
|
-
this.source = [];
|
399
|
-
this.autoHeight = false;
|
400
|
-
this.platform = inject(AXPlatform);
|
401
|
-
}
|
402
|
-
ngOnInit() {
|
55
|
+
ngAfterViewInit() {
|
56
|
+
super.ngAfterViewInit();
|
403
57
|
this.setDropdownSize();
|
404
58
|
}
|
405
59
|
getItemByKey(key) {
|
406
|
-
return
|
60
|
+
return this._listDataSource.find(key);
|
407
61
|
}
|
408
62
|
_handleOnOpenedEvent() {
|
409
63
|
this.renderList = true;
|
410
64
|
this.list?.render();
|
411
65
|
setTimeout(() => {
|
412
66
|
this.list?.focus();
|
413
|
-
}
|
67
|
+
});
|
414
68
|
}
|
415
69
|
_handleOnClosedEvent() {
|
416
70
|
//this.input.focus();
|
417
71
|
}
|
418
72
|
_handleBadgeRemove(e, item) {
|
419
73
|
this.unselectItems(item);
|
74
|
+
e.stopPropagation();
|
420
75
|
}
|
421
76
|
_handleOnDataLoad(items) {
|
422
77
|
this.setDropdownSize(items.length);
|
423
78
|
}
|
424
79
|
_handleValueChanged(e) {
|
425
|
-
if (e.isUserInteraction)
|
426
|
-
this.commitValue(e.
|
80
|
+
if (e.isUserInteraction) {
|
81
|
+
this.commitValue(e.component.selectedItems, true);
|
82
|
+
}
|
83
|
+
;
|
427
84
|
}
|
428
85
|
internalValueChanged() {
|
429
86
|
if (!this.multiple)
|
@@ -434,16 +91,24 @@ class AXSelectBox2Component extends classes(MXDropdownBoxBaseComponent, MXSelect
|
|
434
91
|
}
|
435
92
|
detectAutoHeight() {
|
436
93
|
const containerWidth = this.getHostElement().querySelector('.ax-select-box-selection').clientWidth;
|
437
|
-
const itemsWidth = Array.from(this.getHostElement().querySelectorAll('.ax-
|
94
|
+
const itemsWidth = Array.from(this.getHostElement().querySelectorAll('.ax-selected-token')).reduce((a, i) => a + i.clientWidth, 0);
|
438
95
|
this.autoHeight = containerWidth - itemsWidth <= 8;
|
439
96
|
this.dropdown.updatePosition();
|
440
97
|
this.cdr.markForCheck();
|
441
98
|
}
|
442
99
|
setDropdownSize(count = 0) {
|
443
|
-
this.
|
444
|
-
|
445
|
-
|
446
|
-
|
100
|
+
if (this.dropdown.isActionsheetStyle) {
|
101
|
+
this.dropdownSizes = {
|
102
|
+
width: '100%',
|
103
|
+
height: ['auto', '0px'].includes(this.dropdownSizes.height) ? `${Math.min(15, count) * 40}px` : this.dropdownSizes.height,
|
104
|
+
};
|
105
|
+
}
|
106
|
+
else {
|
107
|
+
this.dropdownSizes = {
|
108
|
+
width: `${this.getHostElement().offsetWidth}px`,
|
109
|
+
height: count == 0 ? 'auto' : `${Math.min(5, count) * 40}px`,
|
110
|
+
};
|
111
|
+
}
|
447
112
|
}
|
448
113
|
_handleKeydown(e) {
|
449
114
|
if (e.code === 'ArrowDown' || e.code === 'ArrowUp') {
|
@@ -467,8 +132,8 @@ class AXSelectBox2Component extends classes(MXDropdownBoxBaseComponent, MXSelect
|
|
467
132
|
// }
|
468
133
|
}
|
469
134
|
selectItemByNav(sign) {
|
470
|
-
if (Array.isArray(this.
|
471
|
-
const items = this.normalizeItemsList(this.
|
135
|
+
if (Array.isArray(this.dataSource) && !this.multiple) {
|
136
|
+
const items = this.normalizeItemsList(this.dataSource);
|
472
137
|
const _last = last(this.selectedItems);
|
473
138
|
let i = -1;
|
474
139
|
if (_last) {
|
@@ -487,25 +152,33 @@ class AXSelectBox2Component extends classes(MXDropdownBoxBaseComponent, MXSelect
|
|
487
152
|
}
|
488
153
|
}
|
489
154
|
search(term) {
|
490
|
-
|
155
|
+
if (term) {
|
156
|
+
const q = {};
|
157
|
+
q[this.textField] = term;
|
158
|
+
this._listDataSource.filter(q);
|
159
|
+
}
|
160
|
+
else {
|
161
|
+
this._listDataSource.filter();
|
162
|
+
}
|
491
163
|
}
|
492
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type:
|
493
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.9", type:
|
494
|
-
{ provide: AXComponent, useExisting:
|
495
|
-
{ provide: AXFocusableComponent, useExisting:
|
496
|
-
{ provide: AXValuableComponent, useExisting:
|
497
|
-
{ provide: AXClearableComponent, useExisting:
|
498
|
-
{ provide:
|
164
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXSelectBoxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
165
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.9", type: AXSelectBoxComponent, selector: "ax-select-box", inputs: { disabled: "disabled", readonly: "readonly", tabIndex: "tabIndex", placeholder: "placeholder", minValue: "minValue", maxValue: "maxValue", value: "value", state: "state", name: "name", id: "id", type: "type", look: "look", multiple: "multiple", valueField: "valueField", textField: "textField", dataSource: "dataSource", itemTemplate: "itemTemplate", emptyTemplate: "emptyTemplate", loadingTemplate: "loadingTemplate" }, outputs: { valueChange: "valueChange", stateChange: "stateChange", onValueChanged: "onValueChanged", onBlur: "onBlur", onFocus: "onFocus", readonlyChange: "readonlyChange", disabledChange: "disabledChange" }, host: { listeners: { "keydown": "_handleKeydown($event)" } }, providers: [
|
166
|
+
{ provide: AXComponent, useExisting: AXSelectBoxComponent },
|
167
|
+
{ provide: AXFocusableComponent, useExisting: AXSelectBoxComponent },
|
168
|
+
{ provide: AXValuableComponent, useExisting: AXSelectBoxComponent },
|
169
|
+
{ provide: AXClearableComponent, useExisting: AXSelectBoxComponent },
|
170
|
+
{ provide: AXClosbaleComponent, useExisting: AXSelectBoxComponent },
|
171
|
+
{ provide: AXSearchableComponent, useExisting: AXSelectBoxComponent },
|
499
172
|
{
|
500
173
|
provide: NG_VALUE_ACCESSOR,
|
501
|
-
useExisting: forwardRef(() =>
|
174
|
+
useExisting: forwardRef(() => AXSelectBoxComponent),
|
502
175
|
multi: true,
|
503
176
|
},
|
504
|
-
], viewQueries: [{ propertyName: "list", first: true, predicate: AXListComponent, descendants: true }, { propertyName: "dropdown", first: true, predicate: AXDropdownBoxComponent, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ax-dropdown-box
|
177
|
+
], queries: [{ propertyName: "searchBox", first: true, predicate: AXSearchBoxComponent, descendants: true, static: true }], viewQueries: [{ propertyName: "list", first: true, predicate: AXListComponent, descendants: true }, { propertyName: "dropdown", first: true, predicate: AXDropdownBoxComponent, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ax-dropdown-box\n [disabled]=\"disabled\"\n (onOpened)=\"_handleOnOpenedEvent()\"\n (onClosed)=\"_handleOnClosedEvent()\"\n [look]=\"look\"\n [class.ax-auto-height]=\"autoHeight\"\n>\n <ng-container input>\n <ng-content select=\"ax-prefix\"> </ng-content>\n <div\n class=\"ax-select-box-selection\"\n [class.ax-multiple]=\"multiple\"\n [tabindex]=\"tabIndex\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n (click)=\"toggle()\"\n >\n <div class=\"ax-placeholder\" role=\"textbox\" area-readonly=\"true\" *ngIf=\"selectedItems.length === 0\">\n {{ placeholder }}\n </div>\n <ng-container *ngFor=\"let item of selectedItems\">\n <div class=\"ax-selected-token\">\n {{ getDisplayText(item) }}\n <span class=\"ax-icon ax-icon-close\" (click)=\"_handleBadgeRemove($event, item)\" *ngIf=\"multiple\">\n </span>\n </div>\n </ng-container>\n </div>\n <ng-content select=\" ax-clear-button\"></ng-content>\n <button\n type=\"button\"\n [disabled]=\"disabled\"\n [tabIndex]=\"-1\"\n class=\"ax-general-button ax-button-icon\"\n (click)=\"toggle()\"\n >\n <ng-container *ngIf=\"isLoading && !isOpen; else iconTemplate\">\n <ax-loading type=\"spinner\"></ax-loading>\n </ng-container>\n <ng-template #iconTemplate>\n <span\n class=\"ax-icon ax-icon-chevron-left ax-arrow-button\"\n [ngClass]=\"{\n '-rotation-90': !isOpen,\n 'rotation-90': isOpen\n }\"\n ></span>\n </ng-template>\n </button>\n <ng-content select=\"ax-suffix\"> </ng-content>\n <ng-template #search>\n <ng-content select=\"ax-search-box\"> </ng-content>\n </ng-template>\n </ng-container>\n <ng-container panel>\n <div class=\"ax-select-box-panel\">\n <ax-header class=\"ax-solid\" *ngIf=\"dropdown.isActionsheetStyle\">\n <ax-title>{{ placeholder }}</ax-title>\n <ax-close-button\n [icon]=\"multiple ? 'ax-icon ax-icon-done !ax-text-primary-500' : 'ax-icon ax-icon-close'\"\n ></ax-close-button>\n </ax-header>\n <div class=\"ax-search-container\" *ngIf=\"searchBox\">\n <ng-template [ngTemplateOutlet]=\"search\"></ng-template>\n </div>\n <ax-list\n *ngIf=\"renderList\"\n [dataSource]=\"_listDataSource\"\n [multiple]=\"multiple\"\n [style.width]=\"dropdownSizes.width\"\n [style.height]=\"dropdownSizes.height\"\n [valueField]=\"valueField\"\n [textField]=\"textField\"\n [emptyTemplate]=\"emptyTemplate ?? empty\"\n [itemTemplate]=\"itemTemplate\"\n [loadingTemplate]=\"loadingTemplate\"\n [ngModel]=\"value\"\n (onValueChanged)=\"_handleValueChanged($event)\"\n (onDataLoad)=\"_handleOnDataLoad($event)\"\n [selectionMode]=\"'item'\"\n >\n <ng-template #empty> No Items! </ng-template>\n </ax-list>\n <ng-content select=\"ax-footer\"> </ng-content>\n </div>\n </ng-container>\n</ax-dropdown-box>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n", styles: ["ax-select-box ax-dropdown-box.ax-auto-height{height:auto!important}ax-select-box .ax-editor-container.ax-look-fill .ax-selected-token{background-color:rgba(var(--ax-color-surface))!important}ax-select-box .ax-selected-token{display:flex;align-items:center;padding:.25rem .5rem;color:rgba(var(--ax-color-text-default));border-radius:var(--ax-rounded-border-default)}ax-select-box .ax-selected-token .ax-icon-close{cursor:pointer;margin-inline-start:.5rem}ax-select-box .ax-select-box-selection{display:flex;justify-content:center;align-items:center;outline-color:transparent;outline:transparent;-webkit-user-select:none;user-select:none;cursor:pointer;justify-content:flex-start;flex:1;flex-wrap:wrap;gap:.25rem;padding:.25rem}ax-select-box .ax-select-box-selection>span{padding-inline-start:1rem;padding-inline-end:.75rem;white-space:nowrap}ax-select-box .ax-select-box-selection .ax-selectbox-input{opacity:0;width:0}ax-select-box .ax-select-box-selection.ax-multiple .ax-selected-token{background-color:rgba(var(--ax-color-on-surface))}ax-select-box .ax-placeholder{padding-inline-start:1rem;padding-inline-end:.75rem}ax-select-box .ax-general-button .ax-arrow-button{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}ax-select-box .ax-general-button .ax-arrow-button.-rotation-90{transform:rotate(-90deg)}ax-select-box .ax-general-button .ax-arrow-button.rotation-90{transform:rotate(90deg)}.ax-select-box-panel>ax-header.ax-solid{border-bottom:1px solid;border-color:rgba(var(--ax-color-border-default))}.ax-select-box-panel .ax-search-container{padding:.5rem}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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: "component", type: i3.AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title , ax-sub-title" }, { kind: "component", type: i4.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "component", type: i5.AXDropdownBoxComponent, selector: "ax-dropdown-box", inputs: ["disabled", "look"], outputs: ["disabledChange", "onBlur", "onFocus", "onClick", "onOpened", "onClosed"] }, { kind: "component", type: i6.AXListComponent, selector: "ax-list", inputs: ["id", "name", "disabled", "readonly", "valueField", "textField", "disabledField", "multiple", "selectionMode", "dataSource", "itemHeight", "itemTemplate", "emptyTemplate", "loadingTemplate", "checkbox"], outputs: ["onValueChanged", "disabledChange", "readOnlyChange", "onBlur", "onFocus", "onDataLoad", "onScrolledIndexChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
505
178
|
}
|
506
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type:
|
179
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXSelectBoxComponent, decorators: [{
|
507
180
|
type: Component,
|
508
|
-
args: [{ selector: 'ax-select-
|
181
|
+
args: [{ selector: 'ax-select-box', inputs: [
|
509
182
|
'disabled',
|
510
183
|
'readonly',
|
511
184
|
'tabIndex',
|
@@ -519,6 +192,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImpor
|
|
519
192
|
'type',
|
520
193
|
'look',
|
521
194
|
'multiple',
|
195
|
+
'valueField',
|
196
|
+
'textField',
|
522
197
|
], outputs: [
|
523
198
|
'valueChange',
|
524
199
|
'stateChange',
|
@@ -528,18 +203,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImpor
|
|
528
203
|
'readonlyChange',
|
529
204
|
'disabledChange',
|
530
205
|
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
|
531
|
-
{ provide: AXComponent, useExisting:
|
532
|
-
{ provide: AXFocusableComponent, useExisting:
|
533
|
-
{ provide: AXValuableComponent, useExisting:
|
534
|
-
{ provide: AXClearableComponent, useExisting:
|
535
|
-
{ provide:
|
206
|
+
{ provide: AXComponent, useExisting: AXSelectBoxComponent },
|
207
|
+
{ provide: AXFocusableComponent, useExisting: AXSelectBoxComponent },
|
208
|
+
{ provide: AXValuableComponent, useExisting: AXSelectBoxComponent },
|
209
|
+
{ provide: AXClearableComponent, useExisting: AXSelectBoxComponent },
|
210
|
+
{ provide: AXClosbaleComponent, useExisting: AXSelectBoxComponent },
|
211
|
+
{ provide: AXSearchableComponent, useExisting: AXSelectBoxComponent },
|
536
212
|
{
|
537
213
|
provide: NG_VALUE_ACCESSOR,
|
538
|
-
useExisting: forwardRef(() =>
|
214
|
+
useExisting: forwardRef(() => AXSelectBoxComponent),
|
539
215
|
multi: true,
|
540
216
|
},
|
541
|
-
], template: "<ax-dropdown-box
|
542
|
-
}], propDecorators: {
|
217
|
+
], template: "<ax-dropdown-box\n [disabled]=\"disabled\"\n (onOpened)=\"_handleOnOpenedEvent()\"\n (onClosed)=\"_handleOnClosedEvent()\"\n [look]=\"look\"\n [class.ax-auto-height]=\"autoHeight\"\n>\n <ng-container input>\n <ng-content select=\"ax-prefix\"> </ng-content>\n <div\n class=\"ax-select-box-selection\"\n [class.ax-multiple]=\"multiple\"\n [tabindex]=\"tabIndex\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n (click)=\"toggle()\"\n >\n <div class=\"ax-placeholder\" role=\"textbox\" area-readonly=\"true\" *ngIf=\"selectedItems.length === 0\">\n {{ placeholder }}\n </div>\n <ng-container *ngFor=\"let item of selectedItems\">\n <div class=\"ax-selected-token\">\n {{ getDisplayText(item) }}\n <span class=\"ax-icon ax-icon-close\" (click)=\"_handleBadgeRemove($event, item)\" *ngIf=\"multiple\">\n </span>\n </div>\n </ng-container>\n </div>\n <ng-content select=\" ax-clear-button\"></ng-content>\n <button\n type=\"button\"\n [disabled]=\"disabled\"\n [tabIndex]=\"-1\"\n class=\"ax-general-button ax-button-icon\"\n (click)=\"toggle()\"\n >\n <ng-container *ngIf=\"isLoading && !isOpen; else iconTemplate\">\n <ax-loading type=\"spinner\"></ax-loading>\n </ng-container>\n <ng-template #iconTemplate>\n <span\n class=\"ax-icon ax-icon-chevron-left ax-arrow-button\"\n [ngClass]=\"{\n '-rotation-90': !isOpen,\n 'rotation-90': isOpen\n }\"\n ></span>\n </ng-template>\n </button>\n <ng-content select=\"ax-suffix\"> </ng-content>\n <ng-template #search>\n <ng-content select=\"ax-search-box\"> </ng-content>\n </ng-template>\n </ng-container>\n <ng-container panel>\n <div class=\"ax-select-box-panel\">\n <ax-header class=\"ax-solid\" *ngIf=\"dropdown.isActionsheetStyle\">\n <ax-title>{{ placeholder }}</ax-title>\n <ax-close-button\n [icon]=\"multiple ? 'ax-icon ax-icon-done !ax-text-primary-500' : 'ax-icon ax-icon-close'\"\n ></ax-close-button>\n </ax-header>\n <div class=\"ax-search-container\" *ngIf=\"searchBox\">\n <ng-template [ngTemplateOutlet]=\"search\"></ng-template>\n </div>\n <ax-list\n *ngIf=\"renderList\"\n [dataSource]=\"_listDataSource\"\n [multiple]=\"multiple\"\n [style.width]=\"dropdownSizes.width\"\n [style.height]=\"dropdownSizes.height\"\n [valueField]=\"valueField\"\n [textField]=\"textField\"\n [emptyTemplate]=\"emptyTemplate ?? empty\"\n [itemTemplate]=\"itemTemplate\"\n [loadingTemplate]=\"loadingTemplate\"\n [ngModel]=\"value\"\n (onValueChanged)=\"_handleValueChanged($event)\"\n (onDataLoad)=\"_handleOnDataLoad($event)\"\n [selectionMode]=\"'item'\"\n >\n <ng-template #empty> No Items! </ng-template>\n </ax-list>\n <ng-content select=\"ax-footer\"> </ng-content>\n </div>\n </ng-container>\n</ax-dropdown-box>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n", styles: ["ax-select-box ax-dropdown-box.ax-auto-height{height:auto!important}ax-select-box .ax-editor-container.ax-look-fill .ax-selected-token{background-color:rgba(var(--ax-color-surface))!important}ax-select-box .ax-selected-token{display:flex;align-items:center;padding:.25rem .5rem;color:rgba(var(--ax-color-text-default));border-radius:var(--ax-rounded-border-default)}ax-select-box .ax-selected-token .ax-icon-close{cursor:pointer;margin-inline-start:.5rem}ax-select-box .ax-select-box-selection{display:flex;justify-content:center;align-items:center;outline-color:transparent;outline:transparent;-webkit-user-select:none;user-select:none;cursor:pointer;justify-content:flex-start;flex:1;flex-wrap:wrap;gap:.25rem;padding:.25rem}ax-select-box .ax-select-box-selection>span{padding-inline-start:1rem;padding-inline-end:.75rem;white-space:nowrap}ax-select-box .ax-select-box-selection .ax-selectbox-input{opacity:0;width:0}ax-select-box .ax-select-box-selection.ax-multiple .ax-selected-token{background-color:rgba(var(--ax-color-on-surface))}ax-select-box .ax-placeholder{padding-inline-start:1rem;padding-inline-end:.75rem}ax-select-box .ax-general-button .ax-arrow-button{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}ax-select-box .ax-general-button .ax-arrow-button.-rotation-90{transform:rotate(-90deg)}ax-select-box .ax-general-button .ax-arrow-button.rotation-90{transform:rotate(90deg)}.ax-select-box-panel>ax-header.ax-solid{border-bottom:1px solid;border-color:rgba(var(--ax-color-border-default))}.ax-select-box-panel .ax-search-container{padding:.5rem}\n"] }]
|
218
|
+
}], propDecorators: { dataSource: [{
|
543
219
|
type: Input
|
544
220
|
}], placeholder: [{
|
545
221
|
type: Input
|
@@ -552,6 +228,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImpor
|
|
552
228
|
}], list: [{
|
553
229
|
type: ViewChild,
|
554
230
|
args: [AXListComponent]
|
231
|
+
}], searchBox: [{
|
232
|
+
type: ContentChild,
|
233
|
+
args: [AXSearchBoxComponent, { static: true }]
|
555
234
|
}], dropdown: [{
|
556
235
|
type: ViewChild,
|
557
236
|
args: [AXDropdownBoxComponent, { static: true }]
|
@@ -562,7 +241,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImpor
|
|
562
241
|
|
563
242
|
class AXSelectBoxModule {
|
564
243
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXSelectBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
565
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.9", ngImport: i0, type: AXSelectBoxModule, declarations: [AXSelectBoxComponent
|
244
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.9", ngImport: i0, type: AXSelectBoxModule, declarations: [AXSelectBoxComponent], imports: [CommonModule,
|
566
245
|
AXCommonModule,
|
567
246
|
FormsModule,
|
568
247
|
AXCheckBoxModule,
|
@@ -574,7 +253,7 @@ class AXSelectBoxModule {
|
|
574
253
|
A11yModule,
|
575
254
|
AXTextBoxModule,
|
576
255
|
AXDropdownModule,
|
577
|
-
AXListModule], exports: [AXSelectBoxComponent
|
256
|
+
AXListModule], exports: [AXSelectBoxComponent] }); }
|
578
257
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.9", ngImport: i0, type: AXSelectBoxModule, imports: [CommonModule,
|
579
258
|
AXCommonModule,
|
580
259
|
FormsModule,
|
@@ -607,8 +286,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImpor
|
|
607
286
|
AXDropdownModule,
|
608
287
|
AXListModule,
|
609
288
|
],
|
610
|
-
exports: [AXSelectBoxComponent
|
611
|
-
declarations: [AXSelectBoxComponent
|
289
|
+
exports: [AXSelectBoxComponent],
|
290
|
+
declarations: [AXSelectBoxComponent],
|
612
291
|
providers: [],
|
613
292
|
}]
|
614
293
|
}] });
|
@@ -617,5 +296,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.9", ngImpor
|
|
617
296
|
* Generated bundle index. Do not edit.
|
618
297
|
*/
|
619
298
|
|
620
|
-
export {
|
299
|
+
export { AXSelectBoxComponent, AXSelectBoxModule };
|
621
300
|
//# sourceMappingURL=acorex-components-select-box.mjs.map
|