@ng-nest/ui 18.0.7 → 18.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/alert/alert.component.d.ts +3 -3
- package/auto-complete/auto-complete-portal.component.d.ts +6 -9
- package/auto-complete/auto-complete.component.d.ts +1 -0
- package/cascade/cascade-portal.component.d.ts +7 -9
- package/cascade/cascade.component.d.ts +1 -9
- package/cascade/cascade.property.d.ts +5 -2
- package/checkbox/checkbox.property.d.ts +10 -98
- package/color-picker/color-picker-portal.component.d.ts +6 -9
- package/core/functions/convert.d.ts +5 -0
- package/core/util/public-api.d.ts +1 -0
- package/core/util/sleep.d.ts +5 -0
- package/date-picker/date-picker-portal.component.d.ts +5 -6
- package/date-picker/date-picker.property.d.ts +1 -31
- package/date-picker/date-range-portal.component.d.ts +5 -6
- package/dialog/dialog.component.d.ts +4 -3
- package/dropdown/dropdown-portal.component.d.ts +5 -7
- package/esm2022/alert/alert.component.mjs +13 -10
- package/esm2022/auto-complete/auto-complete-portal.component.mjs +17 -10
- package/esm2022/auto-complete/auto-complete.component.mjs +7 -4
- package/esm2022/back-top/back-top.component.mjs +4 -2
- package/esm2022/cascade/cascade-portal.component.mjs +20 -11
- package/esm2022/cascade/cascade.component.mjs +5 -3
- package/esm2022/cascade/cascade.property.mjs +2 -2
- package/esm2022/checkbox/checkbox.property.mjs +3 -43
- package/esm2022/color-picker/color-picker-portal.component.mjs +17 -10
- package/esm2022/color-picker/color-picker.component.mjs +3 -3
- package/esm2022/color-picker/color-picker.property.mjs +3 -3
- package/esm2022/core/functions/convert.mjs +15 -1
- package/esm2022/core/util/public-api.mjs +2 -1
- package/esm2022/core/util/sleep.mjs +8 -0
- package/esm2022/date-picker/date-picker-portal.component.mjs +17 -6
- package/esm2022/date-picker/date-picker.component.mjs +3 -3
- package/esm2022/date-picker/date-picker.property.mjs +2 -17
- package/esm2022/date-picker/date-range-portal.component.mjs +17 -6
- package/esm2022/date-picker/date-range.component.mjs +3 -3
- package/esm2022/dialog/dialog.component.mjs +23 -18
- package/esm2022/dropdown/dropdown-portal.component.mjs +17 -8
- package/esm2022/dropdown/dropdown.component.mjs +3 -3
- package/esm2022/find/find.component.mjs +15 -8
- package/esm2022/find/find.property.mjs +7 -57
- package/esm2022/form/form.component.mjs +3 -3
- package/esm2022/form/form.property.mjs +3 -3
- package/esm2022/highlight/highlight.component.mjs +3 -3
- package/esm2022/icon/icon.component.mjs +2 -2
- package/esm2022/image/image.component.mjs +3 -3
- package/esm2022/input/input.component.mjs +3 -3
- package/esm2022/input-number/input-number.component.mjs +3 -3
- package/esm2022/input-number/input-number.property.mjs +3 -23
- package/esm2022/loading/loading.component.mjs +3 -3
- package/esm2022/loading/loading.property.mjs +5 -5
- package/esm2022/pagination/pagination.component.mjs +7 -3
- package/esm2022/radio/radio.property.mjs +3 -53
- package/esm2022/rate/rate.property.mjs +3 -58
- package/esm2022/select/select-portal.component.mjs +17 -10
- package/esm2022/select/select.component.mjs +15 -5
- package/esm2022/select/select.property.mjs +2 -2
- package/esm2022/slider-select/slider-select.property.mjs +3 -58
- package/esm2022/switch/switch.property.mjs +3 -58
- package/esm2022/table/table-body.component.mjs +5 -4
- package/esm2022/table/table.component.mjs +3 -3
- package/esm2022/table/table.property.mjs +14 -4
- package/esm2022/textarea/textarea.property.mjs +3 -38
- package/esm2022/time-picker/time-picker-portal.component.mjs +17 -6
- package/esm2022/time-picker/time-picker.component.mjs +3 -3
- package/esm2022/time-picker/time-picker.property.mjs +3 -3
- package/esm2022/transfer/transfer.component.mjs +3 -3
- package/esm2022/tree/tree-node.component.mjs +10 -2
- package/esm2022/tree/tree.component.mjs +11 -9
- package/esm2022/tree/tree.property.mjs +1 -1
- package/esm2022/tree/tree.service.mjs +28 -4
- package/esm2022/tree-select/tree-select-portal.component.mjs +17 -6
- package/esm2022/tree-select/tree-select.component.mjs +20 -4
- package/fesm2022/ng-nest-ui-alert.mjs +12 -9
- package/fesm2022/ng-nest-ui-alert.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-auto-complete.mjs +21 -11
- package/fesm2022/ng-nest-ui-auto-complete.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-back-top.mjs +3 -1
- package/fesm2022/ng-nest-ui-back-top.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-cascade.mjs +24 -13
- package/fesm2022/ng-nest-ui-cascade.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-checkbox.mjs +2 -42
- package/fesm2022/ng-nest-ui-checkbox.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-color-picker.mjs +20 -13
- package/fesm2022/ng-nest-ui-color-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-core.mjs +23 -1
- package/fesm2022/ng-nest-ui-core.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-date-picker.mjs +36 -29
- package/fesm2022/ng-nest-ui-date-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-dialog.mjs +22 -17
- package/fesm2022/ng-nest-ui-dialog.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-dropdown.mjs +19 -10
- package/fesm2022/ng-nest-ui-dropdown.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-find.mjs +20 -63
- package/fesm2022/ng-nest-ui-find.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-form.mjs +4 -4
- package/fesm2022/ng-nest-ui-form.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-highlight.mjs +2 -2
- package/fesm2022/ng-nest-ui-highlight.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-icon.mjs +1 -1
- package/fesm2022/ng-nest-ui-icon.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-image.mjs +2 -2
- package/fesm2022/ng-nest-ui-image.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-input-number.mjs +4 -24
- package/fesm2022/ng-nest-ui-input-number.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-input.mjs +2 -2
- package/fesm2022/ng-nest-ui-input.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-loading.mjs +6 -6
- package/fesm2022/ng-nest-ui-loading.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-pagination.mjs +6 -2
- package/fesm2022/ng-nest-ui-pagination.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-radio.mjs +2 -52
- package/fesm2022/ng-nest-ui-radio.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-rate.mjs +2 -57
- package/fesm2022/ng-nest-ui-rate.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-select.mjs +31 -14
- package/fesm2022/ng-nest-ui-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-slider-select.mjs +2 -57
- package/fesm2022/ng-nest-ui-slider-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-switch.mjs +2 -57
- package/fesm2022/ng-nest-ui-switch.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-table.mjs +19 -8
- package/fesm2022/ng-nest-ui-table.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-textarea.mjs +2 -37
- package/fesm2022/ng-nest-ui-textarea.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-time-picker.mjs +20 -9
- package/fesm2022/ng-nest-ui-time-picker.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-transfer.mjs +2 -2
- package/fesm2022/ng-nest-ui-transfer.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tree-select.mjs +35 -8
- package/fesm2022/ng-nest-ui-tree-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-tree.mjs +46 -12
- package/fesm2022/ng-nest-ui-tree.mjs.map +1 -1
- package/find/find.component.d.ts +2 -0
- package/find/find.property.d.ts +20 -97
- package/form/form.property.d.ts +4 -4
- package/input-number/input-number.property.d.ts +4 -56
- package/loading/loading.property.d.ts +4 -4
- package/package.json +123 -123
- package/pagination/pagination.component.d.ts +2 -1
- package/radio/radio.property.d.ts +10 -118
- package/rate/rate.property.d.ts +16 -121
- package/select/select-portal.component.d.ts +6 -9
- package/select/select.component.d.ts +3 -1
- package/slider-select/slider-select.property.d.ts +6 -113
- package/switch/switch.property.d.ts +2 -117
- package/table/table-body.component.d.ts +1 -1
- package/table/table.property.d.ts +13 -3
- package/textarea/textarea.property.d.ts +10 -45
- package/time-picker/time-picker-portal.component.d.ts +5 -6
- package/time-picker/time-picker.property.d.ts +1 -2
- package/tree/tree.component.d.ts +2 -3
- package/tree/tree.property.d.ts +1 -1
- package/tree/tree.service.d.ts +1 -1
- package/tree-select/tree-select-portal.component.d.ts +5 -6
- package/tree-select/tree-select.component.d.ts +7 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input,
|
|
2
|
+
import { input, Component, viewChild, computed, signal, ViewEncapsulation, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
3
3
|
import { XToNumber, XToBoolean, XToCssPixelValue, XIsString, XIsObject, XIsEmpty } from '@ng-nest/ui/core';
|
|
4
4
|
import { XFormControlFunction, XValueAccessor } from '@ng-nest/ui/base-form';
|
|
5
5
|
import { NgClass, NgTemplateOutlet } from '@angular/common';
|
|
@@ -40,11 +40,6 @@ class XRateProperty extends XFormControlFunction(X_RATE_CONFIG_NAME) {
|
|
|
40
40
|
* @en_US Custom template
|
|
41
41
|
*/
|
|
42
42
|
this.customTemp = input();
|
|
43
|
-
/**
|
|
44
|
-
* @zh_CN 输入框点击样式
|
|
45
|
-
* @en_US Input pointer
|
|
46
|
-
*/
|
|
47
|
-
this.pointer = input(false, { transform: XToBoolean });
|
|
48
43
|
/**
|
|
49
44
|
* @zh_CN 标签
|
|
50
45
|
* @en_US Label
|
|
@@ -75,11 +70,6 @@ class XRateProperty extends XFormControlFunction(X_RATE_CONFIG_NAME) {
|
|
|
75
70
|
* @en_US The direction of the sub-element arrangement under flex layout
|
|
76
71
|
*/
|
|
77
72
|
this.direction = input('column');
|
|
78
|
-
/**
|
|
79
|
-
* @zh_CN 输入提示信息
|
|
80
|
-
* @en_US Enter prompt information
|
|
81
|
-
*/
|
|
82
|
-
this.placeholder = input('');
|
|
83
73
|
/**
|
|
84
74
|
* @zh_CN 禁用
|
|
85
75
|
* @en_US Disabled
|
|
@@ -90,54 +80,9 @@ class XRateProperty extends XFormControlFunction(X_RATE_CONFIG_NAME) {
|
|
|
90
80
|
* @en_US Required
|
|
91
81
|
*/
|
|
92
82
|
this.required = input(false, { transform: XToBoolean });
|
|
93
|
-
/**
|
|
94
|
-
* @zh_CN 只读
|
|
95
|
-
* @en_US Readonly
|
|
96
|
-
*/
|
|
97
|
-
this.readonly = input(false, { transform: XToBoolean });
|
|
98
|
-
/**
|
|
99
|
-
* @zh_CN 值模板
|
|
100
|
-
* @en_US Node template
|
|
101
|
-
*/
|
|
102
|
-
this.valueTpl = input();
|
|
103
|
-
/**
|
|
104
|
-
* @zh_CN 值模板参数
|
|
105
|
-
* @en_US Node template
|
|
106
|
-
*/
|
|
107
|
-
this.valueTplContext = input();
|
|
108
|
-
/**
|
|
109
|
-
* @zh_CN 前置标签
|
|
110
|
-
* @en_US Before label
|
|
111
|
-
*/
|
|
112
|
-
this.before = input();
|
|
113
|
-
/**
|
|
114
|
-
* @zh_CN 后置标签
|
|
115
|
-
* @en_US After label
|
|
116
|
-
*/
|
|
117
|
-
this.after = input();
|
|
118
|
-
/**
|
|
119
|
-
* @zh_CN 正则验证规则
|
|
120
|
-
* @en_US Regular verification rules
|
|
121
|
-
*/
|
|
122
|
-
this.pattern = input(null);
|
|
123
|
-
/**
|
|
124
|
-
* @zh_CN 验证不通过提示文字
|
|
125
|
-
* @en_US Verify not pass the prompt text
|
|
126
|
-
*/
|
|
127
|
-
this.message = input([]);
|
|
128
|
-
/**
|
|
129
|
-
* @zh_CN 激活状态
|
|
130
|
-
* @en_US Activation state
|
|
131
|
-
*/
|
|
132
|
-
this.active = model(false);
|
|
133
|
-
/**
|
|
134
|
-
* @zh_CN 输入验证函数
|
|
135
|
-
* @en_US Enter the verification function
|
|
136
|
-
*/
|
|
137
|
-
this.inputValidator = input();
|
|
138
83
|
}
|
|
139
84
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XRateProperty, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
140
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.2", type: XRateProperty, selector: "x-rate-property", inputs: { count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, half: { classPropertyName: "half", publicName: "half", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, customTemp: { classPropertyName: "customTemp", publicName: "customTemp", isSignal: true, isRequired: false, transformFunction: null },
|
|
85
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.2", type: XRateProperty, selector: "x-rate-property", inputs: { count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, half: { classPropertyName: "half", publicName: "half", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, customTemp: { classPropertyName: "customTemp", publicName: "customTemp", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelWidth: { classPropertyName: "labelWidth", publicName: "labelWidth", isSignal: true, isRequired: false, transformFunction: null }, labelAlign: { classPropertyName: "labelAlign", publicName: "labelAlign", isSignal: true, isRequired: false, transformFunction: null }, justify: { classPropertyName: "justify", publicName: "justify", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
141
86
|
}
|
|
142
87
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XRateProperty, decorators: [{
|
|
143
88
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-nest-ui-rate.mjs","sources":["../../../../lib/ng-nest/ui/rate/rate.property.ts","../../../../lib/ng-nest/ui/rate/rate.component.ts","../../../../lib/ng-nest/ui/rate/rate.component.html","../../../../lib/ng-nest/ui/rate/rate.module.ts","../../../../lib/ng-nest/ui/rate/ng-nest-ui-rate.ts"],"sourcesContent":["import { XToNumber, XToBoolean, XToCssPixelValue } from '@ng-nest/ui/core';\r\nimport { Component, TemplateRef, input, model } from '@angular/core';\r\nimport { XFormControlFunction, XFormOption } from '@ng-nest/ui/base-form';\r\nimport type { XNumber, XBoolean, XTemplate, XDirection, XAlign, XJustify } from '@ng-nest/ui/core';\r\n\r\n/**\r\n * Rate\r\n * @selector x-rate\r\n * @decorator component\r\n */\r\nexport const XRatePrefix = 'x-rate';\r\nconst X_RATE_CONFIG_NAME = 'rate';\r\n\r\n/**\r\n * Rate Property\r\n */\r\n@Component({ selector: `${XRatePrefix}-property`, template: '' })\r\nexport class XRateProperty extends XFormControlFunction(X_RATE_CONFIG_NAME) {\r\n /**\r\n * @zh_CN 评分个数\r\n * @en_US Number of ratings\r\n */\r\n readonly count = input<number, XNumber>(5, { transform: XToNumber });\r\n /**\r\n * @zh_CN 半星模式\r\n * @en_US Number of ratings\r\n */\r\n readonly half = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 颜色\r\n * @en_US Color\r\n */\r\n readonly color = input<XRateColor>(this.config?.color ?? '');\r\n /**\r\n * @zh_CN 自定义模板\r\n * @en_US Custom template\r\n */\r\n readonly customTemp = input<TemplateRef<any>>();\r\n /**\r\n * @zh_CN 输入框点击样式\r\n * @en_US Input pointer\r\n */\r\n override readonly pointer = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 标签\r\n * @en_US Label\r\n */\r\n override readonly label = input<string>('');\r\n /**\r\n * @zh_CN 标签宽度\r\n * @en_US Label width\r\n */\r\n override readonly labelWidth = input<string, XNumber>('', { transform: XToCssPixelValue });\r\n /**\r\n * @zh_CN 标签文字对齐方式\r\n * @en_US Label text alignment method\r\n */\r\n override readonly labelAlign = input<XAlign>('start');\r\n /**\r\n * @zh_CN flex 布局下的子元素水平排列方式\r\n * @en_US The level of sub-element level arrangement under flex layout\r\n */\r\n override readonly justify = input<XJustify>('start');\r\n /**\r\n * @zh_CN flex 布局下的子元素垂直排列方式\r\n * @en_US sub-element vertical arrangement method under flex layout\r\n */\r\n override readonly align = input<XAlign>('start');\r\n /**\r\n * @zh_CN flex 布局下的子元素排列方向\r\n * @en_US The direction of the sub-element arrangement under flex layout\r\n */\r\n override readonly direction = input<XDirection>('column');\r\n /**\r\n * @zh_CN 输入提示信息\r\n * @en_US Enter prompt information\r\n */\r\n override readonly placeholder = input<string | string[]>('');\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disabled\r\n */\r\n override readonly disabled = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 必填\r\n * @en_US Required\r\n */\r\n override readonly required = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 只读\r\n * @en_US Readonly\r\n */\r\n override readonly readonly = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 值模板\r\n * @en_US Node template\r\n */\r\n override readonly valueTpl = input<TemplateRef<any>>();\r\n /**\r\n * @zh_CN 值模板参数\r\n * @en_US Node template\r\n */\r\n override readonly valueTplContext = input();\r\n /**\r\n * @zh_CN 前置标签\r\n * @en_US Before label\r\n */\r\n override readonly before = input<XTemplate>();\r\n /**\r\n * @zh_CN 后置标签\r\n * @en_US After label\r\n */\r\n override readonly after = input<XTemplate>();\r\n /**\r\n * @zh_CN 正则验证规则\r\n * @en_US Regular verification rules\r\n */\r\n override readonly pattern = input<RegExp | RegExp[] | any>(null);\r\n /**\r\n * @zh_CN 验证不通过提示文字\r\n * @en_US Verify not pass the prompt text\r\n */\r\n override readonly message = input<string | string[]>([]);\r\n /**\r\n * @zh_CN 激活状态\r\n * @en_US Activation state\r\n */\r\n override readonly active = model<boolean>(false);\r\n /**\r\n * @zh_CN 输入验证函数\r\n * @en_US Enter the verification function\r\n */\r\n override readonly inputValidator = input<(value: any) => boolean>();\r\n}\r\n\r\n/**\r\n * @zh_CN 颜色类型\r\n * @en_US Color type\r\n */\r\nexport type XRateColor = string | { [color: string]: (rate: number) => boolean };\r\n\r\n/**\r\n * Rate Option\r\n */\r\nexport interface XRateOption extends XFormOption {\r\n /**\r\n * @zh_CN 评分个数\r\n * @en_US Number of ratings\r\n */\r\n count?: number;\r\n /**\r\n * @zh_CN 半星模式\r\n * @en_US Number of ratings\r\n */\r\n half?: boolean;\r\n /**\r\n * @zh_CN 颜色\r\n * @en_US Color\r\n */\r\n color?: XRateColor;\r\n /**\r\n * @zh_CN 自定义模板\r\n * @en_US Custom template\r\n */\r\n customTemp?: TemplateRef<any>;\r\n /**\r\n * @zh_CN 输入框点击样式\r\n * @en_US Input pointer\r\n */\r\n pointer?: boolean;\r\n /**\r\n * @zh_CN 标签\r\n * @en_US Label\r\n */\r\n label?: string;\r\n /**\r\n * @zh_CN 标签宽度\r\n * @en_US Label width\r\n */\r\n labelWidth?: string;\r\n /**\r\n * @zh_CN 标签文字对齐方式\r\n * @en_US Label text alignment method\r\n */\r\n labelAlign?: XAlign;\r\n /**\r\n * @zh_CN flex 布局下的子元素水平排列方式\r\n * @en_US The level of sub-element level arrangement under flex layout\r\n */\r\n justify?: XJustify;\r\n /**\r\n * @zh_CN flex 布局下的子元素垂直排列方式\r\n * @en_US sub-element vertical arrangement method under flex layout\r\n */\r\n align?: XAlign;\r\n /**\r\n * @zh_CN flex 布局下的子元素排列方向\r\n * @en_US The direction of the sub-element arrangement under flex layout\r\n */\r\n direction?: XDirection;\r\n /**\r\n * @zh_CN 输入提示信息\r\n * @en_US Enter prompt information\r\n */\r\n placeholder?: string;\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disabled\r\n */\r\n disabled?: boolean;\r\n /**\r\n * @zh_CN 必填\r\n * @en_US Required\r\n */\r\n required?: boolean;\r\n /**\r\n * @zh_CN 只读\r\n * @en_US Readonly\r\n */\r\n readonly?: boolean;\r\n /**\r\n * @zh_CN 值模板\r\n * @en_US Node template\r\n */\r\n valueTpl?: TemplateRef<any>;\r\n /**\r\n * @zh_CN 值模板参数\r\n * @en_US Node template\r\n */\r\n valueTplContext?: any;\r\n /**\r\n * @zh_CN 前置标签\r\n * @en_US Before label\r\n */\r\n before?: XTemplate;\r\n /**\r\n * @zh_CN 后置标签\r\n * @en_US After label\r\n */\r\n after?: XTemplate;\r\n /**\r\n * @zh_CN 正则验证规则\r\n * @en_US Regular verification rules\r\n */\r\n pattern?: RegExp | RegExp[];\r\n /**\r\n * @zh_CN 验证不通过提示文字\r\n * @en_US Verify not pass the prompt text\r\n */\r\n message?: string | string[];\r\n /**\r\n * @zh_CN 激活状态\r\n * @en_US Activation state\r\n */\r\n active?: boolean;\r\n /**\r\n * @zh_CN 输入验证函数\r\n * @en_US Enter the verification function\r\n */\r\n inputValidator?: (value: any) => boolean;\r\n}\r\n","import {\r\n Component,\r\n ViewEncapsulation,\r\n ChangeDetectionStrategy,\r\n ElementRef,\r\n viewChild,\r\n computed,\r\n signal\r\n} from '@angular/core';\r\nimport { XIsEmpty, XIsString, XIsObject } from '@ng-nest/ui/core';\r\nimport { XRatePrefix, XRateProperty } from './rate.property';\r\nimport { XValueAccessor } from '@ng-nest/ui/base-form';\r\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { XButtonComponent } from '@ng-nest/ui/button';\r\nimport { XIconComponent } from '@ng-nest/ui/icon';\r\n\r\n@Component({\r\n selector: `${XRatePrefix}`,\r\n standalone: true,\r\n imports: [NgClass, NgTemplateOutlet, FormsModule, XButtonComponent, XIconComponent],\r\n templateUrl: './rate.component.html',\r\n styleUrls: ['./rate.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [XValueAccessor(XRateComponent)]\r\n})\r\nexport class XRateComponent extends XRateProperty {\r\n rate = viewChild.required<ElementRef<HTMLElement>>('rate');\r\n rates = computed(() =>\r\n Array(this.count())\r\n .fill(0)\r\n .map((_, i) => i + 1)\r\n );\r\n hoverActivated = signal(0);\r\n hoverHalfActivated = signal(0);\r\n\r\n getColor = computed(() => {\r\n let result = '';\r\n const color = this.color();\r\n if (XIsString(color)) {\r\n result = color as string;\r\n } else if (XIsObject(color)) {\r\n let val = this.half()\r\n ? (Math.floor(this.hoverActivated()) + this.hoverHalfActivated()) * 0.5\r\n : this.hoverActivated();\r\n for (let key in color) {\r\n if (color[key](val)) {\r\n result = key;\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n });\r\n\r\n classMap = computed(() => ({\r\n [`x-justify-${this.justify()}`]: !!this.justify(),\r\n [`x-align-${this.align()}`]: !!this.align(),\r\n [`x-direction-${this.direction()}`]: !!this.direction()\r\n }));\r\n labelMapSignal = computed(() => ({\r\n [`x-text-align-${this.labelAlign()}`]: !!this.labelAlign()\r\n }));\r\n\r\n override requiredIsEmpty = computed(() => {\r\n return this.validatorComputed() && this.requiredComputed() && (XIsEmpty(this.value()) || this.value() === 0);\r\n });\r\n\r\n override writeValue(value: any) {\r\n if (XIsEmpty(value)) value = 0;\r\n this.value.set(value);\r\n this.hoverActivated.set(value);\r\n this.hoverHalfActivated.set(Math.ceil(value));\r\n }\r\n\r\n rateHover(rate: number, _event: MouseEvent) {\r\n if (this.disabledComputed()) return;\r\n this.hoverActivated.set(rate);\r\n }\r\n\r\n leaveRates() {\r\n if (this.disabledComputed()) return;\r\n const activited = this.value();\r\n this.hoverActivated.set(activited);\r\n this.hoverHalfActivated.set(Math.ceil(activited));\r\n }\r\n\r\n rateClick(rate: number, _event: MouseEvent) {\r\n if (this.disabledComputed()) return;\r\n this.formControlValidator();\r\n this.value.update((x) => (x === rate ? 0 : rate));\r\n if (this.onChange) this.onChange(this.value());\r\n }\r\n\r\n rateHalfHover(rate: number, _event: MouseEvent) {\r\n if (this.disabledComputed()) return;\r\n this.formControlValidator();\r\n this.hoverActivated.set(rate - 1);\r\n this.hoverHalfActivated.set(rate);\r\n }\r\n\r\n rateHalfClick(rate: number, _event: MouseEvent) {\r\n if (this.disabledComputed()) return;\r\n this.value.set(rate - 0.5);\r\n if (this.onChange) this.onChange(this.value());\r\n }\r\n\r\n formControlChanges() {}\r\n}\r\n","<div\r\n #rate\r\n class=\"x-rate\"\r\n [ngClass]=\"classMap()\"\r\n [class.x-flex]=\"justify() || align() || direction()\"\r\n [class.x-disabled]=\"disabledComputed()\"\r\n [class.x-required]=\"requiredIsEmpty()\"\r\n [class.x-invalid]=\"invalid()\"\r\n>\r\n @if (label()) {\r\n <label [class.x-rate-label-required]=\"requiredComputed()\" [style.width]=\"labelWidth()\" [ngClass]=\"labelMapSignal()\">{{\r\n label()\r\n }}</label>\r\n }\r\n <div class=\"x-rate-icons\" (mouseleave)=\"leaveRates()\">\r\n @for (rate of rates(); track rate; let i = $index) {\r\n <div\r\n class=\"x-rate-icon\"\r\n [class.activated]=\"rate <= hoverActivated()\"\r\n [class.half-activated]=\"rate <= hoverHalfActivated()\"\r\n [style.color]=\"rate <= hoverActivated() ? getColor() : ''\"\r\n >\r\n @if (half()) {\r\n <div\r\n class=\"x-rate-half\"\r\n [style.color]=\"rate <= hoverHalfActivated() ? getColor() : ''\"\r\n (mouseenter)=\"rateHalfHover(rate, $event)\"\r\n (click)=\"rateHalfClick(rate, $event)\"\r\n >\r\n @if (customTemp()) {\r\n <ng-container *ngTemplateOutlet=\"customTemp()!\"></ng-container>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"iconTpl\"></ng-container>\r\n }\r\n </div>\r\n }\r\n <div class=\"x-rate-back\" (mouseenter)=\"rateHover(rate, $event)\" (click)=\"rateClick(rate, $event)\">\r\n @if (customTemp()) {\r\n <ng-container *ngTemplateOutlet=\"customTemp()!\"></ng-container>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"iconTpl\"></ng-container>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<ng-template #iconTpl>\r\n <x-icon type=\"adf-star\"></x-icon>\r\n</ng-template>\r\n","import { NgModule } from '@angular/core';\r\nimport { XRateComponent } from './rate.component';\r\n\r\n@NgModule({\r\n exports: [XRateComponent],\r\n imports: [XRateComponent]\r\n})\r\nexport class XRateModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAKA;;;;AAIG;AACI,MAAM,WAAW,GAAG,SAAS;AACpC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC;;AAEG;MAEU,aAAc,SAAQ,oBAAoB,CAAC,kBAAkB,CAAC,CAAA;AAD3E,IAAA,WAAA,GAAA;;AAEE;;;AAGG;QACM,IAAK,CAAA,KAAA,GAAG,KAAK,CAAkB,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;AACrE;;;AAGG;QACM,IAAI,CAAA,IAAA,GAAG,KAAK,CAAoB,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;AAC3E;;;AAGG;QACM,IAAK,CAAA,KAAA,GAAG,KAAK,CAAa,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;AAC7D;;;AAGG;QACM,IAAU,CAAA,UAAA,GAAG,KAAK,EAAoB,CAAC;AAChD;;;AAGG;QACe,IAAO,CAAA,OAAA,GAAG,KAAK,CAAo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A,82DAAA,EAAA,MAAA,EAAA,CAAA,0oEAAA,CAAA,EAAA,CAAA;;;MElBhC,WAAW,CAAA;iIAAX,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;kIAAX,WAAW,EAAA,OAAA,EAAA,CAFZ,cAAc,CAAA,EAAA,OAAA,EAAA,CADd,cAAc,CAAA,EAAA,CAAA,CAAA,EAAA;AAGb,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,YAFZ,cAAc,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAEb,WAAW,EAAA,UAAA,EAAA,CAAA;kBAJvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,cAAc,CAAC;oBACzB,OAAO,EAAE,CAAC,cAAc,CAAC;AAC1B,iBAAA,CAAA;;;ACND;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-nest-ui-rate.mjs","sources":["../../../../lib/ng-nest/ui/rate/rate.property.ts","../../../../lib/ng-nest/ui/rate/rate.component.ts","../../../../lib/ng-nest/ui/rate/rate.component.html","../../../../lib/ng-nest/ui/rate/rate.module.ts","../../../../lib/ng-nest/ui/rate/ng-nest-ui-rate.ts"],"sourcesContent":["import { XToNumber, XToBoolean, XToCssPixelValue } from '@ng-nest/ui/core';\r\nimport { Component, TemplateRef, input } from '@angular/core';\r\nimport { XFormControlFunction, XFormOption } from '@ng-nest/ui/base-form';\r\nimport type { XNumber, XBoolean, XDirection, XAlign, XJustify } from '@ng-nest/ui/core';\r\n\r\n/**\r\n * Rate\r\n * @selector x-rate\r\n * @decorator component\r\n */\r\nexport const XRatePrefix = 'x-rate';\r\nconst X_RATE_CONFIG_NAME = 'rate';\r\n\r\n/**\r\n * Rate Property\r\n */\r\n@Component({ selector: `${XRatePrefix}-property`, template: '' })\r\nexport class XRateProperty extends XFormControlFunction(X_RATE_CONFIG_NAME) {\r\n /**\r\n * @zh_CN 评分个数\r\n * @en_US Number of ratings\r\n */\r\n readonly count = input<number, XNumber>(5, { transform: XToNumber });\r\n /**\r\n * @zh_CN 半星模式\r\n * @en_US Number of ratings\r\n */\r\n readonly half = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 颜色\r\n * @en_US Color\r\n */\r\n readonly color = input<XRateColor>(this.config?.color ?? '');\r\n /**\r\n * @zh_CN 自定义模板\r\n * @en_US Custom template\r\n */\r\n readonly customTemp = input<TemplateRef<any>>();\r\n /**\r\n * @zh_CN 标签\r\n * @en_US Label\r\n */\r\n override readonly label = input<string>('');\r\n /**\r\n * @zh_CN 标签宽度\r\n * @en_US Label width\r\n */\r\n override readonly labelWidth = input<string, XNumber>('', { transform: XToCssPixelValue });\r\n /**\r\n * @zh_CN 标签文字对齐方式\r\n * @en_US Label text alignment method\r\n */\r\n override readonly labelAlign = input<XAlign>('start');\r\n /**\r\n * @zh_CN flex 布局下的子元素水平排列方式\r\n * @en_US The level of sub-element level arrangement under flex layout\r\n */\r\n override readonly justify = input<XJustify>('start');\r\n /**\r\n * @zh_CN flex 布局下的子元素垂直排列方式\r\n * @en_US sub-element vertical arrangement method under flex layout\r\n */\r\n override readonly align = input<XAlign>('start');\r\n /**\r\n * @zh_CN flex 布局下的子元素排列方向\r\n * @en_US The direction of the sub-element arrangement under flex layout\r\n */\r\n override readonly direction = input<XDirection>('column');\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disabled\r\n */\r\n override readonly disabled = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 必填\r\n * @en_US Required\r\n */\r\n override readonly required = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n}\r\n\r\n/**\r\n * @zh_CN 颜色类型\r\n * @en_US Color type\r\n */\r\nexport type XRateColor = string | { [color: string]: (rate: number) => boolean };\r\n\r\n/**\r\n * Rate Option\r\n */\r\nexport interface XRateOption extends XFormOption {\r\n /**\r\n * @zh_CN 评分个数\r\n * @en_US Number of ratings\r\n */\r\n count?: number;\r\n /**\r\n * @zh_CN 半星模式\r\n * @en_US Number of ratings\r\n */\r\n half?: boolean;\r\n /**\r\n * @zh_CN 颜色\r\n * @en_US Color\r\n */\r\n color?: XRateColor;\r\n /**\r\n * @zh_CN 自定义模板\r\n * @en_US Custom template\r\n */\r\n customTemp?: TemplateRef<any>;\r\n /**\r\n * @zh_CN 标签\r\n * @en_US Label\r\n */\r\n label?: string;\r\n /**\r\n * @zh_CN 标签宽度\r\n * @en_US Label width\r\n */\r\n labelWidth?: string;\r\n /**\r\n * @zh_CN 标签文字对齐方式\r\n * @en_US Label text alignment method\r\n */\r\n labelAlign?: XAlign;\r\n /**\r\n * @zh_CN flex 布局下的子元素水平排列方式\r\n * @en_US The level of sub-element level arrangement under flex layout\r\n */\r\n justify?: XJustify;\r\n /**\r\n * @zh_CN flex 布局下的子元素垂直排列方式\r\n * @en_US sub-element vertical arrangement method under flex layout\r\n */\r\n align?: XAlign;\r\n /**\r\n * @zh_CN flex 布局下的子元素排列方向\r\n * @en_US The direction of the sub-element arrangement under flex layout\r\n */\r\n direction?: XDirection;\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disabled\r\n */\r\n disabled?: boolean;\r\n /**\r\n * @zh_CN 必填\r\n * @en_US Required\r\n */\r\n required?: boolean;\r\n}\r\n","import {\r\n Component,\r\n ViewEncapsulation,\r\n ChangeDetectionStrategy,\r\n ElementRef,\r\n viewChild,\r\n computed,\r\n signal\r\n} from '@angular/core';\r\nimport { XIsEmpty, XIsString, XIsObject } from '@ng-nest/ui/core';\r\nimport { XRatePrefix, XRateProperty } from './rate.property';\r\nimport { XValueAccessor } from '@ng-nest/ui/base-form';\r\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { XButtonComponent } from '@ng-nest/ui/button';\r\nimport { XIconComponent } from '@ng-nest/ui/icon';\r\n\r\n@Component({\r\n selector: `${XRatePrefix}`,\r\n standalone: true,\r\n imports: [NgClass, NgTemplateOutlet, FormsModule, XButtonComponent, XIconComponent],\r\n templateUrl: './rate.component.html',\r\n styleUrls: ['./rate.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [XValueAccessor(XRateComponent)]\r\n})\r\nexport class XRateComponent extends XRateProperty {\r\n rate = viewChild.required<ElementRef<HTMLElement>>('rate');\r\n rates = computed(() =>\r\n Array(this.count())\r\n .fill(0)\r\n .map((_, i) => i + 1)\r\n );\r\n hoverActivated = signal(0);\r\n hoverHalfActivated = signal(0);\r\n\r\n getColor = computed(() => {\r\n let result = '';\r\n const color = this.color();\r\n if (XIsString(color)) {\r\n result = color as string;\r\n } else if (XIsObject(color)) {\r\n let val = this.half()\r\n ? (Math.floor(this.hoverActivated()) + this.hoverHalfActivated()) * 0.5\r\n : this.hoverActivated();\r\n for (let key in color) {\r\n if (color[key](val)) {\r\n result = key;\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n });\r\n\r\n classMap = computed(() => ({\r\n [`x-justify-${this.justify()}`]: !!this.justify(),\r\n [`x-align-${this.align()}`]: !!this.align(),\r\n [`x-direction-${this.direction()}`]: !!this.direction()\r\n }));\r\n labelMapSignal = computed(() => ({\r\n [`x-text-align-${this.labelAlign()}`]: !!this.labelAlign()\r\n }));\r\n\r\n override requiredIsEmpty = computed(() => {\r\n return this.validatorComputed() && this.requiredComputed() && (XIsEmpty(this.value()) || this.value() === 0);\r\n });\r\n\r\n override writeValue(value: any) {\r\n if (XIsEmpty(value)) value = 0;\r\n this.value.set(value);\r\n this.hoverActivated.set(value);\r\n this.hoverHalfActivated.set(Math.ceil(value));\r\n }\r\n\r\n rateHover(rate: number, _event: MouseEvent) {\r\n if (this.disabledComputed()) return;\r\n this.hoverActivated.set(rate);\r\n }\r\n\r\n leaveRates() {\r\n if (this.disabledComputed()) return;\r\n const activited = this.value();\r\n this.hoverActivated.set(activited);\r\n this.hoverHalfActivated.set(Math.ceil(activited));\r\n }\r\n\r\n rateClick(rate: number, _event: MouseEvent) {\r\n if (this.disabledComputed()) return;\r\n this.formControlValidator();\r\n this.value.update((x) => (x === rate ? 0 : rate));\r\n if (this.onChange) this.onChange(this.value());\r\n }\r\n\r\n rateHalfHover(rate: number, _event: MouseEvent) {\r\n if (this.disabledComputed()) return;\r\n this.formControlValidator();\r\n this.hoverActivated.set(rate - 1);\r\n this.hoverHalfActivated.set(rate);\r\n }\r\n\r\n rateHalfClick(rate: number, _event: MouseEvent) {\r\n if (this.disabledComputed()) return;\r\n this.value.set(rate - 0.5);\r\n if (this.onChange) this.onChange(this.value());\r\n }\r\n\r\n formControlChanges() {}\r\n}\r\n","<div\r\n #rate\r\n class=\"x-rate\"\r\n [ngClass]=\"classMap()\"\r\n [class.x-flex]=\"justify() || align() || direction()\"\r\n [class.x-disabled]=\"disabledComputed()\"\r\n [class.x-required]=\"requiredIsEmpty()\"\r\n [class.x-invalid]=\"invalid()\"\r\n>\r\n @if (label()) {\r\n <label [class.x-rate-label-required]=\"requiredComputed()\" [style.width]=\"labelWidth()\" [ngClass]=\"labelMapSignal()\">{{\r\n label()\r\n }}</label>\r\n }\r\n <div class=\"x-rate-icons\" (mouseleave)=\"leaveRates()\">\r\n @for (rate of rates(); track rate; let i = $index) {\r\n <div\r\n class=\"x-rate-icon\"\r\n [class.activated]=\"rate <= hoverActivated()\"\r\n [class.half-activated]=\"rate <= hoverHalfActivated()\"\r\n [style.color]=\"rate <= hoverActivated() ? getColor() : ''\"\r\n >\r\n @if (half()) {\r\n <div\r\n class=\"x-rate-half\"\r\n [style.color]=\"rate <= hoverHalfActivated() ? getColor() : ''\"\r\n (mouseenter)=\"rateHalfHover(rate, $event)\"\r\n (click)=\"rateHalfClick(rate, $event)\"\r\n >\r\n @if (customTemp()) {\r\n <ng-container *ngTemplateOutlet=\"customTemp()!\"></ng-container>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"iconTpl\"></ng-container>\r\n }\r\n </div>\r\n }\r\n <div class=\"x-rate-back\" (mouseenter)=\"rateHover(rate, $event)\" (click)=\"rateClick(rate, $event)\">\r\n @if (customTemp()) {\r\n <ng-container *ngTemplateOutlet=\"customTemp()!\"></ng-container>\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"iconTpl\"></ng-container>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<ng-template #iconTpl>\r\n <x-icon type=\"adf-star\"></x-icon>\r\n</ng-template>\r\n","import { NgModule } from '@angular/core';\r\nimport { XRateComponent } from './rate.component';\r\n\r\n@NgModule({\r\n exports: [XRateComponent],\r\n imports: [XRateComponent]\r\n})\r\nexport class XRateModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAKA;;;;AAIG;AACI,MAAM,WAAW,GAAG,SAAS;AACpC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC;;AAEG;MAEU,aAAc,SAAQ,oBAAoB,CAAC,kBAAkB,CAAC,CAAA;AAD3E,IAAA,WAAA,GAAA;;AAEE;;;AAGG;QACM,IAAK,CAAA,KAAA,GAAG,KAAK,CAAkB,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;AACrE;;;AAGG;QACM,IAAI,CAAA,IAAA,GAAG,KAAK,CAAoB,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;AAC3E;;;AAGG;QACM,IAAK,CAAA,KAAA,GAAG,KAAK,CAAa,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;AAC7D;;;AAGG;QACM,IAAU,CAAA,UAAA,GAAG,KAAK,EAAoB,CAAC;AAChD;;;A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
-
import { input, model, Component, inject, viewChild, output,
|
|
3
|
+
import { input, model, Component, signal, inject, DestroyRef, viewChild, output, computed, ViewEncapsulation, ChangeDetectionStrategy, HostBinding, HostListener, Renderer2, ChangeDetectorRef, ViewContainerRef, ElementRef, effect, NgModule } from '@angular/core';
|
|
4
4
|
import { XToDataConvert, XToCssPixelValue, XToBoolean, XToNumber, XConnectBaseAnimation, XIsNull, XIsUndefined, XIsArray, XIsFunction, XIsEmpty, XIsChange, XResize, XSetData, XComputed, XParents, XIsObjectArray, XRemove, XIsString, XIsObservable } from '@ng-nest/ui/core';
|
|
5
5
|
import { XFormControlFunction, XValueAccessor } from '@ng-nest/ui/base-form';
|
|
6
6
|
import { XPortalService, XPortalConnectedPosition } from '@ng-nest/ui/portal';
|
|
@@ -138,7 +138,7 @@ class XSelectProperty extends XFormControlFunction(X_SELECT_CONFIG_NAME) {
|
|
|
138
138
|
* @zh_CN 输入框点击样式
|
|
139
139
|
* @en_US Input pointer
|
|
140
140
|
*/
|
|
141
|
-
this.pointer = input(
|
|
141
|
+
this.pointer = input(true, { transform: XToBoolean });
|
|
142
142
|
/**
|
|
143
143
|
* @zh_CN 标签
|
|
144
144
|
* @en_US Label
|
|
@@ -246,7 +246,9 @@ const XSelectPortalPrefix = 'x-select-portal';
|
|
|
246
246
|
|
|
247
247
|
class XSelectPortalComponent {
|
|
248
248
|
constructor() {
|
|
249
|
+
this.destroy = signal(false);
|
|
249
250
|
this.unSubject = new Subject();
|
|
251
|
+
this.destroyRef = inject(DestroyRef);
|
|
250
252
|
this.i18n = inject(XI18nService);
|
|
251
253
|
this.list = viewChild.required('list');
|
|
252
254
|
this.value = model();
|
|
@@ -273,11 +275,15 @@ class XSelectPortalComponent {
|
|
|
273
275
|
get getPlacement() {
|
|
274
276
|
return this.placement();
|
|
275
277
|
}
|
|
276
|
-
done(
|
|
277
|
-
|
|
278
|
+
done() {
|
|
279
|
+
if (this.destroy())
|
|
280
|
+
return;
|
|
281
|
+
this.animating.emit(false);
|
|
278
282
|
}
|
|
279
|
-
start(
|
|
280
|
-
|
|
283
|
+
start() {
|
|
284
|
+
if (this.destroy())
|
|
285
|
+
return;
|
|
286
|
+
this.animating.emit(true);
|
|
281
287
|
}
|
|
282
288
|
ngOnInit() {
|
|
283
289
|
this.closeSubject.pipe(takeUntil(this.unSubject)).subscribe(() => {
|
|
@@ -286,10 +292,11 @@ class XSelectPortalComponent {
|
|
|
286
292
|
this.keydownSubject.pipe(takeUntil(this.unSubject)).subscribe((x) => {
|
|
287
293
|
this.list().keydown(x);
|
|
288
294
|
});
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
295
|
+
this.destroyRef.onDestroy(() => {
|
|
296
|
+
this.destroy.set(true);
|
|
297
|
+
this.unSubject.next();
|
|
298
|
+
this.unSubject.complete();
|
|
299
|
+
});
|
|
293
300
|
}
|
|
294
301
|
stopPropagation(event) {
|
|
295
302
|
event.stopPropagation();
|
|
@@ -355,6 +362,7 @@ class XSelectComponent extends XSelectProperty {
|
|
|
355
362
|
this.select = viewChild.required('select');
|
|
356
363
|
this.multipleValueTpl = viewChild.required('multipleValueTpl');
|
|
357
364
|
this.multipleInput = viewChild('multipleInput');
|
|
365
|
+
this.valueTemplate = viewChild.required('valueTemplate');
|
|
358
366
|
this.getReadonly = computed(() => this.readonly() || !this.search());
|
|
359
367
|
this.getMaxTagContent = computed(() => this.maxTagContent() || this.locale().maxTagContent);
|
|
360
368
|
this.noPortalWidthPlacements = ['bottom', 'top'];
|
|
@@ -382,13 +390,22 @@ class XSelectComponent extends XSelectProperty {
|
|
|
382
390
|
this.inputChange = new Subject();
|
|
383
391
|
this.multipleInputSizeChange = new Subject();
|
|
384
392
|
this.unSubject = new Subject();
|
|
385
|
-
this.
|
|
393
|
+
this.valueTplComputed = computed(() => {
|
|
394
|
+
if (this.nodeTpl()) {
|
|
395
|
+
return this.nodeTpl();
|
|
396
|
+
}
|
|
397
|
+
if (this.valueTpl()) {
|
|
398
|
+
return this.valueTpl();
|
|
399
|
+
}
|
|
386
400
|
if (this.multiple()) {
|
|
387
401
|
return this.multipleValueTpl();
|
|
388
402
|
}
|
|
389
|
-
return this.
|
|
403
|
+
return this.valueTemplate();
|
|
390
404
|
});
|
|
391
405
|
this.valueTplContextSignal = signal({ $node: null, $isValue: true });
|
|
406
|
+
this.valueTplContextComputed = computed(() => {
|
|
407
|
+
return this.valueTplContext() ? this.valueTplContext() : this.valueTplContextSignal();
|
|
408
|
+
});
|
|
392
409
|
this.placements = computed(() => {
|
|
393
410
|
let placement = this.placement();
|
|
394
411
|
if (this.portalWidth()) {
|
|
@@ -965,11 +982,11 @@ class XSelectComponent extends XSelectProperty {
|
|
|
965
982
|
setTimeout(() => this.inputChange.next(this.multiple() ? this.multipleSearchValue() : this.displayValue()));
|
|
966
983
|
}
|
|
967
984
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
968
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: XSelectComponent, isStandalone: true, selector: "x-select", providers: [XValueAccessor(XSelectComponent)], viewQueries: [{ propertyName: "inputCom", first: true, predicate: ["inputCom"], descendants: true, isSignal: true }, { propertyName: "select", first: true, predicate: ["select"], descendants: true, isSignal: true }, { propertyName: "multipleValueTpl", first: true, predicate: ["multipleValueTpl"], descendants: true, isSignal: true }, { propertyName: "multipleInput", first: true, predicate: ["multipleInput"], descendants: true, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div #select class=\"x-select\" [class.x-select-multiple]=\"multiple()\">\r\n <div class=\"x-select-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label()\"\r\n [labelWidth]=\"labelWidth()\"\r\n [labelAlign]=\"labelAlign()\"\r\n [width]=\"width()\"\r\n [justify]=\"justify()\"\r\n [align]=\"align()\"\r\n [direction]=\"direction()\"\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [validator]=\"validatorComputed()!\"\r\n [icon]=\"icon()\"\r\n [iconSpin]=\"iconSpin()\"\r\n [placeholder]=\"placeholder()\"\r\n [readonly]=\"getReadonly()\"\r\n [clearable]=\"showClearable()\"\r\n [(ngModel)]=\"displayValue\"\r\n [valueTpl]=\"valueTplSignal() ? valueTplSignal() : nodeTpl()\"\r\n [valueTplContext]=\"valueTplContextSignal()\"\r\n [size]=\"size()\"\r\n [bordered]=\"bordered()\"\r\n [before]=\"before()\"\r\n [after]=\"after()\"\r\n [pattern]=\"patternComputed()\"\r\n [message]=\"messageComputed()\"\r\n [pointer]=\"true\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n (xInput)=\"onInput($event)\"\r\n (xFocus)=\"onFocus($event)\"\r\n (xClick)=\"showPortal(true)\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n (xComposition)=\"composition.set($event)\"\r\n ></x-input>\r\n </div>\r\n</div>\r\n\r\n<ng-template #multipleValueTpl>\r\n @for (node of displayNodes(); track node.id; let i = $index) {\r\n <x-tag\r\n [@.disabled]=\"true\"\r\n [bordered]=\"false\"\r\n [closable]=\"!disabledComputed()\"\r\n [type]=\"'info'\"\r\n (close)=\"closeNode($event, node, i)\"\r\n [size]=\"size()\"\r\n >{{ node.label }}</x-tag\r\n >\r\n }\r\n @if (showDisplayMore()) {\r\n <x-tag [@.disabled]=\"true\" [bordered]=\"false\" [type]=\"'info'\" [size]=\"size()\">\r\n <ng-container *xOutlet=\"getMaxTagContent(); context: { $surplus: selectedSurplus(), $total: selectedTotal() }\">{{\r\n displayMore()\r\n }}</ng-container>\r\n </x-tag>\r\n }\r\n\r\n @if (search()) {\r\n <x-input\r\n #multipleInput\r\n [bordered]=\"false\"\r\n [size]=\"size()\"\r\n [ngModel]=\"multipleSearchValue()\"\r\n (ngModelChange)=\"multipleSearchValue.set($event)\"\r\n (xInput)=\"onInput($event)\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n ></x-input>\r\n }\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";x-select{display:inline-block;width:12rem}.x-select{margin:0;padding:0}.x-select{width:100%}.x-select x-input{width:100%}.x-select-multiple .x-input-value-template-value{display:flex;align-items:center;margin-bottom:.125rem;flex-wrap:wrap;width:initial;height:initial!important;left:.125rem!important}.x-select-multiple .x-input-value-template-value>x-tag{display:inline-flex;margin-left:.0625rem;margin-top:.125rem}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-big{height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-big>.x-icon{right:calc(-var(--x-padding-large)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-large{height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-large>.x-icon{right:calc(-var(--x-padding-medium)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-medium{height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-medium>.x-icon{right:calc(-var(--x-padding-small)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-small{height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-small>.x-icon{right:calc(-var(--x-padding-mini)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-mini{height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-mini>.x-icon{right:-.0625rem}.x-select-multiple .x-input-value-template-value>x-input{margin-top:.125rem;width:5rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-large);line-height:var(--x-height-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>label{height:var(--x-height-large);line-height:var(--x-height-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>label{height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-small);line-height:var(--x-height-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>label{height:var(--x-height-small);line-height:var(--x-height-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-mini);line-height:var(--x-height-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>label{height:var(--x-height-mini);line-height:var(--x-height-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-value-template-value{height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-max-length{height:1.125rem;line-height:1.125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>label{height:1.125rem;line-height:1.125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-row>.x-input-input>input{background-color:transparent}.x-select-portal{color:var(--x-text);width:100%;border-radius:var(--x-border-small-radius);box-shadow:var(--x-box-shadow);position:relative;display:flex;background-color:var(--x-background-100);overflow:hidden auto;max-height:calc(calc(var(--x-font-size) + .875rem) * 6 + var(--x-border-width) * 7)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: XTagComponent, selector: "x-tag" }, { kind: "component", type: XInputComponent, selector: "x-input" }, { kind: "directive", type: XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
985
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.2", type: XSelectComponent, isStandalone: true, selector: "x-select", providers: [XValueAccessor(XSelectComponent)], viewQueries: [{ propertyName: "inputCom", first: true, predicate: ["inputCom"], descendants: true, isSignal: true }, { propertyName: "select", first: true, predicate: ["select"], descendants: true, isSignal: true }, { propertyName: "multipleValueTpl", first: true, predicate: ["multipleValueTpl"], descendants: true, isSignal: true }, { propertyName: "multipleInput", first: true, predicate: ["multipleInput"], descendants: true, isSignal: true }, { propertyName: "valueTemplate", first: true, predicate: ["valueTemplate"], descendants: true, isSignal: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div #select class=\"x-select\" [class.x-select-multiple]=\"multiple()\">\r\n <div class=\"x-select-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label()\"\r\n [labelWidth]=\"labelWidth()\"\r\n [labelAlign]=\"labelAlign()\"\r\n [width]=\"width()\"\r\n [justify]=\"justify()\"\r\n [align]=\"align()\"\r\n [direction]=\"direction()\"\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [validator]=\"validatorComputed()!\"\r\n [inputValidator]=\"inputValidator()\"\r\n [icon]=\"icon()\"\r\n [iconSpin]=\"iconSpin()\"\r\n [placeholder]=\"placeholder()\"\r\n [readonly]=\"getReadonly()\"\r\n [clearable]=\"showClearable()\"\r\n [(ngModel)]=\"value\"\r\n [valueTpl]=\"valueTplComputed()\"\r\n [valueTplContext]=\"valueTplContextComputed()\"\r\n [size]=\"size()\"\r\n [bordered]=\"bordered()\"\r\n [before]=\"before()\"\r\n [after]=\"after()\"\r\n [pattern]=\"patternComputed()\"\r\n [message]=\"messageComputed()\"\r\n [pointer]=\"pointer()\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n (xInput)=\"onInput($event)\"\r\n (xFocus)=\"onFocus($event)\"\r\n (xClick)=\"showPortal(true)\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n (xComposition)=\"composition.set($event)\"\r\n ></x-input>\r\n </div>\r\n</div>\r\n\r\n<ng-template #valueTemplate>{{ displayValue() }}</ng-template>\r\n\r\n<ng-template #multipleValueTpl>\r\n @for (node of displayNodes(); track node.id; let i = $index) {\r\n <x-tag\r\n [@.disabled]=\"true\"\r\n [bordered]=\"false\"\r\n [closable]=\"!disabledComputed()\"\r\n [type]=\"'info'\"\r\n (close)=\"closeNode($event, node, i)\"\r\n [size]=\"size()\"\r\n >{{ node.label }}</x-tag\r\n >\r\n }\r\n @if (showDisplayMore()) {\r\n <x-tag [@.disabled]=\"true\" [bordered]=\"false\" [type]=\"'info'\" [size]=\"size()\">\r\n <ng-container *xOutlet=\"getMaxTagContent(); context: { $surplus: selectedSurplus(), $total: selectedTotal() }\">{{\r\n displayMore()\r\n }}</ng-container>\r\n </x-tag>\r\n }\r\n\r\n @if (search()) {\r\n <x-input\r\n #multipleInput\r\n [bordered]=\"false\"\r\n [size]=\"size()\"\r\n [ngModel]=\"multipleSearchValue()\"\r\n (ngModelChange)=\"multipleSearchValue.set($event)\"\r\n (xInput)=\"onInput($event)\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n ></x-input>\r\n }\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";x-select{display:inline-block;width:12rem}.x-select{margin:0;padding:0}.x-select{width:100%}.x-select x-input{width:100%}.x-select-multiple .x-input-value-template-value{display:flex;align-items:center;margin-bottom:.125rem;flex-wrap:wrap;width:initial;height:initial!important;left:.125rem!important}.x-select-multiple .x-input-value-template-value>x-tag{display:inline-flex;margin-left:.0625rem;margin-top:.125rem}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-big{height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-big>.x-icon{right:calc(-var(--x-padding-large)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-large{height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-large>.x-icon{right:calc(-var(--x-padding-medium)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-medium{height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-medium>.x-icon{right:calc(-var(--x-padding-small)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-small{height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-small>.x-icon{right:calc(-var(--x-padding-mini)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-mini{height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-mini>.x-icon{right:-.0625rem}.x-select-multiple .x-input-value-template-value>x-input{margin-top:.125rem;width:5rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-large);line-height:var(--x-height-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>label{height:var(--x-height-large);line-height:var(--x-height-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>label{height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-small);line-height:var(--x-height-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>label{height:var(--x-height-small);line-height:var(--x-height-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-mini);line-height:var(--x-height-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>label{height:var(--x-height-mini);line-height:var(--x-height-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-value-template-value{height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-max-length{height:1.125rem;line-height:1.125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>label{height:1.125rem;line-height:1.125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-row>.x-input-input>input{background-color:transparent}.x-select-portal{color:var(--x-text);width:100%;border-radius:var(--x-border-small-radius);box-shadow:var(--x-box-shadow);position:relative;display:flex;background-color:var(--x-background-100);overflow:hidden auto;max-height:calc(calc(var(--x-font-size) + .875rem) * 6 + var(--x-border-width) * 7)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: XTagComponent, selector: "x-tag" }, { kind: "component", type: XInputComponent, selector: "x-input" }, { kind: "directive", type: XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
969
986
|
}
|
|
970
987
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.2", ngImport: i0, type: XSelectComponent, decorators: [{
|
|
971
988
|
type: Component,
|
|
972
|
-
args: [{ selector: `${XSelectPrefix}`, standalone: true, imports: [FormsModule, ReactiveFormsModule, XTagComponent, XInputComponent, XOutletDirective], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XSelectComponent)], template: "<div #select class=\"x-select\" [class.x-select-multiple]=\"multiple()\">\r\n <div class=\"x-select-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label()\"\r\n [labelWidth]=\"labelWidth()\"\r\n [labelAlign]=\"labelAlign()\"\r\n [width]=\"width()\"\r\n [justify]=\"justify()\"\r\n [align]=\"align()\"\r\n [direction]=\"direction()\"\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [validator]=\"validatorComputed()!\"\r\n [icon]=\"icon()\"\r\n [iconSpin]=\"iconSpin()\"\r\n [placeholder]=\"placeholder()\"\r\n [readonly]=\"getReadonly()\"\r\n [clearable]=\"showClearable()\"\r\n [(ngModel)]=\"displayValue\"\r\n [valueTpl]=\"valueTplSignal() ? valueTplSignal() : nodeTpl()\"\r\n [valueTplContext]=\"valueTplContextSignal()\"\r\n [size]=\"size()\"\r\n [bordered]=\"bordered()\"\r\n [before]=\"before()\"\r\n [after]=\"after()\"\r\n [pattern]=\"patternComputed()\"\r\n [message]=\"messageComputed()\"\r\n [pointer]=\"true\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n (xInput)=\"onInput($event)\"\r\n (xFocus)=\"onFocus($event)\"\r\n (xClick)=\"showPortal(true)\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n (xComposition)=\"composition.set($event)\"\r\n ></x-input>\r\n </div>\r\n</div>\r\n\r\n<ng-template #multipleValueTpl>\r\n @for (node of displayNodes(); track node.id; let i = $index) {\r\n <x-tag\r\n [@.disabled]=\"true\"\r\n [bordered]=\"false\"\r\n [closable]=\"!disabledComputed()\"\r\n [type]=\"'info'\"\r\n (close)=\"closeNode($event, node, i)\"\r\n [size]=\"size()\"\r\n >{{ node.label }}</x-tag\r\n >\r\n }\r\n @if (showDisplayMore()) {\r\n <x-tag [@.disabled]=\"true\" [bordered]=\"false\" [type]=\"'info'\" [size]=\"size()\">\r\n <ng-container *xOutlet=\"getMaxTagContent(); context: { $surplus: selectedSurplus(), $total: selectedTotal() }\">{{\r\n displayMore()\r\n }}</ng-container>\r\n </x-tag>\r\n }\r\n\r\n @if (search()) {\r\n <x-input\r\n #multipleInput\r\n [bordered]=\"false\"\r\n [size]=\"size()\"\r\n [ngModel]=\"multipleSearchValue()\"\r\n (ngModelChange)=\"multipleSearchValue.set($event)\"\r\n (xInput)=\"onInput($event)\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n ></x-input>\r\n }\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";x-select{display:inline-block;width:12rem}.x-select{margin:0;padding:0}.x-select{width:100%}.x-select x-input{width:100%}.x-select-multiple .x-input-value-template-value{display:flex;align-items:center;margin-bottom:.125rem;flex-wrap:wrap;width:initial;height:initial!important;left:.125rem!important}.x-select-multiple .x-input-value-template-value>x-tag{display:inline-flex;margin-left:.0625rem;margin-top:.125rem}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-big{height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-big>.x-icon{right:calc(-var(--x-padding-large)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-large{height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-large>.x-icon{right:calc(-var(--x-padding-medium)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-medium{height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-medium>.x-icon{right:calc(-var(--x-padding-small)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-small{height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-small>.x-icon{right:calc(-var(--x-padding-mini)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-mini{height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-mini>.x-icon{right:-.0625rem}.x-select-multiple .x-input-value-template-value>x-input{margin-top:.125rem;width:5rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-large);line-height:var(--x-height-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>label{height:var(--x-height-large);line-height:var(--x-height-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>label{height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-small);line-height:var(--x-height-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>label{height:var(--x-height-small);line-height:var(--x-height-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-mini);line-height:var(--x-height-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>label{height:var(--x-height-mini);line-height:var(--x-height-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-value-template-value{height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-max-length{height:1.125rem;line-height:1.125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>label{height:1.125rem;line-height:1.125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-row>.x-input-input>input{background-color:transparent}.x-select-portal{color:var(--x-text);width:100%;border-radius:var(--x-border-small-radius);box-shadow:var(--x-box-shadow);position:relative;display:flex;background-color:var(--x-background-100);overflow:hidden auto;max-height:calc(calc(var(--x-font-size) + .875rem) * 6 + var(--x-border-width) * 7)}\n"] }]
|
|
989
|
+
args: [{ selector: `${XSelectPrefix}`, standalone: true, imports: [FormsModule, ReactiveFormsModule, XTagComponent, XInputComponent, XOutletDirective], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XSelectComponent)], template: "<div #select class=\"x-select\" [class.x-select-multiple]=\"multiple()\">\r\n <div class=\"x-select-row\">\r\n <x-input\r\n #inputCom\r\n type=\"text\"\r\n [label]=\"label()\"\r\n [labelWidth]=\"labelWidth()\"\r\n [labelAlign]=\"labelAlign()\"\r\n [width]=\"width()\"\r\n [justify]=\"justify()\"\r\n [align]=\"align()\"\r\n [direction]=\"direction()\"\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [validator]=\"validatorComputed()!\"\r\n [inputValidator]=\"inputValidator()\"\r\n [icon]=\"icon()\"\r\n [iconSpin]=\"iconSpin()\"\r\n [placeholder]=\"placeholder()\"\r\n [readonly]=\"getReadonly()\"\r\n [clearable]=\"showClearable()\"\r\n [(ngModel)]=\"value\"\r\n [valueTpl]=\"valueTplComputed()\"\r\n [valueTplContext]=\"valueTplContextComputed()\"\r\n [size]=\"size()\"\r\n [bordered]=\"bordered()\"\r\n [before]=\"before()\"\r\n [after]=\"after()\"\r\n [pattern]=\"patternComputed()\"\r\n [message]=\"messageComputed()\"\r\n [pointer]=\"pointer()\"\r\n [(active)]=\"active\"\r\n (clearEmit)=\"clearEmit()\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n (xInput)=\"onInput($event)\"\r\n (xFocus)=\"onFocus($event)\"\r\n (xClick)=\"showPortal(true)\"\r\n (xMouseenter)=\"menter()\"\r\n (xMouseleave)=\"mleave()\"\r\n (xComposition)=\"composition.set($event)\"\r\n ></x-input>\r\n </div>\r\n</div>\r\n\r\n<ng-template #valueTemplate>{{ displayValue() }}</ng-template>\r\n\r\n<ng-template #multipleValueTpl>\r\n @for (node of displayNodes(); track node.id; let i = $index) {\r\n <x-tag\r\n [@.disabled]=\"true\"\r\n [bordered]=\"false\"\r\n [closable]=\"!disabledComputed()\"\r\n [type]=\"'info'\"\r\n (close)=\"closeNode($event, node, i)\"\r\n [size]=\"size()\"\r\n >{{ node.label }}</x-tag\r\n >\r\n }\r\n @if (showDisplayMore()) {\r\n <x-tag [@.disabled]=\"true\" [bordered]=\"false\" [type]=\"'info'\" [size]=\"size()\">\r\n <ng-container *xOutlet=\"getMaxTagContent(); context: { $surplus: selectedSurplus(), $total: selectedTotal() }\">{{\r\n displayMore()\r\n }}</ng-container>\r\n </x-tag>\r\n }\r\n\r\n @if (search()) {\r\n <x-input\r\n #multipleInput\r\n [bordered]=\"false\"\r\n [size]=\"size()\"\r\n [ngModel]=\"multipleSearchValue()\"\r\n (ngModelChange)=\"multipleSearchValue.set($event)\"\r\n (xInput)=\"onInput($event)\"\r\n (xKeydown)=\"onKeydown($event)\"\r\n ></x-input>\r\n }\r\n</ng-template>\r\n", styles: ["@charset \"UTF-8\";x-select{display:inline-block;width:12rem}.x-select{margin:0;padding:0}.x-select{width:100%}.x-select x-input{width:100%}.x-select-multiple .x-input-value-template-value{display:flex;align-items:center;margin-bottom:.125rem;flex-wrap:wrap;width:initial;height:initial!important;left:.125rem!important}.x-select-multiple .x-input-value-template-value>x-tag{display:inline-flex;margin-left:.0625rem;margin-top:.125rem}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-big{height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-big>.x-icon{right:calc(-var(--x-padding-large)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-large{height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-large>.x-icon{right:calc(-var(--x-padding-medium)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-medium{height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-medium>.x-icon{right:calc(-var(--x-padding-small)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-small{height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-small>.x-icon{right:calc(-var(--x-padding-mini)/2)}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-mini{height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-tag .x-tag-mini>.x-icon{right:-.0625rem}.x-select-multiple .x-input-value-template-value>x-input{margin-top:.125rem;width:5rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-large);line-height:var(--x-height-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-big>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-large);line-height:var(--x-height-large);padding:0 var(--x-padding-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-big>label{height:var(--x-height-large);line-height:var(--x-height-large)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-large>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-medium);line-height:var(--x-height-medium);padding:0 var(--x-padding-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-large>label{height:var(--x-height-medium);line-height:var(--x-height-medium)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-small);line-height:var(--x-height-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-small);line-height:var(--x-height-small);padding:0 var(--x-padding-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-medium>label{height:var(--x-height-small);line-height:var(--x-height-small)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-value-template-value{height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-input>.x-input-max-length{height:var(--x-height-mini);line-height:var(--x-height-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-small>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:var(--x-height-mini);line-height:var(--x-height-mini);padding:0 var(--x-padding-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-small>label{height:var(--x-height-mini);line-height:var(--x-height-mini)}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>input,.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-row-after:not(.x-input-row-after-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-value-template-value{height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-input>.x-input-max-length{height:1.125rem;line-height:1.125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-row-before:not(.x-input-row-before-template),.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>.x-input-row>.x-input-row-after:not(.x-input-row-after-template){height:1.125rem;line-height:1.125rem;padding:0 .125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-mini>label{height:1.125rem;line-height:1.125rem}.x-select-multiple .x-input-value-template-value>x-input .x-input-row>.x-input-input>input{background-color:transparent}.x-select-portal{color:var(--x-text);width:100%;border-radius:var(--x-border-small-radius);box-shadow:var(--x-box-shadow);position:relative;display:flex;background-color:var(--x-background-100);overflow:hidden auto;max-height:calc(calc(var(--x-font-size) + .875rem) * 6 + var(--x-border-width) * 7)}\n"] }]
|
|
973
990
|
}], ctorParameters: () => [] });
|
|
974
991
|
|
|
975
992
|
class XSelectModule {
|